@cocso-ui/react 0.2.21 → 1.0.1
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 +2 -2
- package/dist/cjs/cn.d.ts +12 -0
- package/dist/cjs/cn.js +17 -0
- package/dist/cjs/components/accordion/accordion.d.ts +25 -0
- package/dist/cjs/components/accordion/accordion.js +54 -0
- package/dist/cjs/components/accordion/accordion.module.css.js +9 -0
- package/dist/cjs/components/alert/alert.d.ts +15 -0
- package/dist/cjs/components/alert/alert.js +44 -0
- package/dist/cjs/components/alert/alert.module.css.js +9 -0
- package/dist/cjs/components/avatar/avatar.d.ts +18 -0
- package/dist/cjs/components/avatar/avatar.js +52 -0
- package/dist/cjs/components/avatar/avatar.module.css.js +9 -0
- package/dist/cjs/components/badge/badge.d.ts +16 -0
- package/dist/cjs/components/badge/badge.js +60 -0
- package/dist/cjs/components/badge/badge.module.css.js +9 -0
- package/dist/cjs/components/breadcrumb/breadcrumb.d.ts +14 -0
- package/dist/cjs/components/breadcrumb/breadcrumb.js +50 -0
- package/dist/cjs/components/breadcrumb/breadcrumb.module.css.js +9 -0
- package/dist/cjs/components/button/button.d.ts +27 -0
- package/dist/cjs/components/button/button.js +83 -0
- package/dist/cjs/components/button/button.module.css.js +9 -0
- package/dist/cjs/components/card/card.d.ts +13 -0
- package/dist/cjs/components/card/card.js +30 -0
- package/dist/cjs/components/card/card.module.css.js +9 -0
- package/dist/cjs/components/checkbox/checkbox.d.ts +20 -0
- package/dist/cjs/components/checkbox/checkbox.js +116 -0
- package/dist/cjs/components/checkbox/checkbox.module.css.js +9 -0
- package/dist/cjs/components/day-picker/day-picker.d.ts +18 -0
- package/dist/cjs/components/day-picker/day-picker.js +117 -0
- package/dist/cjs/components/day-picker/day-picker.module.css.js +9 -0
- package/dist/cjs/components/dialog/dialog.d.ts +29 -0
- package/dist/cjs/components/dialog/dialog.js +105 -0
- package/dist/cjs/components/dialog/dialog.module.css.js +9 -0
- package/dist/cjs/components/dropdown/dropdown.d.ts +16 -0
- package/dist/cjs/components/dropdown/dropdown.js +56 -0
- package/dist/cjs/components/dropdown/dropdown.module.css.js +9 -0
- package/dist/cjs/components/field/field.d.ts +26 -0
- package/dist/cjs/components/field/field.js +49 -0
- package/dist/cjs/components/field/field.module.css.js +9 -0
- package/dist/cjs/components/input/input.d.ts +17 -0
- package/dist/cjs/components/input/input.js +70 -0
- package/dist/cjs/components/input/input.module.css.js +9 -0
- package/dist/cjs/components/input-trigger/input-trigger.d.ts +25 -0
- package/dist/cjs/components/input-trigger/input-trigger.js +54 -0
- package/dist/cjs/components/input-trigger/input-trigger.module.css.js +9 -0
- package/dist/cjs/components/link/link.d.ts +28 -0
- package/dist/cjs/components/link/link.js +64 -0
- package/dist/cjs/components/link/link.module.css.js +9 -0
- package/dist/cjs/components/month-picker/month-picker.d.ts +18 -0
- package/dist/cjs/components/month-picker/month-picker.js +108 -0
- package/dist/cjs/components/month-picker/month-picker.module.css.js +9 -0
- package/dist/cjs/components/one-time-password-field/one-time-password-field.d.ts +13 -0
- package/dist/cjs/components/one-time-password-field/one-time-password-field.js +44 -0
- package/dist/cjs/components/one-time-password-field/one-time-password-field.module.css.js +9 -0
- package/dist/cjs/components/pagination/pagination.d.ts +23 -0
- package/dist/cjs/components/pagination/pagination.js +87 -0
- package/dist/cjs/components/pagination/pagination.module.css.js +9 -0
- package/dist/cjs/components/popover/popover.d.ts +14 -0
- package/dist/cjs/components/popover/popover.js +49 -0
- package/dist/cjs/components/popover/popover.module.css.js +9 -0
- package/dist/cjs/components/progress/progress.d.ts +17 -0
- package/dist/cjs/components/progress/progress.js +43 -0
- package/dist/cjs/components/progress/progress.module.css.js +9 -0
- package/dist/cjs/components/radio-group/radio-group.d.ts +23 -0
- package/dist/cjs/components/radio-group/radio-group.js +53 -0
- package/dist/cjs/components/radio-group/radio-group.module.css.js +9 -0
- package/dist/cjs/components/select/select.d.ts +17 -0
- package/dist/cjs/components/select/select.js +86 -0
- package/dist/cjs/components/select/select.module.css.js +9 -0
- package/dist/cjs/components/skeleton/skeleton.d.ts +15 -0
- package/dist/cjs/components/skeleton/skeleton.js +30 -0
- package/dist/cjs/components/skeleton/skeleton.module.css.js +9 -0
- package/dist/cjs/components/spinner/spinner.d.ts +17 -0
- package/dist/cjs/components/spinner/spinner.js +70 -0
- package/dist/cjs/components/spinner/spinner.module.css.js +9 -0
- package/dist/cjs/components/stock-quantity-status/stock-quantity-status.d.ts +12 -0
- package/dist/cjs/components/stock-quantity-status/stock-quantity-status.js +119 -0
- package/dist/cjs/components/stock-quantity-status/stock-quantity-status.module.css.js +9 -0
- package/dist/cjs/components/switch/switch.d.ts +19 -0
- package/dist/cjs/components/switch/switch.js +74 -0
- package/dist/cjs/components/switch/switch.module.css.js +9 -0
- package/dist/cjs/components/tab/tab.d.ts +21 -0
- package/dist/cjs/components/tab/tab.js +33 -0
- package/dist/cjs/components/tooltip/tooltip.d.ts +17 -0
- package/dist/cjs/components/tooltip/tooltip.js +50 -0
- package/dist/cjs/components/tooltip/tooltip.module.css.js +9 -0
- package/dist/cjs/components/typography/typography.d.ts +30 -0
- package/dist/cjs/components/typography/typography.js +81 -0
- package/dist/cjs/components/typography/typography.module.css.js +9 -0
- package/dist/cjs/ecosystem/codegen/generated/alert.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/alert.js +12 -0
- package/dist/cjs/ecosystem/codegen/generated/avatar.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/avatar.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/badge.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/badge.js +14 -0
- package/dist/cjs/ecosystem/codegen/generated/breadcrumb.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/breadcrumb.js +12 -0
- package/dist/cjs/ecosystem/codegen/generated/button.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/button.js +14 -0
- package/dist/cjs/ecosystem/codegen/generated/card.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/card.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/checkbox.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/checkbox.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/input.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/input.js +12 -0
- package/dist/cjs/ecosystem/codegen/generated/link.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/link.js +12 -0
- package/dist/cjs/ecosystem/codegen/generated/progress.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/progress.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/radio.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/radio.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/select.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/select.js +12 -0
- package/dist/cjs/ecosystem/codegen/generated/skeleton.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/skeleton.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/spinner-geometry.js +33 -0
- package/dist/cjs/ecosystem/codegen/generated/spinner.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/spinner.js +13 -0
- package/dist/cjs/ecosystem/codegen/generated/stock-quantity-status.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/stock-quantity-status.js +12 -0
- package/dist/cjs/ecosystem/codegen/generated/switch.css.js +6 -0
- package/dist/cjs/ecosystem/codegen/generated/switch.js +14 -0
- package/dist/cjs/index.d.ts +32 -19
- package/dist/cjs/index.js +67 -43
- package/dist/cjs/primitives/use-render.d.ts +11 -0
- package/dist/cjs/token/color.d.ts +12 -0
- package/dist/cjs/token/color.js +93 -81
- package/dist/cjs/token/radius.d.ts +12 -0
- package/dist/cjs/token/radius.js +14 -0
- package/dist/cjs/token/spacing.d.ts +24 -23
- package/dist/cjs/token/spacing.js +24 -23
- package/dist/cjs/token/typography.d.ts +17 -0
- package/dist/cjs/token/typography.js +17 -6
- package/dist/esm/cn.d.mts +12 -0
- package/dist/esm/cn.mjs +15 -0
- package/dist/esm/components/accordion/accordion.d.mts +25 -0
- package/dist/esm/components/accordion/accordion.mjs +52 -0
- package/dist/esm/components/accordion/accordion.module.css.mjs +3 -0
- package/dist/esm/components/alert/alert.d.mts +15 -0
- package/dist/esm/components/alert/alert.mjs +41 -0
- package/dist/esm/components/alert/alert.module.css.mjs +3 -0
- package/dist/esm/components/avatar/avatar.d.mts +18 -0
- package/dist/esm/components/avatar/avatar.mjs +49 -0
- package/dist/esm/components/avatar/avatar.module.css.mjs +3 -0
- package/dist/esm/components/badge/badge.d.mts +16 -0
- package/dist/esm/components/badge/badge.mjs +57 -0
- package/dist/esm/components/badge/badge.module.css.mjs +3 -0
- package/dist/esm/components/breadcrumb/breadcrumb.d.mts +14 -0
- package/dist/esm/components/breadcrumb/breadcrumb.mjs +47 -0
- package/dist/esm/components/breadcrumb/breadcrumb.module.css.mjs +3 -0
- package/dist/esm/components/button/button.d.mts +27 -0
- package/dist/esm/components/button/button.mjs +80 -0
- package/dist/esm/components/button/button.module.css.mjs +3 -0
- package/dist/esm/components/card/card.d.mts +13 -0
- package/dist/esm/components/card/card.mjs +27 -0
- package/dist/esm/components/card/card.module.css.mjs +3 -0
- package/dist/esm/components/checkbox/checkbox.d.mts +20 -0
- package/dist/esm/components/checkbox/checkbox.mjs +113 -0
- package/dist/esm/components/checkbox/checkbox.module.css.mjs +3 -0
- package/dist/esm/components/day-picker/day-picker.d.mts +18 -0
- package/dist/esm/components/day-picker/day-picker.mjs +115 -0
- package/dist/esm/components/day-picker/day-picker.module.css.mjs +3 -0
- package/dist/esm/components/dialog/dialog.d.mts +29 -0
- package/dist/esm/components/dialog/dialog.mjs +103 -0
- package/dist/esm/components/dialog/dialog.module.css.mjs +3 -0
- package/dist/esm/components/dropdown/dropdown.d.mts +16 -0
- package/dist/esm/components/dropdown/dropdown.mjs +54 -0
- package/dist/esm/components/dropdown/dropdown.module.css.mjs +3 -0
- package/dist/esm/components/field/field.d.mts +26 -0
- package/dist/esm/components/field/field.mjs +46 -0
- package/dist/esm/components/field/field.module.css.mjs +3 -0
- package/dist/esm/components/input/input.d.mts +17 -0
- package/dist/esm/components/input/input.mjs +67 -0
- package/dist/esm/components/input/input.module.css.mjs +3 -0
- package/dist/esm/components/input-trigger/input-trigger.d.mts +25 -0
- package/dist/esm/components/input-trigger/input-trigger.mjs +51 -0
- package/dist/esm/components/input-trigger/input-trigger.module.css.mjs +3 -0
- package/dist/esm/components/link/link.d.mts +28 -0
- package/dist/esm/components/link/link.mjs +61 -0
- package/dist/esm/components/link/link.module.css.mjs +3 -0
- package/dist/esm/components/month-picker/month-picker.d.mts +18 -0
- package/dist/esm/components/month-picker/month-picker.mjs +106 -0
- package/dist/esm/components/month-picker/month-picker.module.css.mjs +3 -0
- package/dist/esm/components/one-time-password-field/one-time-password-field.d.mts +13 -0
- package/dist/esm/components/one-time-password-field/one-time-password-field.mjs +42 -0
- package/dist/esm/components/one-time-password-field/one-time-password-field.module.css.mjs +3 -0
- package/dist/esm/components/pagination/pagination.d.mts +23 -0
- package/dist/esm/{pagination/Pagination.mjs → components/pagination/pagination.mjs} +46 -15
- package/dist/esm/components/pagination/pagination.module.css.mjs +3 -0
- package/dist/esm/components/popover/popover.d.mts +14 -0
- package/dist/esm/components/popover/popover.mjs +47 -0
- package/dist/esm/components/popover/popover.module.css.mjs +3 -0
- package/dist/esm/components/progress/progress.d.mts +17 -0
- package/dist/esm/components/progress/progress.mjs +40 -0
- package/dist/esm/components/progress/progress.module.css.mjs +3 -0
- package/dist/esm/components/radio-group/radio-group.d.mts +23 -0
- package/dist/esm/components/radio-group/radio-group.mjs +50 -0
- package/dist/esm/components/radio-group/radio-group.module.css.mjs +3 -0
- package/dist/esm/components/select/select.d.mts +17 -0
- package/dist/esm/components/select/select.mjs +83 -0
- package/dist/esm/components/select/select.module.css.mjs +3 -0
- package/dist/esm/components/skeleton/skeleton.d.mts +15 -0
- package/dist/esm/components/skeleton/skeleton.mjs +27 -0
- package/dist/esm/components/skeleton/skeleton.module.css.mjs +3 -0
- package/dist/esm/components/spinner/spinner.d.mts +17 -0
- package/dist/esm/components/spinner/spinner.mjs +67 -0
- package/dist/esm/components/spinner/spinner.module.css.mjs +3 -0
- package/dist/esm/components/stock-quantity-status/stock-quantity-status.d.mts +12 -0
- package/dist/esm/components/stock-quantity-status/stock-quantity-status.mjs +116 -0
- package/dist/esm/components/stock-quantity-status/stock-quantity-status.module.css.mjs +3 -0
- package/dist/esm/components/switch/switch.d.mts +19 -0
- package/dist/esm/components/switch/switch.mjs +71 -0
- package/dist/esm/components/switch/switch.module.css.mjs +3 -0
- package/dist/esm/components/tab/tab.d.mts +21 -0
- package/dist/esm/components/tab/tab.mjs +31 -0
- package/dist/esm/components/tooltip/tooltip.d.mts +17 -0
- package/dist/esm/components/tooltip/tooltip.mjs +48 -0
- package/dist/esm/components/tooltip/tooltip.module.css.mjs +3 -0
- package/dist/esm/components/typography/typography.d.mts +30 -0
- package/dist/esm/components/typography/typography.mjs +79 -0
- package/dist/esm/components/typography/typography.module.css.mjs +3 -0
- package/dist/esm/ecosystem/codegen/generated/alert.mjs +10 -0
- package/dist/esm/ecosystem/codegen/generated/avatar.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/badge.mjs +12 -0
- package/dist/esm/ecosystem/codegen/generated/breadcrumb.mjs +10 -0
- package/dist/esm/ecosystem/codegen/generated/button.mjs +12 -0
- package/dist/esm/ecosystem/codegen/generated/card.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/checkbox.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/input.mjs +10 -0
- package/dist/esm/ecosystem/codegen/generated/link.mjs +10 -0
- package/dist/esm/ecosystem/codegen/generated/progress.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/radio.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/select.mjs +10 -0
- package/dist/esm/ecosystem/codegen/generated/skeleton.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/spinner-geometry.mjs +30 -0
- package/dist/esm/ecosystem/codegen/generated/spinner.mjs +11 -0
- package/dist/esm/ecosystem/codegen/generated/stock-quantity-status.mjs +10 -0
- package/dist/esm/ecosystem/codegen/generated/switch.mjs +12 -0
- package/dist/esm/index.css +7 -1
- package/dist/esm/index.d.mts +32 -19
- package/dist/esm/index.mjs +32 -20
- package/dist/esm/primitives/use-render.d.mts +11 -0
- package/dist/esm/token/color.d.mts +12 -0
- package/dist/esm/token/color.mjs +93 -81
- package/dist/esm/token/radius.d.mts +12 -0
- package/dist/esm/token/radius.mjs +12 -0
- package/dist/esm/token/spacing.d.mts +24 -23
- package/dist/esm/token/spacing.mjs +24 -23
- package/dist/esm/token/typography.d.mts +17 -0
- package/dist/esm/token/typography.mjs +17 -6
- package/package.json +29 -26
- package/dist/cjs/accordion/Accordion.d.ts +0 -15
- package/dist/cjs/accordion/Accordion.js +0 -71
- package/dist/cjs/accordion/Accordion.module.css.js +0 -9
- package/dist/cjs/badge/Badge.d.ts +0 -13
- package/dist/cjs/badge/Badge.js +0 -50
- package/dist/cjs/badge/Badge.module.css.js +0 -9
- package/dist/cjs/button/Button.d.ts +0 -23
- package/dist/cjs/button/Button.js +0 -117
- package/dist/cjs/button/Button.module.css.js +0 -9
- package/dist/cjs/checkbox/Checkbox.d.ts +0 -18
- package/dist/cjs/checkbox/Checkbox.js +0 -117
- package/dist/cjs/checkbox/Checkbox.module.css.js +0 -9
- package/dist/cjs/day-picker/DayPicker.d.ts +0 -14
- package/dist/cjs/day-picker/DayPicker.js +0 -98
- package/dist/cjs/day-picker/DayPicker.module.css.js +0 -9
- package/dist/cjs/dropdown/Dropdown.d.ts +0 -11
- package/dist/cjs/dropdown/Dropdown.js +0 -55
- package/dist/cjs/dropdown/Dropdown.module.css.js +0 -9
- package/dist/cjs/link/Link.d.ts +0 -16
- package/dist/cjs/link/Link.js +0 -35
- package/dist/cjs/link/Link.module.css.js +0 -9
- package/dist/cjs/modal/Modal.d.ts +0 -12
- package/dist/cjs/modal/Modal.js +0 -106
- package/dist/cjs/modal/Modal.module.css.js +0 -9
- package/dist/cjs/month-picker/MonthPicker.d.ts +0 -14
- package/dist/cjs/month-picker/MonthPicker.js +0 -91
- package/dist/cjs/month-picker/MonthPicker.module.css.js +0 -9
- package/dist/cjs/one-time-password-field/OneTimePasswordField.d.ts +0 -8
- package/dist/cjs/one-time-password-field/OneTimePasswordField.js +0 -52
- package/dist/cjs/one-time-password-field/OneTimePasswordField.module.css.js +0 -9
- package/dist/cjs/pagination/Pagination.d.ts +0 -13
- package/dist/cjs/pagination/Pagination.js +0 -56
- package/dist/cjs/pagination/Pagination.module.css.js +0 -9
- package/dist/cjs/popover/Popover.d.ts +0 -10
- package/dist/cjs/popover/Popover.js +0 -44
- package/dist/cjs/popover/Popover.module.css.js +0 -9
- package/dist/cjs/radio-group/RadioGroup.d.ts +0 -9
- package/dist/cjs/radio-group/RadioGroup.js +0 -66
- package/dist/cjs/radio-group/RadioGroup.module.css.js +0 -9
- package/dist/cjs/select/Select.d.ts +0 -13
- package/dist/cjs/select/Select.js +0 -85
- package/dist/cjs/select/Select.module.css.js +0 -9
- package/dist/cjs/spinner/Spinner.d.ts +0 -14
- package/dist/cjs/spinner/Spinner.js +0 -40
- package/dist/cjs/spinner/Spinner.module.css.js +0 -9
- package/dist/cjs/stock-quantity-status/StockQuantityStatus.d.ts +0 -12
- package/dist/cjs/stock-quantity-status/StockQuantityStatus.js +0 -105
- package/dist/cjs/stock-quantity-status/StockQuantityStatus.module.css.js +0 -9
- package/dist/cjs/switch/Switch.d.ts +0 -16
- package/dist/cjs/switch/Switch.js +0 -89
- package/dist/cjs/switch/Switch.module.css.js +0 -9
- package/dist/cjs/tab/Tab.d.ts +0 -10
- package/dist/cjs/tab/Tab.js +0 -64
- package/dist/cjs/typography/Typography.d.ts +0 -33
- package/dist/cjs/typography/Typography.js +0 -90
- package/dist/cjs/typography/Typography.module.css.js +0 -9
- package/dist/esm/accordion/Accordion.d.mts +0 -15
- package/dist/esm/accordion/Accordion.mjs +0 -50
- package/dist/esm/accordion/Accordion.module.css.mjs +0 -3
- package/dist/esm/badge/Badge.d.mts +0 -13
- package/dist/esm/badge/Badge.mjs +0 -48
- package/dist/esm/badge/Badge.module.css.mjs +0 -3
- package/dist/esm/button/Button.d.mts +0 -23
- package/dist/esm/button/Button.mjs +0 -115
- package/dist/esm/button/Button.module.css.mjs +0 -3
- package/dist/esm/checkbox/Checkbox.d.mts +0 -18
- package/dist/esm/checkbox/Checkbox.mjs +0 -96
- package/dist/esm/checkbox/Checkbox.module.css.mjs +0 -3
- package/dist/esm/day-picker/DayPicker.d.mts +0 -14
- package/dist/esm/day-picker/DayPicker.mjs +0 -96
- package/dist/esm/day-picker/DayPicker.module.css.mjs +0 -3
- package/dist/esm/dropdown/Dropdown.d.mts +0 -11
- package/dist/esm/dropdown/Dropdown.mjs +0 -34
- package/dist/esm/dropdown/Dropdown.module.css.mjs +0 -3
- package/dist/esm/link/Link.d.mts +0 -16
- package/dist/esm/link/Link.mjs +0 -33
- package/dist/esm/link/Link.module.css.mjs +0 -3
- package/dist/esm/modal/Modal.d.mts +0 -12
- package/dist/esm/modal/Modal.mjs +0 -85
- package/dist/esm/modal/Modal.module.css.mjs +0 -3
- package/dist/esm/month-picker/MonthPicker.d.mts +0 -14
- package/dist/esm/month-picker/MonthPicker.mjs +0 -89
- package/dist/esm/month-picker/MonthPicker.module.css.mjs +0 -3
- package/dist/esm/one-time-password-field/OneTimePasswordField.d.mts +0 -8
- package/dist/esm/one-time-password-field/OneTimePasswordField.mjs +0 -31
- package/dist/esm/one-time-password-field/OneTimePasswordField.module.css.mjs +0 -3
- package/dist/esm/pagination/Pagination.d.mts +0 -13
- package/dist/esm/pagination/Pagination.module.css.mjs +0 -3
- package/dist/esm/popover/Popover.d.mts +0 -10
- package/dist/esm/popover/Popover.mjs +0 -23
- package/dist/esm/popover/Popover.module.css.mjs +0 -3
- package/dist/esm/radio-group/RadioGroup.d.mts +0 -9
- package/dist/esm/radio-group/RadioGroup.mjs +0 -45
- package/dist/esm/radio-group/RadioGroup.module.css.mjs +0 -3
- package/dist/esm/select/Select.d.mts +0 -13
- package/dist/esm/select/Select.mjs +0 -83
- package/dist/esm/select/Select.module.css.mjs +0 -3
- package/dist/esm/spinner/Spinner.d.mts +0 -14
- package/dist/esm/spinner/Spinner.mjs +0 -38
- package/dist/esm/spinner/Spinner.module.css.mjs +0 -3
- package/dist/esm/stock-quantity-status/StockQuantityStatus.d.mts +0 -12
- package/dist/esm/stock-quantity-status/StockQuantityStatus.mjs +0 -102
- package/dist/esm/stock-quantity-status/StockQuantityStatus.module.css.mjs +0 -3
- package/dist/esm/switch/Switch.d.mts +0 -16
- package/dist/esm/switch/Switch.mjs +0 -68
- package/dist/esm/switch/Switch.module.css.mjs +0 -3
- package/dist/esm/tab/Tab.d.mts +0 -10
- package/dist/esm/tab/Tab.mjs +0 -43
- package/dist/esm/typography/Typography.d.mts +0 -33
- package/dist/esm/typography/Typography.mjs +0 -88
- package/dist/esm/typography/Typography.module.css.mjs +0 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn } from '../../cn.mjs';
|
|
2
|
+
import styles from './popover.module.css.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
5
|
+
|
|
6
|
+
function PopoverArrow({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /*#__PURE__*/jsx(Popover$1.Arrow, {
|
|
11
|
+
className: cn(styles.arrow, className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function PopoverContent({
|
|
16
|
+
className,
|
|
17
|
+
side,
|
|
18
|
+
sideOffset,
|
|
19
|
+
align,
|
|
20
|
+
alignOffset,
|
|
21
|
+
arrowPadding,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return /*#__PURE__*/jsx(Popover$1.Portal, {
|
|
25
|
+
children: /*#__PURE__*/jsx(Popover$1.Positioner, {
|
|
26
|
+
align: align,
|
|
27
|
+
alignOffset: alignOffset,
|
|
28
|
+
arrowPadding: arrowPadding,
|
|
29
|
+
className: styles.positioner,
|
|
30
|
+
side: side,
|
|
31
|
+
sideOffset: sideOffset,
|
|
32
|
+
children: /*#__PURE__*/jsx(Popover$1.Popup, {
|
|
33
|
+
className: cn(styles.content, className),
|
|
34
|
+
"data-cocso-component": "popover-content",
|
|
35
|
+
...props
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const Popover = Object.assign(Popover$1.Root, {
|
|
41
|
+
displayName: "Popover",
|
|
42
|
+
Trigger: Popover$1.Trigger,
|
|
43
|
+
Content: PopoverContent,
|
|
44
|
+
Arrow: PopoverArrow
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { Popover };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Inline type aliases — codegen is a devDependency and must not leak into published .d.ts */
|
|
5
|
+
type ProgressVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info";
|
|
6
|
+
type ProgressSize = "sm" | "md" | "lg";
|
|
7
|
+
interface ProgressProps extends ComponentProps<"div"> {
|
|
8
|
+
max?: number;
|
|
9
|
+
size?: ProgressSize;
|
|
10
|
+
value: number;
|
|
11
|
+
variant?: ProgressVariant;
|
|
12
|
+
}
|
|
13
|
+
/** Determinate progress indicator showing completion percentage. */
|
|
14
|
+
declare function Progress({ ref, className, style, variant, size, value, max, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Progress };
|
|
17
|
+
export type { ProgressProps, ProgressSize, ProgressVariant };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { progress } from '../../ecosystem/codegen/generated/progress.mjs';
|
|
2
|
+
import { cn } from '../../cn.mjs';
|
|
3
|
+
import styles from './progress.module.css.mjs';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
/** Determinate progress indicator showing completion percentage. */
|
|
7
|
+
function Progress({
|
|
8
|
+
ref,
|
|
9
|
+
className,
|
|
10
|
+
style,
|
|
11
|
+
variant = "primary",
|
|
12
|
+
size = "md",
|
|
13
|
+
value,
|
|
14
|
+
max = 100,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const safeMax = max > 0 ? max : 100;
|
|
18
|
+
const percentage = Math.min(100, Math.max(0, value / safeMax * 100));
|
|
19
|
+
return /*#__PURE__*/jsx("div", {
|
|
20
|
+
"aria-valuemax": safeMax,
|
|
21
|
+
"aria-valuemin": 0,
|
|
22
|
+
"aria-valuenow": Math.min(Math.max(0, value), safeMax),
|
|
23
|
+
className: cn(progress({
|
|
24
|
+
variant,
|
|
25
|
+
size
|
|
26
|
+
}), styles.track, className),
|
|
27
|
+
ref: ref,
|
|
28
|
+
role: "progressbar",
|
|
29
|
+
style: style,
|
|
30
|
+
...props,
|
|
31
|
+
children: /*#__PURE__*/jsx("div", {
|
|
32
|
+
className: styles.fill,
|
|
33
|
+
style: {
|
|
34
|
+
width: `${percentage}%`
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { Progress };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Radio } from '@base-ui/react/radio';
|
|
4
|
+
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
5
|
+
|
|
6
|
+
/** Inline type alias — codegen is a devDependency and must not leak into published .d.ts */
|
|
7
|
+
type RadioSize = "large" | "medium" | "small";
|
|
8
|
+
declare function RadioGroupRoot({ className, ...props }: ComponentProps<typeof RadioGroup$1>): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function RadioGroupItem({ className, size, style, ...props }: ComponentProps<typeof Radio.Root> & {
|
|
10
|
+
size?: RadioSize;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function RadioGroupIndicator({ className, ...props }: ComponentProps<typeof Radio.Indicator>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Single-selection radio group. Compose with `RadioGroup.Item` and `RadioGroup.Indicator`.
|
|
15
|
+
*/
|
|
16
|
+
declare const RadioGroup: typeof RadioGroupRoot & {
|
|
17
|
+
displayName: "RadioGroup";
|
|
18
|
+
Item: typeof RadioGroupItem;
|
|
19
|
+
Indicator: typeof RadioGroupIndicator;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { RadioGroup };
|
|
23
|
+
export type { RadioSize };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { radio } from '../../ecosystem/codegen/generated/radio.mjs';
|
|
2
|
+
import { cn } from '../../cn.mjs';
|
|
3
|
+
import styles from './radio-group.module.css.mjs';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
6
|
+
import { Radio } from '@base-ui/react/radio';
|
|
7
|
+
|
|
8
|
+
function RadioGroupRoot({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /*#__PURE__*/jsx(RadioGroup$1, {
|
|
13
|
+
className: cn(styles.root, className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function RadioGroupItem({
|
|
18
|
+
className,
|
|
19
|
+
size = "medium",
|
|
20
|
+
style,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /*#__PURE__*/jsx(Radio.Root, {
|
|
24
|
+
className: cn(radio({
|
|
25
|
+
size
|
|
26
|
+
}), styles.item, className),
|
|
27
|
+
style: style,
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function RadioGroupIndicator({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
return /*#__PURE__*/jsx(Radio.Indicator, {
|
|
36
|
+
className: cn(styles.indicator, className),
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Single-selection radio group. Compose with `RadioGroup.Item` and `RadioGroup.Indicator`.
|
|
43
|
+
*/
|
|
44
|
+
const RadioGroup = Object.assign(RadioGroupRoot, {
|
|
45
|
+
displayName: "RadioGroup",
|
|
46
|
+
Item: RadioGroupItem,
|
|
47
|
+
Indicator: RadioGroupIndicator
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { RadioGroup };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
type SelectSize = "large" | "medium" | "small" | "x-small";
|
|
5
|
+
interface SelectProps extends Omit<ComponentProps<"select">, "size"> {
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
error?: boolean | string;
|
|
9
|
+
label?: string;
|
|
10
|
+
size?: SelectSize;
|
|
11
|
+
stretch?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Dropdown select component wrapping native select. */
|
|
14
|
+
declare function Select({ ref, className, style: _style, size, disabled, error, stretch, label, description, id: _id, children, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Select };
|
|
17
|
+
export type { SelectProps, SelectSize };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { select } from '../../ecosystem/codegen/generated/select.mjs';
|
|
3
|
+
import { SelectorIcon } from '@cocso-ui/react-icons';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { cn } from '../../cn.mjs';
|
|
6
|
+
import styles from './select.module.css.mjs';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { Field, useField } from '../field/field.mjs';
|
|
9
|
+
|
|
10
|
+
const ICON_SIZES = {
|
|
11
|
+
"x-small": 10,
|
|
12
|
+
small: 12,
|
|
13
|
+
medium: 14,
|
|
14
|
+
large: 14
|
|
15
|
+
};
|
|
16
|
+
/** Dropdown select component wrapping native select. */
|
|
17
|
+
function Select({
|
|
18
|
+
ref,
|
|
19
|
+
className,
|
|
20
|
+
style: _style,
|
|
21
|
+
size = "medium",
|
|
22
|
+
disabled = false,
|
|
23
|
+
error = false,
|
|
24
|
+
stretch = false,
|
|
25
|
+
label,
|
|
26
|
+
description,
|
|
27
|
+
id: _id,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
const generatedId = useId();
|
|
32
|
+
const id = _id ?? generatedId;
|
|
33
|
+
const hasError = !!error;
|
|
34
|
+
const errorMessage = typeof error === "string" ? error : undefined;
|
|
35
|
+
const wrapperStyle = {};
|
|
36
|
+
const select$1 = /*#__PURE__*/jsxs("div", {
|
|
37
|
+
className: cn(select({
|
|
38
|
+
size
|
|
39
|
+
}), styles.wrapper, stretch && styles.stretch, hasError && styles.error, className),
|
|
40
|
+
"data-cocso-component": "select",
|
|
41
|
+
style: wrapperStyle,
|
|
42
|
+
children: [/*#__PURE__*/jsx(FieldAwareSelect, {
|
|
43
|
+
"aria-invalid": hasError || undefined,
|
|
44
|
+
className: styles.select,
|
|
45
|
+
disabled: disabled,
|
|
46
|
+
id: id,
|
|
47
|
+
ref: ref,
|
|
48
|
+
style: _style,
|
|
49
|
+
...props,
|
|
50
|
+
children: children
|
|
51
|
+
}), /*#__PURE__*/jsx("span", {
|
|
52
|
+
className: styles.icon,
|
|
53
|
+
children: /*#__PURE__*/jsx(SelectorIcon, {
|
|
54
|
+
size: ICON_SIZES[size]
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
if (label) {
|
|
59
|
+
return /*#__PURE__*/jsx(Field, {
|
|
60
|
+
description: description,
|
|
61
|
+
error: errorMessage,
|
|
62
|
+
htmlFor: id,
|
|
63
|
+
label: label,
|
|
64
|
+
required: props.required,
|
|
65
|
+
children: select$1
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return select$1;
|
|
69
|
+
}
|
|
70
|
+
function FieldAwareSelect({
|
|
71
|
+
"aria-describedby": callerDescribedBy,
|
|
72
|
+
...props
|
|
73
|
+
}) {
|
|
74
|
+
const field = useField();
|
|
75
|
+
const fieldDescribedBy = field.errorId ?? field.descriptionId;
|
|
76
|
+
const describedBy = [fieldDescribedBy, callerDescribedBy].filter(Boolean).join(" ") || undefined;
|
|
77
|
+
return /*#__PURE__*/jsx("select", {
|
|
78
|
+
"aria-describedby": describedBy,
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { Select };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Inline type aliases — codegen is a devDependency and must not leak into published .d.ts */
|
|
5
|
+
type SkeletonVariant = "text" | "circular" | "rectangular";
|
|
6
|
+
type SkeletonAnimation = "pulse" | "wave" | "none";
|
|
7
|
+
interface SkeletonProps extends ComponentProps<"div"> {
|
|
8
|
+
animation?: SkeletonAnimation;
|
|
9
|
+
variant?: SkeletonVariant;
|
|
10
|
+
}
|
|
11
|
+
/** Loading placeholder with configurable shape and animation. */
|
|
12
|
+
declare function Skeleton({ ref, className, style, variant, animation, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { Skeleton };
|
|
15
|
+
export type { SkeletonAnimation, SkeletonProps, SkeletonVariant };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { skeleton } from '../../ecosystem/codegen/generated/skeleton.mjs';
|
|
2
|
+
import { cn } from '../../cn.mjs';
|
|
3
|
+
import styles from './skeleton.module.css.mjs';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
/** Loading placeholder with configurable shape and animation. */
|
|
7
|
+
function Skeleton({
|
|
8
|
+
ref,
|
|
9
|
+
className,
|
|
10
|
+
style,
|
|
11
|
+
variant = "text",
|
|
12
|
+
animation = "pulse",
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/jsx("div", {
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
className: cn(skeleton({
|
|
18
|
+
variant,
|
|
19
|
+
animation
|
|
20
|
+
}), styles.skeleton, animation === "pulse" && styles.pulse, animation === "wave" && styles.wave, className),
|
|
21
|
+
ref: ref,
|
|
22
|
+
style: style,
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Skeleton };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Inline type aliases — codegen is a devDependency and must not leak into published .d.ts */
|
|
5
|
+
type SpinnerVariant = "primary" | "secondary" | "success" | "error" | "warning" | "info" | "white";
|
|
6
|
+
type SpinnerSize = "large" | "medium" | "small";
|
|
7
|
+
|
|
8
|
+
interface SpinnerProps extends Omit<ComponentProps<"output">, "size"> {
|
|
9
|
+
label?: string;
|
|
10
|
+
size?: SpinnerSize;
|
|
11
|
+
variant?: SpinnerVariant;
|
|
12
|
+
}
|
|
13
|
+
/** Loading indicator rendered as an accessible output element. */
|
|
14
|
+
declare function Spinner({ ref, className, style: _style, size, variant, label, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Spinner };
|
|
17
|
+
export type { SpinnerProps, SpinnerSize, SpinnerVariant };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { spinner } from '../../ecosystem/codegen/generated/spinner.mjs';
|
|
2
|
+
import { getSpinnerGeometry } from '../../ecosystem/codegen/generated/spinner-geometry.mjs';
|
|
3
|
+
import { cn } from '../../cn.mjs';
|
|
4
|
+
import styles from './spinner.module.css.mjs';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
/** Loading indicator rendered as an accessible output element. */
|
|
8
|
+
function Spinner({
|
|
9
|
+
ref,
|
|
10
|
+
className,
|
|
11
|
+
style: _style,
|
|
12
|
+
size = "medium",
|
|
13
|
+
variant = "primary",
|
|
14
|
+
label = "Loading",
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
blades: bladeCount,
|
|
19
|
+
bladeWidth: width,
|
|
20
|
+
bladeHeight: height,
|
|
21
|
+
bladeRadius: radius,
|
|
22
|
+
output
|
|
23
|
+
} = getSpinnerGeometry(size);
|
|
24
|
+
const container = output;
|
|
25
|
+
const left = (container - width) / 2;
|
|
26
|
+
const originY = height - container / 2;
|
|
27
|
+
const step = 360 / bladeCount;
|
|
28
|
+
const blades = Array.from({
|
|
29
|
+
length: bladeCount
|
|
30
|
+
}, (_, i) => ({
|
|
31
|
+
angle: i * step,
|
|
32
|
+
delay: -((bladeCount - 1 - i) * (0.75 / bladeCount))
|
|
33
|
+
}));
|
|
34
|
+
return /*#__PURE__*/jsx("output", {
|
|
35
|
+
"aria-label": label,
|
|
36
|
+
"aria-live": "polite",
|
|
37
|
+
className: cn(spinner({
|
|
38
|
+
variant,
|
|
39
|
+
size
|
|
40
|
+
}), styles.spinner, className),
|
|
41
|
+
ref: ref,
|
|
42
|
+
style: {
|
|
43
|
+
width: `${container}px`,
|
|
44
|
+
height: `${container}px`,
|
|
45
|
+
..._style
|
|
46
|
+
},
|
|
47
|
+
...props,
|
|
48
|
+
children: blades.map(({
|
|
49
|
+
angle,
|
|
50
|
+
delay
|
|
51
|
+
}) => /*#__PURE__*/jsx("div", {
|
|
52
|
+
className: styles.blade,
|
|
53
|
+
style: {
|
|
54
|
+
left: `${left}px`,
|
|
55
|
+
width: `${width}px`,
|
|
56
|
+
height: `${height}px`,
|
|
57
|
+
borderRadius: `${radius}px`,
|
|
58
|
+
backgroundColor: "currentColor",
|
|
59
|
+
transformOrigin: `center ${originY}px`,
|
|
60
|
+
animationDelay: `${delay}s`,
|
|
61
|
+
transform: `rotate(${angle}deg)`
|
|
62
|
+
}
|
|
63
|
+
}, `blade-${angle}`))
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { Spinner };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
type QuantityStatus = "normal" | "sufficient" | "insufficient";
|
|
5
|
+
interface StockQuantityStatusProps extends ComponentProps<"div"> {
|
|
6
|
+
quantity: QuantityStatus;
|
|
7
|
+
}
|
|
8
|
+
/** Displays a stock quantity status indicator with icon and label. */
|
|
9
|
+
declare function StockQuantityStatus({ ref, className, style: _style, quantity, ...props }: StockQuantityStatusProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { StockQuantityStatus };
|
|
12
|
+
export type { QuantityStatus, StockQuantityStatusProps };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { stockQuantityStatus } from '../../ecosystem/codegen/generated/stock-quantity-status.mjs';
|
|
2
|
+
import { cn } from '../../cn.mjs';
|
|
3
|
+
import styles from './stock-quantity-status.module.css.mjs';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { spacing } from '../../token/spacing.mjs';
|
|
6
|
+
import { Typography } from '../typography/typography.mjs';
|
|
7
|
+
|
|
8
|
+
const DISPLAY_LABELS = {
|
|
9
|
+
normal: "보통",
|
|
10
|
+
sufficient: "여유",
|
|
11
|
+
insufficient: "부족"
|
|
12
|
+
};
|
|
13
|
+
const renderIndicator = quantity => {
|
|
14
|
+
if (quantity === "sufficient") {
|
|
15
|
+
return /*#__PURE__*/jsxs("svg", {
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
fill: "none",
|
|
18
|
+
height: "16",
|
|
19
|
+
viewBox: "0 0 16 16",
|
|
20
|
+
width: "16",
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
23
|
+
clipRule: "evenodd",
|
|
24
|
+
d: "M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",
|
|
25
|
+
fill: "#D9D9D9",
|
|
26
|
+
fillOpacity: "0.85098",
|
|
27
|
+
fillRule: "evenodd"
|
|
28
|
+
}), /*#__PURE__*/jsx("path", {
|
|
29
|
+
d: "M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",
|
|
30
|
+
fill: "#D9D9D9",
|
|
31
|
+
fillOpacity: "0.85098"
|
|
32
|
+
}), /*#__PURE__*/jsx("path", {
|
|
33
|
+
d: "M9.48047 6.10059H7.06543C5.98955 6.10059 5.11719 6.968 5.11719 8.03809C5.11741 9.10782 5.98893 9.97532 7.06445 9.97559H9.48047V13.0752H7.06445C4.35911 13.0749 2.14983 10.9652 2.00781 8.30957V7.76465C2.15041 5.10939 4.36025 3 7.06543 3H9.48047V6.10059ZM12.0518 6.10059C13.1276 6.10059 14 6.968 14 8.03809C13.9999 9.10806 13.1276 9.97559 12.0518 9.97559H9.48047V6.10059H12.0518Z",
|
|
34
|
+
fill: "currentColor"
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (quantity === "normal") {
|
|
39
|
+
return /*#__PURE__*/jsxs("svg", {
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
fill: "none",
|
|
42
|
+
height: "16",
|
|
43
|
+
viewBox: "0 0 16 16",
|
|
44
|
+
width: "16",
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
47
|
+
clipRule: "evenodd",
|
|
48
|
+
d: "M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",
|
|
49
|
+
fill: "#D9D9D9",
|
|
50
|
+
fillOpacity: "0.85098",
|
|
51
|
+
fillRule: "evenodd"
|
|
52
|
+
}), /*#__PURE__*/jsx("path", {
|
|
53
|
+
d: "M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",
|
|
54
|
+
fill: "#D9D9D9",
|
|
55
|
+
fillOpacity: "0.85098"
|
|
56
|
+
}), /*#__PURE__*/jsx("path", {
|
|
57
|
+
d: "M9.48145 6.0752V6.10059H7.06641C5.99053 6.10059 5.11817 6.968 5.11816 8.03809C5.11839 9.10782 5.98991 9.97532 7.06543 9.97559H9.48145V13.0752H7.06543C4.35577 13.0749 2.14345 10.9585 2.00781 8.29688V7.77832C2.03849 7.17662 2.17568 6.60303 2.40039 6.0752H9.48145ZM12.0527 6.10059C13.1286 6.10059 14.001 6.968 14.001 8.03809C14.0008 9.10806 13.1285 9.97559 12.0527 9.97559H9.48145V6.10059H12.0527Z",
|
|
58
|
+
fill: "currentColor"
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return /*#__PURE__*/jsxs("svg", {
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
fill: "none",
|
|
65
|
+
height: "16",
|
|
66
|
+
viewBox: "0 0 16 16",
|
|
67
|
+
width: "16",
|
|
68
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
70
|
+
clipRule: "evenodd",
|
|
71
|
+
d: "M7.06494 13.0754C4.26764 13.0754 1.99999 10.8199 2 8.03765C2.00001 5.25543 4.26766 3 7.06494 3L9.48051 3V6.10011L7.06494 6.10011C5.98906 6.10011 5.11689 6.96758 5.11689 8.03767C5.11688 9.10776 5.98906 9.97524 7.06494 9.97524L9.48051 9.97524V13.0754H7.06494Z",
|
|
72
|
+
fill: "#D9D9D9",
|
|
73
|
+
fillOpacity: "0.85098",
|
|
74
|
+
fillRule: "evenodd"
|
|
75
|
+
}), /*#__PURE__*/jsx("path", {
|
|
76
|
+
d: "M9.48051 9.97524L9.48051 6.10011L12.0519 6.10026C13.1278 6.10026 14 6.96774 14 8.03783C14 9.10792 13.1278 9.9754 12.0519 9.9754L9.48051 9.97524Z",
|
|
77
|
+
fill: "#D9D9D9",
|
|
78
|
+
fillOpacity: "0.85098"
|
|
79
|
+
}), /*#__PURE__*/jsx("path", {
|
|
80
|
+
d: "M7.04688 9.97461C7.05273 9.97466 7.05859 9.97558 7.06445 9.97559H9.48047V13.0752H7.06445C4.95754 13.075 3.15182 11.7952 2.38867 9.97461H7.04688ZM12.0713 9.97461C12.0648 9.97467 12.0582 9.97559 12.0518 9.97559H9.48047V9.97461H12.0713Z",
|
|
81
|
+
fill: "currentColor"
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
/** Displays a stock quantity status indicator with icon and label. */
|
|
86
|
+
function StockQuantityStatus({
|
|
87
|
+
ref,
|
|
88
|
+
className,
|
|
89
|
+
style: _style,
|
|
90
|
+
quantity,
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
const style = {
|
|
94
|
+
..._style,
|
|
95
|
+
"--cocso-stock-quantity-status-indicator-width": spacing.s9
|
|
96
|
+
};
|
|
97
|
+
return /*#__PURE__*/jsxs("div", {
|
|
98
|
+
className: cn(stockQuantityStatus({
|
|
99
|
+
quantity
|
|
100
|
+
}), styles.stock, className),
|
|
101
|
+
ref: ref,
|
|
102
|
+
style: style,
|
|
103
|
+
...props,
|
|
104
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
105
|
+
className: styles.indicator,
|
|
106
|
+
children: renderIndicator(quantity)
|
|
107
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
108
|
+
color: "currentColor",
|
|
109
|
+
size: "small",
|
|
110
|
+
type: "body",
|
|
111
|
+
children: DISPLAY_LABELS[quantity]
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { StockQuantityStatus };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
4
|
+
|
|
5
|
+
type SwitchSize = "large" | "medium" | "small";
|
|
6
|
+
type SwitchVariant = "primary" | "success" | "error" | "warning" | "info";
|
|
7
|
+
interface SwitchProps extends ComponentProps<typeof Switch$1.Root> {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
position?: "left" | "right";
|
|
12
|
+
size?: SwitchSize;
|
|
13
|
+
variant?: SwitchVariant;
|
|
14
|
+
}
|
|
15
|
+
/** Toggle switch component with optional label and size options. */
|
|
16
|
+
declare function Switch({ ref, id: _id, className, style: _style, size, variant, position, disabled, checked, label, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Switch };
|
|
19
|
+
export type { SwitchProps, SwitchSize, SwitchVariant };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { switchStyles } from '../../ecosystem/codegen/generated/switch.mjs';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { cn } from '../../cn.mjs';
|
|
5
|
+
import styles from './switch.module.css.mjs';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
import { colors } from '../../token/color.mjs';
|
|
8
|
+
import { Typography } from '../typography/typography.mjs';
|
|
9
|
+
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
10
|
+
|
|
11
|
+
const UNCHECKED_BG = colors.neutral100;
|
|
12
|
+
/** Toggle switch component with optional label and size options. */
|
|
13
|
+
function Switch({
|
|
14
|
+
ref,
|
|
15
|
+
id: _id,
|
|
16
|
+
className,
|
|
17
|
+
style: _style,
|
|
18
|
+
size = "medium",
|
|
19
|
+
variant = "primary",
|
|
20
|
+
position = "right",
|
|
21
|
+
disabled,
|
|
22
|
+
checked,
|
|
23
|
+
label,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const generatedId = useId();
|
|
27
|
+
const id = _id ?? generatedId;
|
|
28
|
+
const switchStylesName = switchStyles({
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
checked: String(!!checked)
|
|
32
|
+
});
|
|
33
|
+
const style = {
|
|
34
|
+
..._style,
|
|
35
|
+
"--cocso-switch-bg-color": UNCHECKED_BG
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/jsxs("div", {
|
|
38
|
+
className: cn(switchStylesName, styles.wrapper, className),
|
|
39
|
+
"data-disabled": disabled || undefined,
|
|
40
|
+
style: style,
|
|
41
|
+
children: [position === "left" && label && /*#__PURE__*/jsx(Typography, {
|
|
42
|
+
"aria-disabled": disabled,
|
|
43
|
+
render: /*#__PURE__*/jsx("label", {
|
|
44
|
+
htmlFor: id,
|
|
45
|
+
children: label
|
|
46
|
+
}),
|
|
47
|
+
size: size,
|
|
48
|
+
type: "body"
|
|
49
|
+
}), /*#__PURE__*/jsx(Switch$1.Root, {
|
|
50
|
+
checked: checked,
|
|
51
|
+
className: styles.switch,
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
id: id,
|
|
54
|
+
ref: ref,
|
|
55
|
+
...props,
|
|
56
|
+
children: /*#__PURE__*/jsx(Switch$1.Thumb, {
|
|
57
|
+
className: styles.thumb
|
|
58
|
+
})
|
|
59
|
+
}), position === "right" && label && /*#__PURE__*/jsx(Typography, {
|
|
60
|
+
"aria-disabled": disabled,
|
|
61
|
+
render: /*#__PURE__*/jsx("label", {
|
|
62
|
+
htmlFor: id,
|
|
63
|
+
children: label
|
|
64
|
+
}),
|
|
65
|
+
size: size,
|
|
66
|
+
type: "body"
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { Switch };
|