@jordan-mace/chaser-design-system 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4894 -0
- package/dist/index.d.cts +1111 -0
- package/dist/index.d.mts +1111 -0
- package/dist/index.mjs +4812 -0
- package/package.json +17 -12
- package/src/components/Accordion/Accordion.stories.tsx +73 -0
- package/src/components/Accordion/Accordion.test.tsx +54 -0
- package/src/components/Accordion/Accordion.tsx +146 -0
- package/src/components/Accordion/styles.css.ts +72 -0
- package/src/components/Alert/Alert.stories.tsx +82 -0
- package/src/components/Alert/Alert.test.tsx +58 -0
- package/src/components/Alert/Alert.tsx +48 -0
- package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-dismissible-alert-correctly-1-chromium-linux.png +0 -0
- package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-error-alert-correctly-1-chromium-linux.png +0 -0
- package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-info-alert-correctly-1-chromium-linux.png +0 -0
- package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-success-alert-correctly-1-chromium-linux.png +0 -0
- package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-warning-alert-correctly-1-chromium-linux.png +0 -0
- package/src/components/Alert/styles.css.ts +58 -0
- package/src/components/AspectRatio/AspectRatio.stories.tsx +85 -0
- package/src/components/AspectRatio/AspectRatio.test.tsx +50 -0
- package/src/components/AspectRatio/AspectRatio.tsx +42 -0
- package/src/components/Avatar/Avatar.stories.tsx +82 -0
- package/src/components/Avatar/Avatar.test.tsx +45 -0
- package/src/components/Avatar/Avatar.tsx +51 -0
- package/src/components/Avatar/styles.css.ts +155 -0
- package/src/components/Badge/Badge.stories.tsx +141 -0
- package/src/components/Badge/Badge.test.tsx +74 -0
- package/src/components/Badge/Badge.tsx +46 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-does-not-render-children-when-dot-is-true-1.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-default-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-dot-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-dot-with-size-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-dot-with-variant-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-error-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-info-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-large-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-medium-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-small-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-span-element-with-proper-attributes-1.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-success-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-warning-badge-correctly-1-chromium-linux.png +0 -0
- package/src/components/Badge/styles.css.ts +82 -0
- package/src/components/Box/Box.stories.tsx +183 -0
- package/src/components/Box/Box.test.tsx +63 -0
- package/src/components/Box/Box.tsx +72 -0
- package/src/components/Box/reset.css.ts +16 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +55 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +44 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +102 -0
- package/src/components/Breadcrumb/styles.css.ts +56 -0
- package/src/components/Button/Button.stories.tsx +60 -0
- package/src/components/Button/Button.test.tsx +26 -0
- package/src/components/Button/Button.tsx +31 -0
- package/src/components/Button/__screenshots__/Button.test.tsx/Button-renders-correctly-1-chromium-win32.png +0 -0
- package/src/components/Button/__screenshots__/Button.test.tsx/Button-renders-primary-button-correctly-1-chromium-linux.png +0 -0
- package/src/components/Button/__screenshots__/Button.test.tsx/Button-renders-primary-button-correctly-1-chromium-win32.png +0 -0
- package/src/components/Button/styles.css.ts +32 -0
- package/src/components/Card/Card.stories.tsx +85 -0
- package/src/components/Card/Card.test.tsx +43 -0
- package/src/components/Card/Card.tsx +34 -0
- package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-elevated-card-correctly-1-chromium-linux.png +0 -0
- package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-filled-card-correctly-1-chromium-linux.png +0 -0
- package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-outlined-card-correctly-1-chromium-linux.png +0 -0
- package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-with-no-padding-1-chromium-linux.png +0 -0
- package/src/components/Card/styles.css.ts +27 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +61 -0
- package/src/components/Checkbox/Checkbox.test.tsx +40 -0
- package/src/components/Checkbox/Checkbox.tsx +58 -0
- package/src/components/Checkbox/styles.css.ts +34 -0
- package/src/components/Collapse/Collapse.stories.tsx +63 -0
- package/src/components/Collapse/Collapse.test.tsx +24 -0
- package/src/components/Collapse/Collapse.tsx +97 -0
- package/src/components/Collapse/styles.css.ts +42 -0
- package/src/components/Combobox/Combobox.stories.tsx +100 -0
- package/src/components/Combobox/Combobox.test.tsx +49 -0
- package/src/components/Combobox/Combobox.tsx +266 -0
- package/src/components/Combobox/styles.css.ts +155 -0
- package/src/components/Container/Container.stories.tsx +69 -0
- package/src/components/Container/Container.test.tsx +42 -0
- package/src/components/Container/Container.tsx +47 -0
- package/src/components/Divider/Divider.stories.tsx +121 -0
- package/src/components/Divider/Divider.test.tsx +56 -0
- package/src/components/Divider/Divider.tsx +40 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-applies-orientation-correctly-1.png +0 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-horizontal-divider-correctly-1-chromium-linux.png +0 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-hr-element-with-proper-attributes-1.png +0 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-large-divider-correctly-1-chromium-linux.png +0 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-medium-divider-correctly-1-chromium-linux.png +0 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-small-divider-correctly-1-chromium-linux.png +0 -0
- package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-vertical-divider-correctly-1-chromium-linux.png +0 -0
- package/src/components/Divider/styles.css.ts +45 -0
- package/src/components/Drawer/Drawer.stories.tsx +99 -0
- package/src/components/Drawer/Drawer.test.tsx +51 -0
- package/src/components/Drawer/Drawer.tsx +148 -0
- package/src/components/Drawer/styles.css.ts +138 -0
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +72 -0
- package/src/components/DropdownMenu/DropdownMenu.test.tsx +43 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +156 -0
- package/src/components/DropdownMenu/styles.css.ts +102 -0
- package/src/components/EmptyState/EmptyState.stories.tsx +47 -0
- package/src/components/EmptyState/EmptyState.test.tsx +25 -0
- package/src/components/EmptyState/EmptyState.tsx +53 -0
- package/src/components/EmptyState/styles.css.ts +36 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +138 -0
- package/src/components/FileUpload/FileUpload.test.tsx +56 -0
- package/src/components/FileUpload/FileUpload.tsx +269 -0
- package/src/components/FileUpload/styles.css.ts +164 -0
- package/src/components/Form/Form.stories.tsx +51 -0
- package/src/components/Form/Form.test.tsx +41 -0
- package/src/components/Form/Form.tsx +28 -0
- package/src/components/Form/FormInput.tsx +16 -0
- package/src/components/Form/__screenshots__/Form.test.tsx/Form-can-submit-1.png +0 -0
- package/src/components/Form/__screenshots__/Form.test.tsx/Form-renders-correctly-1-chromium-win32.png +0 -0
- package/src/components/Form/__screenshots__/Form.test.tsx/Form-renders-form-correctly-1-chromium-linux.png +0 -0
- package/src/components/Form/__screenshots__/Form.test.tsx/Form-renders-form-correctly-1-chromium-win32.png +0 -0
- package/src/components/Form/styles.css.ts +13 -0
- package/src/components/Grid/Grid.stories.tsx +134 -0
- package/src/components/Grid/Grid.test.tsx +41 -0
- package/src/components/Grid/Grid.tsx +48 -0
- package/src/components/Icon/Icon.tsx +43 -0
- package/src/components/Icon/styles.css.ts +11 -0
- package/src/components/Input/Input.stories.tsx +38 -0
- package/src/components/Input/Input.test.tsx +16 -0
- package/src/components/Input/Input.tsx +43 -0
- package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-with-label-1-chromium-linux.png +0 -0
- package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-with-label-1-chromium-win32.png +0 -0
- package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-without-label-1-chromium-linux.png +0 -0
- package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-without-label-1-chromium-win32.png +0 -0
- package/src/components/Input/styles.css.ts +10 -0
- package/src/components/Kbd/Kbd.stories.tsx +53 -0
- package/src/components/Kbd/Kbd.test.tsx +22 -0
- package/src/components/Kbd/Kbd.tsx +17 -0
- package/src/components/Kbd/styles.css.ts +18 -0
- package/src/components/List/List.test.tsx +18 -0
- package/src/components/List/List.tsx +13 -0
- package/src/components/List/ListItem.tsx +13 -0
- package/src/components/List/__screenshots__/List.test.tsx/List-renders-correctly-1-chromium-win32.png +0 -0
- package/src/components/List/__screenshots__/List.test.tsx/List-renders-list-correctly-1-chromium-linux.png +0 -0
- package/src/components/List/__screenshots__/List.test.tsx/List-renders-list-correctly-1-chromium-win32.png +0 -0
- package/src/components/List/styles.css.ts +13 -0
- package/src/components/Modal/Modal.stories.tsx +202 -0
- package/src/components/Modal/Modal.test.tsx +168 -0
- package/src/components/Modal/Modal.tsx +109 -0
- package/src/components/Modal/__screenshots__/Modal.test.tsx/Modal-displays-title-correctly-1.png +0 -0
- package/src/components/Modal/__screenshots__/Modal.test.tsx/Modal-handles-backdrop-click-to-close-1.png +0 -0
- package/src/components/Modal/styles.css.ts +99 -0
- package/src/components/Navbar/Navbar.stories.tsx +49 -0
- package/src/components/Navbar/Navbar.test.tsx +18 -0
- package/src/components/Navbar/Navbar.tsx +27 -0
- package/src/components/Navbar/NavbarItem.tsx +14 -0
- package/src/components/Navbar/__screenshots__/Navbar.test.tsx/Navbar-renders-correctly-1-chromium-win32.png +0 -0
- package/src/components/Navbar/__screenshots__/Navbar.test.tsx/Navbar-renders-navbar-correctly-1-chromium-linux.png +0 -0
- package/src/components/Navbar/__screenshots__/Navbar.test.tsx/Navbar-renders-navbar-correctly-1-chromium-win32.png +0 -0
- package/src/components/Navbar/styles.css.ts +5 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +101 -0
- package/src/components/NumberInput/NumberInput.test.tsx +39 -0
- package/src/components/NumberInput/NumberInput.tsx +161 -0
- package/src/components/NumberInput/styles.css.ts +127 -0
- package/src/components/Pagination/Pagination.stories.tsx +63 -0
- package/src/components/Pagination/Pagination.test.tsx +27 -0
- package/src/components/Pagination/Pagination.tsx +138 -0
- package/src/components/Pagination/styles.css.ts +48 -0
- package/src/components/Popover/Popover.stories.tsx +80 -0
- package/src/components/Popover/Popover.test.tsx +47 -0
- package/src/components/Popover/Popover.tsx +171 -0
- package/src/components/Popover/styles.css.ts +197 -0
- package/src/components/Progress/Progress.stories.tsx +73 -0
- package/src/components/Progress/Progress.test.tsx +53 -0
- package/src/components/Progress/Progress.tsx +66 -0
- package/src/components/Progress/styles.css.ts +75 -0
- package/src/components/Radio/Radio.stories.tsx +75 -0
- package/src/components/Radio/Radio.test.tsx +54 -0
- package/src/components/Radio/Radio.tsx +104 -0
- package/src/components/Radio/styles.css.ts +47 -0
- package/src/components/ScrollArea/ScrollArea.stories.tsx +63 -0
- package/src/components/ScrollArea/ScrollArea.test.tsx +24 -0
- package/src/components/ScrollArea/ScrollArea.tsx +50 -0
- package/src/components/ScrollArea/styles.css.ts +28 -0
- package/src/components/Select/Select.stories.tsx +94 -0
- package/src/components/Select/Select.test.tsx +57 -0
- package/src/components/Select/Select.tsx +60 -0
- package/src/components/Select/styles.css.ts +86 -0
- package/src/components/Separator/Separator.stories.tsx +49 -0
- package/src/components/Separator/Separator.test.tsx +22 -0
- package/src/components/Separator/Separator.tsx +37 -0
- package/src/components/Separator/styles.css.ts +32 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +78 -0
- package/src/components/Skeleton/Skeleton.test.tsx +36 -0
- package/src/components/Skeleton/Skeleton.tsx +67 -0
- package/src/components/Skeleton/styles.css.ts +62 -0
- package/src/components/Spinner/Spinner.stories.tsx +123 -0
- package/src/components/Spinner/Spinner.test.tsx +73 -0
- package/src/components/Spinner/Spinner.tsx +41 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-div-element-with-proper-attributes-1.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-error-color-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-info-color-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-large-spinner-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-medium-spinner-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-primary-spinner-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-secondary-color-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-small-spinner-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-success-color-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-warning-color-correctly-1-chromium-linux.png +0 -0
- package/src/components/Spinner/styles.css.ts +59 -0
- package/src/components/Stack/Stack.stories.tsx +123 -0
- package/src/components/Stack/Stack.test.tsx +48 -0
- package/src/components/Stack/Stack.tsx +60 -0
- package/src/components/Stepper/Stepper.stories.tsx +85 -0
- package/src/components/Stepper/Stepper.test.tsx +47 -0
- package/src/components/Stepper/Stepper.tsx +133 -0
- package/src/components/Stepper/styles.css.ts +118 -0
- package/src/components/Table/Table.stories.tsx +147 -0
- package/src/components/Table/Table.test.tsx +104 -0
- package/src/components/Table/Table.tsx +131 -0
- package/src/components/Table/styles.css.ts +57 -0
- package/src/components/Tabs/Tabs.stories.tsx +104 -0
- package/src/components/Tabs/Tabs.test.tsx +52 -0
- package/src/components/Tabs/Tabs.tsx +147 -0
- package/src/components/Tabs/styles.css.ts +106 -0
- package/src/components/Tag/Tag.stories.tsx +72 -0
- package/src/components/Tag/Tag.test.tsx +49 -0
- package/src/components/Tag/Tag.tsx +72 -0
- package/src/components/Tag/styles.css.ts +96 -0
- package/src/components/Text/Header.stories.tsx +45 -0
- package/src/components/Text/Header.tsx +20 -0
- package/src/components/Text/P.stories.tsx +24 -0
- package/src/components/Text/P.tsx +19 -0
- package/src/components/Text/Text.test.tsx +32 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h1-correctly-1-chromium-linux.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h1-correctly-1-chromium-win32.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h2-correctly-1-chromium-linux.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h2-correctly-1-chromium-win32.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h3-correctly-1-chromium-linux.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h3-correctly-1-chromium-win32.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/P-renders-correctly-1-chromium-win32.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/P-renders-p-correctly-1-chromium-linux.png +0 -0
- package/src/components/Text/__screenshots__/Text.test.tsx/P-renders-p-correctly-1-chromium-win32.png +0 -0
- package/src/components/Text/styles.css.ts +15 -0
- package/src/components/TextArea/TextArea.stories.tsx +40 -0
- package/src/components/TextArea/TextArea.test.tsx +16 -0
- package/src/components/TextArea/TextArea.tsx +43 -0
- package/src/components/TextArea/styles.css.ts +12 -0
- package/src/components/Toast/Toast.tsx +342 -0
- package/src/components/Toast/index.ts +9 -0
- package/src/components/Toast/styles.css.ts +213 -0
- package/src/components/Toggle/Toggle.stories.tsx +190 -0
- package/src/components/Toggle/Toggle.test.tsx +85 -0
- package/src/components/Toggle/Toggle.tsx +94 -0
- package/src/components/Toggle/styles.css.ts +130 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +111 -0
- package/src/components/Tooltip/Tooltip.test.tsx +93 -0
- package/src/components/Tooltip/Tooltip.tsx +72 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-has-proper-role-attribute-1.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-bottom-tooltip-correctly-1-chromium-linux.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-left-tooltip-correctly-1-chromium-linux.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-right-tooltip-correctly-1-chromium-linux.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-tooltip-without-arrow-1-chromium-linux.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-top-tooltip-correctly-1-chromium-linux.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-with-tooltip-content-1.png +0 -0
- package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-shows-tooltip-on-hover-1.png +0 -0
- package/src/components/Tooltip/styles.css.ts +94 -0
- package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +42 -0
- package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +20 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +26 -0
- package/src/components/VisuallyHidden/styles.css.ts +14 -0
- package/src/index.ts +1 -0
- package/src/styles/layers.css.ts +3 -0
- package/src/styles/reset.css.ts +79 -0
- package/src/styles/sprinkles.css.ts +177 -0
- package/src/styles/theme.css.ts +55 -0
- package/src/styles/utils.ts +9 -0
- package/dist/components/Accordion/Accordion.d.ts +0 -16
- package/dist/components/Accordion/Accordion.js +0 -108
- package/dist/components/Accordion/index.js +0 -2
- package/dist/components/Accordion/styles.css.d.ts +0 -7
- package/dist/components/Accordion/styles.css.js +0 -14
- package/dist/components/Alert/Alert.d.ts +0 -9
- package/dist/components/Alert/Alert.js +0 -28
- package/dist/components/Alert/index.js +0 -2
- package/dist/components/Alert/styles.css.d.ts +0 -4
- package/dist/components/Alert/styles.css.js +0 -13
- package/dist/components/AspectRatio/AspectRatio.d.ts +0 -9
- package/dist/components/AspectRatio/AspectRatio.js +0 -27
- package/dist/components/AspectRatio/index.js +0 -2
- package/dist/components/Avatar/Avatar.d.ts +0 -11
- package/dist/components/Avatar/Avatar.js +0 -27
- package/dist/components/Avatar/index.js +0 -2
- package/dist/components/Avatar/styles.css.d.ts +0 -4
- package/dist/components/Avatar/styles.css.js +0 -19
- package/dist/components/Badge/Badge.d.ts +0 -11
- package/dist/components/Badge/Badge.js +0 -13
- package/dist/components/Badge/index.js +0 -2
- package/dist/components/Badge/styles.css.d.ts +0 -5
- package/dist/components/Badge/styles.css.js +0 -23
- package/dist/components/Box/Box.d.ts +0 -11
- package/dist/components/Box/Box.js +0 -53
- package/dist/components/Box/index.js +0 -2
- package/dist/components/Box/reset.css.d.ts +0 -1
- package/dist/components/Box/reset.css.js +0 -3
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +0 -66
- package/dist/components/Breadcrumb/index.js +0 -2
- package/dist/components/Breadcrumb/styles.css.d.ts +0 -6
- package/dist/components/Breadcrumb/styles.css.js +0 -10
- package/dist/components/Button/Button.d.ts +0 -9
- package/dist/components/Button/Button.js +0 -15
- package/dist/components/Button/index.js +0 -2
- package/dist/components/Button/styles.css.d.ts +0 -2
- package/dist/components/Button/styles.css.js +0 -9
- package/dist/components/Card/Card.d.ts +0 -8
- package/dist/components/Card/Card.js +0 -15
- package/dist/components/Card/index.js +0 -2
- package/dist/components/Card/styles.css.d.ts +0 -2
- package/dist/components/Card/styles.css.js +0 -10
- package/dist/components/Checkbox/Checkbox.d.ts +0 -6
- package/dist/components/Checkbox/Checkbox.js +0 -50
- package/dist/components/Checkbox/index.js +0 -2
- package/dist/components/Checkbox/styles.css.d.ts +0 -3
- package/dist/components/Checkbox/styles.css.js +0 -7
- package/dist/components/Collapse/Collapse.d.ts +0 -12
- package/dist/components/Collapse/Collapse.js +0 -58
- package/dist/components/Collapse/index.js +0 -2
- package/dist/components/Collapse/styles.css.d.ts +0 -3
- package/dist/components/Collapse/styles.css.js +0 -8
- package/dist/components/Combobox/Combobox.d.ts +0 -23
- package/dist/components/Combobox/Combobox.js +0 -171
- package/dist/components/Combobox/index.js +0 -2
- package/dist/components/Combobox/styles.css.d.ts +0 -13
- package/dist/components/Combobox/styles.css.js +0 -20
- package/dist/components/Container/Container.d.ts +0 -11
- package/dist/components/Container/Container.js +0 -31
- package/dist/components/Container/index.js +0 -2
- package/dist/components/Divider/Divider.d.ts +0 -9
- package/dist/components/Divider/Divider.js +0 -14
- package/dist/components/Divider/index.js +0 -2
- package/dist/components/Divider/styles.css.d.ts +0 -4
- package/dist/components/Divider/styles.css.js +0 -19
- package/dist/components/Drawer/Drawer.d.ts +0 -16
- package/dist/components/Drawer/Drawer.js +0 -113
- package/dist/components/Drawer/index.js +0 -2
- package/dist/components/Drawer/styles.css.d.ts +0 -8
- package/dist/components/Drawer/styles.css.js +0 -17
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -23
- package/dist/components/DropdownMenu/DropdownMenu.js +0 -98
- package/dist/components/DropdownMenu/index.js +0 -2
- package/dist/components/DropdownMenu/styles.css.d.ts +0 -9
- package/dist/components/DropdownMenu/styles.css.js +0 -22
- package/dist/components/EmptyState/EmptyState.d.ts +0 -10
- package/dist/components/EmptyState/EmptyState.js +0 -32
- package/dist/components/EmptyState/index.js +0 -2
- package/dist/components/EmptyState/styles.css.d.ts +0 -5
- package/dist/components/EmptyState/styles.css.js +0 -9
- package/dist/components/FileUpload/FileUpload.d.ts +0 -27
- package/dist/components/FileUpload/FileUpload.js +0 -214
- package/dist/components/FileUpload/index.js +0 -2
- package/dist/components/FileUpload/styles.css.d.ts +0 -19
- package/dist/components/FileUpload/styles.css.js +0 -32
- package/dist/components/Form/Form.d.ts +0 -7
- package/dist/components/Form/Form.js +0 -15
- package/dist/components/Form/FormInput.d.ts +0 -5
- package/dist/components/Form/FormInput.js +0 -15
- package/dist/components/Form/index.js +0 -3
- package/dist/components/Form/styles.css.d.ts +0 -2
- package/dist/components/Form/styles.css.js +0 -4
- package/dist/components/Grid/Grid.d.ts +0 -13
- package/dist/components/Grid/Grid.js +0 -30
- package/dist/components/Grid/index.js +0 -2
- package/dist/components/Icon/Icon.d.ts +0 -12
- package/dist/components/Icon/Icon.js +0 -29
- package/dist/components/Icon/index.js +0 -2
- package/dist/components/Icon/styles.css.d.ts +0 -1
- package/dist/components/Icon/styles.css.js +0 -3
- package/dist/components/Input/Input.d.ts +0 -7
- package/dist/components/Input/Input.js +0 -38
- package/dist/components/Input/index.js +0 -2
- package/dist/components/Input/styles.css.d.ts +0 -2
- package/dist/components/Input/styles.css.js +0 -4
- package/dist/components/Kbd/Kbd.d.ts +0 -7
- package/dist/components/Kbd/Kbd.js +0 -10
- package/dist/components/Kbd/index.js +0 -2
- package/dist/components/Kbd/styles.css.d.ts +0 -1
- package/dist/components/Kbd/styles.css.js +0 -5
- package/dist/components/List/List.d.ts +0 -5
- package/dist/components/List/List.js +0 -11
- package/dist/components/List/ListItem.d.ts +0 -5
- package/dist/components/List/ListItem.js +0 -11
- package/dist/components/List/index.js +0 -3
- package/dist/components/List/styles.css.d.ts +0 -2
- package/dist/components/List/styles.css.js +0 -6
- package/dist/components/Modal/Modal.d.ts +0 -13
- package/dist/components/Modal/Modal.js +0 -71
- package/dist/components/Modal/index.js +0 -2
- package/dist/components/Modal/styles.css.d.ts +0 -7
- package/dist/components/Modal/styles.css.js +0 -16
- package/dist/components/Navbar/Navbar.d.ts +0 -6
- package/dist/components/Navbar/Navbar.js +0 -16
- package/dist/components/Navbar/NavbarItem.d.ts +0 -6
- package/dist/components/Navbar/NavbarItem.js +0 -12
- package/dist/components/Navbar/index.js +0 -3
- package/dist/components/Navbar/styles.css.d.ts +0 -2
- package/dist/components/Navbar/styles.css.js +0 -4
- package/dist/components/NumberInput/NumberInput.d.ts +0 -20
- package/dist/components/NumberInput/NumberInput.js +0 -108
- package/dist/components/NumberInput/index.js +0 -2
- package/dist/components/NumberInput/styles.css.d.ts +0 -10
- package/dist/components/NumberInput/styles.css.js +0 -17
- package/dist/components/Pagination/Pagination.d.ts +0 -11
- package/dist/components/Pagination/Pagination.js +0 -70
- package/dist/components/Pagination/index.js +0 -2
- package/dist/components/Pagination/styles.css.d.ts +0 -4
- package/dist/components/Pagination/styles.css.js +0 -11
- package/dist/components/Popover/Popover.d.ts +0 -18
- package/dist/components/Popover/Popover.js +0 -105
- package/dist/components/Popover/index.js +0 -2
- package/dist/components/Popover/styles.css.d.ts +0 -11
- package/dist/components/Popover/styles.css.js +0 -33
- package/dist/components/Progress/Progress.d.ts +0 -11
- package/dist/components/Progress/Progress.js +0 -55
- package/dist/components/Progress/index.js +0 -2
- package/dist/components/Progress/styles.css.d.ts +0 -4
- package/dist/components/Progress/styles.css.js +0 -18
- package/dist/components/Radio/Radio.d.ts +0 -16
- package/dist/components/Radio/Radio.js +0 -60
- package/dist/components/Radio/index.js +0 -2
- package/dist/components/Radio/styles.css.d.ts +0 -5
- package/dist/components/Radio/styles.css.js +0 -9
- package/dist/components/ScrollArea/ScrollArea.d.ts +0 -11
- package/dist/components/ScrollArea/ScrollArea.js +0 -22
- package/dist/components/ScrollArea/index.js +0 -2
- package/dist/components/ScrollArea/styles.css.d.ts +0 -3
- package/dist/components/ScrollArea/styles.css.js +0 -11
- package/dist/components/Select/Select.d.ts +0 -13
- package/dist/components/Select/Select.js +0 -36
- package/dist/components/Select/index.js +0 -2
- package/dist/components/Select/styles.css.d.ts +0 -4
- package/dist/components/Select/styles.css.js +0 -11
- package/dist/components/Separator/Separator.d.ts +0 -9
- package/dist/components/Separator/Separator.js +0 -13
- package/dist/components/Separator/index.js +0 -2
- package/dist/components/Separator/styles.css.d.ts +0 -4
- package/dist/components/Separator/styles.css.js +0 -15
- package/dist/components/Skeleton/Skeleton.d.ts +0 -14
- package/dist/components/Skeleton/Skeleton.js +0 -28
- package/dist/components/Skeleton/index.js +0 -2
- package/dist/components/Skeleton/styles.css.d.ts +0 -4
- package/dist/components/Skeleton/styles.css.js +0 -20
- package/dist/components/Spinner/Spinner.d.ts +0 -10
- package/dist/components/Spinner/Spinner.js +0 -14
- package/dist/components/Spinner/index.js +0 -2
- package/dist/components/Spinner/styles.css.d.ts +0 -4
- package/dist/components/Spinner/styles.css.js +0 -19
- package/dist/components/Stack/Stack.d.ts +0 -16
- package/dist/components/Stack/Stack.js +0 -39
- package/dist/components/Stack/index.js +0 -2
- package/dist/components/Stepper/Stepper.d.ts +0 -18
- package/dist/components/Stepper/Stepper.js +0 -70
- package/dist/components/Stepper/index.js +0 -2
- package/dist/components/Stepper/styles.css.d.ts +0 -14
- package/dist/components/Stepper/styles.css.js +0 -22
- package/dist/components/Table/Table.d.ts +0 -42
- package/dist/components/Table/Table.js +0 -65
- package/dist/components/Table/index.js +0 -2
- package/dist/components/Table/styles.css.d.ts +0 -8
- package/dist/components/Table/styles.css.js +0 -15
- package/dist/components/Tabs/Tabs.d.ts +0 -29
- package/dist/components/Tabs/Tabs.js +0 -71
- package/dist/components/Tabs/index.js +0 -2
- package/dist/components/Tabs/styles.css.d.ts +0 -6
- package/dist/components/Tabs/styles.css.js +0 -14
- package/dist/components/Tag/Tag.d.ts +0 -16
- package/dist/components/Tag/Tag.js +0 -40
- package/dist/components/Tag/index.js +0 -2
- package/dist/components/Tag/styles.css.d.ts +0 -3
- package/dist/components/Tag/styles.css.js +0 -14
- package/dist/components/Text/Header.d.ts +0 -8
- package/dist/components/Text/Header.js +0 -12
- package/dist/components/Text/P.d.ts +0 -7
- package/dist/components/Text/P.js +0 -12
- package/dist/components/Text/index.js +0 -3
- package/dist/components/Text/styles.css.d.ts +0 -2
- package/dist/components/Text/styles.css.js +0 -6
- package/dist/components/TextArea/TextArea.d.ts +0 -7
- package/dist/components/TextArea/TextArea.js +0 -38
- package/dist/components/TextArea/index.js +0 -2
- package/dist/components/TextArea/styles.css.d.ts +0 -2
- package/dist/components/TextArea/styles.css.js +0 -4
- package/dist/components/Toast/Toast.d.ts +0 -34
- package/dist/components/Toast/Toast.js +0 -236
- package/dist/components/Toast/index.d.ts +0 -1
- package/dist/components/Toast/index.js +0 -2
- package/dist/components/Toast/styles.css.d.ts +0 -21
- package/dist/components/Toast/styles.css.js +0 -32
- package/dist/components/Toggle/Toggle.d.ts +0 -10
- package/dist/components/Toggle/Toggle.js +0 -62
- package/dist/components/Toggle/index.js +0 -2
- package/dist/components/Toggle/styles.css.d.ts +0 -12
- package/dist/components/Toggle/styles.css.js +0 -24
- package/dist/components/Tooltip/Tooltip.d.ts +0 -10
- package/dist/components/Tooltip/Tooltip.js +0 -41
- package/dist/components/Tooltip/index.js +0 -2
- package/dist/components/Tooltip/styles.css.d.ts +0 -8
- package/dist/components/Tooltip/styles.css.js +0 -17
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +0 -8
- package/dist/components/VisuallyHidden/VisuallyHidden.js +0 -8
- package/dist/components/VisuallyHidden/index.js +0 -2
- package/dist/components/VisuallyHidden/styles.css.d.ts +0 -1
- package/dist/components/VisuallyHidden/styles.css.js +0 -3
- package/dist/components/index.js +0 -48
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/layers.css.js +0 -4
- package/dist/reset.css.js +0 -1
- package/dist/styles/layers.css.d.ts +0 -3
- package/dist/styles/layers.css.js +0 -4
- package/dist/styles/reset.css.js +0 -1
- package/dist/styles/sprinkles.css.d.ts +0 -241
- package/dist/styles/sprinkles.css.js +0 -2312
- package/dist/styles/theme.css.d.ts +0 -38
- package/dist/styles/theme.css.js +0 -41
- package/dist/styles/utils.d.ts +0 -2
- package/dist/styles/utils.js +0 -8
- package/dist/theme.css.js +0 -41
- /package/{dist/components/Accordion/index.d.ts → src/components/Accordion/index.ts} +0 -0
- /package/{dist/components/Alert/index.d.ts → src/components/Alert/index.ts} +0 -0
- /package/{dist/components/AspectRatio/index.d.ts → src/components/AspectRatio/index.ts} +0 -0
- /package/{dist/components/Avatar/index.d.ts → src/components/Avatar/index.ts} +0 -0
- /package/{dist/components/Badge/index.d.ts → src/components/Badge/index.ts} +0 -0
- /package/{dist/components/Box/index.d.ts → src/components/Box/index.ts} +0 -0
- /package/{dist/components/Breadcrumb/index.d.ts → src/components/Breadcrumb/index.ts} +0 -0
- /package/{dist/components/Button/index.d.ts → src/components/Button/index.ts} +0 -0
- /package/{dist/components/Card/index.d.ts → src/components/Card/index.ts} +0 -0
- /package/{dist/components/Checkbox/index.d.ts → src/components/Checkbox/index.ts} +0 -0
- /package/{dist/components/Collapse/index.d.ts → src/components/Collapse/index.ts} +0 -0
- /package/{dist/components/Combobox/index.d.ts → src/components/Combobox/index.ts} +0 -0
- /package/{dist/components/Container/index.d.ts → src/components/Container/index.ts} +0 -0
- /package/{dist/components/Divider/index.d.ts → src/components/Divider/index.ts} +0 -0
- /package/{dist/components/Drawer/index.d.ts → src/components/Drawer/index.ts} +0 -0
- /package/{dist/components/DropdownMenu/index.d.ts → src/components/DropdownMenu/index.ts} +0 -0
- /package/{dist/components/EmptyState/index.d.ts → src/components/EmptyState/index.ts} +0 -0
- /package/{dist/components/FileUpload/index.d.ts → src/components/FileUpload/index.ts} +0 -0
- /package/{dist/components/Form/index.d.ts → src/components/Form/index.ts} +0 -0
- /package/{dist/components/Grid/index.d.ts → src/components/Grid/index.ts} +0 -0
- /package/{dist/components/Icon/index.d.ts → src/components/Icon/index.ts} +0 -0
- /package/{dist/components/Input/index.d.ts → src/components/Input/index.ts} +0 -0
- /package/{dist/components/Kbd/index.d.ts → src/components/Kbd/index.ts} +0 -0
- /package/{dist/components/List/index.d.ts → src/components/List/index.ts} +0 -0
- /package/{dist/components/Modal/index.d.ts → src/components/Modal/index.ts} +0 -0
- /package/{dist/components/Navbar/index.d.ts → src/components/Navbar/index.ts} +0 -0
- /package/{dist/components/NumberInput/index.d.ts → src/components/NumberInput/index.ts} +0 -0
- /package/{dist/components/Pagination/index.d.ts → src/components/Pagination/index.ts} +0 -0
- /package/{dist/components/Popover/index.d.ts → src/components/Popover/index.ts} +0 -0
- /package/{dist/components/Progress/index.d.ts → src/components/Progress/index.ts} +0 -0
- /package/{dist/components/Radio/index.d.ts → src/components/Radio/index.ts} +0 -0
- /package/{dist/components/ScrollArea/index.d.ts → src/components/ScrollArea/index.ts} +0 -0
- /package/{dist/components/Select/index.d.ts → src/components/Select/index.ts} +0 -0
- /package/{dist/components/Separator/index.d.ts → src/components/Separator/index.ts} +0 -0
- /package/{dist/components/Skeleton/index.d.ts → src/components/Skeleton/index.ts} +0 -0
- /package/{dist/components/Spinner/index.d.ts → src/components/Spinner/index.ts} +0 -0
- /package/{dist/components/Stack/index.d.ts → src/components/Stack/index.ts} +0 -0
- /package/{dist/components/Stepper/index.d.ts → src/components/Stepper/index.ts} +0 -0
- /package/{dist/components/Table/index.d.ts → src/components/Table/index.ts} +0 -0
- /package/{dist/components/Tabs/index.d.ts → src/components/Tabs/index.ts} +0 -0
- /package/{dist/components/Tag/index.d.ts → src/components/Tag/index.ts} +0 -0
- /package/{dist/components/Text/index.d.ts → src/components/Text/index.ts} +0 -0
- /package/{dist/components/TextArea/index.d.ts → src/components/TextArea/index.ts} +0 -0
- /package/{dist/components/Toggle/index.d.ts → src/components/Toggle/index.ts} +0 -0
- /package/{dist/components/Tooltip/index.d.ts → src/components/Tooltip/index.ts} +0 -0
- /package/{dist/components/VisuallyHidden/index.d.ts → src/components/VisuallyHidden/index.ts} +0 -0
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { style } from '@vanilla-extract/css';
|
|
2
|
+
import { vars } from '../../styles/theme.css';
|
|
3
|
+
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
+
|
|
5
|
+
export const radioContainer = styleWithLayer({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
gap: '8px',
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
userSelect: 'none',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const radioInput = style({
|
|
14
|
+
width: '18px',
|
|
15
|
+
height: '18px',
|
|
16
|
+
border: `2px solid ${vars.colors.borderDefault}`,
|
|
17
|
+
borderRadius: '50%',
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
accentColor: vars.colors.buttonBackgroundPrimary,
|
|
20
|
+
':focus-visible': {
|
|
21
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
22
|
+
outlineOffset: '2px',
|
|
23
|
+
},
|
|
24
|
+
':disabled': {
|
|
25
|
+
cursor: 'not-allowed',
|
|
26
|
+
opacity: 0.5,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const radioLabel = styleWithLayer({
|
|
31
|
+
fontFamily: vars.fontFamily.body,
|
|
32
|
+
fontSize: '14px',
|
|
33
|
+
color: vars.colors.textPrimary,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const radioGroup = styleWithLayer({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'column',
|
|
39
|
+
gap: '8px',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const radioGroupHorizontal = styleWithLayer({
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
gap: '16px',
|
|
46
|
+
flexWrap: 'wrap',
|
|
47
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ScrollArea } from '.';
|
|
4
|
+
import { Box } from '../Box';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/ScrollArea',
|
|
8
|
+
component: ScrollArea,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
} satisfies Meta<typeof ScrollArea>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const LongContent = () => (
|
|
19
|
+
<div>
|
|
20
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
21
|
+
<Box key={i} padding="small" background={i % 2 === 0 ? 'c1-50' : 'c1-100'}>
|
|
22
|
+
Item {i + 1}
|
|
23
|
+
</Box>
|
|
24
|
+
))}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const Vertical: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
orientation: 'vertical',
|
|
31
|
+
maxHeight: '200px',
|
|
32
|
+
children: <LongContent />,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Horizontal: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
orientation: 'horizontal',
|
|
39
|
+
maxWidth: '300px',
|
|
40
|
+
children: (
|
|
41
|
+
<div style={{ whiteSpace: 'nowrap' }}>
|
|
42
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
43
|
+
<span key={i} style={{ marginRight: '20px' }}>
|
|
44
|
+
Horizontal item {i + 1}
|
|
45
|
+
</span>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Both: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
orientation: 'both',
|
|
55
|
+
maxHeight: '200px',
|
|
56
|
+
maxWidth: '300px',
|
|
57
|
+
children: (
|
|
58
|
+
<div style={{ width: '500px' }}>
|
|
59
|
+
<LongContent />
|
|
60
|
+
</div>
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from 'vitest-browser-react';
|
|
3
|
+
import ScrollArea from './ScrollArea';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
describe('ScrollArea', () => {
|
|
7
|
+
it('renders with vertical scroll', async () => {
|
|
8
|
+
const { container } = await render(
|
|
9
|
+
<ScrollArea maxHeight="100px">
|
|
10
|
+
<div style={{ height: '200px' }}>Scrollable content</div>
|
|
11
|
+
</ScrollArea>
|
|
12
|
+
);
|
|
13
|
+
expect(container).toMatchScreenshot();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('renders with horizontal scroll', async () => {
|
|
17
|
+
const { container } = await render(
|
|
18
|
+
<ScrollArea orientation="horizontal" maxWidth="100px">
|
|
19
|
+
<div style={{ width: '200px' }}>Wide content</div>
|
|
20
|
+
</ScrollArea>
|
|
21
|
+
);
|
|
22
|
+
expect(container).toMatchScreenshot();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
scrollArea,
|
|
5
|
+
scrollAreaOrientation,
|
|
6
|
+
scrollAreaViewport,
|
|
7
|
+
} from './styles.css';
|
|
8
|
+
import Box from '../Box';
|
|
9
|
+
|
|
10
|
+
export type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';
|
|
11
|
+
|
|
12
|
+
export interface ScrollAreaProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
orientation?: ScrollAreaOrientation;
|
|
15
|
+
maxHeight?: string | number;
|
|
16
|
+
maxWidth?: string | number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const ScrollArea = ({
|
|
21
|
+
children,
|
|
22
|
+
orientation = 'vertical',
|
|
23
|
+
maxHeight,
|
|
24
|
+
maxWidth,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: ScrollAreaProps) => {
|
|
28
|
+
const style: React.CSSProperties = {
|
|
29
|
+
maxHeight,
|
|
30
|
+
maxWidth,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Box
|
|
35
|
+
className={clsx(
|
|
36
|
+
scrollArea,
|
|
37
|
+
scrollAreaOrientation[orientation],
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
style={style}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<Box className={scrollAreaViewport}>
|
|
44
|
+
{children}
|
|
45
|
+
</Box>
|
|
46
|
+
</Box>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default ScrollArea;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { vars } from '../../styles/theme.css';
|
|
3
|
+
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
+
|
|
5
|
+
export const scrollArea = styleWithLayer({
|
|
6
|
+
overflow: 'auto',
|
|
7
|
+
scrollbarWidth: 'thin',
|
|
8
|
+
scrollbarColor: `${vars.colors.borderDefault} ${vars.colors.backgroundMuted}`,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const scrollAreaOrientation = styleVariants({
|
|
12
|
+
vertical: {
|
|
13
|
+
overflowX: 'hidden',
|
|
14
|
+
overflowY: 'auto',
|
|
15
|
+
},
|
|
16
|
+
horizontal: {
|
|
17
|
+
overflowX: 'auto',
|
|
18
|
+
overflowY: 'hidden',
|
|
19
|
+
},
|
|
20
|
+
both: {
|
|
21
|
+
overflow: 'auto',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const scrollAreaViewport = styleWithLayer({
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { Select } from '.';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Select',
|
|
9
|
+
component: Select,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
args: { onChange: fn() },
|
|
15
|
+
} satisfies Meta<typeof Select>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
const options = [
|
|
21
|
+
{ value: 'option1', label: 'Option 1' },
|
|
22
|
+
{ value: 'option2', label: 'Option 2' },
|
|
23
|
+
{ value: 'option3', label: 'Option 3' },
|
|
24
|
+
{ value: 'option4', label: 'Option 4' },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
options,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const WithLabel: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
label: 'Choose an option',
|
|
36
|
+
options,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const WithDefaultValue: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
label: 'Choose an option',
|
|
43
|
+
options,
|
|
44
|
+
defaultValue: 'option2',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const WithPlaceholder: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
label: 'Choose an option',
|
|
51
|
+
placeholder: 'Select...',
|
|
52
|
+
options: [
|
|
53
|
+
{ value: '', label: 'Select...', disabled: true },
|
|
54
|
+
...options,
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Error: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
label: 'Choose an option',
|
|
62
|
+
options,
|
|
63
|
+
error: true,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Disabled: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
label: 'Choose an option',
|
|
70
|
+
options,
|
|
71
|
+
disabled: true,
|
|
72
|
+
defaultValue: 'option2',
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const WithDisabledOptions: Story = {
|
|
77
|
+
args: {
|
|
78
|
+
label: 'Choose an option',
|
|
79
|
+
options: [
|
|
80
|
+
{ value: 'option1', label: 'Option 1' },
|
|
81
|
+
{ value: 'option2', label: 'Option 2 (disabled)', disabled: true },
|
|
82
|
+
{ value: 'option3', label: 'Option 3' },
|
|
83
|
+
{ value: 'option4', label: 'Option 4' },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const NotFullWidth: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
label: 'Choose an option',
|
|
91
|
+
options,
|
|
92
|
+
fullWidth: false,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from 'vitest-browser-react';
|
|
3
|
+
import Select from './Select';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
describe('Select', () => {
|
|
7
|
+
const options = [
|
|
8
|
+
{ value: 'option1', label: 'Option 1' },
|
|
9
|
+
{ value: 'option2', label: 'Option 2' },
|
|
10
|
+
{ value: 'option3', label: 'Option 3' },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
it('renders select correctly', async () => {
|
|
14
|
+
const { container } = await render(<Select options={options} />);
|
|
15
|
+
expect(container).toMatchScreenshot();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders select with label correctly', async () => {
|
|
19
|
+
const { container } = await render(
|
|
20
|
+
<Select label="Choose an option" options={options} />,
|
|
21
|
+
);
|
|
22
|
+
expect(container).toMatchScreenshot();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('renders select with error state correctly', async () => {
|
|
26
|
+
const { container } = await render(
|
|
27
|
+
<Select label="Choose an option" options={options} error />,
|
|
28
|
+
);
|
|
29
|
+
expect(container).toMatchScreenshot();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('renders disabled select correctly', async () => {
|
|
33
|
+
const { container } = await render(
|
|
34
|
+
<Select label="Choose an option" options={options} disabled />,
|
|
35
|
+
);
|
|
36
|
+
expect(container).toMatchScreenshot();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders select with disabled option correctly', async () => {
|
|
40
|
+
const optionsWithDisabled = [
|
|
41
|
+
{ value: 'option1', label: 'Option 1' },
|
|
42
|
+
{ value: 'option2', label: 'Option 2', disabled: true },
|
|
43
|
+
{ value: 'option3', label: 'Option 3' },
|
|
44
|
+
];
|
|
45
|
+
const { container } = await render(
|
|
46
|
+
<Select options={optionsWithDisabled} />,
|
|
47
|
+
);
|
|
48
|
+
expect(container).toMatchScreenshot();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders select with selected value correctly', async () => {
|
|
52
|
+
const { container } = await render(
|
|
53
|
+
<Select options={options} defaultValue="option2" />,
|
|
54
|
+
);
|
|
55
|
+
expect(container).toMatchScreenshot();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { select, selectLabel, selectWrapper } from './styles.css';
|
|
4
|
+
import Box from '../Box';
|
|
5
|
+
|
|
6
|
+
type SelectOption = {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> & {
|
|
13
|
+
label?: string;
|
|
14
|
+
options: SelectOption[];
|
|
15
|
+
error?: boolean;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
20
|
+
({ label, options, error = false, fullWidth = true, className, ...props }, ref) => {
|
|
21
|
+
return (
|
|
22
|
+
<Box className={selectWrapper} width="100%">
|
|
23
|
+
{label && (
|
|
24
|
+
<Box
|
|
25
|
+
as="label"
|
|
26
|
+
className={selectLabel}
|
|
27
|
+
display="block"
|
|
28
|
+
fontSize="14px"
|
|
29
|
+
fontWeight="500"
|
|
30
|
+
color="c5-700"
|
|
31
|
+
marginBottom="small"
|
|
32
|
+
>
|
|
33
|
+
{label}
|
|
34
|
+
</Box>
|
|
35
|
+
)}
|
|
36
|
+
<Box
|
|
37
|
+
as="select"
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={clsx(select[error ? 'error' : 'default'], className)}
|
|
40
|
+
width={fullWidth ? '100%' : undefined}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{options.map((option) => (
|
|
44
|
+
<option
|
|
45
|
+
key={option.value}
|
|
46
|
+
value={option.value}
|
|
47
|
+
disabled={option.disabled}
|
|
48
|
+
>
|
|
49
|
+
{option.label}
|
|
50
|
+
</option>
|
|
51
|
+
))}
|
|
52
|
+
</Box>
|
|
53
|
+
</Box>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
Select.displayName = 'Select';
|
|
59
|
+
|
|
60
|
+
export default Select;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { vars } from '../../styles/theme.css';
|
|
3
|
+
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
+
|
|
5
|
+
export const selectContainer = styleWithLayer({
|
|
6
|
+
width: '100%',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const select = styleVariants({
|
|
10
|
+
default: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
padding: '0.75rem 1rem',
|
|
13
|
+
fontSize: '14px',
|
|
14
|
+
fontFamily: vars.fontFamily.body,
|
|
15
|
+
color: vars.colors.textPrimary,
|
|
16
|
+
backgroundColor: vars.colors.inputBackground,
|
|
17
|
+
border: `1px solid ${vars.colors.inputBorder}`,
|
|
18
|
+
borderRadius: '8px',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
outline: 'none',
|
|
21
|
+
appearance: 'none',
|
|
22
|
+
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23252525' d='M6 8L1 3h10z'/%3E%3C/svg%3E")`,
|
|
23
|
+
backgroundRepeat: 'no-repeat',
|
|
24
|
+
backgroundPosition: 'right 12px center',
|
|
25
|
+
transition: 'border-color 0.2s ease',
|
|
26
|
+
'::placeholder': {
|
|
27
|
+
color: vars.colors.inputPlaceholder,
|
|
28
|
+
},
|
|
29
|
+
':focus-visible': {
|
|
30
|
+
outline: `2px solid ${vars.colors.inputBorderFocused}`,
|
|
31
|
+
outlineOffset: '2px',
|
|
32
|
+
},
|
|
33
|
+
':hover:not(:disabled)': {
|
|
34
|
+
borderColor: vars.colors.inputBorderFocused,
|
|
35
|
+
},
|
|
36
|
+
':disabled': {
|
|
37
|
+
cursor: 'not-allowed',
|
|
38
|
+
opacity: 0.5,
|
|
39
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
error: {
|
|
43
|
+
width: '100%',
|
|
44
|
+
padding: '0.75rem 1rem',
|
|
45
|
+
fontSize: '14px',
|
|
46
|
+
fontFamily: vars.fontFamily.body,
|
|
47
|
+
color: vars.colors.textPrimary,
|
|
48
|
+
backgroundColor: vars.colors.inputBackground,
|
|
49
|
+
border: `1px solid ${vars.colors.alertErrorBorder}`,
|
|
50
|
+
borderRadius: '8px',
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
outline: 'none',
|
|
53
|
+
appearance: 'none',
|
|
54
|
+
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23252525' d='M6 8L1 3h10z'/%3E%3C/svg%3E")`,
|
|
55
|
+
backgroundRepeat: 'no-repeat',
|
|
56
|
+
backgroundPosition: 'right 12px center',
|
|
57
|
+
transition: 'border-color 0.2s ease',
|
|
58
|
+
'::placeholder': {
|
|
59
|
+
color: vars.colors.inputPlaceholder,
|
|
60
|
+
},
|
|
61
|
+
':focus-visible': {
|
|
62
|
+
outline: `2px solid ${vars.colors.alertErrorBorder}`,
|
|
63
|
+
outlineOffset: '2px',
|
|
64
|
+
},
|
|
65
|
+
':hover:not(:disabled)': {
|
|
66
|
+
borderColor: vars.colors.alertErrorBorder,
|
|
67
|
+
},
|
|
68
|
+
':disabled': {
|
|
69
|
+
cursor: 'not-allowed',
|
|
70
|
+
opacity: 0.5,
|
|
71
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const selectLabel = styleWithLayer({
|
|
77
|
+
display: 'block',
|
|
78
|
+
fontSize: '14px',
|
|
79
|
+
fontWeight: '500',
|
|
80
|
+
color: vars.colors.textPrimary,
|
|
81
|
+
marginBottom: '8px',
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const selectWrapper = styleWithLayer({
|
|
85
|
+
width: '100%',
|
|
86
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Separator } from '.';
|
|
4
|
+
import { Box } from '../Box';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/Separator',
|
|
8
|
+
component: Separator,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
} satisfies Meta<typeof Separator>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Horizontal: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
orientation: 'horizontal',
|
|
21
|
+
},
|
|
22
|
+
render: () => (
|
|
23
|
+
<Box width="100%">
|
|
24
|
+
<p>Content above</p>
|
|
25
|
+
<Separator orientation="horizontal" />
|
|
26
|
+
<p>Content below</p>
|
|
27
|
+
</Box>
|
|
28
|
+
),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Vertical: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
orientation: 'vertical',
|
|
34
|
+
},
|
|
35
|
+
render: () => (
|
|
36
|
+
<Box display="flex" height="100px" alignItems="center">
|
|
37
|
+
<span>Left content</span>
|
|
38
|
+
<Separator orientation="vertical" />
|
|
39
|
+
<span>Right content</span>
|
|
40
|
+
</Box>
|
|
41
|
+
),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Decorative: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
orientation: 'horizontal',
|
|
47
|
+
decorative: true,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { render } from 'vitest-browser-react';
|
|
3
|
+
import Separator from './Separator';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
describe('Separator', () => {
|
|
7
|
+
it('renders horizontal separator', async () => {
|
|
8
|
+
const { container } = await render(
|
|
9
|
+
<Separator orientation="horizontal" />
|
|
10
|
+
);
|
|
11
|
+
expect(container).toMatchScreenshot();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('renders vertical separator', async () => {
|
|
15
|
+
const { container } = await render(
|
|
16
|
+
<div style={{ height: '100px' }}>
|
|
17
|
+
<Separator orientation="vertical" />
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
expect(container).toMatchScreenshot();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
separator,
|
|
5
|
+
separatorOrientation,
|
|
6
|
+
} from './styles.css';
|
|
7
|
+
import Box from '../Box';
|
|
8
|
+
|
|
9
|
+
export type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
10
|
+
|
|
11
|
+
export interface SeparatorProps {
|
|
12
|
+
orientation?: SeparatorOrientation;
|
|
13
|
+
decorative?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Separator = ({
|
|
18
|
+
orientation = 'horizontal',
|
|
19
|
+
decorative = false,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: SeparatorProps) => {
|
|
23
|
+
return (
|
|
24
|
+
<Box
|
|
25
|
+
as="hr"
|
|
26
|
+
className={clsx(
|
|
27
|
+
separator,
|
|
28
|
+
separatorOrientation[orientation],
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
aria-hidden={decorative}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default Separator;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { vars } from '../../styles/theme.css';
|
|
3
|
+
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
+
|
|
5
|
+
export const separator = styleWithLayer({
|
|
6
|
+
border: 'none',
|
|
7
|
+
margin: 0,
|
|
8
|
+
flexShrink: 0,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const separatorOrientation = styleVariants({
|
|
12
|
+
horizontal: {
|
|
13
|
+
width: '100%',
|
|
14
|
+
height: '1px',
|
|
15
|
+
backgroundColor: vars.colors.borderDefault,
|
|
16
|
+
},
|
|
17
|
+
vertical: {
|
|
18
|
+
width: '1px',
|
|
19
|
+
height: '100%',
|
|
20
|
+
backgroundColor: vars.colors.borderDefault,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const separatorSize = styleVariants({
|
|
25
|
+
small: {},
|
|
26
|
+
medium: {},
|
|
27
|
+
large: {},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const separatorDecorative = styleWithLayer({
|
|
31
|
+
backgroundColor: vars.colors.borderMuted,
|
|
32
|
+
});
|