diff --git a/react/src/Button/Button.stories.tsx b/react/src/Button/Button.stories.tsx index 3020d802..1139c67d 100644 --- a/react/src/Button/Button.stories.tsx +++ b/react/src/Button/Button.stories.tsx @@ -191,3 +191,60 @@ LinkPrimary.args = { variant: 'link', colorScheme: 'brand.primary', } + +export const Sizes = () => ( + + Solid + Outline + Clear + Reverse + + + + + + + + + + + + + + + + + +) diff --git a/react/src/Toolbar/Toolbar.stories.tsx b/react/src/Toolbar/Toolbar.stories.tsx new file mode 100644 index 00000000..59d65423 --- /dev/null +++ b/react/src/Toolbar/Toolbar.stories.tsx @@ -0,0 +1,50 @@ +import { Spacer, Text } from '@chakra-ui/react' +import { Meta, StoryFn } from '@storybook/react' + +import { BxsTimeFive, BxUpload } from '~/icons' + +import { Toolbar, ToolbarProps } from './Toolbar' +import { ToolbarButton } from './ToolbarButton' +import { ToolbarDivider } from './ToolbarDivider' +import { ToolbarGroup } from './ToolbarGroup' +import { ToolbarIconButton } from './ToolbarIconButton' + +export default { + title: 'Components/Toolbar', + component: Toolbar, + decorators: [], + tags: ['autodocs'], +} as Meta + +const Template: StoryFn = ({ children, ...args }) => { + return ( + + 1 item selected + + {children} + + }> + Download + + }> + Move + + + } aria-label="Upload" /> + + Cancel + + + ) +} +export const TemplateExample = Template.bind({}) + +export const NeutralColorScheme = Template.bind({}) +NeutralColorScheme.args = { + colorScheme: 'neutral', +} + +export const SizeXs = Template.bind({}) +SizeXs.args = { + size: 'xs', +} diff --git a/react/src/Toolbar/Toolbar.tsx b/react/src/Toolbar/Toolbar.tsx new file mode 100644 index 00000000..5e231515 --- /dev/null +++ b/react/src/Toolbar/Toolbar.tsx @@ -0,0 +1,35 @@ +import { PropsWithChildren } from 'react' +import { + createStylesContext, + Flex, + FlexProps, + ThemingProps, + useMultiStyleConfig, +} from '@chakra-ui/react' + +import { ToolbarProvider } from './ToolbarContext' + +const [ToolbarStylesProvider, useToolbarStyles] = createStylesContext('Toolbar') + +export { useToolbarStyles } + +export interface ToolbarProps extends PropsWithChildren, FlexProps { + colorScheme?: 'main' | 'neutral' | 'sub' + size?: ThemingProps<'Toolbar'>['size'] +} + +/** + * Container for the toolbar. + */ +export const Toolbar = ({ children, ...props }: ToolbarProps): JSX.Element => { + const styles = useMultiStyleConfig('Toolbar', props) + return ( + + + + {children} + + + + ) +} diff --git a/react/src/Toolbar/ToolbarButton.tsx b/react/src/Toolbar/ToolbarButton.tsx new file mode 100644 index 00000000..e782718c --- /dev/null +++ b/react/src/Toolbar/ToolbarButton.tsx @@ -0,0 +1,11 @@ +import { Button, ButtonProps } from '~/Button' + +import { useToolbarButtonProps } from './utils/useToolbarButtonProps' + +export type ToolbarButtonProps = ButtonProps + +export const ToolbarButton = (props: ToolbarButtonProps): JSX.Element => { + const toolbarButtonProps = useToolbarButtonProps() + + return