From 8d80893939cb21d83f6ba3c450c6d016019b4f72 Mon Sep 17 00:00:00 2001 From: David Linke Date: Fri, 6 Sep 2024 14:07:25 -0400 Subject: [PATCH] docs: add ActionBar component documentation (#1527) * docs(patterns): add base documentation for ActionBar * docs(patterns): add SideNav link for Action Bar * docs(patterns): add changeset for action bar documentation * docs(patterns): correct array sample style for ActionButton Co-authored-by: Chancellor Clark --------- Co-authored-by: Chancellor Clark --- .changeset/grumpy-houses-happen.md | 5 ++ .../docs/PropTables/ActionBarPropTable.tsx | 38 ++++++++ packages/docs/components/SideNav/SideNav.tsx | 1 + packages/docs/pages/action-bar.tsx | 88 +++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 .changeset/grumpy-houses-happen.md create mode 100644 packages/docs/PropTables/ActionBarPropTable.tsx create mode 100644 packages/docs/pages/action-bar.tsx diff --git a/.changeset/grumpy-houses-happen.md b/.changeset/grumpy-houses-happen.md new file mode 100644 index 000000000..39a6b57ed --- /dev/null +++ b/.changeset/grumpy-houses-happen.md @@ -0,0 +1,5 @@ +--- +'@bigcommerce/docs': patch +--- + +Added Action Bar pattern component documentation diff --git a/packages/docs/PropTables/ActionBarPropTable.tsx b/packages/docs/PropTables/ActionBarPropTable.tsx new file mode 100644 index 000000000..f646ca923 --- /dev/null +++ b/packages/docs/PropTables/ActionBarPropTable.tsx @@ -0,0 +1,38 @@ +import React from 'react'; + +import { NextLink, Prop, PropTable, PropTableWrapper } from '../components'; + +const actionBarProps: Prop[] = [ + { + name: 'actions', + types: ( + <> + + ActionButton + + [] + + ), + description: 'An array of actions to display in the action bar. Supports up to three actions.', + required: true, + }, +]; + +export const ActionBarPropsTable: React.FC = (props) => ( + +); + +const actionButtonProps: Prop[] = [ + { + name: 'text', + types: 'string', + description: 'The text content of the button.', + required: true, + }, +]; + +export const ActionButtonPropsTable: React.FC = (props) => ( + +); diff --git a/packages/docs/components/SideNav/SideNav.tsx b/packages/docs/components/SideNav/SideNav.tsx index cad3c699d..884dc6b9a 100644 --- a/packages/docs/components/SideNav/SideNav.tsx +++ b/packages/docs/components/SideNav/SideNav.tsx @@ -103,6 +103,7 @@ export const SideNav: React.FC = () => { + Action Bar Header diff --git a/packages/docs/pages/action-bar.tsx b/packages/docs/pages/action-bar.tsx new file mode 100644 index 000000000..2c1405def --- /dev/null +++ b/packages/docs/pages/action-bar.tsx @@ -0,0 +1,88 @@ +import { H1, Panel, Text } from '@bigcommerce/big-design'; +import { ActionBar } from '@bigcommerce/big-design-patterns'; +import React, { Fragment } from 'react'; + +import { Code, CodePreview, CodeSnippet, ContentRoutingTabs, GuidelinesTable } from '../components'; +import { ButtonPropTable } from '../PropTables'; +import { ActionBarPropsTable, ActionButtonPropsTable } from '../PropTables/ActionBarPropTable'; + +const ActionBarPage = () => { + return ( + <> +

ActionBar

+ + + + The ActionBar component provides a consistent way to display a set of + action buttons at the bottom of a page or section. It supports up to three actions and + ensures visual consistency across the platform. + + + + Use to provide quick and consistent access to key actions at the bottom of a page. + + + + + + + To use ActionBar import the component from the package: + + {`import { ActionBar } from '@bigcommerce/big-design-patterns';`} + + + {/* jsx-to-string:start */} + + {/* jsx-to-string:end */} + + + + + , + }, + { + id: 'action-button-props', + title: 'ActionButton', + render: () => ( + } + /> + ), + }, + ]} + /> + + + + + + + ); +}; + +export default ActionBarPage;