@godxjp/ui 13.9.3 → 13.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/app-provider.d.ts +30 -0
- package/dist/app/app-provider.js +244 -0
- package/dist/app/date-format-labels.d.ts +8 -0
- package/dist/app/date-format-labels.js +16 -0
- package/dist/app/date-formats.d.ts +10 -0
- package/dist/app/date-formats.js +27 -0
- package/dist/app/index.d.ts +13 -136
- package/dist/app/index.js +65 -38
- package/dist/app/locales.d.ts +12 -0
- package/dist/app/locales.js +26 -0
- package/dist/app/request-headers.d.ts +7 -0
- package/dist/app/request-headers.js +27 -0
- package/dist/app/storage.d.ts +11 -0
- package/dist/app/storage.js +32 -0
- package/dist/app/time-format-labels.d.ts +8 -0
- package/dist/app/time-format-labels.js +14 -0
- package/dist/app/time-formats.d.ts +7 -0
- package/dist/app/time-formats.js +14 -0
- package/dist/app/timezones.d.ts +31 -0
- package/dist/app/timezones.js +161 -0
- package/dist/app/types.d.ts +21 -0
- package/dist/app/types.js +30 -0
- package/dist/app/use-formatting.d.ts +19 -0
- package/dist/app/use-formatting.js +37 -0
- package/dist/components/admin/index.d.ts +26 -66
- package/dist/components/admin/index.js +96 -49
- package/dist/components/data-display/accordion.d.ts +1 -0
- package/dist/components/data-display/accordion.js +7 -0
- package/dist/components/data-display/avatar.d.ts +1 -0
- package/dist/components/data-display/avatar.js +6 -0
- package/dist/components/data-display/badge.d.ts +9 -13
- package/dist/components/data-display/badge.js +111 -5
- package/dist/components/data-display/card.d.ts +22 -26
- package/dist/components/data-display/card.js +153 -2
- package/dist/components/data-display/carousel.d.ts +11 -13
- package/dist/components/data-display/carousel.js +220 -4
- package/dist/components/data-display/collapsible.d.ts +4 -0
- package/dist/components/data-display/collapsible.js +9 -0
- package/dist/components/data-display/data-table.d.ts +53 -0
- package/dist/{chunk-NVTZ2EDW.js → components/data-display/data-table.js} +28 -36
- package/dist/components/data-display/descriptions.d.ts +19 -0
- package/dist/components/data-display/descriptions.js +25 -0
- package/dist/components/data-display/empty-state.d.ts +3 -0
- package/dist/{chunk-YD7V2HGZ.js → components/data-display/empty-state.js} +5 -5
- package/dist/components/data-display/hover-card.d.ts +1 -0
- package/dist/components/data-display/hover-card.js +6 -0
- package/dist/components/data-display/index.d.ts +24 -79
- package/dist/components/data-display/index.js +95 -176
- package/dist/components/data-display/popover.d.ts +9 -13
- package/dist/components/data-display/popover.js +61 -2
- package/dist/components/data-display/progress.d.ts +7 -0
- package/dist/components/data-display/progress.js +27 -0
- package/dist/components/data-display/scroll-area.d.ts +4 -7
- package/dist/components/data-display/scroll-area.js +38 -2
- package/dist/components/data-display/table.d.ts +7 -10
- package/dist/components/data-display/table.js +36 -3
- package/dist/components/data-display/timeline.d.ts +12 -0
- package/dist/components/data-display/timeline.js +35 -0
- package/dist/components/data-display/tree-list.d.ts +13 -0
- package/dist/components/data-display/tree-list.js +30 -0
- package/dist/components/data-entry/calendar.d.ts +3 -19
- package/dist/components/data-entry/calendar.js +96 -6
- package/dist/components/data-entry/cascader.d.ts +4 -35
- package/dist/components/data-entry/cascader.js +327 -10
- package/dist/components/data-entry/checkbox-group.d.ts +3 -0
- package/dist/{chunk-BE6GJGKJ.js → components/data-entry/checkbox-group.js} +9 -26
- package/dist/components/data-entry/checkbox.d.ts +7 -16
- package/dist/components/data-entry/checkbox.js +26 -4
- package/dist/components/data-entry/choice-option.d.ts +10 -0
- package/dist/components/data-entry/choice-option.js +7 -0
- package/dist/components/data-entry/color-picker.d.ts +3 -19
- package/dist/components/data-entry/color-picker.js +75 -6
- package/dist/components/data-entry/command.d.ts +7 -10
- package/dist/components/data-entry/command.js +51 -3
- package/dist/components/data-entry/date-picker.d.ts +3 -19
- package/dist/components/data-entry/date-picker.js +153 -9
- package/dist/components/data-entry/date-range-picker.d.ts +3 -19
- package/dist/components/data-entry/date-range-picker.js +191 -8
- package/dist/components/data-entry/field.d.ts +4 -0
- package/dist/{chunk-44YRPSZ7.js → components/data-entry/field.js} +6 -11
- package/dist/components/data-entry/form-field.d.ts +3 -0
- package/dist/{chunk-LBYSX3VM.js → components/data-entry/form-field.js} +14 -47
- package/dist/components/data-entry/form.d.ts +29 -0
- package/dist/components/data-entry/form.js +41 -0
- package/dist/components/data-entry/index.d.ts +61 -164
- package/dist/components/data-entry/index.js +117 -37
- package/dist/components/data-entry/input-otp.d.ts +1 -0
- package/dist/components/data-entry/input-otp.js +7 -0
- package/dist/components/data-entry/input.d.ts +3 -6
- package/dist/components/data-entry/input.js +98 -4
- package/dist/components/data-entry/label.d.ts +4 -8
- package/dist/components/data-entry/label.js +25 -2
- package/dist/components/data-entry/month-picker.d.ts +9 -0
- package/dist/components/data-entry/month-picker.js +188 -0
- package/dist/components/data-entry/month-range-picker.d.ts +11 -0
- package/dist/components/data-entry/month-range-picker.js +245 -0
- package/dist/components/data-entry/number-input.d.ts +12 -0
- package/dist/components/data-entry/number-input.js +219 -0
- package/dist/components/data-entry/password-input.d.ts +2 -0
- package/dist/components/data-entry/password-input.js +4 -0
- package/dist/components/data-entry/password-strength.d.ts +20 -0
- package/dist/{chunk-VSUYVT2Q.js → components/data-entry/password-strength.js} +8 -62
- package/dist/components/data-entry/radio.d.ts +7 -20
- package/dist/components/data-entry/radio.js +93 -4
- package/dist/components/data-entry/rating.d.ts +2 -0
- package/dist/components/data-entry/rating.js +4 -0
- package/dist/components/data-entry/search-input.d.ts +18 -0
- package/dist/{chunk-LVLPNKJP.js → components/data-entry/search-input.js} +11 -11
- package/dist/components/data-entry/search-select.d.ts +11 -0
- package/dist/{chunk-6S2ZU26B.js → components/data-entry/search-select.js} +14 -239
- package/dist/components/data-entry/select.d.ts +14 -30
- package/dist/components/data-entry/select.js +243 -9
- package/dist/components/data-entry/slider.d.ts +4 -18
- package/dist/components/data-entry/slider.js +52 -2
- package/dist/components/data-entry/switch.d.ts +4 -18
- package/dist/components/data-entry/switch.js +40 -2
- package/dist/components/data-entry/tag-input.d.ts +2 -0
- package/dist/components/data-entry/tag-input.js +4 -0
- package/dist/components/data-entry/textarea.d.ts +3 -6
- package/dist/components/data-entry/textarea.js +86 -5
- package/dist/components/data-entry/time-input.d.ts +3 -6
- package/dist/components/data-entry/time-input.js +137 -3
- package/dist/components/data-entry/time-picker.d.ts +3 -19
- package/dist/components/data-entry/time-picker.js +329 -7
- package/dist/components/data-entry/toggle-group.d.ts +1 -0
- package/dist/components/data-entry/toggle-group.js +5 -0
- package/dist/components/data-entry/toggle.d.ts +2 -0
- package/dist/components/data-entry/toggle.js +4 -0
- package/dist/components/data-entry/transfer.d.ts +3 -20
- package/dist/components/data-entry/transfer.js +193 -13
- package/dist/components/data-entry/tree-select-strategy.d.ts +5 -0
- package/dist/components/data-entry/tree-select-strategy.js +8 -0
- package/dist/components/data-entry/tree-select.d.ts +5 -25
- package/dist/components/data-entry/tree-select.js +299 -13
- package/dist/components/data-entry/tree-utils.d.ts +48 -0
- package/dist/{chunk-SMLKNECP.js → components/data-entry/tree-utils.js} +33 -5
- package/dist/components/data-entry/upload-crop-dialog.d.ts +9 -0
- package/dist/components/data-entry/upload-crop-dialog.js +102 -0
- package/dist/components/data-entry/upload-types.d.ts +39 -0
- package/dist/components/data-entry/upload-types.js +41 -0
- package/dist/components/data-entry/upload.d.ts +6 -45
- package/dist/components/data-entry/upload.js +417 -12
- package/dist/components/data-entry/use-upload-draft.d.ts +25 -0
- package/dist/components/data-entry/use-upload-draft.js +64 -0
- package/dist/components/data-grid/data-grid.d.ts +67 -0
- package/dist/components/data-grid/data-grid.js +402 -0
- package/dist/components/data-grid/index.d.ts +2 -71
- package/dist/components/data-grid/index.js +3 -371
- package/dist/components/feedback/alert.d.ts +37 -42
- package/dist/components/feedback/alert.js +127 -7
- package/dist/components/feedback/dialog.d.ts +21 -25
- package/dist/components/feedback/dialog.js +356 -8
- package/dist/components/feedback/index.d.ts +10 -28
- package/dist/components/feedback/index.js +105 -18
- package/dist/components/feedback/overlay-header-tone.d.ts +7 -0
- package/dist/{chunk-VU4GFGDG.js → components/feedback/overlay-header-tone.js} +4 -4
- package/dist/components/feedback/sheet.d.ts +18 -23
- package/dist/components/feedback/sheet.js +192 -3
- package/dist/components/feedback/skeleton.d.ts +17 -0
- package/dist/{chunk-2BR7KFCP.js → components/feedback/skeleton.js} +10 -6
- package/dist/components/feedback/sonner.d.ts +2 -5
- package/dist/components/feedback/sonner.js +50 -1
- package/dist/components/feedback/tooltip.d.ts +10 -0
- package/dist/{chunk-32WO3YLB.js → components/feedback/tooltip.js} +12 -9
- package/dist/components/feedback/use-toast.d.ts +3 -0
- package/dist/components/feedback/use-toast.js +5 -0
- package/dist/components/general/button.d.ts +12 -18
- package/dist/components/general/button.js +118 -4
- package/dist/components/general/index.d.ts +4 -37
- package/dist/components/general/index.js +8 -48
- package/dist/components/general/typography.d.ts +30 -0
- package/dist/components/general/typography.js +46 -0
- package/dist/components/layout/app-shell.d.ts +3 -0
- package/dist/components/layout/app-shell.js +33 -0
- package/dist/components/layout/aspect-ratio.d.ts +1 -0
- package/dist/components/layout/aspect-ratio.js +4 -0
- package/dist/components/layout/breadcrumb.d.ts +7 -0
- package/dist/components/layout/breadcrumb.js +16 -0
- package/dist/components/layout/flex.d.ts +3 -0
- package/dist/components/layout/flex.js +29 -0
- package/dist/components/layout/index.d.ts +19 -60
- package/dist/components/layout/index.js +29 -12
- package/dist/components/layout/page-container.d.ts +8 -0
- package/dist/components/layout/page-container.js +77 -0
- package/dist/components/layout/resizable.d.ts +8 -12
- package/dist/components/layout/resizable.js +44 -2
- package/dist/components/layout/responsive-grid.d.ts +7 -0
- package/dist/{chunk-C3PKEV6S.js → components/layout/responsive-grid.js} +4 -5
- package/dist/components/layout/separator.d.ts +1 -0
- package/dist/components/layout/separator.js +4 -0
- package/dist/components/layout/sidebar.d.ts +21 -0
- package/dist/components/layout/sidebar.js +254 -0
- package/dist/components/layout/split-pane.d.ts +7 -0
- package/dist/components/layout/split-pane.js +10 -0
- package/dist/components/layout/topbar.d.ts +3 -0
- package/dist/components/layout/topbar.js +133 -0
- package/dist/components/navigation/app-setting-picker.d.ts +9 -0
- package/dist/{chunk-RHPFCKB2.js → components/navigation/app-setting-picker.js} +24 -49
- package/dist/components/navigation/context-menu.d.ts +16 -20
- package/dist/components/navigation/context-menu.js +144 -2
- package/dist/components/navigation/dropdown-menu.d.ts +17 -21
- package/dist/components/navigation/dropdown-menu.js +164 -2
- package/dist/components/navigation/filter-bar.d.ts +4 -0
- package/dist/components/navigation/filter-bar.js +43 -0
- package/dist/components/navigation/index.d.ts +12 -36
- package/dist/components/navigation/index.js +140 -17
- package/dist/components/navigation/menubar.d.ts +18 -23
- package/dist/components/navigation/menubar.js +135 -2
- package/dist/components/navigation/navigation-menu.d.ts +10 -13
- package/dist/components/navigation/navigation-menu.js +90 -2
- package/dist/components/navigation/pagination-utils.d.ts +2 -0
- package/dist/components/navigation/pagination-utils.js +25 -0
- package/dist/components/navigation/pagination.d.ts +6 -12
- package/dist/components/navigation/pagination.js +222 -10
- package/dist/components/navigation/steps.d.ts +3 -12
- package/dist/components/navigation/steps.js +150 -5
- package/dist/components/navigation/tabs.d.ts +8 -12
- package/dist/components/navigation/tabs.js +109 -2
- package/dist/components/query/data-state.d.ts +7 -0
- package/dist/components/query/data-state.js +44 -0
- package/dist/components/query/index.d.ts +10 -43
- package/dist/components/query/index.js +13 -195
- package/dist/components/query/infinite-query-state.d.ts +13 -0
- package/dist/components/query/infinite-query-state.js +70 -0
- package/dist/components/query/mutation-feedback.d.ts +7 -0
- package/dist/components/query/mutation-feedback.js +23 -0
- package/dist/components/query/prefetch-link.d.ts +7 -0
- package/dist/components/query/prefetch-link.js +36 -0
- package/dist/components/query/query-refetch-button.d.ts +4 -0
- package/dist/components/query/query-refetch-button.js +40 -0
- package/dist/components/ui/accordion.d.ts +6 -0
- package/dist/components/ui/accordion.js +47 -0
- package/dist/components/ui/alert-dialog.d.ts +1 -0
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.d.ts +1 -0
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.js +18 -0
- package/dist/components/ui/avatar.d.ts +5 -0
- package/dist/{chunk-QTUJSRDH.js → components/ui/avatar.js} +12 -10
- package/dist/components/ui/badge.d.ts +1 -0
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/button.d.ts +1 -0
- package/dist/components/ui/button.js +1 -0
- package/dist/components/ui/calendar.d.ts +1 -0
- package/dist/components/ui/calendar.js +1 -0
- package/dist/components/ui/card.d.ts +1 -0
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/carousel.d.ts +1 -0
- package/dist/components/ui/carousel.js +1 -0
- package/dist/components/ui/checkbox.d.ts +1 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/color-picker.d.ts +1 -0
- package/dist/components/ui/color-picker.js +1 -0
- package/dist/components/ui/command.d.ts +1 -0
- package/dist/components/ui/command.js +1 -0
- package/dist/components/ui/context-menu.d.ts +1 -0
- package/dist/components/ui/context-menu.js +1 -0
- package/dist/components/ui/date-picker.d.ts +1 -0
- package/dist/components/ui/date-picker.js +1 -0
- package/dist/components/ui/date-range-picker.d.ts +1 -0
- package/dist/components/ui/date-range-picker.js +1 -0
- package/dist/components/ui/dialog.d.ts +1 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +1 -0
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/hover-card.d.ts +10 -0
- package/dist/components/ui/hover-card.js +45 -0
- package/dist/components/ui/index.d.ts +43 -80
- package/dist/components/ui/index.js +50 -47
- package/dist/components/ui/input-otp.d.ts +33 -0
- package/dist/components/ui/input-otp.js +55 -0
- package/dist/components/ui/input.d.ts +1 -0
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/label.d.ts +1 -0
- package/dist/components/ui/label.js +1 -0
- package/dist/components/ui/menubar.d.ts +1 -0
- package/dist/components/ui/menubar.js +1 -0
- package/dist/components/ui/navigation-menu.d.ts +1 -0
- package/dist/components/ui/navigation-menu.js +1 -0
- package/dist/components/ui/pagination.d.ts +1 -0
- package/dist/components/ui/pagination.js +1 -0
- package/dist/components/ui/password-input.d.ts +4 -0
- package/dist/components/ui/password-input.js +38 -0
- package/dist/components/ui/password-strength.d.ts +1 -0
- package/dist/components/ui/password-strength.js +1 -0
- package/dist/components/ui/popover.d.ts +1 -0
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/radio.d.ts +1 -0
- package/dist/components/ui/radio.js +1 -0
- package/dist/components/ui/rating.d.ts +13 -0
- package/dist/components/ui/rating.js +90 -0
- package/dist/components/ui/resizable.d.ts +1 -0
- package/dist/components/ui/resizable.js +1 -0
- package/dist/components/ui/scroll-area.d.ts +1 -0
- package/dist/components/ui/scroll-area.js +1 -0
- package/dist/components/ui/select.d.ts +1 -0
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/separator.js +20 -0
- package/dist/components/ui/sheet.d.ts +1 -0
- package/dist/components/ui/sheet.js +1 -0
- package/dist/components/ui/skeleton.d.ts +1 -0
- package/dist/components/ui/skeleton.js +4 -0
- package/dist/components/ui/slider.d.ts +1 -0
- package/dist/components/ui/slider.js +1 -0
- package/dist/components/ui/sonner.d.ts +1 -0
- package/dist/components/ui/sonner.js +1 -0
- package/dist/components/ui/switch.d.ts +1 -0
- package/dist/components/ui/switch.js +1 -0
- package/dist/components/ui/table.d.ts +1 -0
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/tabs.d.ts +1 -0
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/tag-input.d.ts +13 -0
- package/dist/components/ui/tag-input.js +100 -0
- package/dist/components/ui/textarea.d.ts +1 -0
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/time-input.d.ts +1 -0
- package/dist/components/ui/time-input.js +1 -0
- package/dist/components/ui/time-picker.d.ts +1 -0
- package/dist/components/ui/time-picker.js +1 -0
- package/dist/components/ui/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle-group.js +32 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.js +36 -0
- package/dist/components/ui/upload.d.ts +1 -0
- package/dist/components/ui/upload.js +1 -0
- package/dist/form/form-field-control.d.ts +4 -0
- package/dist/form/form-field-control.js +42 -0
- package/dist/form/form-root.d.ts +4 -0
- package/dist/form/form-root.js +26 -0
- package/dist/form/index.d.ts +7 -21
- package/dist/form/index.js +8 -73
- package/dist/form/use-zod-form.d.ts +10 -0
- package/dist/form/use-zod-form.js +14 -0
- package/dist/i18n/index.d.ts +3 -326
- package/dist/i18n/index.js +17 -2
- package/dist/i18n/messages/en.json +279 -0
- package/dist/i18n/messages/ja.json +276 -0
- package/dist/i18n/messages/vi.json +276 -0
- package/dist/i18n/translate.d.ts +15 -0
- package/dist/i18n/translate.js +82 -0
- package/dist/i18n/use-translation.d.ts +19 -0
- package/dist/i18n/use-translation.js +46 -0
- package/dist/index.d.ts +11 -47
- package/dist/index.js +16 -62
- package/dist/lib/control-styles.d.ts +26 -0
- package/dist/lib/control-styles.js +34 -0
- package/dist/lib/datetime/detect.d.ts +4 -0
- package/dist/lib/datetime/detect.js +16 -0
- package/dist/lib/datetime/format-date.d.ts +22 -0
- package/dist/lib/datetime/format-date.js +73 -0
- package/dist/lib/datetime/format.d.ts +23 -0
- package/dist/lib/datetime/format.js +94 -0
- package/dist/lib/datetime/index.d.ts +5 -35
- package/dist/lib/datetime/index.js +50 -1
- package/dist/lib/datetime/parse.d.ts +12 -0
- package/dist/lib/datetime/parse.js +56 -0
- package/dist/lib/datetime/sync.d.ts +19 -0
- package/dist/lib/datetime/sync.js +45 -0
- package/dist/lib/format.d.ts +21 -0
- package/dist/{chunk-X6AJ5HEI.js → lib/format.js} +35 -5
- package/dist/lib/hooks.d.ts +4 -6
- package/dist/lib/hooks.js +70 -1
- package/dist/lib/utils.d.ts +2 -5
- package/dist/lib/utils.js +8 -1
- package/dist/lib/variants.d.ts +12 -0
- package/dist/lib/variants.js +38 -0
- package/dist/{app.prop-CVY8V4ss.d.ts → props/components/app.prop.d.ts} +8 -12
- package/dist/props/components/app.prop.js +0 -0
- package/dist/{data-display.prop-CT0nVMdp.d.ts → props/components/data-display.prop.d.ts} +7 -15
- package/dist/props/components/data-display.prop.js +0 -0
- package/dist/{data-entry.prop-BSUaseKh.d.ts → props/components/data-entry.prop.d.ts} +46 -91
- package/dist/props/components/data-entry.prop.js +0 -0
- package/dist/{feedback.prop-CHlHDYZK.d.ts → props/components/feedback.prop.d.ts} +10 -16
- package/dist/props/components/feedback.prop.js +0 -0
- package/dist/{form.prop-5cyL3bvT.d.ts → props/components/form.prop.d.ts} +10 -14
- package/dist/props/components/form.prop.js +0 -0
- package/dist/{general.prop-CzlQin6v.d.ts → props/components/general.prop.d.ts} +5 -10
- package/dist/props/components/general.prop.js +0 -0
- package/dist/props/components/index.d.ts +9 -27
- package/dist/props/components/index.js +0 -1
- package/dist/{layout.prop-fCz-Vlie.d.ts → props/components/layout.prop.d.ts} +19 -26
- package/dist/props/components/layout.prop.js +0 -0
- package/dist/{navigation.prop-FCsOVGrP.d.ts → props/components/navigation.prop.d.ts} +10 -15
- package/dist/props/components/navigation.prop.js +0 -0
- package/dist/{query.prop-CT2gFtr4.d.ts → props/components/query.prop.d.ts} +12 -15
- package/dist/props/components/query.prop.js +0 -0
- package/dist/props/index.d.ts +7 -28
- package/dist/props/index.js +12 -3
- package/dist/props/registry.d.ts +5 -7
- package/dist/props/registry.js +998 -1
- package/dist/{content.prop-DrV_zDy-.d.ts → props/vocabulary/content.prop.d.ts} +12 -16
- package/dist/props/vocabulary/content.prop.js +0 -0
- package/dist/props/vocabulary/data.prop.d.ts +38 -0
- package/dist/props/vocabulary/data.prop.js +0 -0
- package/dist/props/vocabulary/index.d.ts +7 -7
- package/dist/props/vocabulary/index.js +0 -1
- package/dist/props/vocabulary/interaction.prop.d.ts +45 -0
- package/dist/props/vocabulary/interaction.prop.js +0 -0
- package/dist/props/vocabulary/layout.prop.d.ts +14 -0
- package/dist/props/vocabulary/layout.prop.js +0 -0
- package/dist/{navigation.prop-CXDaVNaR.d.ts → props/vocabulary/navigation.prop.d.ts} +3 -7
- package/dist/props/vocabulary/navigation.prop.js +0 -0
- package/dist/{shared.prop-BvMSLFJ6.d.ts → props/vocabulary/shared.prop.d.ts} +23 -27
- package/dist/props/vocabulary/shared.prop.js +0 -0
- package/package.json +2 -2
- package/dist/aspect-ratio-CZZJd9Km.d.ts +0 -9
- package/dist/avatar-D9MdXzfF.d.ts +0 -8
- package/dist/checkbox-bBfLARyF.d.ts +0 -13
- package/dist/chunk-2H65B4JA.js +0 -1
- package/dist/chunk-2RGPEFAW.js +0 -46
- package/dist/chunk-3JORZPS7.js +0 -232
- package/dist/chunk-3VFNWVR7.js +0 -153
- package/dist/chunk-4FGE5XVC.js +0 -996
- package/dist/chunk-5732TWQF.js +0 -1206
- package/dist/chunk-57VDEN64.js +0 -881
- package/dist/chunk-5LTW2LWF.js +0 -182
- package/dist/chunk-65RWSIZF.js +0 -327
- package/dist/chunk-7PWBC4BY.js +0 -25
- package/dist/chunk-B4K4BXEF.js +0 -18
- package/dist/chunk-B6S6LTWT.js +0 -464
- package/dist/chunk-B73NA66T.js +0 -122
- package/dist/chunk-B775Y6BE.js +0 -1
- package/dist/chunk-D4JX6O2W.js +0 -114
- package/dist/chunk-DV52WNXO.js +0 -8
- package/dist/chunk-DY5C44UP.js +0 -55
- package/dist/chunk-EG3RDM6F.js +0 -288
- package/dist/chunk-ES4Q3KGL.js +0 -1
- package/dist/chunk-FQGGF7GQ.js +0 -320
- package/dist/chunk-GJXOBDER.js +0 -1
- package/dist/chunk-HIEGUYPP.js +0 -95
- package/dist/chunk-HL3G4SVG.js +0 -131
- package/dist/chunk-I6G4IO7V.js +0 -485
- package/dist/chunk-I7NQ2LIL.js +0 -40
- package/dist/chunk-IJ5ALJGA.js +0 -31
- package/dist/chunk-INIIF7F7.js +0 -47
- package/dist/chunk-ION2KFXK.js +0 -75
- package/dist/chunk-J2DEWIYY.js +0 -37
- package/dist/chunk-K24AQV4R.js +0 -98
- package/dist/chunk-LFW37FGG.js +0 -68
- package/dist/chunk-LMKUKCTN.js +0 -150
- package/dist/chunk-NU2SOVTU.js +0 -96
- package/dist/chunk-NZBAFFWP.js +0 -214
- package/dist/chunk-OO5DZH45.js +0 -587
- package/dist/chunk-Q3KUZG4P.js +0 -86
- package/dist/chunk-QROC2RMH.js +0 -150
- package/dist/chunk-QVBOICFU.js +0 -145
- package/dist/chunk-R2TXLS7S.js +0 -137
- package/dist/chunk-RZ32HY5E.js +0 -331
- package/dist/chunk-S2IJKT3D.js +0 -89
- package/dist/chunk-TBJBVEIP.js +0 -52
- package/dist/chunk-TO7URV7U.js +0 -51
- package/dist/chunk-U7N2A7A3.js +0 -9
- package/dist/chunk-V3N266PT.js +0 -106
- package/dist/chunk-W4REF4TD.js +0 -42
- package/dist/chunk-WGWI7EGL.js +0 -83
- package/dist/chunk-WY3VYUMX.js +0 -193
- package/dist/chunk-XBFUROAY.js +0 -117
- package/dist/chunk-XK3M3VRR.js +0 -32
- package/dist/chunk-YXVJFYQE.js +0 -191
- package/dist/chunk-ZT5UEUBO.js +0 -1
- package/dist/data-table-DRr70ULe.d.ts +0 -80
- package/dist/data.prop-D0UEEczj.d.ts +0 -42
- package/dist/filter-bar-DoDtwYrr.d.ts +0 -7
- package/dist/flex-1Cy46L0M.d.ts +0 -12
- package/dist/format-date-ByyZoqI5.d.ts +0 -51
- package/dist/interaction.prop-DD46aTro.d.ts +0 -47
- package/dist/layout.prop-CXvl2rVR.d.ts +0 -16
- package/dist/password-strength-DVRvXEOK.d.ts +0 -47
- package/dist/search-input-D4v1JGOA.d.ts +0 -27
- package/dist/skeleton-cj9kh5wo.d.ts +0 -20
- package/dist/types-mvzYGrma.d.ts +0 -37
package/dist/chunk-57VDEN64.js
DELETED
|
@@ -1,881 +0,0 @@
|
|
|
1
|
-
import { Input } from './chunk-K24AQV4R.js';
|
|
2
|
-
import { Button } from './chunk-XBFUROAY.js';
|
|
3
|
-
import { Popover, PopoverAnchor, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
4
|
-
import { useTranslation, usePickerLocales } from './chunk-B6S6LTWT.js';
|
|
5
|
-
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import { ChevronUp, ChevronDown, EyeOff, Eye, Minus, Star, X, CalendarIcon, ChevronLeft, ChevronRight, ArrowRight } from 'lucide-react';
|
|
8
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
10
|
-
|
|
11
|
-
function decimalsOf(n) {
|
|
12
|
-
if (!Number.isFinite(n)) return 0;
|
|
13
|
-
const s = String(n);
|
|
14
|
-
const dot = s.indexOf(".");
|
|
15
|
-
return dot === -1 ? 0 : s.length - dot - 1;
|
|
16
|
-
}
|
|
17
|
-
function clamp(n, min, max) {
|
|
18
|
-
let out = n;
|
|
19
|
-
if (min != null && out < min) out = min;
|
|
20
|
-
if (max != null && out > max) out = max;
|
|
21
|
-
return out;
|
|
22
|
-
}
|
|
23
|
-
function roundTo(n, precision) {
|
|
24
|
-
if (!Number.isFinite(n)) return n;
|
|
25
|
-
const factor = 10 ** precision;
|
|
26
|
-
return Math.round((n + Number.EPSILON) * factor) / factor;
|
|
27
|
-
}
|
|
28
|
-
var NumberInput = React.forwardRef(
|
|
29
|
-
({
|
|
30
|
-
value: controlledValue,
|
|
31
|
-
defaultValue = null,
|
|
32
|
-
onValueChange,
|
|
33
|
-
min,
|
|
34
|
-
max,
|
|
35
|
-
step = 1,
|
|
36
|
-
precision,
|
|
37
|
-
disabled,
|
|
38
|
-
readOnly,
|
|
39
|
-
size = "md",
|
|
40
|
-
placeholder,
|
|
41
|
-
prefix,
|
|
42
|
-
suffix,
|
|
43
|
-
name,
|
|
44
|
-
id,
|
|
45
|
-
className,
|
|
46
|
-
"aria-label": ariaLabel,
|
|
47
|
-
"aria-labelledby": ariaLabelledby,
|
|
48
|
-
"aria-describedby": ariaDescribedby,
|
|
49
|
-
"data-testid": dataTestId
|
|
50
|
-
}, ref) => {
|
|
51
|
-
const { t, locale } = useTranslation();
|
|
52
|
-
const isControlled = controlledValue !== void 0;
|
|
53
|
-
const [internal, setInternal] = React.useState(defaultValue);
|
|
54
|
-
const numericValue = isControlled ? controlledValue ?? null : internal;
|
|
55
|
-
const effectivePrecision = precision ?? decimalsOf(step);
|
|
56
|
-
const formatter = React.useMemo(
|
|
57
|
-
() => new Intl.NumberFormat(locale, {
|
|
58
|
-
minimumFractionDigits: 0,
|
|
59
|
-
maximumFractionDigits: Math.max(effectivePrecision, 0),
|
|
60
|
-
useGrouping: false
|
|
61
|
-
}),
|
|
62
|
-
[locale, effectivePrecision]
|
|
63
|
-
);
|
|
64
|
-
const formatAtRest = React.useCallback(
|
|
65
|
-
(n) => n == null ? "" : formatter.format(n),
|
|
66
|
-
[formatter]
|
|
67
|
-
);
|
|
68
|
-
const [draft, setDraft] = React.useState(() => formatAtRest(numericValue));
|
|
69
|
-
const [focused, setFocused] = React.useState(false);
|
|
70
|
-
React.useEffect(() => {
|
|
71
|
-
if (focused) return;
|
|
72
|
-
setDraft(formatAtRest(numericValue));
|
|
73
|
-
}, [numericValue, focused, formatAtRest]);
|
|
74
|
-
const commit = React.useCallback(
|
|
75
|
-
(next) => {
|
|
76
|
-
const normalized = next == null || Number.isNaN(next) ? null : roundTo(clamp(next, min, max), effectivePrecision);
|
|
77
|
-
if (!isControlled) setInternal(normalized);
|
|
78
|
-
onValueChange?.(normalized);
|
|
79
|
-
if (!focused) setDraft(formatAtRest(normalized));
|
|
80
|
-
return normalized;
|
|
81
|
-
},
|
|
82
|
-
[effectivePrecision, focused, formatAtRest, isControlled, max, min, onValueChange]
|
|
83
|
-
);
|
|
84
|
-
const stepBy = React.useCallback(
|
|
85
|
-
(direction, multiplier = 1) => {
|
|
86
|
-
const base = numericValue ?? min ?? 0;
|
|
87
|
-
const next = base + direction * step * multiplier;
|
|
88
|
-
const committed = commit(next);
|
|
89
|
-
setDraft(formatAtRest(committed));
|
|
90
|
-
},
|
|
91
|
-
[commit, formatAtRest, min, numericValue, step]
|
|
92
|
-
);
|
|
93
|
-
const atMin = min != null && numericValue != null && numericValue <= min;
|
|
94
|
-
const atMax = max != null && numericValue != null && numericValue >= max;
|
|
95
|
-
const interactive = !disabled && !readOnly;
|
|
96
|
-
const handleChange = (event) => {
|
|
97
|
-
const raw = event.target.value;
|
|
98
|
-
setDraft(raw);
|
|
99
|
-
if (readOnly) return;
|
|
100
|
-
const trimmed = raw.trim();
|
|
101
|
-
if (trimmed === "" || trimmed === "-") {
|
|
102
|
-
if (trimmed === "") commit(null);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const parsed = Number(trimmed);
|
|
106
|
-
if (Number.isNaN(parsed)) return;
|
|
107
|
-
if (!isControlled) setInternal(parsed);
|
|
108
|
-
onValueChange?.(parsed);
|
|
109
|
-
};
|
|
110
|
-
const handleBlur = () => {
|
|
111
|
-
setFocused(false);
|
|
112
|
-
const trimmed = draft.trim();
|
|
113
|
-
if (trimmed === "" || trimmed === "-") {
|
|
114
|
-
commit(null);
|
|
115
|
-
setDraft(formatAtRest(null));
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const parsed = Number(trimmed);
|
|
119
|
-
const committed = commit(Number.isNaN(parsed) ? null : parsed);
|
|
120
|
-
setDraft(formatAtRest(committed));
|
|
121
|
-
};
|
|
122
|
-
const handleKeyDown = (event) => {
|
|
123
|
-
if (!interactive) return;
|
|
124
|
-
if (event.key === "ArrowUp") {
|
|
125
|
-
event.preventDefault();
|
|
126
|
-
stepBy(1, event.shiftKey ? 10 : 1);
|
|
127
|
-
} else if (event.key === "ArrowDown") {
|
|
128
|
-
event.preventDefault();
|
|
129
|
-
stepBy(-1, event.shiftKey ? 10 : 1);
|
|
130
|
-
} else if (event.key === "Enter") {
|
|
131
|
-
const trimmed = draft.trim();
|
|
132
|
-
const parsed = Number(trimmed);
|
|
133
|
-
const committed = commit(trimmed === "" || Number.isNaN(parsed) ? null : parsed);
|
|
134
|
-
setDraft(formatAtRest(committed));
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
return /* @__PURE__ */ jsxs("div", { "data-slot": "number-input", "data-size": size, className: cn("ui-number-input", className), children: [
|
|
138
|
-
prefix != null ? /* @__PURE__ */ jsx(
|
|
139
|
-
"span",
|
|
140
|
-
{
|
|
141
|
-
"data-slot": "number-input-prefix",
|
|
142
|
-
className: "ui-number-input-affix",
|
|
143
|
-
"aria-hidden": "true",
|
|
144
|
-
children: prefix
|
|
145
|
-
}
|
|
146
|
-
) : null,
|
|
147
|
-
/* @__PURE__ */ jsx(
|
|
148
|
-
Input,
|
|
149
|
-
{
|
|
150
|
-
ref,
|
|
151
|
-
id,
|
|
152
|
-
name,
|
|
153
|
-
type: "text",
|
|
154
|
-
inputMode: "decimal",
|
|
155
|
-
autoComplete: "off",
|
|
156
|
-
role: "spinbutton",
|
|
157
|
-
"data-slot": "number-input-field",
|
|
158
|
-
"data-testid": dataTestId,
|
|
159
|
-
className: "ui-number-input-field",
|
|
160
|
-
value: draft,
|
|
161
|
-
placeholder,
|
|
162
|
-
disabled,
|
|
163
|
-
readOnly,
|
|
164
|
-
"aria-label": ariaLabel,
|
|
165
|
-
"aria-labelledby": ariaLabelledby,
|
|
166
|
-
"aria-describedby": ariaDescribedby,
|
|
167
|
-
"aria-valuenow": numericValue ?? void 0,
|
|
168
|
-
"aria-valuemin": min,
|
|
169
|
-
"aria-valuemax": max,
|
|
170
|
-
"aria-valuetext": numericValue != null ? formatAtRest(numericValue) : void 0,
|
|
171
|
-
onChange: handleChange,
|
|
172
|
-
onFocus: () => setFocused(true),
|
|
173
|
-
onBlur: handleBlur,
|
|
174
|
-
onKeyDown: handleKeyDown
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
suffix != null ? /* @__PURE__ */ jsx(
|
|
178
|
-
"span",
|
|
179
|
-
{
|
|
180
|
-
"data-slot": "number-input-suffix",
|
|
181
|
-
className: "ui-number-input-affix",
|
|
182
|
-
"aria-hidden": "true",
|
|
183
|
-
children: suffix
|
|
184
|
-
}
|
|
185
|
-
) : null,
|
|
186
|
-
/* @__PURE__ */ jsxs("span", { "data-slot": "number-input-steppers", className: "ui-number-input-steppers", children: [
|
|
187
|
-
/* @__PURE__ */ jsx(
|
|
188
|
-
Button,
|
|
189
|
-
{
|
|
190
|
-
type: "button",
|
|
191
|
-
variant: "outline",
|
|
192
|
-
size: "icon-xs",
|
|
193
|
-
className: "ui-number-input-step ui-number-input-step-up",
|
|
194
|
-
tabIndex: -1,
|
|
195
|
-
disabled: !interactive || atMax,
|
|
196
|
-
"aria-label": t("ui.numberInput.increment"),
|
|
197
|
-
onClick: () => stepBy(1),
|
|
198
|
-
children: /* @__PURE__ */ jsx(ChevronUp, { "aria-hidden": "true" })
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
/* @__PURE__ */ jsx(
|
|
202
|
-
Button,
|
|
203
|
-
{
|
|
204
|
-
type: "button",
|
|
205
|
-
variant: "outline",
|
|
206
|
-
size: "icon-xs",
|
|
207
|
-
className: "ui-number-input-step ui-number-input-step-down",
|
|
208
|
-
tabIndex: -1,
|
|
209
|
-
disabled: !interactive || atMin,
|
|
210
|
-
"aria-label": t("ui.numberInput.decrement"),
|
|
211
|
-
onClick: () => stepBy(-1),
|
|
212
|
-
children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" })
|
|
213
|
-
}
|
|
214
|
-
)
|
|
215
|
-
] })
|
|
216
|
-
] });
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
NumberInput.displayName = "NumberInput";
|
|
220
|
-
var YM_HINT = "yyyy/mm";
|
|
221
|
-
var toYmText = (d) => d ? `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, "0")}` : "";
|
|
222
|
-
var parseYm = (raw) => {
|
|
223
|
-
const m = /^(\d{4})[/-](\d{1,2})$/.exec(raw.trim());
|
|
224
|
-
if (!m) return void 0;
|
|
225
|
-
const month = Number(m[2]);
|
|
226
|
-
if (month < 1 || month > 12) return void 0;
|
|
227
|
-
return new Date(Number(m[1]), month - 1, 1);
|
|
228
|
-
};
|
|
229
|
-
function MonthPicker({
|
|
230
|
-
value: valueProp,
|
|
231
|
-
defaultValue,
|
|
232
|
-
onValueChange,
|
|
233
|
-
placeholder,
|
|
234
|
-
disabled,
|
|
235
|
-
className,
|
|
236
|
-
id,
|
|
237
|
-
name,
|
|
238
|
-
fromYear,
|
|
239
|
-
toYear,
|
|
240
|
-
allowClear = true
|
|
241
|
-
}) {
|
|
242
|
-
const { t } = useTranslation();
|
|
243
|
-
const { locale } = usePickerLocales();
|
|
244
|
-
const [open, setOpen] = React.useState(false);
|
|
245
|
-
const autoId = React.useId();
|
|
246
|
-
const inputId = id ?? autoId;
|
|
247
|
-
const isControlled = React.useRef(valueProp !== void 0).current;
|
|
248
|
-
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
249
|
-
const value = isControlled ? valueProp : internalValue;
|
|
250
|
-
const [text, setText] = React.useState(() => toYmText(value));
|
|
251
|
-
const [viewYear, setViewYear] = React.useState(() => (value ?? /* @__PURE__ */ new Date()).getFullYear());
|
|
252
|
-
React.useEffect(() => {
|
|
253
|
-
setText(toYmText(value));
|
|
254
|
-
if (value) setViewYear(value.getFullYear());
|
|
255
|
-
}, [value]);
|
|
256
|
-
const monthLabels = React.useMemo(() => {
|
|
257
|
-
const fmt = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
258
|
-
return Array.from({ length: 12 }, (_, i) => fmt.format(new Date(2026, i, 1)));
|
|
259
|
-
}, [locale]);
|
|
260
|
-
const emit = (next) => {
|
|
261
|
-
if (!isControlled) setInternalValue(next);
|
|
262
|
-
onValueChange?.(next);
|
|
263
|
-
};
|
|
264
|
-
const showClear = allowClear && Boolean(value) && !disabled;
|
|
265
|
-
const prevDisabled = fromYear !== void 0 && viewYear <= fromYear;
|
|
266
|
-
const nextDisabled = toYear !== void 0 && viewYear >= toYear;
|
|
267
|
-
return /* @__PURE__ */ jsx(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
268
|
-
"div",
|
|
269
|
-
{
|
|
270
|
-
className: cn(
|
|
271
|
-
"ui-control border-input bg-background flex w-full min-w-0 items-center gap-2 rounded-md border px-3 shadow-xs transition-[color,box-shadow] outline-none",
|
|
272
|
-
"focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",
|
|
273
|
-
open && "border-ring ring-ring/50 ring-[3px]",
|
|
274
|
-
disabled && "pointer-events-none cursor-not-allowed opacity-50",
|
|
275
|
-
className
|
|
276
|
-
),
|
|
277
|
-
onClick: () => {
|
|
278
|
-
if (!disabled) setOpen(true);
|
|
279
|
-
},
|
|
280
|
-
children: [
|
|
281
|
-
/* @__PURE__ */ jsx(
|
|
282
|
-
"input",
|
|
283
|
-
{
|
|
284
|
-
id: inputId,
|
|
285
|
-
name,
|
|
286
|
-
value: text,
|
|
287
|
-
disabled,
|
|
288
|
-
placeholder: placeholder ?? t("dataEntry.monthPicker.placeholder") ?? YM_HINT,
|
|
289
|
-
inputMode: "numeric",
|
|
290
|
-
autoComplete: "off",
|
|
291
|
-
className: "placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent tabular-nums outline-none disabled:cursor-not-allowed",
|
|
292
|
-
onKeyDown: (event) => {
|
|
293
|
-
if (event.key === "ArrowDown") {
|
|
294
|
-
event.preventDefault();
|
|
295
|
-
setOpen(true);
|
|
296
|
-
} else if (event.key === "Escape" && open) {
|
|
297
|
-
setOpen(false);
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
onChange: (event) => {
|
|
301
|
-
setText(event.target.value);
|
|
302
|
-
const parsed = parseYm(event.target.value);
|
|
303
|
-
if (parsed) emit(parsed);
|
|
304
|
-
else if (event.target.value.trim() === "") emit(void 0);
|
|
305
|
-
},
|
|
306
|
-
onBlur: () => setText(toYmText(value))
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
showClear ? /* @__PURE__ */ jsx(
|
|
310
|
-
"button",
|
|
311
|
-
{
|
|
312
|
-
type: "button",
|
|
313
|
-
tabIndex: -1,
|
|
314
|
-
"aria-label": t("common.clear") ?? "Clear",
|
|
315
|
-
className: "text-muted-foreground hover:text-foreground shrink-0",
|
|
316
|
-
onClick: (event) => {
|
|
317
|
-
event.stopPropagation();
|
|
318
|
-
emit(void 0);
|
|
319
|
-
setText("");
|
|
320
|
-
},
|
|
321
|
-
children: /* @__PURE__ */ jsx(X, { className: "size-4 shrink-0", "aria-hidden": "true" })
|
|
322
|
-
}
|
|
323
|
-
) : null,
|
|
324
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
325
|
-
"button",
|
|
326
|
-
{
|
|
327
|
-
type: "button",
|
|
328
|
-
disabled,
|
|
329
|
-
tabIndex: -1,
|
|
330
|
-
"aria-label": t("dataEntry.monthPicker.openGrid") ?? "Open month grid",
|
|
331
|
-
className: "text-muted-foreground hover:text-foreground shrink-0",
|
|
332
|
-
children: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 shrink-0", "aria-hidden": "true" })
|
|
333
|
-
}
|
|
334
|
-
) }),
|
|
335
|
-
/* @__PURE__ */ jsxs(
|
|
336
|
-
PopoverContent,
|
|
337
|
-
{
|
|
338
|
-
className: "w-auto p-3",
|
|
339
|
-
align: "start",
|
|
340
|
-
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
341
|
-
onClick: (event) => event.stopPropagation(),
|
|
342
|
-
children: [
|
|
343
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
344
|
-
/* @__PURE__ */ jsx(
|
|
345
|
-
Button,
|
|
346
|
-
{
|
|
347
|
-
type: "button",
|
|
348
|
-
variant: "outline",
|
|
349
|
-
size: "icon-sm",
|
|
350
|
-
disabled: prevDisabled,
|
|
351
|
-
"aria-label": t("dataEntry.monthPicker.previousYear") ?? "Previous year",
|
|
352
|
-
className: "bg-transparent opacity-70 hover:opacity-100",
|
|
353
|
-
onClick: () => setViewYear((y) => y - 1),
|
|
354
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4", "aria-hidden": "true" })
|
|
355
|
-
}
|
|
356
|
-
),
|
|
357
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", "aria-live": "polite", children: viewYear }),
|
|
358
|
-
/* @__PURE__ */ jsx(
|
|
359
|
-
Button,
|
|
360
|
-
{
|
|
361
|
-
type: "button",
|
|
362
|
-
variant: "outline",
|
|
363
|
-
size: "icon-sm",
|
|
364
|
-
disabled: nextDisabled,
|
|
365
|
-
"aria-label": t("dataEntry.monthPicker.nextYear") ?? "Next year",
|
|
366
|
-
className: "bg-transparent opacity-70 hover:opacity-100",
|
|
367
|
-
onClick: () => setViewYear((y) => y + 1),
|
|
368
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4", "aria-hidden": "true" })
|
|
369
|
-
}
|
|
370
|
-
)
|
|
371
|
-
] }),
|
|
372
|
-
/* @__PURE__ */ jsx("div", { role: "grid", "aria-label": String(viewYear), className: "mt-3 grid grid-cols-3 gap-1", children: monthLabels.map((label, i) => {
|
|
373
|
-
const selected = value?.getFullYear() === viewYear && value?.getMonth() === i;
|
|
374
|
-
return /* @__PURE__ */ jsx(
|
|
375
|
-
Button,
|
|
376
|
-
{
|
|
377
|
-
type: "button",
|
|
378
|
-
variant: selected ? "default" : "ghost",
|
|
379
|
-
size: "sm",
|
|
380
|
-
"aria-pressed": selected,
|
|
381
|
-
className: "px-4 font-normal",
|
|
382
|
-
onClick: () => {
|
|
383
|
-
emit(new Date(viewYear, i, 1));
|
|
384
|
-
setOpen(false);
|
|
385
|
-
},
|
|
386
|
-
children: label
|
|
387
|
-
},
|
|
388
|
-
label
|
|
389
|
-
);
|
|
390
|
-
}) })
|
|
391
|
-
]
|
|
392
|
-
}
|
|
393
|
-
)
|
|
394
|
-
]
|
|
395
|
-
}
|
|
396
|
-
) }) });
|
|
397
|
-
}
|
|
398
|
-
var YM_HINT2 = "yyyy/mm";
|
|
399
|
-
var toYmText2 = (d) => d ? `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, "0")}` : "";
|
|
400
|
-
var parseYm2 = (raw) => {
|
|
401
|
-
const m = /^(\d{4})[/-](\d{1,2})$/.exec(raw.trim());
|
|
402
|
-
if (!m) return void 0;
|
|
403
|
-
const month = Number(m[2]);
|
|
404
|
-
if (month < 1 || month > 12) return void 0;
|
|
405
|
-
return new Date(Number(m[1]), month - 1, 1);
|
|
406
|
-
};
|
|
407
|
-
var ymIndex = (d) => d.getFullYear() * 12 + d.getMonth();
|
|
408
|
-
function MonthRangePicker({
|
|
409
|
-
value: valueProp,
|
|
410
|
-
defaultValue,
|
|
411
|
-
onValueChange,
|
|
412
|
-
placeholder,
|
|
413
|
-
disabled,
|
|
414
|
-
className,
|
|
415
|
-
id,
|
|
416
|
-
name,
|
|
417
|
-
fromYear,
|
|
418
|
-
toYear,
|
|
419
|
-
allowClear = true
|
|
420
|
-
}) {
|
|
421
|
-
const { t } = useTranslation();
|
|
422
|
-
const { locale } = usePickerLocales();
|
|
423
|
-
const [open, setOpen] = React.useState(false);
|
|
424
|
-
const autoId = React.useId();
|
|
425
|
-
const fromId = id ?? autoId;
|
|
426
|
-
const toId = `${fromId}-to`;
|
|
427
|
-
const isControlled = React.useRef(valueProp !== void 0).current;
|
|
428
|
-
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
429
|
-
const value = isControlled ? valueProp : internalValue;
|
|
430
|
-
const [fromText, setFromText] = React.useState(() => toYmText2(value?.from));
|
|
431
|
-
const [toText, setToText] = React.useState(() => toYmText2(value?.to));
|
|
432
|
-
const [viewYear, setViewYear] = React.useState(() => (value?.from ?? /* @__PURE__ */ new Date()).getFullYear());
|
|
433
|
-
React.useEffect(() => {
|
|
434
|
-
setFromText(toYmText2(value?.from));
|
|
435
|
-
setToText(toYmText2(value?.to));
|
|
436
|
-
if (value?.from) setViewYear(value.from.getFullYear());
|
|
437
|
-
}, [value?.from, value?.to]);
|
|
438
|
-
const monthLabels = React.useMemo(() => {
|
|
439
|
-
const fmt = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
440
|
-
return Array.from({ length: 12 }, (_, i) => fmt.format(new Date(2026, i, 1)));
|
|
441
|
-
}, [locale]);
|
|
442
|
-
const emit = (next) => {
|
|
443
|
-
if (!isControlled) setInternalValue(next);
|
|
444
|
-
onValueChange?.(next);
|
|
445
|
-
};
|
|
446
|
-
const showClear = allowClear && Boolean(value?.from || value?.to) && !disabled;
|
|
447
|
-
const prevDisabled = fromYear !== void 0 && viewYear <= fromYear;
|
|
448
|
-
const nextDisabled = toYear !== void 0 && viewYear >= toYear;
|
|
449
|
-
const clear = () => {
|
|
450
|
-
emit(void 0);
|
|
451
|
-
setFromText("");
|
|
452
|
-
setToText("");
|
|
453
|
-
};
|
|
454
|
-
const commitEdge = (edge, raw) => {
|
|
455
|
-
const trimmed = raw.trim();
|
|
456
|
-
const parsed = trimmed === "" ? void 0 : parseYm2(trimmed);
|
|
457
|
-
if (trimmed !== "" && !parsed) return;
|
|
458
|
-
const next = { from: value?.from, to: value?.to, [edge]: parsed };
|
|
459
|
-
if (next.from && next.to && ymIndex(next.from) > ymIndex(next.to)) {
|
|
460
|
-
const swapped = { from: next.to, to: next.from };
|
|
461
|
-
emit(swapped);
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
emit(next.from || next.to ? next : void 0);
|
|
465
|
-
};
|
|
466
|
-
const pickMonth = (picked) => {
|
|
467
|
-
const pendingFrom = value?.from && !value?.to ? value.from : void 0;
|
|
468
|
-
if (!pendingFrom) {
|
|
469
|
-
emit({ from: picked, to: void 0 });
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
const [from, to] = ymIndex(picked) < ymIndex(pendingFrom) ? [picked, pendingFrom] : [pendingFrom, picked];
|
|
473
|
-
emit({ from, to });
|
|
474
|
-
setOpen(false);
|
|
475
|
-
};
|
|
476
|
-
const sharedKeyHandlers = {
|
|
477
|
-
onKeyDown: (event) => {
|
|
478
|
-
if (event.key === "ArrowDown") {
|
|
479
|
-
event.preventDefault();
|
|
480
|
-
setOpen(true);
|
|
481
|
-
} else if (event.key === "Escape" && open) {
|
|
482
|
-
setOpen(false);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
const innerInputClass = "min-w-0 flex-1 bg-transparent tabular-nums outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed";
|
|
487
|
-
const resolvedPlaceholder = placeholder ?? t("dataEntry.monthPicker.placeholder") ?? YM_HINT2;
|
|
488
|
-
return /* @__PURE__ */ jsx(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
489
|
-
"div",
|
|
490
|
-
{
|
|
491
|
-
className: cn(
|
|
492
|
-
"ui-control border-input bg-background flex w-full min-w-0 items-center gap-2 rounded-md border px-3 shadow-xs transition-[color,box-shadow] outline-none",
|
|
493
|
-
"focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",
|
|
494
|
-
open && "border-ring ring-ring/50 ring-[3px]",
|
|
495
|
-
disabled && "pointer-events-none cursor-not-allowed opacity-50",
|
|
496
|
-
className
|
|
497
|
-
),
|
|
498
|
-
onClick: () => {
|
|
499
|
-
if (!disabled) setOpen(true);
|
|
500
|
-
},
|
|
501
|
-
children: [
|
|
502
|
-
/* @__PURE__ */ jsx(
|
|
503
|
-
"input",
|
|
504
|
-
{
|
|
505
|
-
id: fromId,
|
|
506
|
-
name: name ? `${name}_from` : void 0,
|
|
507
|
-
value: fromText,
|
|
508
|
-
disabled,
|
|
509
|
-
placeholder: resolvedPlaceholder,
|
|
510
|
-
inputMode: "numeric",
|
|
511
|
-
autoComplete: "off",
|
|
512
|
-
"aria-label": t("dataEntry.dateRangePicker.from") ?? "From",
|
|
513
|
-
className: innerInputClass,
|
|
514
|
-
...sharedKeyHandlers,
|
|
515
|
-
onChange: (event) => {
|
|
516
|
-
setFromText(event.target.value);
|
|
517
|
-
commitEdge("from", event.target.value);
|
|
518
|
-
},
|
|
519
|
-
onBlur: () => setFromText(toYmText2(value?.from))
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
/* @__PURE__ */ jsx(ArrowRight, { className: "text-muted-foreground size-3.5 shrink-0", "aria-hidden": "true" }),
|
|
523
|
-
/* @__PURE__ */ jsx(
|
|
524
|
-
"input",
|
|
525
|
-
{
|
|
526
|
-
id: toId,
|
|
527
|
-
name: name ? `${name}_to` : void 0,
|
|
528
|
-
value: toText,
|
|
529
|
-
disabled,
|
|
530
|
-
placeholder: resolvedPlaceholder,
|
|
531
|
-
inputMode: "numeric",
|
|
532
|
-
autoComplete: "off",
|
|
533
|
-
"aria-label": t("dataEntry.dateRangePicker.to") ?? "To",
|
|
534
|
-
className: innerInputClass,
|
|
535
|
-
...sharedKeyHandlers,
|
|
536
|
-
onChange: (event) => {
|
|
537
|
-
setToText(event.target.value);
|
|
538
|
-
commitEdge("to", event.target.value);
|
|
539
|
-
},
|
|
540
|
-
onBlur: () => setToText(toYmText2(value?.to))
|
|
541
|
-
}
|
|
542
|
-
),
|
|
543
|
-
showClear ? /* @__PURE__ */ jsx(
|
|
544
|
-
"button",
|
|
545
|
-
{
|
|
546
|
-
type: "button",
|
|
547
|
-
tabIndex: -1,
|
|
548
|
-
"aria-label": t("common.clear") ?? "Clear",
|
|
549
|
-
className: "text-muted-foreground hover:text-foreground shrink-0",
|
|
550
|
-
onClick: (event) => {
|
|
551
|
-
event.stopPropagation();
|
|
552
|
-
clear();
|
|
553
|
-
},
|
|
554
|
-
children: /* @__PURE__ */ jsx(X, { className: "size-4 shrink-0", "aria-hidden": "true" })
|
|
555
|
-
}
|
|
556
|
-
) : null,
|
|
557
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
558
|
-
"button",
|
|
559
|
-
{
|
|
560
|
-
type: "button",
|
|
561
|
-
disabled,
|
|
562
|
-
tabIndex: -1,
|
|
563
|
-
"aria-label": t("dataEntry.monthPicker.openGrid") ?? "Open month grid",
|
|
564
|
-
className: "text-muted-foreground hover:text-foreground shrink-0",
|
|
565
|
-
children: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 shrink-0", "aria-hidden": "true" })
|
|
566
|
-
}
|
|
567
|
-
) }),
|
|
568
|
-
/* @__PURE__ */ jsxs(
|
|
569
|
-
PopoverContent,
|
|
570
|
-
{
|
|
571
|
-
className: "w-auto p-3",
|
|
572
|
-
align: "start",
|
|
573
|
-
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
574
|
-
onClick: (event) => event.stopPropagation(),
|
|
575
|
-
children: [
|
|
576
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
577
|
-
/* @__PURE__ */ jsx(
|
|
578
|
-
Button,
|
|
579
|
-
{
|
|
580
|
-
type: "button",
|
|
581
|
-
variant: "outline",
|
|
582
|
-
size: "icon-sm",
|
|
583
|
-
disabled: prevDisabled,
|
|
584
|
-
"aria-label": t("dataEntry.monthPicker.previousYear") ?? "Previous year",
|
|
585
|
-
className: "bg-transparent opacity-70 hover:opacity-100",
|
|
586
|
-
onClick: () => setViewYear((y) => y - 1),
|
|
587
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4", "aria-hidden": "true" })
|
|
588
|
-
}
|
|
589
|
-
),
|
|
590
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", "aria-live": "polite", children: viewYear }),
|
|
591
|
-
/* @__PURE__ */ jsx(
|
|
592
|
-
Button,
|
|
593
|
-
{
|
|
594
|
-
type: "button",
|
|
595
|
-
variant: "outline",
|
|
596
|
-
size: "icon-sm",
|
|
597
|
-
disabled: nextDisabled,
|
|
598
|
-
"aria-label": t("dataEntry.monthPicker.nextYear") ?? "Next year",
|
|
599
|
-
className: "bg-transparent opacity-70 hover:opacity-100",
|
|
600
|
-
onClick: () => setViewYear((y) => y + 1),
|
|
601
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4", "aria-hidden": "true" })
|
|
602
|
-
}
|
|
603
|
-
)
|
|
604
|
-
] }),
|
|
605
|
-
/* @__PURE__ */ jsx("div", { role: "grid", "aria-label": String(viewYear), className: "mt-3 grid grid-cols-3 gap-1", children: monthLabels.map((label, i) => {
|
|
606
|
-
const cell = new Date(viewYear, i, 1);
|
|
607
|
-
const cellIdx = ymIndex(cell);
|
|
608
|
-
const fromIdx = value?.from ? ymIndex(value.from) : void 0;
|
|
609
|
-
const toIdx = value?.to ? ymIndex(value.to) : void 0;
|
|
610
|
-
const isEdge = cellIdx === fromIdx || cellIdx === toIdx;
|
|
611
|
-
const inRange = fromIdx !== void 0 && toIdx !== void 0 && cellIdx > fromIdx && cellIdx < toIdx;
|
|
612
|
-
return /* @__PURE__ */ jsx(
|
|
613
|
-
Button,
|
|
614
|
-
{
|
|
615
|
-
type: "button",
|
|
616
|
-
variant: isEdge ? "default" : inRange ? "secondary" : "ghost",
|
|
617
|
-
size: "sm",
|
|
618
|
-
"aria-pressed": isEdge,
|
|
619
|
-
className: "px-4 font-normal",
|
|
620
|
-
onClick: () => pickMonth(cell),
|
|
621
|
-
children: label
|
|
622
|
-
},
|
|
623
|
-
label
|
|
624
|
-
);
|
|
625
|
-
}) })
|
|
626
|
-
]
|
|
627
|
-
}
|
|
628
|
-
)
|
|
629
|
-
]
|
|
630
|
-
}
|
|
631
|
-
) }) });
|
|
632
|
-
}
|
|
633
|
-
var PasswordInput = React.forwardRef(
|
|
634
|
-
({ className, ...props }, ref) => {
|
|
635
|
-
const { t } = useTranslation();
|
|
636
|
-
const [visible, setVisible] = React.useState(false);
|
|
637
|
-
return /* @__PURE__ */ jsxs("div", { className: "ui-password-input", "data-slot": "password-input", children: [
|
|
638
|
-
/* @__PURE__ */ jsx(
|
|
639
|
-
Input,
|
|
640
|
-
{
|
|
641
|
-
ref,
|
|
642
|
-
type: visible ? "text" : "password",
|
|
643
|
-
className: cn("ui-password-input-field", className),
|
|
644
|
-
...props
|
|
645
|
-
}
|
|
646
|
-
),
|
|
647
|
-
/* @__PURE__ */ jsx(
|
|
648
|
-
"button",
|
|
649
|
-
{
|
|
650
|
-
type: "button",
|
|
651
|
-
className: "ui-password-input-toggle",
|
|
652
|
-
onClick: () => setVisible((v) => !v),
|
|
653
|
-
"aria-label": visible ? t("ui.passwordInput.hide") : t("ui.passwordInput.show"),
|
|
654
|
-
"aria-pressed": visible,
|
|
655
|
-
children: visible ? /* @__PURE__ */ jsx(EyeOff, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Eye, { "aria-hidden": "true" })
|
|
656
|
-
}
|
|
657
|
-
)
|
|
658
|
-
] });
|
|
659
|
-
}
|
|
660
|
-
);
|
|
661
|
-
PasswordInput.displayName = "PasswordInput";
|
|
662
|
-
var InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
663
|
-
OTPInput,
|
|
664
|
-
{
|
|
665
|
-
ref,
|
|
666
|
-
"data-slot": "input-otp",
|
|
667
|
-
containerClassName: cn("ui-otp-container", containerClassName),
|
|
668
|
-
className: cn("ui-otp-input", className),
|
|
669
|
-
...props
|
|
670
|
-
}
|
|
671
|
-
));
|
|
672
|
-
InputOTP.displayName = "InputOTP";
|
|
673
|
-
var InputOTPGroup = React.forwardRef(
|
|
674
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
675
|
-
"div",
|
|
676
|
-
{
|
|
677
|
-
ref,
|
|
678
|
-
"data-slot": "input-otp-group",
|
|
679
|
-
className: cn("ui-otp-group", className),
|
|
680
|
-
...props
|
|
681
|
-
}
|
|
682
|
-
)
|
|
683
|
-
);
|
|
684
|
-
InputOTPGroup.displayName = "InputOTPGroup";
|
|
685
|
-
var InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
|
|
686
|
-
const context = React.useContext(OTPInputContext);
|
|
687
|
-
const slot = context.slots[index] ?? { char: null, hasFakeCaret: false, isActive: false };
|
|
688
|
-
return /* @__PURE__ */ jsxs(
|
|
689
|
-
"div",
|
|
690
|
-
{
|
|
691
|
-
ref,
|
|
692
|
-
"data-slot": "input-otp-slot",
|
|
693
|
-
"data-active": slot.isActive || void 0,
|
|
694
|
-
className: cn("ui-otp-slot", className),
|
|
695
|
-
...props,
|
|
696
|
-
children: [
|
|
697
|
-
slot.char,
|
|
698
|
-
slot.hasFakeCaret ? /* @__PURE__ */ jsx("div", { className: "ui-otp-caret-wrapper", "aria-hidden": "true", children: /* @__PURE__ */ jsx("div", { className: "ui-otp-caret" }) }) : null
|
|
699
|
-
]
|
|
700
|
-
}
|
|
701
|
-
);
|
|
702
|
-
});
|
|
703
|
-
InputOTPSlot.displayName = "InputOTPSlot";
|
|
704
|
-
var InputOTPSeparator = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx(Minus, { className: "ui-otp-separator-icon", "aria-hidden": "true" }) }));
|
|
705
|
-
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
706
|
-
var Rating = React.forwardRef(
|
|
707
|
-
({
|
|
708
|
-
value,
|
|
709
|
-
defaultValue = 0,
|
|
710
|
-
onValueChange,
|
|
711
|
-
max = 5,
|
|
712
|
-
readOnly,
|
|
713
|
-
disabled,
|
|
714
|
-
name,
|
|
715
|
-
className,
|
|
716
|
-
...rest
|
|
717
|
-
}, ref) => {
|
|
718
|
-
const { t } = useTranslation();
|
|
719
|
-
const [internal, setInternal] = React.useState(defaultValue);
|
|
720
|
-
const current = value ?? internal;
|
|
721
|
-
const [hover, setHover] = React.useState(null);
|
|
722
|
-
const display = hover ?? current;
|
|
723
|
-
const interactive = !readOnly && !disabled;
|
|
724
|
-
const select = (next) => {
|
|
725
|
-
if (!interactive) return;
|
|
726
|
-
if (value === void 0) setInternal(next);
|
|
727
|
-
onValueChange?.(next);
|
|
728
|
-
};
|
|
729
|
-
const focusableStar = current > 0 ? current : 1;
|
|
730
|
-
const onKeyDown = (e, star) => {
|
|
731
|
-
if (!interactive) return;
|
|
732
|
-
let next = null;
|
|
733
|
-
switch (e.key) {
|
|
734
|
-
case "ArrowRight":
|
|
735
|
-
case "ArrowUp":
|
|
736
|
-
next = Math.min(max, star + 1);
|
|
737
|
-
break;
|
|
738
|
-
case "ArrowLeft":
|
|
739
|
-
case "ArrowDown":
|
|
740
|
-
next = Math.max(1, star - 1);
|
|
741
|
-
break;
|
|
742
|
-
case "Home":
|
|
743
|
-
next = 1;
|
|
744
|
-
break;
|
|
745
|
-
case "End":
|
|
746
|
-
next = max;
|
|
747
|
-
break;
|
|
748
|
-
default:
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
751
|
-
e.preventDefault();
|
|
752
|
-
select(next);
|
|
753
|
-
};
|
|
754
|
-
return /* @__PURE__ */ jsxs(
|
|
755
|
-
"div",
|
|
756
|
-
{
|
|
757
|
-
ref,
|
|
758
|
-
role: "radiogroup",
|
|
759
|
-
"data-slot": "rating",
|
|
760
|
-
className: cn("ui-rating", className),
|
|
761
|
-
"aria-label": rest["aria-label"] ?? t("ui.rating.ariaLabel"),
|
|
762
|
-
children: [
|
|
763
|
-
Array.from({ length: max }, (_, i) => i + 1).map((star) => /* @__PURE__ */ jsx(
|
|
764
|
-
"button",
|
|
765
|
-
{
|
|
766
|
-
type: "button",
|
|
767
|
-
role: "radio",
|
|
768
|
-
"aria-checked": current === star,
|
|
769
|
-
"aria-label": t("ui.rating.starLabel", { star, max }),
|
|
770
|
-
disabled: disabled || readOnly,
|
|
771
|
-
tabIndex: interactive && star === focusableStar ? 0 : -1,
|
|
772
|
-
className: cn("ui-rating-star", star <= display && "ui-rating-star-filled"),
|
|
773
|
-
onMouseEnter: () => interactive && setHover(star),
|
|
774
|
-
onMouseLeave: () => setHover(null),
|
|
775
|
-
onClick: () => select(star),
|
|
776
|
-
onKeyDown: (e) => onKeyDown(e, star),
|
|
777
|
-
children: /* @__PURE__ */ jsx(Star, { "aria-hidden": "true" })
|
|
778
|
-
},
|
|
779
|
-
star
|
|
780
|
-
)),
|
|
781
|
-
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: current }) : null
|
|
782
|
-
]
|
|
783
|
-
}
|
|
784
|
-
);
|
|
785
|
-
}
|
|
786
|
-
);
|
|
787
|
-
Rating.displayName = "Rating";
|
|
788
|
-
var TagInput = React.forwardRef(
|
|
789
|
-
({
|
|
790
|
-
value,
|
|
791
|
-
defaultValue = [],
|
|
792
|
-
onValueChange,
|
|
793
|
-
placeholder,
|
|
794
|
-
disabled,
|
|
795
|
-
name,
|
|
796
|
-
className,
|
|
797
|
-
id,
|
|
798
|
-
"aria-label": ariaLabel
|
|
799
|
-
}, ref) => {
|
|
800
|
-
const { t } = useTranslation();
|
|
801
|
-
const [internal, setInternal] = React.useState(defaultValue);
|
|
802
|
-
const tags = value ?? internal;
|
|
803
|
-
const [draft, setDraft] = React.useState("");
|
|
804
|
-
const commit = (next) => {
|
|
805
|
-
if (value === void 0) setInternal(next);
|
|
806
|
-
onValueChange?.(next);
|
|
807
|
-
};
|
|
808
|
-
const add = (raw) => {
|
|
809
|
-
const tag = raw.trim();
|
|
810
|
-
if (!tag || tags.includes(tag)) return;
|
|
811
|
-
commit([...tags, tag]);
|
|
812
|
-
};
|
|
813
|
-
const removeAt = (i) => commit(tags.filter((_, idx) => idx !== i));
|
|
814
|
-
const onKeyDown = (e) => {
|
|
815
|
-
if (e.key === "Enter" || e.key === ",") {
|
|
816
|
-
e.preventDefault();
|
|
817
|
-
add(draft);
|
|
818
|
-
setDraft("");
|
|
819
|
-
} else if (e.key === "Backspace" && draft === "" && tags.length > 0) {
|
|
820
|
-
removeAt(tags.length - 1);
|
|
821
|
-
}
|
|
822
|
-
};
|
|
823
|
-
return /* @__PURE__ */ jsxs(
|
|
824
|
-
"div",
|
|
825
|
-
{
|
|
826
|
-
"data-slot": "tag-input",
|
|
827
|
-
className: cn("ui-tag-input", disabled && "ui-tag-input-disabled", className),
|
|
828
|
-
children: [
|
|
829
|
-
tags.length > 0 ? /* @__PURE__ */ jsx("ul", { role: "list", className: "ui-tag-input-list", "data-slot": "tag-input-list", children: tags.map((tag, i) => /* @__PURE__ */ jsxs(
|
|
830
|
-
"li",
|
|
831
|
-
{
|
|
832
|
-
role: "listitem",
|
|
833
|
-
className: "ui-tag-input-chip",
|
|
834
|
-
"data-slot": "tag-input-chip",
|
|
835
|
-
children: [
|
|
836
|
-
tag,
|
|
837
|
-
!disabled ? /* @__PURE__ */ jsx(
|
|
838
|
-
"button",
|
|
839
|
-
{
|
|
840
|
-
type: "button",
|
|
841
|
-
className: "ui-tag-input-remove",
|
|
842
|
-
"aria-label": t("ui.tagInput.removeTag", { tag }),
|
|
843
|
-
onClick: () => removeAt(i),
|
|
844
|
-
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
845
|
-
}
|
|
846
|
-
) : null
|
|
847
|
-
]
|
|
848
|
-
},
|
|
849
|
-
tag
|
|
850
|
-
)) }) : null,
|
|
851
|
-
/* @__PURE__ */ jsx(
|
|
852
|
-
"input",
|
|
853
|
-
{
|
|
854
|
-
ref,
|
|
855
|
-
id,
|
|
856
|
-
type: "text",
|
|
857
|
-
className: "ui-tag-input-field",
|
|
858
|
-
value: draft,
|
|
859
|
-
placeholder: tags.length === 0 ? placeholder : void 0,
|
|
860
|
-
disabled,
|
|
861
|
-
"aria-label": ariaLabel ?? t("ui.tagInput.inputLabel"),
|
|
862
|
-
onChange: (e) => setDraft(e.target.value),
|
|
863
|
-
onKeyDown,
|
|
864
|
-
onBlur: () => {
|
|
865
|
-
if (draft.trim()) {
|
|
866
|
-
add(draft);
|
|
867
|
-
setDraft("");
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
),
|
|
872
|
-
/* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", "data-slot": "tag-input-status", children: t("ui.tagInput.tagCount", { count: tags.length }) }),
|
|
873
|
-
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: tags.join(",") }) : null
|
|
874
|
-
]
|
|
875
|
-
}
|
|
876
|
-
);
|
|
877
|
-
}
|
|
878
|
-
);
|
|
879
|
-
TagInput.displayName = "TagInput";
|
|
880
|
-
|
|
881
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, MonthPicker, MonthRangePicker, NumberInput, PasswordInput, Rating, TagInput };
|