diff --git a/packages/frontend/src/pages/components/index.tsx b/packages/frontend/src/pages/components/index.tsx index b2c81d3..67e68e0 100644 --- a/packages/frontend/src/pages/components/index.tsx +++ b/packages/frontend/src/pages/components/index.tsx @@ -10,6 +10,7 @@ import { renderBadges } from './renders/badge'; import { renderButtonIcons, renderButtons, + renderDisabledButtons, renderLinks, } from './renders/button'; import { @@ -53,6 +54,27 @@ const Page = () => { {renderButtonIcons()} + {/* Link */} +
+

Link

+
+ {renderLinks()} +
+
+ + {/* Disabled button, icon only, and link */} +
+
+

Disabled

+

+ Button – icon only – link +

+
+
+ {renderDisabledButtons()} +
+
+
{/* Badge */} @@ -139,16 +161,6 @@ const Page = () => { {renderInlineNotificationWithDescriptions()}
- -
- - {/* Link */} -
-

Link

-
- {renderLinks()} -
-
diff --git a/packages/frontend/src/pages/components/renders/button.tsx b/packages/frontend/src/pages/components/renders/button.tsx index f5272d3..0b86aaa 100644 --- a/packages/frontend/src/pages/components/renders/button.tsx +++ b/packages/frontend/src/pages/components/renders/button.tsx @@ -2,44 +2,45 @@ import { Button, ButtonTheme } from 'components/shared/Button'; import { PlusIcon } from 'components/shared/CustomIcon'; import React from 'react'; +const buttonVariants = ['primary', 'secondary', 'tertiary', 'danger'] as const; +const buttonSizes = ['lg', 'md', 'sm', 'xs'] as const; +const iconOnlyVariants = [ + 'primary', + 'secondary', + 'tertiary', + 'ghost', + 'danger', + 'danger-ghost', +] as const; +const linkVariants = ['link', 'link-emphasized'] as const; + export const renderButtons = () => { - return ['primary', 'secondary', 'tertiary', 'danger'].map( - (variant, index) => ( -
- {['lg', 'md', 'sm', 'xs', 'disabled'].map((size) => ( - - ))} -
- ), - ); + return buttonVariants.map((variant, index) => ( +
+ {buttonSizes.map((size) => ( + + ))} +
+ )); }; export const renderButtonIcons = () => { - return [ - 'primary', - 'secondary', - 'tertiary', - 'ghost', - 'danger', - 'danger-ghost', - ].map((variant, index) => ( + return iconOnlyVariants.map((variant, index) => (
- {['lg', 'md', 'sm', 'xs', 'disabled'].map((size) => ( + {buttonSizes.map((size) => ( @@ -49,17 +50,38 @@ export const renderButtonIcons = () => { }; export const renderLinks = () => { - return ['link', 'link-emphasized', 'disabled'].map((variant) => ( + return linkVariants.map((variant) => ( )); }; + +export const renderDisabledButtons = () => { + return ( + <> + {/* Button variants */} + + {/* Icon only variants */} + + {/* Link variantws */} + + + ); +};