From a539b127987e61c99cd0e7f0164ed1f330ec1184 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Tue, 17 Dec 2024 11:51:50 +0000 Subject: [PATCH] Fix button component Signed-off-by: Charles de Dreuille --- .../src/components/Button/Button.stories.tsx | 30 ++++--- packages/canon/src/components/Button/Docs.mdx | 81 +++++++++++++++++++ .../canon/src/components/Button/styles.css | 7 +- 3 files changed, 103 insertions(+), 15 deletions(-) diff --git a/packages/canon/src/components/Button/Button.stories.tsx b/packages/canon/src/components/Button/Button.stories.tsx index c88791ddc7..c921efa6f2 100644 --- a/packages/canon/src/components/Button/Button.stories.tsx +++ b/packages/canon/src/components/Button/Button.stories.tsx @@ -46,28 +46,34 @@ export const Primary: Story = { }, }; -export const Secondary: Story = { +export const Variants: Story = { args: { - children: 'Secondary button', - variant: 'secondary', + children: 'Button', }, -}; - -export const Tertiary: Story = { - args: { - children: 'Tertiary button', - variant: 'tertiary', + parameters: { + argTypes: { + variant: { + control: false, + }, + }, }, + render: () => ( + + + + + + ), }; export const Sizes: Story = { args: { children: 'Button', }, - render: args => ( + render: () => ( - + ), }; diff --git a/packages/canon/src/components/Button/Docs.mdx b/packages/canon/src/components/Button/Docs.mdx index 2dabace9b2..e4b069cbcd 100644 --- a/packages/canon/src/components/Button/Docs.mdx +++ b/packages/canon/src/components/Button/Docs.mdx @@ -51,4 +51,85 @@ import { PropsTable } from '../../../docs/components/PropsTable/PropsTable'; }} /> +Examples + +Variants +Here's a view when buttons have different variants. + + + + + + + +`} + language="tsx" + dark +/> + +Sizes +Here's a view when buttons have different sizes. + + + + + + +`} + language="tsx" + dark +/> + +With Icons +Here's a view when buttons have icons. + + + + + + + +`} + language="tsx" + dark +/> + +Full width +Here's a view when buttons are full width. + + + + + + + +`} + language="tsx" + dark +/> + +Disabled +Here's a view when buttons are disabled. + + + +Button`} language="tsx" dark /> + +Responsive +Here's a view when buttons are responsive. + + + + + Button +`} + language="tsx" + dark +/> + diff --git a/packages/canon/src/components/Button/styles.css b/packages/canon/src/components/Button/styles.css index 914dd08c65..9d24e6b452 100644 --- a/packages/canon/src/components/Button/styles.css +++ b/packages/canon/src/components/Button/styles.css @@ -21,8 +21,8 @@ justify-content: center; user-select: none; font-family: var(--canon-font-regular); - font-weight: var(--canon-font-bold); - font-size: var(--canon-font-size-md); + font-weight: var(--canon-font-weight-bold); + font-size: var(--canon-font-size-body); padding: 0; transition: all 150ms ease; cursor: pointer; @@ -70,10 +70,11 @@ height: 40px; } - &.cn-button-content { + & .cn-button-content { display: flex; align-items: center; gap: var(--canon-spacing-xs); + font-weight: var(--canon-font-weight-bold); &.cn-button-content-icon-both { flex: 1;