@jordan-mace/chaser-design-system 1.2.2 → 1.2.4
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/components/Accordion/Accordion.d.ts +2 -2
- package/dist/components/Accordion/Accordion.js +26 -91
- package/dist/components/Accordion/index.js +1 -2
- package/dist/components/Accordion/styles.css.js +65 -14
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.js +8 -28
- package/dist/components/Alert/index.js +1 -2
- package/dist/components/Alert/styles.css.js +54 -13
- package/dist/components/AspectRatio/AspectRatio.js +9 -24
- package/dist/components/AspectRatio/index.js +1 -2
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +10 -24
- package/dist/components/Avatar/index.js +1 -2
- package/dist/components/Avatar/styles.css.js +151 -19
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.js +8 -13
- package/dist/components/Badge/index.js +1 -2
- package/dist/components/Badge/styles.css.js +77 -23
- package/dist/components/Box/Box.js +18 -17
- package/dist/components/Box/index.js +1 -2
- package/dist/components/Box/reset.css.js +15 -3
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +8 -66
- package/dist/components/Breadcrumb/index.js +1 -2
- package/dist/components/Breadcrumb/styles.css.js +50 -10
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +8 -15
- package/dist/components/Button/index.js +1 -2
- package/dist/components/Button/styles.css.js +30 -9
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +8 -15
- package/dist/components/Card/index.js +1 -2
- package/dist/components/Card/styles.css.js +25 -10
- package/dist/components/Checkbox/Checkbox.js +20 -45
- package/dist/components/Checkbox/index.js +1 -2
- package/dist/components/Checkbox/styles.css.js +31 -7
- package/dist/components/Collapse/Collapse.d.ts +1 -1
- package/dist/components/Collapse/Collapse.js +40 -42
- package/dist/components/Collapse/index.js +1 -2
- package/dist/components/Collapse/styles.css.js +36 -8
- package/dist/components/Combobox/Combobox.d.ts +1 -1
- package/dist/components/Combobox/Combobox.js +62 -129
- package/dist/components/Combobox/index.js +1 -2
- package/dist/components/Combobox/styles.css.js +142 -20
- package/dist/components/Container/Container.js +9 -19
- package/dist/components/Container/index.js +1 -2
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +8 -14
- package/dist/components/Divider/index.js +1 -2
- package/dist/components/Divider/styles.css.js +41 -19
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +37 -85
- package/dist/components/Drawer/index.js +1 -2
- package/dist/components/Drawer/styles.css.js +125 -17
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +33 -88
- package/dist/components/DropdownMenu/index.js +1 -2
- package/dist/components/DropdownMenu/styles.css.d.ts +1 -1
- package/dist/components/DropdownMenu/styles.css.js +93 -22
- package/dist/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/components/EmptyState/EmptyState.js +8 -32
- package/dist/components/EmptyState/index.js +1 -2
- package/dist/components/EmptyState/styles.css.js +30 -9
- package/dist/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/FileUpload/FileUpload.js +63 -175
- package/dist/components/FileUpload/index.js +1 -2
- package/dist/components/FileUpload/styles.css.js +145 -32
- package/dist/components/Form/Form.d.ts +1 -1
- package/dist/components/Form/Form.js +8 -15
- package/dist/components/Form/FormInput.d.ts +1 -1
- package/dist/components/Form/FormInput.js +9 -15
- package/dist/components/Form/index.js +2 -3
- package/dist/components/Form/styles.css.js +11 -4
- package/dist/components/Grid/Grid.js +14 -19
- package/dist/components/Grid/index.js +1 -2
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +12 -20
- package/dist/components/Icon/index.js +1 -2
- package/dist/components/Icon/styles.css.js +9 -3
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +9 -38
- package/dist/components/Input/index.js +1 -2
- package/dist/components/Input/styles.css.js +8 -4
- package/dist/components/Kbd/Kbd.d.ts +1 -1
- package/dist/components/Kbd/Kbd.js +6 -10
- package/dist/components/Kbd/index.js +1 -2
- package/dist/components/Kbd/styles.css.js +16 -5
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/List.js +7 -11
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/List/ListItem.js +7 -11
- package/dist/components/List/index.js +2 -3
- package/dist/components/List/styles.css.js +11 -6
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +21 -57
- package/dist/components/Modal/index.js +1 -2
- package/dist/components/Modal/styles.css.js +92 -16
- package/dist/components/Navbar/Navbar.d.ts +1 -1
- package/dist/components/Navbar/Navbar.js +8 -16
- package/dist/components/Navbar/NavbarItem.d.ts +1 -1
- package/dist/components/Navbar/NavbarItem.js +8 -12
- package/dist/components/Navbar/index.js +2 -3
- package/dist/components/Navbar/styles.css.js +3 -4
- package/dist/components/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.js +25 -94
- package/dist/components/NumberInput/index.js +1 -2
- package/dist/components/NumberInput/styles.css.js +117 -17
- package/dist/components/Pagination/Pagination.d.ts +1 -2
- package/dist/components/Pagination/Pagination.js +34 -57
- package/dist/components/Pagination/index.js +1 -2
- package/dist/components/Pagination/styles.css.js +44 -11
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popover/Popover.js +43 -93
- package/dist/components/Popover/index.js +1 -2
- package/dist/components/Popover/styles.css.d.ts +2 -2
- package/dist/components/Popover/styles.css.js +185 -33
- package/dist/components/Progress/Progress.d.ts +1 -2
- package/dist/components/Progress/Progress.js +8 -54
- package/dist/components/Progress/index.js +1 -2
- package/dist/components/Progress/styles.css.js +71 -18
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.js +17 -52
- package/dist/components/Radio/index.js +1 -2
- package/dist/components/Radio/styles.css.js +42 -9
- package/dist/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +8 -18
- package/dist/components/ScrollArea/index.js +1 -2
- package/dist/components/ScrollArea/styles.css.js +25 -11
- package/dist/components/Select/Select.js +9 -35
- package/dist/components/Select/index.js +1 -2
- package/dist/components/Select/styles.css.js +82 -11
- package/dist/components/Separator/Separator.d.ts +1 -2
- package/dist/components/Separator/Separator.js +8 -13
- package/dist/components/Separator/index.js +1 -2
- package/dist/components/Separator/styles.css.js +28 -15
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +9 -24
- package/dist/components/Skeleton/index.js +1 -2
- package/dist/components/Skeleton/styles.css.js +56 -20
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/Spinner/Spinner.js +8 -14
- package/dist/components/Spinner/index.js +1 -2
- package/dist/components/Spinner/styles.css.d.ts +1 -1
- package/dist/components/Spinner/styles.css.js +55 -19
- package/dist/components/Stack/Stack.js +10 -25
- package/dist/components/Stack/index.js +1 -2
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.js +19 -64
- package/dist/components/Stepper/index.js +1 -2
- package/dist/components/Stepper/styles.css.js +104 -22
- package/dist/components/Table/Table.d.ts +7 -7
- package/dist/components/Table/Table.js +30 -56
- package/dist/components/Table/index.js +1 -2
- package/dist/components/Table/styles.css.js +49 -15
- package/dist/components/Tabs/Tabs.d.ts +4 -4
- package/dist/components/Tabs/Tabs.js +33 -52
- package/dist/components/Tabs/index.js +1 -2
- package/dist/components/Tabs/styles.css.js +100 -14
- package/dist/components/Tag/Tag.d.ts +2 -2
- package/dist/components/Tag/Tag.js +16 -38
- package/dist/components/Tag/index.js +1 -2
- package/dist/components/Tag/styles.css.d.ts +1 -1
- package/dist/components/Tag/styles.css.js +93 -14
- package/dist/components/Text/Header.d.ts +1 -1
- package/dist/components/Text/Header.js +8 -12
- package/dist/components/Text/P.d.ts +1 -1
- package/dist/components/Text/P.js +8 -12
- package/dist/components/Text/index.js +2 -3
- package/dist/components/Text/styles.css.js +13 -6
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +9 -38
- package/dist/components/TextArea/index.js +1 -2
- package/dist/components/TextArea/styles.css.js +10 -4
- package/dist/components/Toast/Toast.d.ts +3 -3
- package/dist/components/Toast/Toast.js +85 -144
- package/dist/components/Toast/index.js +1 -2
- package/dist/components/Toast/styles.css.d.ts +1 -1
- package/dist/components/Toast/styles.css.js +192 -32
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +12 -57
- package/dist/components/Toggle/index.js +1 -2
- package/dist/components/Toggle/styles.css.js +118 -24
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +12 -37
- package/dist/components/Tooltip/index.js +1 -2
- package/dist/components/Tooltip/styles.css.js +86 -17
- package/dist/components/VisuallyHidden/VisuallyHidden.js +7 -6
- package/dist/components/VisuallyHidden/index.js +1 -2
- package/dist/components/VisuallyHidden/styles.css.js +12 -3
- package/dist/components/index.js +47 -48
- package/dist/index.js +1 -1
- package/dist/styles/layers.css.js +3 -4
- package/dist/styles/sprinkles.css.d.ts +115 -115
- package/dist/styles/sprinkles.css.js +72 -2219
- package/dist/styles/theme.css.js +48 -38
- package/dist/styles/utils.js +7 -8
- package/package.json +12 -16
- 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/index.ts +1 -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/index.ts +1 -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/AspectRatio/index.ts +2 -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/index.ts +1 -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/index.ts +2 -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/index.ts +2 -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/index.ts +1 -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/index.ts +1 -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/index.ts +1 -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/index.ts +1 -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/index.ts +2 -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/index.ts +2 -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/Container/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/Grid/index.ts +2 -0
- package/src/components/Icon/Icon.tsx +43 -0
- package/src/components/Icon/index.ts +1 -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/index.ts +1 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +1 -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/index.ts +1 -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/index.ts +2 -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/index.ts +1 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/Stack/index.ts +2 -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/index.ts +2 -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/index.ts +1 -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/index.ts +1 -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/index.ts +1 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -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/index.ts +2 -0
- package/src/components/VisuallyHidden/styles.css.ts +14 -0
- package/src/components/index.ts +68 -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/layers.css.js +0 -4
- package/dist/reset.css.js +0 -1
- package/dist/styles/reset.css.js +0 -1
- package/dist/theme.css.js +0 -41
|
@@ -1,171 +1,104 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import clsx from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import Box from
|
|
6
|
-
const defaultFilterFn = (option, inputValue)=>
|
|
7
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { comboboxContainer, comboboxInput, comboboxInputVariants, comboboxLabel, comboboxDropdown, comboboxOption, comboboxOptionSelected, comboboxOptionDisabled, comboboxClearButton, comboboxArrow, comboboxNoResults, comboboxHint, comboboxErrorMessage, } from './styles.css';
|
|
5
|
+
import Box from '../Box';
|
|
6
|
+
const defaultFilterFn = (option, inputValue) => {
|
|
7
|
+
return option.label.toLowerCase().includes(inputValue.toLowerCase());
|
|
8
|
+
};
|
|
9
|
+
const Combobox = ({ label, options, value, onChange, onInputChange, placeholder = 'Search...', hint, error = false, errorMessage, fullWidth = true, clearable = true, disabled = false, filterFn = defaultFilterFn, className, ...props }) => {
|
|
8
10
|
const [inputValue, setInputValue] = useState('');
|
|
9
11
|
const [isOpen, setIsOpen] = useState(false);
|
|
10
12
|
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
11
13
|
const containerRef = useRef(null);
|
|
12
14
|
const inputRef = useRef(null);
|
|
13
|
-
const selectedOption = options.find(
|
|
14
|
-
useEffect(()=>{
|
|
15
|
-
if (selectedOption)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const selectedOption = options.find(opt => opt.value === value);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (selectedOption) {
|
|
18
|
+
setInputValue(selectedOption.label);
|
|
19
|
+
}
|
|
20
|
+
else if (!isOpen) {
|
|
21
|
+
setInputValue('');
|
|
22
|
+
}
|
|
23
|
+
}, [selectedOption, isOpen]);
|
|
24
|
+
const filteredOptions = options.filter(option => filterFn(option, inputValue));
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const handleClickOutside = (event) => {
|
|
24
27
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
25
28
|
setIsOpen(false);
|
|
26
|
-
|
|
29
|
+
if (selectedOption) {
|
|
30
|
+
setInputValue(selectedOption.label);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
setInputValue('');
|
|
34
|
+
}
|
|
27
35
|
}
|
|
28
36
|
};
|
|
29
37
|
document.addEventListener('mousedown', handleClickOutside);
|
|
30
|
-
return ()=>document.removeEventListener('mousedown', handleClickOutside);
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
]);
|
|
34
|
-
const handleInputChange = (e)=>{
|
|
38
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
39
|
+
}, [selectedOption]);
|
|
40
|
+
const handleInputChange = (e) => {
|
|
35
41
|
const newValue = e.target.value;
|
|
36
42
|
setInputValue(newValue);
|
|
37
43
|
setIsOpen(true);
|
|
38
44
|
setHighlightedIndex(-1);
|
|
39
45
|
onInputChange?.(newValue);
|
|
40
|
-
if (!newValue)
|
|
46
|
+
if (!newValue) {
|
|
47
|
+
onChange?.('', null);
|
|
48
|
+
}
|
|
41
49
|
};
|
|
42
|
-
const handleOptionClick = (option)=>{
|
|
43
|
-
if (option.disabled)
|
|
50
|
+
const handleOptionClick = (option) => {
|
|
51
|
+
if (option.disabled)
|
|
52
|
+
return;
|
|
44
53
|
setInputValue(option.label);
|
|
45
54
|
setIsOpen(false);
|
|
46
55
|
onChange?.(option.value, option);
|
|
47
56
|
};
|
|
48
|
-
const handleClear = (e)=>{
|
|
57
|
+
const handleClear = (e) => {
|
|
49
58
|
e.stopPropagation();
|
|
50
59
|
setInputValue('');
|
|
51
60
|
setIsOpen(false);
|
|
52
61
|
onChange?.('', null);
|
|
53
62
|
inputRef.current?.focus();
|
|
54
63
|
};
|
|
55
|
-
const handleKeyDown = (e)=>{
|
|
56
|
-
if (disabled)
|
|
57
|
-
|
|
64
|
+
const handleKeyDown = (e) => {
|
|
65
|
+
if (disabled)
|
|
66
|
+
return;
|
|
67
|
+
switch (e.key) {
|
|
58
68
|
case 'ArrowDown':
|
|
59
69
|
e.preventDefault();
|
|
60
|
-
if (!isOpen)
|
|
61
|
-
|
|
70
|
+
if (!isOpen) {
|
|
71
|
+
setIsOpen(true);
|
|
72
|
+
}
|
|
73
|
+
setHighlightedIndex(prev => prev < filteredOptions.length - 1 ? prev + 1 : prev);
|
|
62
74
|
break;
|
|
63
75
|
case 'ArrowUp':
|
|
64
76
|
e.preventDefault();
|
|
65
|
-
setHighlightedIndex(
|
|
77
|
+
setHighlightedIndex(prev => (prev > 0 ? prev - 1 : prev));
|
|
66
78
|
break;
|
|
67
79
|
case 'Enter':
|
|
68
80
|
e.preventDefault();
|
|
69
|
-
if (isOpen && highlightedIndex >= 0 && filteredOptions[highlightedIndex])
|
|
70
|
-
|
|
81
|
+
if (isOpen && highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {
|
|
82
|
+
handleOptionClick(filteredOptions[highlightedIndex]);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
setIsOpen(!isOpen);
|
|
86
|
+
}
|
|
71
87
|
break;
|
|
72
88
|
case 'Escape':
|
|
73
89
|
setIsOpen(false);
|
|
74
|
-
|
|
90
|
+
if (selectedOption) {
|
|
91
|
+
setInputValue(selectedOption.label);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
setInputValue('');
|
|
95
|
+
}
|
|
75
96
|
break;
|
|
76
97
|
}
|
|
77
98
|
};
|
|
78
99
|
const displayValue = selectedOption && !isOpen ? selectedOption.label : inputValue;
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
width: fullWidth ? '100%' : void 0,
|
|
83
|
-
children: [
|
|
84
|
-
label && /*#__PURE__*/ jsx(Box, {
|
|
85
|
-
as: "label",
|
|
86
|
-
className: comboboxLabel,
|
|
87
|
-
children: label
|
|
88
|
-
}),
|
|
89
|
-
/*#__PURE__*/ jsxs(Box, {
|
|
90
|
-
position: "relative",
|
|
91
|
-
children: [
|
|
92
|
-
/*#__PURE__*/ jsx(Box, {
|
|
93
|
-
as: "input",
|
|
94
|
-
ref: inputRef,
|
|
95
|
-
type: "text",
|
|
96
|
-
value: displayValue,
|
|
97
|
-
onChange: handleInputChange,
|
|
98
|
-
onKeyDown: handleKeyDown,
|
|
99
|
-
onFocus: ()=>setIsOpen(true),
|
|
100
|
-
placeholder: placeholder,
|
|
101
|
-
disabled: disabled,
|
|
102
|
-
className: clsx(comboboxInput, comboboxInputVariants[error ? 'error' : 'default'], className),
|
|
103
|
-
role: "combobox",
|
|
104
|
-
"aria-expanded": isOpen,
|
|
105
|
-
"aria-autocomplete": "list",
|
|
106
|
-
"aria-controls": isOpen ? 'combobox-listbox' : void 0,
|
|
107
|
-
"aria-activedescendant": highlightedIndex >= 0 ? `option-${filteredOptions[highlightedIndex]?.value}` : void 0,
|
|
108
|
-
...props
|
|
109
|
-
}),
|
|
110
|
-
clearable && inputValue && !disabled && /*#__PURE__*/ jsx(Box, {
|
|
111
|
-
as: "button",
|
|
112
|
-
className: comboboxClearButton,
|
|
113
|
-
onClick: handleClear,
|
|
114
|
-
type: "button",
|
|
115
|
-
"aria-label": "Clear selection",
|
|
116
|
-
children: "\xd7"
|
|
117
|
-
}),
|
|
118
|
-
/*#__PURE__*/ jsx(Box, {
|
|
119
|
-
className: comboboxArrow,
|
|
120
|
-
"aria-hidden": "true",
|
|
121
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
122
|
-
width: "12",
|
|
123
|
-
height: "12",
|
|
124
|
-
viewBox: "0 0 12 12",
|
|
125
|
-
fill: "currentColor",
|
|
126
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
127
|
-
d: "M6 8L1 3h10z"
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
}),
|
|
133
|
-
isOpen && /*#__PURE__*/ jsx(Box, {
|
|
134
|
-
as: "ul",
|
|
135
|
-
id: "combobox-listbox",
|
|
136
|
-
className: comboboxDropdown,
|
|
137
|
-
role: "listbox",
|
|
138
|
-
children: 0 === filteredOptions.length ? /*#__PURE__*/ jsx(Box, {
|
|
139
|
-
as: "li",
|
|
140
|
-
className: comboboxNoResults,
|
|
141
|
-
children: "No results found"
|
|
142
|
-
}) : filteredOptions.map((option, index)=>/*#__PURE__*/ jsx(Box, {
|
|
143
|
-
as: "li",
|
|
144
|
-
id: `option-${option.value}`,
|
|
145
|
-
className: clsx(comboboxOption, option.value === value && comboboxOptionSelected, option.disabled && comboboxOptionDisabled),
|
|
146
|
-
onClick: ()=>handleOptionClick(option),
|
|
147
|
-
role: "option",
|
|
148
|
-
"aria-selected": option.value === value,
|
|
149
|
-
"aria-disabled": option.disabled,
|
|
150
|
-
style: {
|
|
151
|
-
backgroundColor: index === highlightedIndex ? 'var(--highlight-color, #f3f4f6)' : void 0
|
|
152
|
-
},
|
|
153
|
-
children: option.label
|
|
154
|
-
}, option.value))
|
|
155
|
-
}),
|
|
156
|
-
error && errorMessage && /*#__PURE__*/ jsx(Box, {
|
|
157
|
-
as: "div",
|
|
158
|
-
className: comboboxErrorMessage,
|
|
159
|
-
role: "alert",
|
|
160
|
-
children: errorMessage
|
|
161
|
-
}),
|
|
162
|
-
hint && !error && /*#__PURE__*/ jsx(Box, {
|
|
163
|
-
as: "div",
|
|
164
|
-
className: comboboxHint,
|
|
165
|
-
children: hint
|
|
166
|
-
})
|
|
167
|
-
]
|
|
168
|
-
});
|
|
100
|
+
return (_jsxs(Box, { className: comboboxContainer, ref: containerRef, width: fullWidth ? '100%' : undefined, children: [label && (_jsx(Box, { as: "label", className: comboboxLabel, children: label })), _jsxs(Box, { position: "relative", children: [_jsx(Box, { as: "input", ref: inputRef, type: "text", value: displayValue, onChange: handleInputChange, onKeyDown: handleKeyDown, onFocus: () => setIsOpen(true), placeholder: placeholder, disabled: disabled, className: clsx(comboboxInput, comboboxInputVariants[error ? 'error' : 'default'], className), role: "combobox", "aria-expanded": isOpen, "aria-autocomplete": "list", "aria-controls": isOpen ? 'combobox-listbox' : undefined, "aria-activedescendant": highlightedIndex >= 0 ? `option-${filteredOptions[highlightedIndex]?.value}` : undefined, ...props }), clearable && inputValue && !disabled && (_jsx(Box, { as: "button", className: comboboxClearButton, onClick: handleClear, type: "button", "aria-label": "Clear selection", children: "\u00D7" })), _jsx(Box, { className: comboboxArrow, "aria-hidden": "true", children: _jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "currentColor", children: _jsx("path", { d: "M6 8L1 3h10z" }) }) })] }), isOpen && (_jsx(Box, { as: "ul", id: "combobox-listbox", className: comboboxDropdown, role: "listbox", children: filteredOptions.length === 0 ? (_jsx(Box, { as: "li", className: comboboxNoResults, children: "No results found" })) : (filteredOptions.map((option, index) => (_jsx(Box, { as: "li", id: `option-${option.value}`, className: clsx(comboboxOption, option.value === value && comboboxOptionSelected, option.disabled && comboboxOptionDisabled), onClick: () => handleOptionClick(option), role: "option", "aria-selected": option.value === value, "aria-disabled": option.disabled, style: {
|
|
101
|
+
backgroundColor: index === highlightedIndex ? 'var(--highlight-color, #f3f4f6)' : undefined,
|
|
102
|
+
}, children: option.label }, option.value)))) })), error && errorMessage && (_jsx(Box, { as: "div", className: comboboxErrorMessage, role: "alert", children: errorMessage })), hint && !error && (_jsx(Box, { as: "div", className: comboboxHint, children: hint }))] }));
|
|
169
103
|
};
|
|
170
|
-
|
|
171
|
-
export { Combobox_Combobox as default };
|
|
104
|
+
export default Combobox;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Combobox };
|
|
1
|
+
export { default as Combobox } from './Combobox';
|
|
@@ -1,20 +1,142 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { vars } from '../../styles/theme.css';
|
|
3
|
+
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
+
export const comboboxContainer = styleWithLayer({
|
|
5
|
+
position: 'relative',
|
|
6
|
+
width: '100%',
|
|
7
|
+
});
|
|
8
|
+
export const comboboxInput = styleWithLayer({
|
|
9
|
+
width: '100%',
|
|
10
|
+
padding: '0.75rem 2.5rem 0.75rem 1rem',
|
|
11
|
+
fontSize: '14px',
|
|
12
|
+
fontFamily: vars.fontFamily.body,
|
|
13
|
+
color: vars.colors.textPrimary,
|
|
14
|
+
backgroundColor: vars.colors.inputBackground,
|
|
15
|
+
border: `1px solid ${vars.colors.inputBorder}`,
|
|
16
|
+
borderRadius: '8px',
|
|
17
|
+
outline: 'none',
|
|
18
|
+
transition: 'border-color 0.2s ease',
|
|
19
|
+
'::placeholder': {
|
|
20
|
+
color: vars.colors.inputPlaceholder,
|
|
21
|
+
},
|
|
22
|
+
':focus-visible': {
|
|
23
|
+
outline: `2px solid ${vars.colors.inputBorderFocused}`,
|
|
24
|
+
outlineOffset: '2px',
|
|
25
|
+
},
|
|
26
|
+
':hover': {
|
|
27
|
+
borderColor: vars.colors.inputBorderFocused,
|
|
28
|
+
},
|
|
29
|
+
selectors: {
|
|
30
|
+
'&:disabled': {
|
|
31
|
+
cursor: 'not-allowed',
|
|
32
|
+
opacity: 0.5,
|
|
33
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
34
|
+
},
|
|
35
|
+
'&:disabled:hover': {
|
|
36
|
+
borderColor: vars.colors.inputBorder,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
export const comboboxInputVariants = styleVariants({
|
|
41
|
+
default: {},
|
|
42
|
+
error: {
|
|
43
|
+
border: `1px solid ${vars.colors.alertErrorBorder}`,
|
|
44
|
+
':focus-visible': {
|
|
45
|
+
outline: `2px solid ${vars.colors.alertErrorBorder}`,
|
|
46
|
+
},
|
|
47
|
+
':hover': {
|
|
48
|
+
borderColor: vars.colors.alertErrorBorder,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
export const comboboxLabel = styleWithLayer({
|
|
53
|
+
display: 'block',
|
|
54
|
+
fontSize: '14px',
|
|
55
|
+
fontWeight: '500',
|
|
56
|
+
color: vars.colors.textPrimary,
|
|
57
|
+
marginBottom: '8px',
|
|
58
|
+
});
|
|
59
|
+
export const comboboxDropdown = styleWithLayer({
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
top: '100%',
|
|
62
|
+
left: 0,
|
|
63
|
+
right: 0,
|
|
64
|
+
backgroundColor: vars.colors.backgroundDefault,
|
|
65
|
+
border: `1px solid ${vars.colors.borderDefault}`,
|
|
66
|
+
borderRadius: '8px',
|
|
67
|
+
boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
68
|
+
maxHeight: '200px',
|
|
69
|
+
overflowY: 'auto',
|
|
70
|
+
zIndex: 50,
|
|
71
|
+
marginTop: '4px',
|
|
72
|
+
});
|
|
73
|
+
export const comboboxOption = styleWithLayer({
|
|
74
|
+
padding: '0.75rem 1rem',
|
|
75
|
+
cursor: 'pointer',
|
|
76
|
+
fontSize: '14px',
|
|
77
|
+
color: vars.colors.textPrimary,
|
|
78
|
+
transition: 'background-color 0.15s ease',
|
|
79
|
+
':hover': {
|
|
80
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
81
|
+
},
|
|
82
|
+
':focus-visible': {
|
|
83
|
+
outline: 'none',
|
|
84
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
export const comboboxOptionSelected = styleWithLayer({
|
|
88
|
+
backgroundColor: vars.colors.buttonBackgroundPrimary,
|
|
89
|
+
color: vars.colors.buttonTextPrimary,
|
|
90
|
+
':hover': {
|
|
91
|
+
backgroundColor: vars.colors.buttonBackgroundFocusedPrimary,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
export const comboboxOptionDisabled = styleWithLayer({
|
|
95
|
+
opacity: 0.5,
|
|
96
|
+
cursor: 'not-allowed',
|
|
97
|
+
':hover': {
|
|
98
|
+
backgroundColor: 'transparent',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
export const comboboxClearButton = styleWithLayer({
|
|
102
|
+
position: 'absolute',
|
|
103
|
+
right: '2.5rem',
|
|
104
|
+
top: '50%',
|
|
105
|
+
transform: 'translateY(-50%)',
|
|
106
|
+
background: 'none',
|
|
107
|
+
border: 'none',
|
|
108
|
+
cursor: 'pointer',
|
|
109
|
+
padding: '0.25rem',
|
|
110
|
+
color: vars.colors.textSecondary,
|
|
111
|
+
fontSize: '16px',
|
|
112
|
+
display: 'flex',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'center',
|
|
115
|
+
':hover': {
|
|
116
|
+
color: vars.colors.textPrimary,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
export const comboboxArrow = styleWithLayer({
|
|
120
|
+
position: 'absolute',
|
|
121
|
+
right: '0.75rem',
|
|
122
|
+
top: '50%',
|
|
123
|
+
transform: 'translateY(-50%)',
|
|
124
|
+
pointerEvents: 'none',
|
|
125
|
+
color: vars.colors.textSecondary,
|
|
126
|
+
});
|
|
127
|
+
export const comboboxNoResults = styleWithLayer({
|
|
128
|
+
padding: '0.75rem 1rem',
|
|
129
|
+
fontSize: '14px',
|
|
130
|
+
color: vars.colors.textSecondary,
|
|
131
|
+
textAlign: 'center',
|
|
132
|
+
});
|
|
133
|
+
export const comboboxHint = styleWithLayer({
|
|
134
|
+
fontSize: '12px',
|
|
135
|
+
color: vars.colors.textSecondary,
|
|
136
|
+
marginTop: '4px',
|
|
137
|
+
});
|
|
138
|
+
export const comboboxErrorMessage = styleWithLayer({
|
|
139
|
+
fontSize: '12px',
|
|
140
|
+
color: vars.colors.alertErrorText,
|
|
141
|
+
marginTop: '4px',
|
|
142
|
+
});
|
|
@@ -1,31 +1,21 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import Box from
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import Box from '../Box';
|
|
4
4
|
const sizeMap = {
|
|
5
5
|
sm: '640px',
|
|
6
6
|
md: '768px',
|
|
7
7
|
lg: '1024px',
|
|
8
8
|
xl: '1280px',
|
|
9
|
-
full: '100%'
|
|
9
|
+
full: '100%',
|
|
10
10
|
};
|
|
11
|
-
const Container =
|
|
11
|
+
const Container = forwardRef(({ size = 'lg', centerContent = true, children, className, style }, ref) => {
|
|
12
12
|
const sizeValue = size;
|
|
13
13
|
const containerStyle = {
|
|
14
14
|
maxWidth: sizeMap[sizeValue],
|
|
15
|
-
marginLeft: centerContent ? 'auto' :
|
|
16
|
-
marginRight: centerContent ? 'auto' :
|
|
15
|
+
marginLeft: centerContent ? 'auto' : undefined,
|
|
16
|
+
marginRight: centerContent ? 'auto' : undefined,
|
|
17
17
|
};
|
|
18
|
-
return
|
|
19
|
-
ref: ref,
|
|
20
|
-
width: "100%",
|
|
21
|
-
className: className,
|
|
22
|
-
style: {
|
|
23
|
-
...containerStyle,
|
|
24
|
-
...style
|
|
25
|
-
},
|
|
26
|
-
children: children
|
|
27
|
-
});
|
|
18
|
+
return (_jsx(Box, { ref: ref, width: "100%", className: className, style: { ...containerStyle, ...style }, children: children }));
|
|
28
19
|
});
|
|
29
20
|
Container.displayName = 'Container';
|
|
30
|
-
|
|
31
|
-
export { Container_Container as default };
|
|
21
|
+
export default Container;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Container };
|
|
1
|
+
export { default as Container } from './Container';
|
|
@@ -5,5 +5,5 @@ export interface DividerProps extends React.HTMLAttributes<HTMLHRElement> {
|
|
|
5
5
|
orientation?: DividerOrientation;
|
|
6
6
|
size?: DividerSize;
|
|
7
7
|
}
|
|
8
|
-
declare const Divider: ({ orientation, size, ...props }: DividerProps) =>
|
|
8
|
+
declare const Divider: ({ orientation, size, ...props }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default Divider;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from
|
|
3
|
-
import { divider, dividerOrientations, dividerSizes, dividerVerticalSizes } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
role: "separator",
|
|
10
|
-
"aria-orientation": orientation,
|
|
11
|
-
...props
|
|
12
|
-
});
|
|
13
|
-
const Divider_Divider = Divider;
|
|
14
|
-
export { Divider_Divider as default };
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { divider, dividerOrientations, dividerSizes, dividerVerticalSizes, } from './styles.css';
|
|
4
|
+
import Box from '../Box';
|
|
5
|
+
const Divider = ({ orientation = 'horizontal', size = 'medium', ...props }) => {
|
|
6
|
+
return (_jsx(Box, { as: "hr", className: clsx(divider, dividerOrientations[orientation], orientation === 'vertical' ? dividerVerticalSizes[size] : dividerSizes[size], props.className), role: "separator", "aria-orientation": orientation, ...props }));
|
|
7
|
+
};
|
|
8
|
+
export default Divider;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Divider };
|
|
1
|
+
export { default as Divider } from './Divider';
|
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { vars } from '../../styles/theme.css';
|
|
3
|
+
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
+
export const dividerOrientations = styleVariants({
|
|
5
|
+
horizontal: {
|
|
6
|
+
width: '100%',
|
|
7
|
+
height: '1px',
|
|
8
|
+
borderTop: `1px solid ${vars.colors.borderMuted}`,
|
|
9
|
+
},
|
|
10
|
+
vertical: {
|
|
11
|
+
width: '1px',
|
|
12
|
+
height: '100%',
|
|
13
|
+
borderLeft: `1px solid ${vars.colors.borderMuted}`,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const dividerSizes = styleVariants({
|
|
17
|
+
small: {
|
|
18
|
+
margin: '0.5rem 0',
|
|
19
|
+
},
|
|
20
|
+
medium: {
|
|
21
|
+
margin: '1rem 0',
|
|
22
|
+
},
|
|
23
|
+
large: {
|
|
24
|
+
margin: '1.5rem 0',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const divider = styleWithLayer({
|
|
28
|
+
border: 'none',
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
});
|
|
31
|
+
export const dividerVerticalSizes = styleVariants({
|
|
32
|
+
small: {
|
|
33
|
+
margin: '0 0.5rem',
|
|
34
|
+
},
|
|
35
|
+
medium: {
|
|
36
|
+
margin: '0 1rem',
|
|
37
|
+
},
|
|
38
|
+
large: {
|
|
39
|
+
margin: '0 1.5rem',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -12,5 +12,5 @@ export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
showCloseButton?: boolean;
|
|
13
13
|
closeOnOverlayClick?: boolean;
|
|
14
14
|
}
|
|
15
|
-
declare const Drawer: ({ isOpen, onClose, title, position, size, children, footer, showCloseButton, closeOnOverlayClick, className, ...props }: DrawerProps) =>
|
|
15
|
+
declare const Drawer: ({ isOpen, onClose, title, position, size, children, footer, showCloseButton, closeOnOverlayClick, className, ...props }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export default Drawer;
|