@techsio/ui-kit 0.3.2 → 0.4.0
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/README.md +59 -6
- package/dist/.storybook/decorator.d.ts +12 -0
- package/dist/.storybook/decorator.d.ts.map +1 -0
- package/dist/.storybook/main.d.ts +4 -0
- package/dist/.storybook/main.d.ts.map +1 -0
- package/dist/.storybook/preview.d.ts +5 -0
- package/dist/.storybook/preview.d.ts.map +1 -0
- package/dist/.storybook/test-runner.d.ts +12 -0
- package/dist/.storybook/test-runner.d.ts.map +1 -0
- package/dist/atoms/badge.js +37 -19
- package/dist/atoms/button.js +167 -154
- package/dist/atoms/checkbox.js +52 -0
- package/dist/atoms/figma/badge.figma.js +33 -0
- package/dist/atoms/figma/button.figma.js +76 -0
- package/dist/atoms/figma/checkbox.figma.js +35 -0
- package/dist/atoms/figma/icon.figma.js +33 -0
- package/dist/atoms/figma/image.figma.js +21 -0
- package/dist/atoms/figma/input.figma.js +34 -0
- package/dist/atoms/figma/label.figma.js +25 -0
- package/dist/atoms/figma/link-button.figma.js +42 -0
- package/dist/atoms/figma/link.figma.js +15 -0
- package/dist/atoms/figma/numeric-input.figma.js +52 -0
- package/dist/atoms/figma/rating.figma.js +38 -0
- package/dist/atoms/figma/skeleton.figma.js +119 -0
- package/dist/atoms/figma/status-text.figma.js +27 -0
- package/dist/atoms/figma/textarea.figma.js +38 -0
- package/dist/atoms/figma/tooltip.figma.js +47 -0
- package/dist/atoms/icon.js +17 -17
- package/dist/atoms/image.js +22 -4
- package/dist/atoms/input.js +40 -34
- package/dist/atoms/label.js +10 -10
- package/dist/atoms/link-button.js +19 -18
- package/dist/atoms/link.js +6 -4
- package/dist/atoms/numeric-input.js +98 -70
- package/dist/atoms/rating.js +30 -30
- package/dist/atoms/skeleton.js +47 -47
- package/dist/atoms/status-text.js +75 -0
- package/dist/atoms/textarea.js +48 -42
- package/dist/atoms/tooltip.js +17 -17
- package/dist/molecules/accordion.js +58 -60
- package/dist/molecules/breadcrumb.js +206 -124
- package/dist/molecules/carousel.js +139 -87
- package/dist/molecules/color-select.js +56 -56
- package/dist/molecules/combobox.js +131 -104
- package/dist/molecules/dialog.js +97 -97
- package/dist/molecules/figma/accordion.figma.js +41 -0
- package/dist/molecules/figma/breadcrumb.figma.js +31 -0
- package/dist/molecules/figma/carousel.figma.js +34 -0
- package/dist/molecules/figma/combobox.figma.js +38 -0
- package/dist/molecules/figma/dialog.figma.js +24 -0
- package/dist/molecules/figma/form-checkbox.figma.js +41 -0
- package/dist/molecules/figma/form-input.figma.js +38 -0
- package/dist/molecules/figma/form-numeric-input.figma.js +67 -0
- package/dist/molecules/figma/form-textarea.figma.js +38 -0
- package/dist/molecules/figma/menu.figma.js +26 -0
- package/dist/molecules/figma/pagination.figma.js +22 -0
- package/dist/molecules/figma/popover.figma.js +38 -0
- package/dist/molecules/figma/product-card.figma.js +34 -0
- package/dist/molecules/figma/radio-card.figma.js +35 -0
- package/dist/molecules/figma/radio-group.figma.js +45 -0
- package/dist/molecules/figma/search-form.figma.js +24 -0
- package/dist/molecules/figma/select.figma.js +46 -0
- package/dist/molecules/figma/slider.figma.js +30 -0
- package/dist/molecules/figma/steps.figma.js +33 -0
- package/dist/molecules/figma/switch.figma.js +33 -0
- package/dist/molecules/figma/tabs.figma.js +46 -0
- package/dist/molecules/figma/toast.figma.js +34 -0
- package/dist/molecules/figma/tree-view.figma.js +30 -0
- package/dist/molecules/form-checkbox.js +121 -48
- package/dist/molecules/form-input.js +15 -27
- package/dist/molecules/form-numeric-input.js +11 -24
- package/dist/molecules/form-textarea.js +15 -27
- package/dist/molecules/menu.js +69 -67
- package/dist/molecules/pagination.js +112 -76
- package/dist/molecules/phone-input.js +654 -0
- package/dist/molecules/popover.js +221 -96
- package/dist/molecules/product-card.js +38 -37
- package/dist/molecules/radio-card.js +517 -0
- package/dist/molecules/radio-group.js +341 -0
- package/dist/molecules/search-form.js +170 -91
- package/dist/molecules/select.js +369 -141
- package/dist/molecules/slider.js +72 -85
- package/dist/molecules/steps.js +517 -152
- package/dist/molecules/switch.js +37 -43
- package/dist/molecules/tabs.js +63 -61
- package/dist/molecules/toast.js +32 -32
- package/dist/molecules/tree-view.js +89 -83
- package/dist/organisms/footer.js +50 -52
- package/dist/organisms/gallery.js +244 -0
- package/dist/organisms/header.js +60 -58
- package/dist/organisms/table.js +52 -52
- package/dist/src/atoms/badge.d.ts +27 -7
- package/dist/src/atoms/badge.d.ts.map +1 -1
- package/dist/src/atoms/button.d.ts +7 -6
- package/dist/src/atoms/button.d.ts.map +1 -1
- package/dist/src/atoms/checkbox.d.ts +11 -0
- package/dist/src/atoms/checkbox.d.ts.map +1 -0
- package/dist/src/atoms/figma/badge.figma.d.ts +2 -0
- package/dist/src/atoms/figma/badge.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/button.figma.d.ts +2 -0
- package/dist/src/atoms/figma/button.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/checkbox.figma.d.ts +2 -0
- package/dist/src/atoms/figma/checkbox.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/icon.figma.d.ts +2 -0
- package/dist/src/atoms/figma/icon.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/image.figma.d.ts +2 -0
- package/dist/src/atoms/figma/image.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/input.figma.d.ts +2 -0
- package/dist/src/atoms/figma/input.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/label.figma.d.ts +2 -0
- package/dist/src/atoms/figma/label.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/link-button.figma.d.ts +2 -0
- package/dist/src/atoms/figma/link-button.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/link.figma.d.ts +2 -0
- package/dist/src/atoms/figma/link.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/numeric-input.figma.d.ts +2 -0
- package/dist/src/atoms/figma/numeric-input.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/rating.figma.d.ts +2 -0
- package/dist/src/atoms/figma/rating.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/skeleton.figma.d.ts +2 -0
- package/dist/src/atoms/figma/skeleton.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/status-text.figma.d.ts +2 -0
- package/dist/src/atoms/figma/status-text.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/textarea.figma.d.ts +2 -0
- package/dist/src/atoms/figma/textarea.figma.d.ts.map +1 -0
- package/dist/src/atoms/figma/tooltip.figma.d.ts +2 -0
- package/dist/src/atoms/figma/tooltip.figma.d.ts.map +1 -0
- package/dist/src/atoms/icon.d.ts +6 -6
- package/dist/src/atoms/image.d.ts +35 -9
- package/dist/src/atoms/image.d.ts.map +1 -1
- package/dist/src/atoms/input.d.ts +3 -3
- package/dist/src/atoms/input.d.ts.map +1 -1
- package/dist/src/atoms/label.d.ts +2 -2
- package/dist/src/atoms/link-button.d.ts +71 -12
- package/dist/src/atoms/link-button.d.ts.map +1 -1
- package/dist/src/atoms/link.d.ts +5 -5
- package/dist/src/atoms/link.d.ts.map +1 -1
- package/dist/src/atoms/numeric-input.d.ts +23 -22
- package/dist/src/atoms/numeric-input.d.ts.map +1 -1
- package/dist/src/atoms/rating.d.ts +6 -5
- package/dist/src/atoms/rating.d.ts.map +1 -1
- package/dist/src/atoms/skeleton.d.ts +15 -15
- package/dist/src/atoms/skeleton.d.ts.map +1 -1
- package/dist/src/atoms/status-text.d.ts +97 -0
- package/dist/src/atoms/status-text.d.ts.map +1 -0
- package/dist/src/atoms/textarea.d.ts +3 -3
- package/dist/src/atoms/textarea.d.ts.map +1 -1
- package/dist/src/atoms/tooltip.d.ts +3 -3
- package/dist/src/atoms/tooltip.d.ts.map +1 -1
- package/dist/src/molecules/accordion.d.ts +14 -13
- package/dist/src/molecules/accordion.d.ts.map +1 -1
- package/dist/src/molecules/breadcrumb.d.ts +132 -35
- package/dist/src/molecules/breadcrumb.d.ts.map +1 -1
- package/dist/src/molecules/carousel.d.ts +67 -16
- package/dist/src/molecules/carousel.d.ts.map +1 -1
- package/dist/src/molecules/color-select.d.ts +4 -4
- package/dist/src/molecules/combobox.d.ts +36 -9
- package/dist/src/molecules/combobox.d.ts.map +1 -1
- package/dist/src/molecules/dialog.d.ts +3 -3
- package/dist/src/molecules/dialog.d.ts.map +1 -1
- package/dist/src/molecules/figma/accordion.figma.d.ts +2 -0
- package/dist/src/molecules/figma/accordion.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/breadcrumb.figma.d.ts +2 -0
- package/dist/src/molecules/figma/breadcrumb.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/carousel.figma.d.ts +2 -0
- package/dist/src/molecules/figma/carousel.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/combobox.figma.d.ts +2 -0
- package/dist/src/molecules/figma/combobox.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/dialog.figma.d.ts +2 -0
- package/dist/src/molecules/figma/dialog.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/form-checkbox.figma.d.ts +2 -0
- package/dist/src/molecules/figma/form-checkbox.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/form-input.figma.d.ts +2 -0
- package/dist/src/molecules/figma/form-input.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/form-numeric-input.figma.d.ts +2 -0
- package/dist/src/molecules/figma/form-numeric-input.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/form-textarea.figma.d.ts +2 -0
- package/dist/src/molecules/figma/form-textarea.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/menu.figma.d.ts +2 -0
- package/dist/src/molecules/figma/menu.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/pagination.figma.d.ts +2 -0
- package/dist/src/molecules/figma/pagination.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/popover.figma.d.ts +2 -0
- package/dist/src/molecules/figma/popover.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/product-card.figma.d.ts +2 -0
- package/dist/src/molecules/figma/product-card.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/radio-card.figma.d.ts +2 -0
- package/dist/src/molecules/figma/radio-card.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/radio-group.figma.d.ts +2 -0
- package/dist/src/molecules/figma/radio-group.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/search-form.figma.d.ts +2 -0
- package/dist/src/molecules/figma/search-form.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/select.figma.d.ts +2 -0
- package/dist/src/molecules/figma/select.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/slider.figma.d.ts +2 -0
- package/dist/src/molecules/figma/slider.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/steps.figma.d.ts +2 -0
- package/dist/src/molecules/figma/steps.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/switch.figma.d.ts +2 -0
- package/dist/src/molecules/figma/switch.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/tabs.figma.d.ts +2 -0
- package/dist/src/molecules/figma/tabs.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/toast.figma.d.ts +2 -0
- package/dist/src/molecules/figma/toast.figma.d.ts.map +1 -0
- package/dist/src/molecules/figma/tree-view.figma.d.ts +2 -0
- package/dist/src/molecules/figma/tree-view.figma.d.ts.map +1 -0
- package/dist/src/molecules/form-checkbox.d.ts +22 -12
- package/dist/src/molecules/form-checkbox.d.ts.map +1 -1
- package/dist/src/molecules/form-input.d.ts +8 -6
- package/dist/src/molecules/form-input.d.ts.map +1 -1
- package/dist/src/molecules/form-numeric-input.d.ts +6 -6
- package/dist/src/molecules/form-numeric-input.d.ts.map +1 -1
- package/dist/src/molecules/form-textarea.d.ts +8 -6
- package/dist/src/molecules/form-textarea.d.ts.map +1 -1
- package/dist/src/molecules/menu.d.ts +11 -11
- package/dist/src/molecules/menu.d.ts.map +1 -1
- package/dist/src/molecules/pagination.d.ts +37 -9
- package/dist/src/molecules/pagination.d.ts.map +1 -1
- package/dist/src/molecules/phone-input.d.ts +246 -0
- package/dist/src/molecules/phone-input.d.ts.map +1 -0
- package/dist/src/molecules/popover.d.ts +76 -24
- package/dist/src/molecules/popover.d.ts.map +1 -1
- package/dist/src/molecules/product-card.d.ts +11 -10
- package/dist/src/molecules/product-card.d.ts.map +1 -1
- package/dist/src/molecules/radio-card.d.ts +429 -0
- package/dist/src/molecules/radio-card.d.ts.map +1 -0
- package/dist/src/molecules/radio-group.d.ts +245 -0
- package/dist/src/molecules/radio-group.d.ts.map +1 -0
- package/dist/src/molecules/search-form.d.ts +94 -27
- package/dist/src/molecules/search-form.d.ts.map +1 -1
- package/dist/src/molecules/select.d.ts +124 -30
- package/dist/src/molecules/select.d.ts.map +1 -1
- package/dist/src/molecules/slider.d.ts +9 -12
- package/dist/src/molecules/slider.d.ts.map +1 -1
- package/dist/src/molecules/steps.d.ts +236 -64
- package/dist/src/molecules/steps.d.ts.map +1 -1
- package/dist/src/molecules/switch.d.ts +7 -7
- package/dist/src/molecules/switch.d.ts.map +1 -1
- package/dist/src/molecules/tabs.d.ts +10 -10
- package/dist/src/molecules/tabs.d.ts.map +1 -1
- package/dist/src/molecules/toast.d.ts +6 -6
- package/dist/src/molecules/tree-view.d.ts +14 -14
- package/dist/src/molecules/tree-view.d.ts.map +1 -1
- package/dist/src/organisms/footer.d.ts +15 -6
- package/dist/src/organisms/footer.d.ts.map +1 -1
- package/dist/src/organisms/gallery.d.ts +147 -0
- package/dist/src/organisms/gallery.d.ts.map +1 -0
- package/dist/src/organisms/header.d.ts +9 -9
- package/dist/src/organisms/header.d.ts.map +1 -1
- package/dist/src/organisms/table.d.ts +10 -10
- package/dist/src/organisms/table.d.ts.map +1 -1
- package/dist/src/templates/accordion.d.ts +3 -3
- package/dist/src/templates/breadcrumb.d.ts +28 -0
- package/dist/src/templates/breadcrumb.d.ts.map +1 -0
- package/dist/src/templates/carousel.d.ts +4 -4
- package/dist/src/templates/carousel.d.ts.map +1 -1
- package/dist/src/templates/gallery.d.ts +43 -0
- package/dist/src/templates/gallery.d.ts.map +1 -0
- package/dist/src/templates/numeric-input.d.ts +5 -5
- package/dist/src/templates/popover.d.ts +19 -0
- package/dist/src/templates/popover.d.ts.map +1 -0
- package/dist/src/templates/product-card.d.ts +4 -4
- package/dist/src/templates/select.d.ts +22 -0
- package/dist/src/templates/select.d.ts.map +1 -0
- package/dist/src/templates/tabs.d.ts +4 -4
- package/dist/src/types/zag.d.ts +19 -18
- package/dist/src/types/zag.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/stories/atoms/badge.stories.d.ts +12 -0
- package/dist/stories/atoms/badge.stories.d.ts.map +1 -0
- package/dist/stories/atoms/button.stories.d.ts +12 -0
- package/dist/stories/atoms/button.stories.d.ts.map +1 -0
- package/dist/stories/atoms/checkbox.stories.d.ts +56 -0
- package/dist/stories/atoms/checkbox.stories.d.ts.map +1 -0
- package/dist/stories/atoms/icon.stories.d.ts +11 -0
- package/dist/stories/atoms/icon.stories.d.ts.map +1 -0
- package/dist/stories/atoms/image.stories.d.ts +8 -0
- package/dist/stories/atoms/image.stories.d.ts.map +1 -0
- package/dist/stories/atoms/input.stories.d.ts +8 -0
- package/dist/stories/atoms/input.stories.d.ts.map +1 -0
- package/dist/stories/atoms/numeric-input.stories.d.ts +23 -0
- package/dist/stories/atoms/numeric-input.stories.d.ts.map +1 -0
- package/dist/stories/atoms/rating.stories.d.ts +10 -0
- package/dist/stories/atoms/rating.stories.d.ts.map +1 -0
- package/dist/stories/atoms/skeleton.stories.d.ts +34 -0
- package/dist/stories/atoms/skeleton.stories.d.ts.map +1 -0
- package/dist/stories/atoms/status-text.stories.d.ts +15 -0
- package/dist/stories/atoms/status-text.stories.d.ts.map +1 -0
- package/dist/stories/atoms/textarea.stories.d.ts +12 -0
- package/dist/stories/atoms/textarea.stories.d.ts.map +1 -0
- package/dist/stories/atoms/tooltip.stories.d.ts +28 -0
- package/dist/stories/atoms/tooltip.stories.d.ts.map +1 -0
- package/dist/stories/helpers/icon-options.d.ts +4 -0
- package/dist/stories/helpers/icon-options.d.ts.map +1 -0
- package/dist/stories/molecules/accordion.stories.d.ts +14 -0
- package/dist/stories/molecules/accordion.stories.d.ts.map +1 -0
- package/dist/stories/molecules/breadcrumb.stories.d.ts +14 -0
- package/dist/stories/molecules/breadcrumb.stories.d.ts.map +1 -0
- package/dist/stories/molecules/carousel.stories.d.ts +19 -0
- package/dist/stories/molecules/carousel.stories.d.ts.map +1 -0
- package/dist/stories/molecules/color-select.stories.d.ts +12 -0
- package/dist/stories/molecules/color-select.stories.d.ts.map +1 -0
- package/dist/stories/molecules/combobox.stories.d.ts +11 -0
- package/dist/stories/molecules/combobox.stories.d.ts.map +1 -0
- package/dist/stories/molecules/dialog.stories.d.ts +19 -0
- package/dist/stories/molecules/dialog.stories.d.ts.map +1 -0
- package/dist/stories/molecules/form-checkbox.stories.d.ts +17 -0
- package/dist/stories/molecules/form-checkbox.stories.d.ts.map +1 -0
- package/dist/stories/molecules/form-input.stories.d.ts +12 -0
- package/dist/stories/molecules/form-input.stories.d.ts.map +1 -0
- package/dist/stories/molecules/form-numeric-input.stories.d.ts +17 -0
- package/dist/stories/molecules/form-numeric-input.stories.d.ts.map +1 -0
- package/dist/stories/molecules/form-textarea.stories.d.ts +12 -0
- package/dist/stories/molecules/form-textarea.stories.d.ts.map +1 -0
- package/dist/stories/molecules/menu.stories.d.ts +22 -0
- package/dist/stories/molecules/menu.stories.d.ts.map +1 -0
- package/dist/stories/molecules/pagination.stories.d.ts +13 -0
- package/dist/stories/molecules/pagination.stories.d.ts.map +1 -0
- package/dist/stories/molecules/phone-input.stories.d.ts +19 -0
- package/dist/stories/molecules/phone-input.stories.d.ts.map +1 -0
- package/dist/stories/molecules/popover.stories.d.ts +140 -0
- package/dist/stories/molecules/popover.stories.d.ts.map +1 -0
- package/dist/stories/molecules/product-card.stories.d.ts +41 -0
- package/dist/stories/molecules/product-card.stories.d.ts.map +1 -0
- package/dist/stories/molecules/radio-card.stories.d.ts +13 -0
- package/dist/stories/molecules/radio-card.stories.d.ts.map +1 -0
- package/dist/stories/molecules/radio-group.stories.d.ts +13 -0
- package/dist/stories/molecules/radio-group.stories.d.ts.map +1 -0
- package/dist/stories/molecules/search-form.stories.d.ts +16 -0
- package/dist/stories/molecules/search-form.stories.d.ts.map +1 -0
- package/dist/stories/molecules/select.stories.d.ts +19 -0
- package/dist/stories/molecules/select.stories.d.ts.map +1 -0
- package/dist/stories/molecules/slider.stories.d.ts +19 -0
- package/dist/stories/molecules/slider.stories.d.ts.map +1 -0
- package/dist/stories/molecules/steps.stories.d.ts +19 -0
- package/dist/stories/molecules/steps.stories.d.ts.map +1 -0
- package/dist/stories/molecules/switch.stories.d.ts +13 -0
- package/dist/stories/molecules/switch.stories.d.ts.map +1 -0
- package/dist/stories/molecules/tabs.stories.d.ts +18 -0
- package/dist/stories/molecules/tabs.stories.d.ts.map +1 -0
- package/dist/stories/molecules/toast.stories.d.ts +11 -0
- package/dist/stories/molecules/toast.stories.d.ts.map +1 -0
- package/dist/stories/molecules/tree-view.stories.d.ts +17 -0
- package/dist/stories/molecules/tree-view.stories.d.ts.map +1 -0
- package/dist/stories/organisms/footer.stories.d.ts +12 -0
- package/dist/stories/organisms/footer.stories.d.ts.map +1 -0
- package/dist/stories/organisms/gallery.stories.d.ts +73 -0
- package/dist/stories/organisms/gallery.stories.d.ts.map +1 -0
- package/dist/stories/organisms/header.stories.d.ts +12 -0
- package/dist/stories/organisms/header.stories.d.ts.map +1 -0
- package/dist/stories/organisms/table.stories.d.ts +56 -0
- package/dist/stories/organisms/table.stories.d.ts.map +1 -0
- package/dist/stories/overview/apca-contrast-test.stories.d.ts +8 -0
- package/dist/stories/overview/apca-contrast-test.stories.d.ts.map +1 -0
- package/dist/stories/overview/color-palette.stories.d.ts +8 -0
- package/dist/stories/overview/color-palette.stories.d.ts.map +1 -0
- package/dist/stories/overview/component-comparison.stories.d.ts +6 -0
- package/dist/stories/overview/component-comparison.stories.d.ts.map +1 -0
- package/dist/stories/templates/accordion.stories.d.ts +8 -0
- package/dist/stories/templates/accordion.stories.d.ts.map +1 -0
- package/dist/stories/templates/breadcrumb.stories.d.ts +12 -0
- package/dist/stories/templates/breadcrumb.stories.d.ts.map +1 -0
- package/dist/stories/templates/carousel.stories.d.ts +8 -0
- package/dist/stories/templates/carousel.stories.d.ts.map +1 -0
- package/dist/stories/templates/comprehensive-form.stories.d.ts +26 -0
- package/dist/stories/templates/comprehensive-form.stories.d.ts.map +1 -0
- package/dist/stories/templates/gallery.stories.d.ts +7 -0
- package/dist/stories/templates/gallery.stories.d.ts.map +1 -0
- package/dist/stories/templates/numeric-input.stories.d.ts +8 -0
- package/dist/stories/templates/numeric-input.stories.d.ts.map +1 -0
- package/dist/stories/templates/popover.stories.d.ts +55 -0
- package/dist/stories/templates/popover.stories.d.ts.map +1 -0
- package/dist/stories/templates/product-card.stories.d.ts +10 -0
- package/dist/stories/templates/product-card.stories.d.ts.map +1 -0
- package/dist/stories/templates/select.stories.d.ts +10 -0
- package/dist/stories/templates/select.stories.d.ts.map +1 -0
- package/dist/stories/templates/tabs.stories.d.ts +8 -0
- package/dist/stories/templates/tabs.stories.d.ts.map +1 -0
- package/dist/templates/accordion.js +9 -9
- package/dist/templates/breadcrumb.js +78 -0
- package/dist/templates/carousel.js +13 -15
- package/dist/templates/gallery.js +89 -0
- package/dist/templates/numeric-input.js +4 -4
- package/dist/templates/popover.js +35 -0
- package/dist/templates/product-card.js +10 -10
- package/dist/templates/select.js +43 -0
- package/dist/templates/tabs.js +8 -8
- package/dist/test/visual.spec.d.ts +2 -0
- package/dist/test/visual.spec.d.ts.map +1 -0
- package/dist/utils.js +1 -1
- package/package.json +41 -28
- package/src/tokens/_base.css +3 -3
- package/src/tokens/_layout.css +4 -0
- package/src/tokens/_semantic.css +49 -10
- package/src/tokens/_tokens-base.css +67 -0
- package/src/tokens/_typography.css +36 -6
- package/src/tokens/components/_form-control.css +67 -0
- package/src/tokens/components/atoms/_badge.css +16 -5
- package/src/tokens/components/atoms/_button.css +16 -10
- package/src/tokens/components/atoms/_checkbox.css +52 -0
- package/src/tokens/components/atoms/_icon.css +90 -2
- package/src/tokens/components/atoms/_image.css +5 -0
- package/src/tokens/components/atoms/_input.css +11 -32
- package/src/tokens/components/atoms/_label.css +11 -0
- package/src/tokens/components/atoms/_numeric-input.css +27 -13
- package/src/tokens/components/atoms/_rating.css +2 -2
- package/src/tokens/components/atoms/_status-text.css +32 -0
- package/src/tokens/components/atoms/_textarea.css +15 -17
- package/src/tokens/components/components.css +10 -1
- package/src/tokens/components/molecules/_accordion.css +1 -8
- package/src/tokens/components/molecules/_breadcrumb.css +42 -20
- package/src/tokens/components/molecules/_carousel.css +10 -2
- package/src/tokens/components/molecules/_color-select.css +3 -3
- package/src/tokens/components/molecules/_combobox.css +15 -21
- package/src/tokens/components/molecules/_dialog.css +0 -1
- package/src/tokens/components/molecules/_menu.css +0 -1
- package/src/tokens/components/molecules/_pagination.css +3 -3
- package/src/tokens/components/molecules/_phone-input.css +63 -0
- package/src/tokens/components/molecules/_popover.css +3 -0
- package/src/tokens/components/molecules/_product-card.css +9 -1
- package/src/tokens/components/molecules/_radio-card.css +197 -0
- package/src/tokens/components/molecules/_radio-group.css +150 -0
- package/src/tokens/components/molecules/_search-form.css +7 -3
- package/src/tokens/components/molecules/_select.css +41 -20
- package/src/tokens/components/molecules/_steps.css +115 -34
- package/src/tokens/components/molecules/_toast.css +5 -5
- package/src/tokens/components/molecules/_tree-view.css +5 -6
- package/src/tokens/components/organisms/_footer.css +1 -6
- package/src/tokens/components/organisms/_gallery.css +35 -0
- package/src/tokens/components/organisms/_header.css +8 -0
- package/src/tokens/figma/dark/variables.css +1406 -0
- package/src/tokens/figma/light/variables.css +1406 -0
- package/src/tokens/index.css +1 -65
- package/src/tokens/tokens-only.css +1 -64
- package/dist/atoms/error-text.js +0 -38
- package/dist/atoms/extra-text.js +0 -27
- package/dist/molecules/checkbox.js +0 -98
- package/dist/src/atoms/error-text.d.ts +0 -29
- package/dist/src/atoms/error-text.d.ts.map +0 -1
- package/dist/src/atoms/extra-text.d.ts +0 -27
- package/dist/src/atoms/extra-text.d.ts.map +0 -1
- package/dist/src/molecules/checkbox.d.ts +0 -19
- package/dist/src/molecules/checkbox.d.ts.map +0 -1
- package/src/tokens/components/molecules/_checkbox.css +0 -34
- package/src/tokens/components/molecules/index.css +0 -2
|
@@ -1,151 +1,276 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { connect, machine } from "@zag-js/popover";
|
|
3
|
-
import { Portal, normalizeProps, useMachine } from "@zag-js/react";
|
|
4
|
-
import { useId } from "react";
|
|
3
|
+
import { Portal, mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
4
|
+
import { createContext, useContext, useId } from "react";
|
|
5
5
|
import { Button } from "../atoms/button.js";
|
|
6
6
|
import { tv } from "../utils.js";
|
|
7
7
|
const popoverVariants = tv({
|
|
8
8
|
slots: {
|
|
9
9
|
trigger: [
|
|
10
|
-
|
|
10
|
+
"p-popover-trigger"
|
|
11
|
+
],
|
|
12
|
+
indicator: [
|
|
13
|
+
"data-[state=open]:rotate-180"
|
|
11
14
|
],
|
|
12
15
|
positioner: [
|
|
13
|
-
|
|
16
|
+
"absolute"
|
|
14
17
|
],
|
|
15
18
|
content: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
"bg-popover-bg",
|
|
20
|
+
"text-popover-fg",
|
|
21
|
+
"rounded-popover",
|
|
22
|
+
"outline-none",
|
|
23
|
+
"z-50",
|
|
24
|
+
"relative"
|
|
21
25
|
],
|
|
22
|
-
arrow:
|
|
26
|
+
arrow: "",
|
|
27
|
+
arrowTip: "",
|
|
23
28
|
title: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
"font-popover-title",
|
|
30
|
+
"leading-none",
|
|
31
|
+
"mb-popover-title-mb"
|
|
27
32
|
],
|
|
28
33
|
description: [
|
|
29
34
|
"text-popover-description-fg text-popover-description-size",
|
|
30
|
-
|
|
35
|
+
"leading-normal"
|
|
36
|
+
],
|
|
37
|
+
closeTrigger: [
|
|
38
|
+
"absolute top-2 right-2",
|
|
39
|
+
"text-popover-close-trigger-fg"
|
|
31
40
|
]
|
|
32
41
|
},
|
|
33
42
|
variants: {
|
|
34
43
|
shadow: {
|
|
35
44
|
true: {
|
|
36
|
-
content:
|
|
45
|
+
content: "shadow-popover"
|
|
37
46
|
}
|
|
38
47
|
},
|
|
39
48
|
border: {
|
|
40
49
|
true: {
|
|
41
|
-
content:
|
|
42
|
-
|
|
50
|
+
content: "border border-popover-border",
|
|
51
|
+
arrowTip: "border-popover-border border-t border-l"
|
|
43
52
|
}
|
|
44
53
|
},
|
|
45
54
|
size: {
|
|
46
55
|
sm: {
|
|
47
|
-
content:
|
|
48
|
-
title:
|
|
56
|
+
content: "p-popover-sm text-sm",
|
|
57
|
+
title: "text-popover-title-sm"
|
|
49
58
|
},
|
|
50
59
|
md: {
|
|
51
|
-
content:
|
|
52
|
-
title:
|
|
60
|
+
content: "p-popover-md",
|
|
61
|
+
title: "text-popover-title-md"
|
|
53
62
|
},
|
|
54
63
|
lg: {
|
|
55
|
-
content:
|
|
56
|
-
title:
|
|
64
|
+
content: "p-popover-lg text-lg",
|
|
65
|
+
title: "text-popover-title-lg"
|
|
57
66
|
}
|
|
58
67
|
}
|
|
59
68
|
},
|
|
60
69
|
defaultVariants: {
|
|
61
|
-
size:
|
|
62
|
-
shadow: true
|
|
70
|
+
size: "md",
|
|
71
|
+
shadow: true,
|
|
72
|
+
border: true
|
|
63
73
|
}
|
|
64
74
|
});
|
|
65
|
-
|
|
75
|
+
const PopoverContext = /*#__PURE__*/ createContext(null);
|
|
76
|
+
function usePopoverContext() {
|
|
77
|
+
const context = useContext(PopoverContext);
|
|
78
|
+
if (!context) throw new Error("Popover components must be used within Popover.Root");
|
|
79
|
+
return context;
|
|
80
|
+
}
|
|
81
|
+
function Popover({ autoFocus = true, border, children, closeOnEscape = true, closeOnInteractOutside = true, defaultOpen, dir = "ltr", flip = true, gutter = 8, id, modal = false, offset = {
|
|
66
82
|
mainAxis: 8,
|
|
67
83
|
crossAxis: 0
|
|
68
|
-
},
|
|
84
|
+
}, onOpenChange, onPointerDownOutside, open, overflowPadding = 8, placement = "bottom", portalled = true, sameWidth = false, shadow, size, slide = true, ...props }) {
|
|
69
85
|
const generatedId = useId();
|
|
70
86
|
const uniqueId = id || generatedId;
|
|
71
87
|
const service = useMachine(machine, {
|
|
88
|
+
...props,
|
|
89
|
+
autoFocus,
|
|
90
|
+
closeOnEscape,
|
|
91
|
+
closeOnInteractOutside,
|
|
92
|
+
defaultOpen,
|
|
93
|
+
dir,
|
|
72
94
|
id: uniqueId,
|
|
95
|
+
modal,
|
|
96
|
+
onOpenChange,
|
|
97
|
+
onPointerDownOutside,
|
|
73
98
|
open,
|
|
74
|
-
|
|
75
|
-
dir: 'ltr',
|
|
99
|
+
portalled,
|
|
76
100
|
positioning: {
|
|
77
|
-
|
|
78
|
-
offset,
|
|
101
|
+
flip,
|
|
79
102
|
gutter,
|
|
103
|
+
offset,
|
|
104
|
+
overflowPadding,
|
|
105
|
+
placement,
|
|
80
106
|
sameWidth,
|
|
81
|
-
slide
|
|
82
|
-
|
|
83
|
-
overflowPadding
|
|
84
|
-
},
|
|
85
|
-
modal,
|
|
86
|
-
closeOnInteractOutside,
|
|
87
|
-
closeOnEscape,
|
|
88
|
-
autoFocus,
|
|
89
|
-
portalled,
|
|
90
|
-
onOpenChange,
|
|
91
|
-
onPointerDownOutside
|
|
107
|
+
slide
|
|
108
|
+
}
|
|
92
109
|
});
|
|
93
110
|
const api = connect(service, normalizeProps);
|
|
94
|
-
const
|
|
95
|
-
|
|
111
|
+
const styles = popoverVariants({
|
|
112
|
+
border,
|
|
96
113
|
shadow,
|
|
97
|
-
|
|
114
|
+
size
|
|
98
115
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
className: contentClassName
|
|
107
|
-
}),
|
|
108
|
-
"data-side": placement.split('-')[0],
|
|
109
|
-
"data-state": api.open ? 'open' : 'closed',
|
|
110
|
-
children: [
|
|
111
|
-
showArrow && /*#__PURE__*/ jsx("div", {
|
|
112
|
-
...api.getArrowProps(),
|
|
113
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
114
|
-
...api.getArrowTipProps(),
|
|
115
|
-
className: arrow()
|
|
116
|
-
})
|
|
117
|
-
}),
|
|
118
|
-
title && /*#__PURE__*/ jsx("div", {
|
|
119
|
-
...api.getTitleProps(),
|
|
120
|
-
className: titleStyles(),
|
|
121
|
-
children: title
|
|
122
|
-
}),
|
|
123
|
-
description && /*#__PURE__*/ jsx("div", {
|
|
124
|
-
...api.getDescriptionProps(),
|
|
125
|
-
className: descriptionStyles(),
|
|
126
|
-
children: description
|
|
127
|
-
}),
|
|
128
|
-
children
|
|
129
|
-
]
|
|
130
|
-
})
|
|
131
|
-
});
|
|
132
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
133
|
-
children: [
|
|
134
|
-
/*#__PURE__*/ jsx(Button, {
|
|
135
|
-
theme: "borderless",
|
|
136
|
-
disabled: disabled,
|
|
137
|
-
...api.getTriggerProps(),
|
|
138
|
-
ref: triggerRef,
|
|
139
|
-
className: triggerStyles({
|
|
140
|
-
className: triggerClassName
|
|
141
|
-
}),
|
|
142
|
-
"data-state": api.open ? 'open' : 'closed',
|
|
143
|
-
children: trigger
|
|
144
|
-
}),
|
|
145
|
-
portalled ? /*#__PURE__*/ jsx(Portal, {
|
|
146
|
-
children: api.open && renderContent()
|
|
147
|
-
}) : api.open && renderContent()
|
|
148
|
-
]
|
|
116
|
+
return /*#__PURE__*/ jsx(PopoverContext.Provider, {
|
|
117
|
+
value: {
|
|
118
|
+
api,
|
|
119
|
+
placement,
|
|
120
|
+
styles
|
|
121
|
+
},
|
|
122
|
+
children: children
|
|
149
123
|
});
|
|
150
124
|
}
|
|
125
|
+
Popover.Anchor = function({ className, ref, ...props }) {
|
|
126
|
+
const { api } = usePopoverContext();
|
|
127
|
+
const anchorProps = mergeProps(props, api.getAnchorProps());
|
|
128
|
+
return /*#__PURE__*/ jsx("div", {
|
|
129
|
+
...anchorProps,
|
|
130
|
+
className: className,
|
|
131
|
+
ref: ref
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
Popover.Trigger = function({ children, className, clickBehavior = "toggle", disabled, onClick, ref, size = "current", theme = "borderless", type = "button", ...props }) {
|
|
135
|
+
const { api, styles } = usePopoverContext();
|
|
136
|
+
const { disabled: machineDisabled, onClick: onMachineClick, ...machineTriggerProps } = api.getTriggerProps();
|
|
137
|
+
const buttonProps = mergeProps(props, machineTriggerProps);
|
|
138
|
+
const isDisabled = Boolean(disabled || machineDisabled);
|
|
139
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
140
|
+
...buttonProps,
|
|
141
|
+
className: styles.trigger({
|
|
142
|
+
className
|
|
143
|
+
}),
|
|
144
|
+
"data-state": api.open ? "open" : "closed",
|
|
145
|
+
disabled: isDisabled,
|
|
146
|
+
onClick: (event)=>{
|
|
147
|
+
onClick?.(event);
|
|
148
|
+
if (!event.defaultPrevented && "toggle" === clickBehavior) onMachineClick?.(event);
|
|
149
|
+
},
|
|
150
|
+
ref: ref,
|
|
151
|
+
size: size,
|
|
152
|
+
theme: theme,
|
|
153
|
+
type: type,
|
|
154
|
+
children: children
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
Popover.Indicator = function({ className, ref, ...props }) {
|
|
158
|
+
const { api, styles } = usePopoverContext();
|
|
159
|
+
const indicatorProps = mergeProps(props, api.getIndicatorProps());
|
|
160
|
+
return /*#__PURE__*/ jsx("span", {
|
|
161
|
+
...indicatorProps,
|
|
162
|
+
className: styles.indicator({
|
|
163
|
+
className
|
|
164
|
+
}),
|
|
165
|
+
"data-state": api.open ? "open" : "closed",
|
|
166
|
+
ref: ref
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
Popover.Positioner = function({ children, className, forceMount = false, ref, ...props }) {
|
|
170
|
+
const { api, styles } = usePopoverContext();
|
|
171
|
+
if (!(api.open || forceMount)) return null;
|
|
172
|
+
const positionerProps = mergeProps(props, api.getPositionerProps());
|
|
173
|
+
const positionerNode = /*#__PURE__*/ jsx("div", {
|
|
174
|
+
...positionerProps,
|
|
175
|
+
className: styles.positioner({
|
|
176
|
+
className
|
|
177
|
+
}),
|
|
178
|
+
ref: ref,
|
|
179
|
+
children: children
|
|
180
|
+
});
|
|
181
|
+
return api.portalled ? /*#__PURE__*/ jsx(Portal, {
|
|
182
|
+
children: positionerNode
|
|
183
|
+
}) : positionerNode;
|
|
184
|
+
};
|
|
185
|
+
Popover.Content = function({ children, className, ref, ...props }) {
|
|
186
|
+
const { api, placement, styles } = usePopoverContext();
|
|
187
|
+
const machineContentProps = api.getContentProps();
|
|
188
|
+
const contentProps = mergeProps(props, machineContentProps);
|
|
189
|
+
const contentPlacement = contentProps["data-placement"];
|
|
190
|
+
const contentSide = "string" == typeof contentPlacement ? contentPlacement.split("-")[0] : placement.split("-")[0];
|
|
191
|
+
return /*#__PURE__*/ jsx("div", {
|
|
192
|
+
...contentProps,
|
|
193
|
+
className: styles.content({
|
|
194
|
+
className
|
|
195
|
+
}),
|
|
196
|
+
"data-side": contentSide,
|
|
197
|
+
"data-state": api.open ? "open" : "closed",
|
|
198
|
+
ref: ref,
|
|
199
|
+
children: children
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
Popover.Arrow = function({ children, className, ref, ...props }) {
|
|
203
|
+
const { api, styles } = usePopoverContext();
|
|
204
|
+
const arrowProps = mergeProps(props, api.getArrowProps());
|
|
205
|
+
return /*#__PURE__*/ jsx("div", {
|
|
206
|
+
...arrowProps,
|
|
207
|
+
className: styles.arrow({
|
|
208
|
+
className
|
|
209
|
+
}),
|
|
210
|
+
ref: ref,
|
|
211
|
+
children: children ?? /*#__PURE__*/ jsx(Popover.ArrowTip, {})
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
Popover.ArrowTip = function({ className, ref, ...props }) {
|
|
215
|
+
const { api, styles } = usePopoverContext();
|
|
216
|
+
const arrowTipProps = mergeProps(props, api.getArrowTipProps());
|
|
217
|
+
return /*#__PURE__*/ jsx("div", {
|
|
218
|
+
...arrowTipProps,
|
|
219
|
+
className: styles.arrowTip({
|
|
220
|
+
className
|
|
221
|
+
}),
|
|
222
|
+
ref: ref
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
Popover.Title = function({ className, ref, ...props }) {
|
|
226
|
+
const { api, styles } = usePopoverContext();
|
|
227
|
+
const titleProps = mergeProps(props, api.getTitleProps());
|
|
228
|
+
return /*#__PURE__*/ jsx("div", {
|
|
229
|
+
...titleProps,
|
|
230
|
+
className: styles.title({
|
|
231
|
+
className
|
|
232
|
+
}),
|
|
233
|
+
ref: ref
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
Popover.Description = function({ className, ref, ...props }) {
|
|
237
|
+
const { api, styles } = usePopoverContext();
|
|
238
|
+
const descriptionProps = mergeProps(props, api.getDescriptionProps());
|
|
239
|
+
return /*#__PURE__*/ jsx("div", {
|
|
240
|
+
...descriptionProps,
|
|
241
|
+
className: styles.description({
|
|
242
|
+
className
|
|
243
|
+
}),
|
|
244
|
+
ref: ref
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
Popover.CloseTrigger = function({ children, className, icon, onClick, ref, size = "current", theme = "unstyled", type = "button", ...props }) {
|
|
248
|
+
const { api, styles } = usePopoverContext();
|
|
249
|
+
const { onClick: onMachineClick, ...machineCloseTriggerProps } = api.getCloseTriggerProps();
|
|
250
|
+
const buttonProps = mergeProps(props, machineCloseTriggerProps);
|
|
251
|
+
const closeIcon = icon ?? (children ? void 0 : "token-icon-close");
|
|
252
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
253
|
+
...buttonProps,
|
|
254
|
+
"aria-label": children ? void 0 : "Close popover",
|
|
255
|
+
className: styles.closeTrigger({
|
|
256
|
+
className
|
|
257
|
+
}),
|
|
258
|
+
icon: closeIcon,
|
|
259
|
+
onClick: (event)=>{
|
|
260
|
+
onClick?.(event);
|
|
261
|
+
if (!event.defaultPrevented) onMachineClick?.(event);
|
|
262
|
+
},
|
|
263
|
+
ref: ref,
|
|
264
|
+
size: size,
|
|
265
|
+
theme: theme,
|
|
266
|
+
type: type,
|
|
267
|
+
children: children
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
Popover.Context = function({ children }) {
|
|
271
|
+
const { api } = usePopoverContext();
|
|
272
|
+
return children(api);
|
|
273
|
+
};
|
|
274
|
+
Popover.Root = Popover;
|
|
275
|
+
Popover.displayName = "Popover";
|
|
151
276
|
export { Popover };
|
|
@@ -7,56 +7,56 @@ import { tv } from "../utils.js";
|
|
|
7
7
|
const productCardVariants = tv({
|
|
8
8
|
slots: {
|
|
9
9
|
root: [
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
"rounded-product-card p-product-card-padding",
|
|
11
|
+
"border-(length:--border-product-card-width) max-w-product-card-max border-product-card-border bg-product-card-bg shadow-sm"
|
|
12
12
|
],
|
|
13
|
-
imageSlot:
|
|
14
|
-
nameSlot:
|
|
15
|
-
priceSlot:
|
|
13
|
+
imageSlot: "h-full rounded-product-card-image object-cover",
|
|
14
|
+
nameSlot: "line-clamp-product-card-name font-product-card-name text-product-card-name-fg text-product-card-name-size",
|
|
15
|
+
priceSlot: "font-product-card-price text-product-card-price-fg text-product-card-price-size",
|
|
16
16
|
stockStatusSlot: [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
"font-product-card-stock text-product-card-stock-size",
|
|
18
|
+
"data-[stock=in-stock]:text-product-card-stock-fg-in-stock",
|
|
19
|
+
"data-[stock=limited-stock]:text-product-card-stock-fg-limited-stock",
|
|
20
|
+
"data-[stock=out-of-stock]:text-product-card-stock-fg-out-of-stock"
|
|
21
21
|
],
|
|
22
|
-
badgesSlot:
|
|
23
|
-
ratingSlot:
|
|
24
|
-
actionsSlot:
|
|
25
|
-
button:
|
|
22
|
+
badgesSlot: "flex flex-wrap gap-product-card-box",
|
|
23
|
+
ratingSlot: "flex items-center",
|
|
24
|
+
actionsSlot: "flex flex-wrap gap-product-card-buttons",
|
|
25
|
+
button: ""
|
|
26
26
|
},
|
|
27
27
|
variants: {
|
|
28
28
|
buttonVariant: {
|
|
29
29
|
cart: {
|
|
30
|
-
button:
|
|
30
|
+
button: "w-max bg-product-card-button-cart-bg text-product-card-button-cart-fg hover:bg-product-card-button-cart-bg-hover"
|
|
31
31
|
},
|
|
32
32
|
detail: {
|
|
33
|
-
button:
|
|
33
|
+
button: "w-max bg-product-card-button-detail-bg text-product-card-button-detail-fg hover:bg-product-card-button-detail-bg-hover"
|
|
34
34
|
},
|
|
35
35
|
wishlist: {
|
|
36
|
-
button:
|
|
36
|
+
button: "w-max bg-product-card-button-wishlist-bg text-product-card-button-wishlist-fg hover:bg-product-card-button-wishlist-bg-hover"
|
|
37
37
|
},
|
|
38
38
|
custom: {}
|
|
39
39
|
},
|
|
40
40
|
layout: {
|
|
41
41
|
column: {
|
|
42
42
|
root: [
|
|
43
|
-
|
|
43
|
+
"grid grid-cols-(--product-card-layout-column-grid) gap-product-card-col-layout"
|
|
44
44
|
],
|
|
45
|
-
imageSlot:
|
|
45
|
+
imageSlot: "aspect-product-card-image"
|
|
46
46
|
},
|
|
47
47
|
row: {
|
|
48
|
-
root:
|
|
49
|
-
imageSlot:
|
|
48
|
+
root: "grid grid-cols-(--product-card-layout-row-grid) gap-x-product-card-row-layout",
|
|
49
|
+
imageSlot: "row-span-6 aspect-auto"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
defaultVariants: {
|
|
54
|
-
layout:
|
|
55
|
-
buttonVariant:
|
|
54
|
+
layout: "column",
|
|
55
|
+
buttonVariant: "cart"
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
const ProductCardContext = /*#__PURE__*/ createContext({});
|
|
59
|
-
function ProductCard({ children, layout =
|
|
59
|
+
function ProductCard({ children, layout = "column", className, ref, ...props }) {
|
|
60
60
|
const { root } = productCardVariants({
|
|
61
61
|
layout
|
|
62
62
|
});
|
|
@@ -65,10 +65,10 @@ function ProductCard({ children, layout = 'column', className, ref, ...props })
|
|
|
65
65
|
layout
|
|
66
66
|
},
|
|
67
67
|
children: /*#__PURE__*/ jsx("div", {
|
|
68
|
-
ref: ref,
|
|
69
68
|
className: root({
|
|
70
69
|
className
|
|
71
70
|
}),
|
|
71
|
+
ref: ref,
|
|
72
72
|
...props,
|
|
73
73
|
children: children
|
|
74
74
|
})
|
|
@@ -81,10 +81,10 @@ ProductCard.Image = function({ as, className, ref, ...props }) {
|
|
|
81
81
|
});
|
|
82
82
|
const ImageComponent = as || Image;
|
|
83
83
|
return /*#__PURE__*/ jsx(ImageComponent, {
|
|
84
|
-
ref: ref,
|
|
85
84
|
className: imageSlot({
|
|
86
85
|
className
|
|
87
86
|
}),
|
|
87
|
+
ref: ref,
|
|
88
88
|
...props
|
|
89
89
|
});
|
|
90
90
|
};
|
|
@@ -94,10 +94,10 @@ ProductCard.Name = function({ children, className, ref, ...props }) {
|
|
|
94
94
|
layout: context.layout
|
|
95
95
|
});
|
|
96
96
|
return /*#__PURE__*/ jsx("h3", {
|
|
97
|
-
ref: ref,
|
|
98
97
|
className: nameSlot({
|
|
99
98
|
className
|
|
100
99
|
}),
|
|
100
|
+
ref: ref,
|
|
101
101
|
...props,
|
|
102
102
|
children: children
|
|
103
103
|
});
|
|
@@ -108,25 +108,25 @@ ProductCard.Price = function({ children, className, ref, ...props }) {
|
|
|
108
108
|
layout: context.layout
|
|
109
109
|
});
|
|
110
110
|
return /*#__PURE__*/ jsx("p", {
|
|
111
|
-
ref: ref,
|
|
112
111
|
className: priceSlot({
|
|
113
112
|
className
|
|
114
113
|
}),
|
|
114
|
+
ref: ref,
|
|
115
115
|
...props,
|
|
116
116
|
children: children
|
|
117
117
|
});
|
|
118
118
|
};
|
|
119
|
-
ProductCard.Stock = function({ children, className, ref, status =
|
|
119
|
+
ProductCard.Stock = function({ children, className, ref, status = "in-stock", ...props }) {
|
|
120
120
|
const context = useContext(ProductCardContext);
|
|
121
121
|
const { stockStatusSlot } = productCardVariants({
|
|
122
122
|
layout: context.layout
|
|
123
123
|
});
|
|
124
124
|
return /*#__PURE__*/ jsx("p", {
|
|
125
|
-
ref: ref,
|
|
126
|
-
"data-stock": status,
|
|
127
125
|
className: stockStatusSlot({
|
|
128
126
|
className
|
|
129
127
|
}),
|
|
128
|
+
"data-stock": status,
|
|
129
|
+
ref: ref,
|
|
130
130
|
...props,
|
|
131
131
|
children: children
|
|
132
132
|
});
|
|
@@ -137,10 +137,10 @@ ProductCard.Badges = function({ children, className, ref, ...props }) {
|
|
|
137
137
|
layout: context.layout
|
|
138
138
|
});
|
|
139
139
|
return /*#__PURE__*/ jsx("div", {
|
|
140
|
-
ref: ref,
|
|
141
140
|
className: badgesSlot({
|
|
142
141
|
className
|
|
143
142
|
}),
|
|
143
|
+
ref: ref,
|
|
144
144
|
...props,
|
|
145
145
|
children: children
|
|
146
146
|
});
|
|
@@ -151,10 +151,10 @@ ProductCard.Rating = function({ children, className, rating, ref, ...props }) {
|
|
|
151
151
|
layout: context.layout
|
|
152
152
|
});
|
|
153
153
|
return /*#__PURE__*/ jsx("div", {
|
|
154
|
-
ref: ref,
|
|
155
154
|
className: ratingSlot({
|
|
156
155
|
className
|
|
157
156
|
}),
|
|
157
|
+
ref: ref,
|
|
158
158
|
...props,
|
|
159
159
|
children: rating ? /*#__PURE__*/ jsx(Rating, {
|
|
160
160
|
...rating
|
|
@@ -167,26 +167,27 @@ ProductCard.Actions = function({ children, className, ref, ...props }) {
|
|
|
167
167
|
layout: context.layout
|
|
168
168
|
});
|
|
169
169
|
return /*#__PURE__*/ jsx("div", {
|
|
170
|
-
ref: ref,
|
|
171
170
|
className: actionsSlot({
|
|
172
171
|
className
|
|
173
172
|
}),
|
|
173
|
+
ref: ref,
|
|
174
174
|
...props,
|
|
175
175
|
children: children
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
|
-
ProductCard.Button = function({ children, onClick, icon, className, buttonVariant, ref, ...props }) {
|
|
178
|
+
ProductCard.Button = function({ children, onClick, icon, iconSize, className, buttonVariant, ref, ...props }) {
|
|
179
179
|
const { button } = productCardVariants({
|
|
180
180
|
buttonVariant
|
|
181
181
|
});
|
|
182
182
|
return /*#__PURE__*/ jsx(Button, {
|
|
183
|
-
ref: ref,
|
|
184
|
-
size: "sm",
|
|
185
183
|
className: button({
|
|
186
184
|
className
|
|
187
185
|
}),
|
|
188
|
-
onClick: onClick,
|
|
189
186
|
icon: icon,
|
|
187
|
+
iconSize: iconSize,
|
|
188
|
+
onClick: onClick,
|
|
189
|
+
ref: ref,
|
|
190
|
+
size: "sm",
|
|
190
191
|
...props,
|
|
191
192
|
children: children
|
|
192
193
|
});
|