@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,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useId, useContext, createContext } from 'react';
|
|
3
|
+
import styles from './field.module.css.mjs';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const FieldContext = /*#__PURE__*/createContext({});
|
|
7
|
+
const useField = () => useContext(FieldContext);
|
|
8
|
+
function Field({
|
|
9
|
+
children,
|
|
10
|
+
label,
|
|
11
|
+
htmlFor,
|
|
12
|
+
required,
|
|
13
|
+
optionalLabel,
|
|
14
|
+
error,
|
|
15
|
+
description
|
|
16
|
+
}) {
|
|
17
|
+
const descriptionId = useId();
|
|
18
|
+
const errorId = useId();
|
|
19
|
+
return /*#__PURE__*/jsx(FieldContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
descriptionId: !error && description ? descriptionId : undefined,
|
|
22
|
+
errorId: error ? errorId : undefined
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
25
|
+
className: styles.root,
|
|
26
|
+
children: [/*#__PURE__*/jsxs("label", {
|
|
27
|
+
className: styles.label,
|
|
28
|
+
htmlFor: htmlFor,
|
|
29
|
+
children: [label, required === false && /*#__PURE__*/jsx("span", {
|
|
30
|
+
className: styles.optional,
|
|
31
|
+
children: optionalLabel ?? "(Optional)"
|
|
32
|
+
})]
|
|
33
|
+
}), children, error && /*#__PURE__*/jsx("p", {
|
|
34
|
+
className: styles.errorMessage,
|
|
35
|
+
id: errorId,
|
|
36
|
+
children: error
|
|
37
|
+
}), !error && description && /*#__PURE__*/jsx("p", {
|
|
38
|
+
className: styles.description,
|
|
39
|
+
id: descriptionId,
|
|
40
|
+
children: description
|
|
41
|
+
})]
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { Field, useField };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
type InputSize = "large" | "medium" | "small" | "x-small";
|
|
5
|
+
interface InputProps extends Omit<ComponentProps<"input">, "size"> {
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
error?: boolean | string;
|
|
9
|
+
label?: string;
|
|
10
|
+
size?: InputSize;
|
|
11
|
+
stretch?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Text input component with size and variant options. */
|
|
14
|
+
declare function Input({ ref, className, style: _style, size, disabled, error, stretch, label, description, id: _id, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Input };
|
|
17
|
+
export type { InputProps, InputSize };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { input } from '../../ecosystem/codegen/generated/input.mjs';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { cn } from '../../cn.mjs';
|
|
5
|
+
import styles from './input.module.css.mjs';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
import { Field, useField } from '../field/field.mjs';
|
|
8
|
+
|
|
9
|
+
/** Text input component with size and variant options. */
|
|
10
|
+
function Input({
|
|
11
|
+
ref,
|
|
12
|
+
className,
|
|
13
|
+
style: _style,
|
|
14
|
+
size = "medium",
|
|
15
|
+
disabled = false,
|
|
16
|
+
error = false,
|
|
17
|
+
stretch = false,
|
|
18
|
+
label,
|
|
19
|
+
description,
|
|
20
|
+
id: _id,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
const generatedId = useId();
|
|
24
|
+
const id = _id ?? generatedId;
|
|
25
|
+
const hasError = !!error;
|
|
26
|
+
const errorMessage = typeof error === "string" ? error : undefined;
|
|
27
|
+
const style = {
|
|
28
|
+
..._style
|
|
29
|
+
};
|
|
30
|
+
const inputEl = /*#__PURE__*/jsx(FieldAwareInput, {
|
|
31
|
+
"aria-invalid": hasError || undefined,
|
|
32
|
+
className: cn(input({
|
|
33
|
+
size
|
|
34
|
+
}), styles.input, stretch && styles.stretch, hasError && styles.error, className),
|
|
35
|
+
"data-cocso-component": "input",
|
|
36
|
+
disabled: disabled,
|
|
37
|
+
id: id,
|
|
38
|
+
ref: ref,
|
|
39
|
+
style: style,
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
if (label) {
|
|
43
|
+
return /*#__PURE__*/jsx(Field, {
|
|
44
|
+
description: description,
|
|
45
|
+
error: errorMessage,
|
|
46
|
+
htmlFor: id,
|
|
47
|
+
label: label,
|
|
48
|
+
required: props.required,
|
|
49
|
+
children: inputEl
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return inputEl;
|
|
53
|
+
}
|
|
54
|
+
function FieldAwareInput({
|
|
55
|
+
"aria-describedby": callerDescribedBy,
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
const field = useField();
|
|
59
|
+
const fieldDescribedBy = field.errorId ?? field.descriptionId;
|
|
60
|
+
const describedBy = [fieldDescribedBy, callerDescribedBy].filter(Boolean).join(" ") || undefined;
|
|
61
|
+
return /*#__PURE__*/jsx("input", {
|
|
62
|
+
"aria-describedby": describedBy,
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { Input };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import { InputSize } from '../input/input.mjs';
|
|
4
|
+
|
|
5
|
+
interface InputTriggerProps extends Omit<ComponentProps<"button">, "prefix"> {
|
|
6
|
+
error?: boolean | string;
|
|
7
|
+
/** Shown in a muted style when no `children` value is present. */
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** Leading content (e.g. an icon) rendered before the value. */
|
|
10
|
+
prefix?: ReactNode;
|
|
11
|
+
size?: InputSize;
|
|
12
|
+
stretch?: boolean;
|
|
13
|
+
/** Trailing content (e.g. a calendar or chevron icon). */
|
|
14
|
+
suffix?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A native `<button>` styled to look like an `Input`. Use it as the trigger for
|
|
18
|
+
* `Dropdown`, `DayPicker`, `MonthPicker`, etc. — being a real button, it never
|
|
19
|
+
* triggers Base UI's `nativeButton` warning, while still presenting an
|
|
20
|
+
* input-like surface (value/placeholder + optional affix icons).
|
|
21
|
+
*/
|
|
22
|
+
declare function InputTrigger({ ref, className, size, error, stretch, disabled, prefix, suffix, placeholder, children, ...props }: InputTriggerProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { InputTrigger };
|
|
25
|
+
export type { InputTriggerProps };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { input } from '../../ecosystem/codegen/generated/input.mjs';
|
|
3
|
+
import { cn } from '../../cn.mjs';
|
|
4
|
+
import styles from './input-trigger.module.css.mjs';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A native `<button>` styled to look like an `Input`. Use it as the trigger for
|
|
9
|
+
* `Dropdown`, `DayPicker`, `MonthPicker`, etc. — being a real button, it never
|
|
10
|
+
* triggers Base UI's `nativeButton` warning, while still presenting an
|
|
11
|
+
* input-like surface (value/placeholder + optional affix icons).
|
|
12
|
+
*/
|
|
13
|
+
function InputTrigger({
|
|
14
|
+
ref,
|
|
15
|
+
className,
|
|
16
|
+
size = "medium",
|
|
17
|
+
error = false,
|
|
18
|
+
stretch = false,
|
|
19
|
+
disabled = false,
|
|
20
|
+
prefix,
|
|
21
|
+
suffix,
|
|
22
|
+
placeholder,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const hasError = !!error;
|
|
27
|
+
const hasValue = children != null && children !== "";
|
|
28
|
+
return /*#__PURE__*/jsxs("button", {
|
|
29
|
+
"aria-invalid": hasError || undefined,
|
|
30
|
+
className: cn(input({
|
|
31
|
+
size
|
|
32
|
+
}), styles.trigger, stretch && styles.stretch, hasError && styles.error, className),
|
|
33
|
+
"data-cocso-component": "input-trigger",
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
ref: ref,
|
|
36
|
+
type: "button",
|
|
37
|
+
...props,
|
|
38
|
+
children: [prefix && /*#__PURE__*/jsx("span", {
|
|
39
|
+
className: styles.affix,
|
|
40
|
+
children: prefix
|
|
41
|
+
}), /*#__PURE__*/jsx("span", {
|
|
42
|
+
className: cn(styles.value, !hasValue && styles.placeholder),
|
|
43
|
+
children: hasValue ? children : placeholder
|
|
44
|
+
}), suffix && /*#__PURE__*/jsx("span", {
|
|
45
|
+
className: styles.affix,
|
|
46
|
+
children: suffix
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { InputTrigger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"trigger":"input-trigger-module_trigger__FepZ1","stretch":"input-trigger-module_stretch__iRyO-","error":"input-trigger-module_error__qttrx","value":"input-trigger-module_value__3RNV4","placeholder":"input-trigger-module_placeholder__-9y7a","affix":"input-trigger-module_affix__IJsDY"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ExternalLinkIcon } from '@cocso-ui/react-icons';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { RenderProp } from '../../primitives/use-render.mjs';
|
|
5
|
+
import { LineHeight, FontWeight } from '../../token/typography.mjs';
|
|
6
|
+
import { TypographyProps } from '../typography/typography.mjs';
|
|
7
|
+
|
|
8
|
+
type LinkSize = "large" | "medium" | "small" | "x-small";
|
|
9
|
+
type LinkVariant = "inline" | "current" | "plain";
|
|
10
|
+
interface LinkProps extends ComponentProps<"a"> {
|
|
11
|
+
indicator?: boolean;
|
|
12
|
+
lineHeight?: LineHeight;
|
|
13
|
+
render?: RenderProp;
|
|
14
|
+
size?: TypographyProps["size"];
|
|
15
|
+
type?: TypographyProps["type"];
|
|
16
|
+
variant?: LinkVariant;
|
|
17
|
+
weight?: FontWeight;
|
|
18
|
+
}
|
|
19
|
+
declare function LinkComponent({ ref, render: renderProp, className, style: _style, size, type, weight, lineHeight, variant, indicator, ...props }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function ExternalIcon({ className, ...props }: ComponentProps<typeof ExternalLinkIcon>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
/** Styled anchor/link component with inline, current, and plain variants. */
|
|
22
|
+
declare const Link: typeof LinkComponent & {
|
|
23
|
+
displayName: "Link";
|
|
24
|
+
ExternalIcon: typeof ExternalIcon;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { Link };
|
|
28
|
+
export type { LinkProps, LinkSize, LinkVariant };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { link } from '../../ecosystem/codegen/generated/link.mjs';
|
|
2
|
+
import { ExternalLinkIcon } from '@cocso-ui/react-icons';
|
|
3
|
+
import { cn } from '../../cn.mjs';
|
|
4
|
+
import styles from './link.module.css.mjs';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { Typography } from '../typography/typography.mjs';
|
|
7
|
+
|
|
8
|
+
function LinkComponent({
|
|
9
|
+
ref,
|
|
10
|
+
render: renderProp,
|
|
11
|
+
className,
|
|
12
|
+
style: _style,
|
|
13
|
+
size,
|
|
14
|
+
type = "body",
|
|
15
|
+
weight,
|
|
16
|
+
lineHeight,
|
|
17
|
+
variant = "inline",
|
|
18
|
+
indicator,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const showIndicator = indicator ?? variant !== "plain";
|
|
22
|
+
const style = {
|
|
23
|
+
..._style
|
|
24
|
+
};
|
|
25
|
+
const mergedClassName = cn(link({
|
|
26
|
+
variant
|
|
27
|
+
}), styles.link, variant === "current" && styles.current, showIndicator && styles.indicator, className);
|
|
28
|
+
const typographyProps = {
|
|
29
|
+
className: mergedClassName,
|
|
30
|
+
lineHeight,
|
|
31
|
+
ref,
|
|
32
|
+
render: renderProp ?? (renderProps => /*#__PURE__*/jsx("a", {
|
|
33
|
+
...renderProps
|
|
34
|
+
})),
|
|
35
|
+
size,
|
|
36
|
+
style,
|
|
37
|
+
type,
|
|
38
|
+
weight,
|
|
39
|
+
...props
|
|
40
|
+
};
|
|
41
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
42
|
+
...typographyProps
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function ExternalIcon({
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}) {
|
|
49
|
+
return /*#__PURE__*/jsx(ExternalLinkIcon, {
|
|
50
|
+
className: cn(styles.externalIcon, className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Styled anchor/link component with inline, current, and plain variants. */
|
|
56
|
+
const Link = Object.assign(LinkComponent, {
|
|
57
|
+
displayName: "Link",
|
|
58
|
+
ExternalIcon
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { Link };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Locale } from 'date-fns';
|
|
3
|
+
import { ComponentProps, ReactElement } from 'react';
|
|
4
|
+
|
|
5
|
+
interface MonthPickerProps extends Omit<ComponentProps<"div">, "children"> {
|
|
6
|
+
dateFormat?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
locale?: Locale;
|
|
9
|
+
maxDate?: Date;
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
onValueChange?: (value: Date | null) => void;
|
|
12
|
+
trigger?: ReactElement;
|
|
13
|
+
value?: Date;
|
|
14
|
+
}
|
|
15
|
+
declare function MonthPicker({ ref, className, value, onValueChange, trigger, locale, dateFormat, minDate, maxDate, disabled, ...props }: MonthPickerProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { MonthPicker };
|
|
18
|
+
export type { MonthPickerProps };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ArrowIOSBackwardIcon, ArrowIOSForwardIcon } from '@cocso-ui/react-icons';
|
|
3
|
+
import { format } from 'date-fns';
|
|
4
|
+
import { ko } from 'date-fns/locale';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import DatePicker from 'react-datepicker';
|
|
7
|
+
import { cn } from '../../cn.mjs';
|
|
8
|
+
import styles from './month-picker.module.css.mjs';
|
|
9
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
+
import { Dropdown } from '../dropdown/dropdown.mjs';
|
|
11
|
+
import { Button } from '../button/button.mjs';
|
|
12
|
+
import { Typography } from '../typography/typography.mjs';
|
|
13
|
+
|
|
14
|
+
function MonthPicker({
|
|
15
|
+
ref,
|
|
16
|
+
className,
|
|
17
|
+
value,
|
|
18
|
+
onValueChange,
|
|
19
|
+
trigger,
|
|
20
|
+
locale = ko,
|
|
21
|
+
dateFormat = "yyyy년 MM월",
|
|
22
|
+
minDate,
|
|
23
|
+
maxDate,
|
|
24
|
+
disabled,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const [open, setOpen] = useState(false);
|
|
28
|
+
const handleChange = date => {
|
|
29
|
+
onValueChange?.(date);
|
|
30
|
+
setOpen(false);
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/jsx("div", {
|
|
33
|
+
className: cn(styles.root, className),
|
|
34
|
+
ref: ref,
|
|
35
|
+
...props,
|
|
36
|
+
children: /*#__PURE__*/jsxs(Dropdown, {
|
|
37
|
+
onOpenChange: setOpen,
|
|
38
|
+
open: open,
|
|
39
|
+
children: [/*#__PURE__*/jsx(Dropdown.Trigger, {
|
|
40
|
+
render: trigger ?? /*#__PURE__*/jsx(Button, {
|
|
41
|
+
disabled: disabled,
|
|
42
|
+
size: "small",
|
|
43
|
+
variant: "outline",
|
|
44
|
+
children: value ? format(value, dateFormat, {
|
|
45
|
+
locale
|
|
46
|
+
}) : "Select month"
|
|
47
|
+
})
|
|
48
|
+
}), /*#__PURE__*/jsx(Dropdown.Content, {
|
|
49
|
+
"aria-label": "Select month",
|
|
50
|
+
className: styles.content,
|
|
51
|
+
children: /*#__PURE__*/jsx(DatePicker, {
|
|
52
|
+
dateFormat: dateFormat,
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
inline: true,
|
|
55
|
+
locale: locale,
|
|
56
|
+
maxDate: maxDate,
|
|
57
|
+
minDate: minDate,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
renderCustomHeader: ({
|
|
60
|
+
date,
|
|
61
|
+
decreaseYear,
|
|
62
|
+
increaseYear,
|
|
63
|
+
prevYearButtonDisabled,
|
|
64
|
+
nextYearButtonDisabled
|
|
65
|
+
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
66
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
67
|
+
size: "small",
|
|
68
|
+
type: "body",
|
|
69
|
+
weight: "semibold",
|
|
70
|
+
children: date.toLocaleDateString(locale.code ?? "ko-KR", {
|
|
71
|
+
year: "numeric"
|
|
72
|
+
})
|
|
73
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
74
|
+
className: styles.menu,
|
|
75
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
76
|
+
className: styles.arrow,
|
|
77
|
+
disabled: prevYearButtonDisabled,
|
|
78
|
+
onClick: decreaseYear,
|
|
79
|
+
size: "x-small",
|
|
80
|
+
svgOnly: true,
|
|
81
|
+
type: "button",
|
|
82
|
+
variant: "outline",
|
|
83
|
+
children: /*#__PURE__*/jsx(ArrowIOSBackwardIcon, {})
|
|
84
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
85
|
+
className: styles.arrow,
|
|
86
|
+
disabled: nextYearButtonDisabled,
|
|
87
|
+
onClick: increaseYear,
|
|
88
|
+
size: "x-small",
|
|
89
|
+
svgOnly: true,
|
|
90
|
+
type: "button",
|
|
91
|
+
variant: "outline",
|
|
92
|
+
children: /*#__PURE__*/jsx(ArrowIOSForwardIcon, {})
|
|
93
|
+
})]
|
|
94
|
+
})]
|
|
95
|
+
}),
|
|
96
|
+
selected: value,
|
|
97
|
+
showFourColumnMonthYearPicker: true,
|
|
98
|
+
showMonthYearPicker: true,
|
|
99
|
+
showPopperArrow: false
|
|
100
|
+
})
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { MonthPicker };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { OTPInput } from 'input-otp';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
|
|
5
|
+
interface OneTimePasswordFieldProps extends Omit<ComponentProps<typeof OTPInput>, "onChange" | "render" | "children"> {
|
|
6
|
+
className?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
slotClassName?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function OneTimePasswordField({ className, slotClassName, onValueChange, ref, ...props }: OneTimePasswordFieldProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { OneTimePasswordField };
|
|
13
|
+
export type { OneTimePasswordFieldProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OTPInput } from 'input-otp';
|
|
2
|
+
import { cn } from '../../cn.mjs';
|
|
3
|
+
import styles from './one-time-password-field.module.css.mjs';
|
|
4
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const Slot = ({
|
|
7
|
+
char,
|
|
8
|
+
className,
|
|
9
|
+
hasFakeCaret,
|
|
10
|
+
isActive,
|
|
11
|
+
placeholderChar
|
|
12
|
+
}) => /*#__PURE__*/jsxs("div", {
|
|
13
|
+
className: cn(styles.slot, isActive && styles.slotActive, className),
|
|
14
|
+
"data-active": isActive || undefined,
|
|
15
|
+
children: [char ?? placeholderChar, hasFakeCaret && /*#__PURE__*/jsx("div", {
|
|
16
|
+
className: styles.caret
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
function OneTimePasswordField({
|
|
20
|
+
className,
|
|
21
|
+
slotClassName,
|
|
22
|
+
onValueChange,
|
|
23
|
+
ref,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /*#__PURE__*/jsx(OTPInput, {
|
|
27
|
+
containerClassName: cn(styles.otp, className),
|
|
28
|
+
onChange: onValueChange,
|
|
29
|
+
ref: ref,
|
|
30
|
+
render: ({
|
|
31
|
+
slots
|
|
32
|
+
}) => /*#__PURE__*/jsx(Fragment, {
|
|
33
|
+
children: [...slots.entries()].map(([i, slot]) => /*#__PURE__*/jsx(Slot, {
|
|
34
|
+
...slot,
|
|
35
|
+
className: slotClassName
|
|
36
|
+
}, `otp-slot-${i}`))
|
|
37
|
+
}),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { OneTimePasswordField };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
interface PaginationLabels {
|
|
5
|
+
navigation?: string;
|
|
6
|
+
next?: string;
|
|
7
|
+
page?: (n: number) => string;
|
|
8
|
+
previous?: string;
|
|
9
|
+
}
|
|
10
|
+
type PaginationLocale = "en" | "ko";
|
|
11
|
+
interface PaginationProps extends Omit<ComponentProps<"nav">, "onChange"> {
|
|
12
|
+
labels?: PaginationLabels;
|
|
13
|
+
locale?: PaginationLocale;
|
|
14
|
+
maxVisible?: number;
|
|
15
|
+
onChange: (pageNumber: number) => void;
|
|
16
|
+
page: number;
|
|
17
|
+
totalPages: number;
|
|
18
|
+
}
|
|
19
|
+
/** Page navigation component with previous/next controls and truncated page range. */
|
|
20
|
+
declare function Pagination({ ref, className, page, totalPages, maxVisible, onChange, labels, locale, ...props }: PaginationProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Pagination };
|
|
23
|
+
export type { PaginationLabels, PaginationLocale, PaginationProps };
|
|
@@ -1,54 +1,85 @@
|
|
|
1
1
|
import { ArrowIOSBackwardIcon, MoreHorizIcon, ArrowIOSForwardIcon } from '@cocso-ui/react-icons';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import styles from './Pagination.module.css.mjs';
|
|
2
|
+
import { cn } from '../../cn.mjs';
|
|
3
|
+
import styles from './pagination.module.css.mjs';
|
|
5
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
const LOCALE_LABELS = {
|
|
7
|
+
en: {
|
|
8
|
+
navigation: "Page navigation",
|
|
9
|
+
previous: "Previous page",
|
|
10
|
+
next: "Next page",
|
|
11
|
+
page: n => `Page ${n}`
|
|
12
|
+
},
|
|
13
|
+
ko: {
|
|
14
|
+
navigation: "페이지 탐색",
|
|
15
|
+
previous: "이전 페이지",
|
|
16
|
+
next: "다음 페이지",
|
|
17
|
+
page: n => `${n} 페이지`
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/** Page navigation component with previous/next controls and truncated page range. */
|
|
21
|
+
function Pagination({
|
|
22
|
+
ref,
|
|
8
23
|
className,
|
|
9
24
|
page,
|
|
10
25
|
totalPages,
|
|
11
26
|
maxVisible = 5,
|
|
12
27
|
onChange,
|
|
28
|
+
labels,
|
|
29
|
+
locale = "en",
|
|
13
30
|
...props
|
|
14
|
-
}
|
|
31
|
+
}) {
|
|
15
32
|
const halfVisible = Math.ceil(maxVisible / 2);
|
|
33
|
+
const defaults = LOCALE_LABELS[locale];
|
|
34
|
+
const navigationLabel = labels?.navigation ?? defaults.navigation;
|
|
35
|
+
const previousLabel = labels?.previous ?? defaults.previous;
|
|
36
|
+
const nextLabel = labels?.next ?? defaults.next;
|
|
37
|
+
const pageLabel = labels?.page ?? defaults.page;
|
|
16
38
|
const renderPageButton = pageNumber => /*#__PURE__*/jsx("button", {
|
|
17
|
-
|
|
39
|
+
"aria-current": page === pageNumber ? "page" : undefined,
|
|
40
|
+
"aria-label": pageLabel(pageNumber),
|
|
18
41
|
className: styles.item,
|
|
19
|
-
onClick: () => onChange(pageNumber),
|
|
20
42
|
"data-active": page === pageNumber,
|
|
43
|
+
onClick: () => onChange(pageNumber),
|
|
44
|
+
type: "button",
|
|
21
45
|
children: pageNumber
|
|
22
46
|
}, pageNumber);
|
|
23
|
-
return /*#__PURE__*/jsxs("
|
|
47
|
+
return /*#__PURE__*/jsxs("nav", {
|
|
48
|
+
"aria-label": navigationLabel,
|
|
49
|
+
className: cn(styles.pagination, className),
|
|
24
50
|
ref: ref,
|
|
25
|
-
className: clsx(styles.pagination, className),
|
|
26
51
|
...props,
|
|
27
52
|
children: [totalPages > 1 && /*#__PURE__*/jsx("button", {
|
|
53
|
+
"aria-label": previousLabel,
|
|
28
54
|
className: styles.arrow,
|
|
29
|
-
type: "button",
|
|
30
55
|
disabled: page === 1,
|
|
31
56
|
onClick: () => page > 1 && onChange(page - 1),
|
|
57
|
+
type: "button",
|
|
32
58
|
children: /*#__PURE__*/jsx(ArrowIOSBackwardIcon, {})
|
|
33
|
-
}), totalPages <= maxVisible + 2 ? Array
|
|
59
|
+
}), totalPages <= maxVisible + 2 ? Array.from({
|
|
60
|
+
length: totalPages
|
|
61
|
+
}, (_, index) => renderPageButton(index + 1)) : /*#__PURE__*/jsxs(Fragment, {
|
|
34
62
|
children: [renderPageButton(1), page > 1 + halfVisible && /*#__PURE__*/jsx("span", {
|
|
35
63
|
className: styles.trunc,
|
|
36
64
|
children: /*#__PURE__*/jsx(MoreHorizIcon, {})
|
|
37
|
-
}), Array
|
|
65
|
+
}), Array.from({
|
|
66
|
+
length: maxVisible
|
|
67
|
+
}, (_, index) => {
|
|
38
68
|
const pageNumber = page - halfVisible + index + 1;
|
|
39
|
-
return pageNumber > 1 && pageNumber < totalPages ? renderPageButton(pageNumber) :
|
|
69
|
+
return pageNumber > 1 && pageNumber < totalPages ? renderPageButton(pageNumber) : null;
|
|
40
70
|
}), page < totalPages - halfVisible && /*#__PURE__*/jsx("span", {
|
|
41
71
|
className: styles.trunc,
|
|
42
72
|
children: /*#__PURE__*/jsx(MoreHorizIcon, {})
|
|
43
73
|
}), renderPageButton(totalPages)]
|
|
44
74
|
}), totalPages > 1 && /*#__PURE__*/jsx("button", {
|
|
75
|
+
"aria-label": nextLabel,
|
|
45
76
|
className: styles.arrow,
|
|
46
|
-
type: "button",
|
|
47
77
|
disabled: page === totalPages,
|
|
48
78
|
onClick: () => page < totalPages && onChange(page + 1),
|
|
79
|
+
type: "button",
|
|
49
80
|
children: /*#__PURE__*/jsx(ArrowIOSForwardIcon, {})
|
|
50
81
|
})]
|
|
51
82
|
});
|
|
52
|
-
}
|
|
83
|
+
}
|
|
53
84
|
|
|
54
85
|
export { Pagination };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
4
|
+
|
|
5
|
+
declare function PopoverArrow({ className, ...props }: ComponentProps<typeof Popover$1.Arrow>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function PopoverContent({ className, side, sideOffset, align, alignOffset, arrowPadding, ...props }: ComponentProps<typeof Popover$1.Popup> & Pick<ComponentProps<typeof Popover$1.Positioner>, "side" | "sideOffset" | "align" | "alignOffset" | "arrowPadding">): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare const Popover: typeof Popover$1.Root & {
|
|
8
|
+
displayName: "Popover";
|
|
9
|
+
Trigger: Popover$1.Trigger;
|
|
10
|
+
Content: typeof PopoverContent;
|
|
11
|
+
Arrow: typeof PopoverArrow;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { Popover };
|