diff --git a/packages/canon/src/components/Box/Box.stories.tsx b/packages/canon/src/components/Box/Box.stories.tsx index bd4e597fa0..d11f9fbab7 100644 --- a/packages/canon/src/components/Box/Box.stories.tsx +++ b/packages/canon/src/components/Box/Box.stories.tsx @@ -40,22 +40,28 @@ const meta = { export default meta; type Story = StoryObj; -export const Basic: Story = { +export const Default: Story = { args: { style: { - background: '#1f47ff', - color: 'white', - padding: '4px 8px', + width: '64px', + height: '64px', + background: '#eaf2fd', borderRadius: '4px', + border: '1px solid #2563eb', + color: '#2563eb', + backgroundImage: + 'url("data:image/svg+xml,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cg%20fill%3D%22%232563eb%22%20fill-opacity%3D%220.3%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M5%200h1L0%206V5zM6%205v1H5z%22/%3E%3C/g%3E%3C/svg%3E")', }, - children: 'Basic Box', }, }; export const Display: Story = { args: { style: { - ...Basic.args?.style, + ...Default.args?.style, + width: 'auto', + height: 'auto', + padding: '8px', }, }, render: args => ( @@ -84,7 +90,10 @@ export const Display: Story = { export const FlexDirection: Story = { args: { style: { - ...Basic.args?.style, + ...Default.args?.style, + width: 'auto', + height: 'auto', + padding: '8px', }, display: 'flex', gap: 'xs', @@ -110,8 +119,10 @@ export const FlexDirection: Story = { export const JustifyContent: Story = { args: { style: { - ...Basic.args?.style, + ...Default.args?.style, width: '200px', + height: 'auto', + padding: '8px', }, display: 'flex', gap: 'xs', @@ -153,9 +164,10 @@ export const JustifyContent: Story = { export const AlignItems: Story = { args: { style: { - ...Basic.args?.style, + ...Default.args?.style, width: '200px', height: '100px', + padding: '8px', }, display: 'flex', gap: 'xs', @@ -289,8 +301,10 @@ export const Margin: Story = { export const FlexWrap: Story = { args: { style: { - ...Basic.args?.style, + ...Default.args?.style, width: '200px', + height: 'auto', + padding: '8px', }, display: 'flex', gap: 'xs', @@ -328,11 +342,14 @@ export const FlexWrap: Story = { export const BorderRadius: Story = { args: { style: { - background: '#1f47ff', - color: 'white', - padding: '4px 8px', width: '64px', height: '64px', + background: '#eaf2fd', + border: '1px solid #2563eb', + color: '#2563eb', + backgroundImage: + 'url("data:image/svg+xml,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cg%20fill%3D%22%232563eb%22%20fill-opacity%3D%220.3%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M5%200h1L0%206V5zM6%205v1H5z%22/%3E%3C/g%3E%3C/svg%3E")', + padding: '4px 8px', }, display: 'flex', alignItems: 'center', diff --git a/packages/canon/src/components/Button/Button.stories.tsx b/packages/canon/src/components/Button/Button.stories.tsx index c921efa6f2..728098970c 100644 --- a/packages/canon/src/components/Button/Button.stories.tsx +++ b/packages/canon/src/components/Button/Button.stories.tsx @@ -19,13 +19,12 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Button } from './Button'; import { Inline } from '../Inline'; import { Stack } from '../Stack'; +import { Text } from '../Text'; +import { ButtonProps } from './types'; const meta = { title: 'Components/Button', component: Button, - parameters: { - layout: 'centered', - }, argTypes: { size: { control: 'select', @@ -40,12 +39,6 @@ const meta = { export default meta; type Story = StoryObj; -export const Primary: Story = { - args: { - children: 'Primary button', - }, -}; - export const Variants: Story = { args: { children: 'Button', @@ -59,9 +52,15 @@ export const Variants: Story = { }, render: () => ( - - - + + + ), }; @@ -125,3 +124,47 @@ export const Responsive: Story = { }, }, }; + +const variants: string[] = ['primary', 'secondary', 'tertiary']; + +export const Playground: Story = { + args: { + children: 'Button', + }, + render: () => ( + + {variants.map(variant => ( + + {variant} + {['small', 'medium'].map(size => ( + + + + + + ))} + + ))} + + ), +}; diff --git a/packages/canon/src/components/Button/Button.tsx b/packages/canon/src/components/Button/Button.tsx index e4166e5c79..081d09a1d5 100644 --- a/packages/canon/src/components/Button/Button.tsx +++ b/packages/canon/src/components/Button/Button.tsx @@ -29,6 +29,8 @@ export const Button = forwardRef( iconStart, iconEnd, children, + style, + ...rest } = props; const { getResponsiveValue } = useCanon(); @@ -39,7 +41,7 @@ export const Button = forwardRef( return (