@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-DV52WNXO.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
-
|
|
3
|
-
// src/components/data-display/collapsible.tsx
|
|
4
|
-
var Collapsible = CollapsiblePrimitive.Root;
|
|
5
|
-
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
6
|
-
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
7
|
-
|
|
8
|
-
export { Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger };
|
package/dist/chunk-DY5C44UP.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function Popover(props) {
|
|
7
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
8
|
-
}
|
|
9
|
-
function PopoverTrigger(props) {
|
|
10
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
11
|
-
}
|
|
12
|
-
function PopoverAnchor(props) {
|
|
13
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
14
|
-
}
|
|
15
|
-
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
16
|
-
PopoverPrimitive.Content,
|
|
17
|
-
{
|
|
18
|
-
ref,
|
|
19
|
-
"data-slot": "popover-content",
|
|
20
|
-
align,
|
|
21
|
-
sideOffset,
|
|
22
|
-
className: cn(
|
|
23
|
-
"bg-popover text-popover-foreground z-50 w-72 origin-[var(--radix-popover-content-transform-origin)] rounded-md border p-4 shadow-md outline-none",
|
|
24
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
25
|
-
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
26
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
27
|
-
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
28
|
-
className
|
|
29
|
-
),
|
|
30
|
-
...props
|
|
31
|
-
}
|
|
32
|
-
) }));
|
|
33
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
34
|
-
var PopoverHeader = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
"data-slot": "popover-header",
|
|
38
|
-
className: cn("flex flex-col gap-1 text-sm", className),
|
|
39
|
-
...props
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
var PopoverTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "popover-title", className: cn("font-medium", className), ...props });
|
|
43
|
-
var PopoverDescription = ({
|
|
44
|
-
className,
|
|
45
|
-
...props
|
|
46
|
-
}) => /* @__PURE__ */ jsx(
|
|
47
|
-
"p",
|
|
48
|
-
{
|
|
49
|
-
"data-slot": "popover-description",
|
|
50
|
-
className: cn("text-muted-foreground", className),
|
|
51
|
-
...props
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
package/dist/chunk-EG3RDM6F.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { normalizeTreeOptions, collectAllExpandableKeys, filterVisibleTree, flattenVisibleTree, findNodeByValue, reactNodeText, getDescendantValues } from './chunk-SMLKNECP.js';
|
|
2
|
-
import { Command, CommandInput } from './chunk-2RGPEFAW.js';
|
|
3
|
-
import { Checkbox } from './chunk-BE6GJGKJ.js';
|
|
4
|
-
import { Button } from './chunk-XBFUROAY.js';
|
|
5
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
6
|
-
import { ScrollArea } from './chunk-J2DEWIYY.js';
|
|
7
|
-
import { controlOpenRingClass } from './chunk-B4K4BXEF.js';
|
|
8
|
-
import { useTranslation } from './chunk-B6S6LTWT.js';
|
|
9
|
-
import { cn } from './chunk-U7N2A7A3.js';
|
|
10
|
-
import * as React from 'react';
|
|
11
|
-
import { X, ChevronsUpDown, ChevronDown, ChevronRight } from 'lucide-react';
|
|
12
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
|
-
|
|
14
|
-
// src/components/data-entry/tree-select-strategy.ts
|
|
15
|
-
var SHOW_CHILD = "SHOW_CHILD";
|
|
16
|
-
var SHOW_PARENT = "SHOW_PARENT";
|
|
17
|
-
var SHOW_ALL = "SHOW_ALL";
|
|
18
|
-
function toArray(value) {
|
|
19
|
-
if (value == null) return [];
|
|
20
|
-
return Array.isArray(value) ? value : [value];
|
|
21
|
-
}
|
|
22
|
-
function displayValues(values, options, showCheckedStrategy, treeCheckStrictly) {
|
|
23
|
-
if (treeCheckStrictly || showCheckedStrategy === SHOW_ALL) return values;
|
|
24
|
-
if (showCheckedStrategy === SHOW_PARENT) {
|
|
25
|
-
const filtered = values.filter((v) => {
|
|
26
|
-
const node = findNodeByValue(options, v);
|
|
27
|
-
if (!node?.children?.length) return true;
|
|
28
|
-
const desc = getDescendantValues(node).slice(1);
|
|
29
|
-
return !desc.every((d) => values.includes(d));
|
|
30
|
-
});
|
|
31
|
-
return filtered.length ? filtered : values;
|
|
32
|
-
}
|
|
33
|
-
return values.filter((v) => {
|
|
34
|
-
const node = findNodeByValue(options, v);
|
|
35
|
-
return !node?.children?.length;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function TreeSelectRoot({
|
|
39
|
-
treeData: treeDataProp,
|
|
40
|
-
value,
|
|
41
|
-
defaultValue,
|
|
42
|
-
onValueChange,
|
|
43
|
-
multiple,
|
|
44
|
-
treeCheckable,
|
|
45
|
-
treeCheckStrictly,
|
|
46
|
-
showSearch,
|
|
47
|
-
showCheckedStrategy = SHOW_CHILD,
|
|
48
|
-
treeDefaultExpandAll,
|
|
49
|
-
placeholder,
|
|
50
|
-
disabled,
|
|
51
|
-
allowClear = true,
|
|
52
|
-
className,
|
|
53
|
-
id,
|
|
54
|
-
fieldNames
|
|
55
|
-
}) {
|
|
56
|
-
const { t } = useTranslation();
|
|
57
|
-
const options = React.useMemo(
|
|
58
|
-
() => normalizeTreeOptions(treeDataProp, fieldNames),
|
|
59
|
-
[treeDataProp, fieldNames]
|
|
60
|
-
);
|
|
61
|
-
const checkable = treeCheckable ?? multiple;
|
|
62
|
-
const [open, setOpen] = React.useState(false);
|
|
63
|
-
const [search, setSearch] = React.useState("");
|
|
64
|
-
const [expandedKeys, setExpandedKeys] = React.useState(
|
|
65
|
-
() => new Set(treeDefaultExpandAll ? collectAllExpandableKeys(options) : [])
|
|
66
|
-
);
|
|
67
|
-
const isControlled = value !== void 0;
|
|
68
|
-
const [internal, setInternal] = React.useState(() => toArray(defaultValue));
|
|
69
|
-
const [activeKey, setActiveKey] = React.useState(null);
|
|
70
|
-
const treeItemRefs = React.useRef(/* @__PURE__ */ new Map());
|
|
71
|
-
const selected = isControlled ? toArray(value) : internal;
|
|
72
|
-
const resolvedPlaceholder = placeholder ?? t("dataEntry.treeSelect.placeholder");
|
|
73
|
-
const visible = React.useMemo(() => {
|
|
74
|
-
if (showSearch && search.trim()) return filterVisibleTree(options, search);
|
|
75
|
-
return flattenVisibleTree(options, expandedKeys);
|
|
76
|
-
}, [options, expandedKeys, search, showSearch]);
|
|
77
|
-
const commit = (next) => {
|
|
78
|
-
if (!isControlled) setInternal(next);
|
|
79
|
-
onValueChange?.(checkable || multiple ? next : next[0] ?? void 0);
|
|
80
|
-
};
|
|
81
|
-
const toggleExpand = (key) => {
|
|
82
|
-
setExpandedKeys((prev) => {
|
|
83
|
-
const next = new Set(prev);
|
|
84
|
-
if (next.has(key)) next.delete(key);
|
|
85
|
-
else next.add(key);
|
|
86
|
-
return next;
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
const toggleSelect = (node) => {
|
|
90
|
-
if (node.disabled) return;
|
|
91
|
-
const key = node.value;
|
|
92
|
-
if (!checkable && !multiple) {
|
|
93
|
-
commit([key]);
|
|
94
|
-
setOpen(false);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const isOn = selected.includes(key);
|
|
98
|
-
let next;
|
|
99
|
-
if (treeCheckStrictly) {
|
|
100
|
-
next = isOn ? selected.filter((v) => v !== key) : [...selected, key];
|
|
101
|
-
} else {
|
|
102
|
-
const related = getDescendantValues(node);
|
|
103
|
-
next = isOn ? selected.filter((v) => !related.includes(v)) : [.../* @__PURE__ */ new Set([...selected, ...related])];
|
|
104
|
-
}
|
|
105
|
-
commit(next);
|
|
106
|
-
};
|
|
107
|
-
const displayKeys = displayValues(selected, options, showCheckedStrategy, treeCheckStrictly);
|
|
108
|
-
const displayLabel = displayKeys.map((v) => {
|
|
109
|
-
const label = findNodeByValue(options, v)?.label;
|
|
110
|
-
return label ? reactNodeText(label) : v;
|
|
111
|
-
}).join(", ");
|
|
112
|
-
const clearValue = (e) => {
|
|
113
|
-
e.stopPropagation();
|
|
114
|
-
commit([]);
|
|
115
|
-
};
|
|
116
|
-
const rovingKey = (activeKey && visible.some(({ node }) => node.value === activeKey) ? activeKey : null) ?? visible[0]?.node.value ?? null;
|
|
117
|
-
React.useEffect(() => {
|
|
118
|
-
if (!open || !activeKey) return;
|
|
119
|
-
treeItemRefs.current.get(activeKey)?.focus();
|
|
120
|
-
}, [activeKey, open, visible]);
|
|
121
|
-
const focusByOffset = (currentValue, delta) => {
|
|
122
|
-
const index = visible.findIndex(({ node }) => node.value === currentValue);
|
|
123
|
-
if (index === -1) return;
|
|
124
|
-
const next = visible[index + delta];
|
|
125
|
-
if (next) setActiveKey(next.node.value);
|
|
126
|
-
};
|
|
127
|
-
const onTreeItemKeyDown = (event, node, hasChildren, expanded) => {
|
|
128
|
-
switch (event.key) {
|
|
129
|
-
case "ArrowDown": {
|
|
130
|
-
event.preventDefault();
|
|
131
|
-
focusByOffset(node.value, 1);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
case "ArrowUp": {
|
|
135
|
-
event.preventDefault();
|
|
136
|
-
focusByOffset(node.value, -1);
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
case "ArrowRight": {
|
|
140
|
-
event.preventDefault();
|
|
141
|
-
if (hasChildren && !expanded) {
|
|
142
|
-
toggleExpand(node.value);
|
|
143
|
-
} else if (hasChildren && expanded) {
|
|
144
|
-
focusByOffset(node.value, 1);
|
|
145
|
-
}
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
case "ArrowLeft": {
|
|
149
|
-
event.preventDefault();
|
|
150
|
-
if (hasChildren && expanded) {
|
|
151
|
-
toggleExpand(node.value);
|
|
152
|
-
}
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
case "Enter":
|
|
156
|
-
case " ": {
|
|
157
|
-
event.preventDefault();
|
|
158
|
-
toggleSelect(node);
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
164
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
165
|
-
Button,
|
|
166
|
-
{
|
|
167
|
-
id,
|
|
168
|
-
type: "button",
|
|
169
|
-
variant: "outline",
|
|
170
|
-
role: "combobox",
|
|
171
|
-
"aria-expanded": open,
|
|
172
|
-
disabled,
|
|
173
|
-
className: cn(
|
|
174
|
-
"w-full justify-between font-normal",
|
|
175
|
-
controlOpenRingClass,
|
|
176
|
-
!displayKeys.length && "text-muted-foreground",
|
|
177
|
-
className
|
|
178
|
-
),
|
|
179
|
-
children: [
|
|
180
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: displayKeys.length ? displayLabel : resolvedPlaceholder }),
|
|
181
|
-
/* @__PURE__ */ jsxs("span", { className: "ms-2 flex shrink-0 items-center gap-1", children: [
|
|
182
|
-
allowClear && displayKeys.length > 0 && !disabled && /* @__PURE__ */ jsx(
|
|
183
|
-
"button",
|
|
184
|
-
{
|
|
185
|
-
type: "button",
|
|
186
|
-
"aria-label": t("dataEntry.treeSelect.clear"),
|
|
187
|
-
className: "flex size-4 items-center justify-center rounded-sm opacity-50 hover:opacity-100 focus-visible:opacity-100",
|
|
188
|
-
onClick: clearValue,
|
|
189
|
-
children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
|
|
190
|
-
}
|
|
191
|
-
),
|
|
192
|
-
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "size-4 opacity-50", "aria-hidden": "true" })
|
|
193
|
-
] })
|
|
194
|
-
]
|
|
195
|
-
}
|
|
196
|
-
) }),
|
|
197
|
-
/* @__PURE__ */ jsxs(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: [
|
|
198
|
-
showSearch && /* @__PURE__ */ jsx("div", { className: "border-b p-2", children: /* @__PURE__ */ jsx(Command, { shouldFilter: false, children: /* @__PURE__ */ jsx(
|
|
199
|
-
CommandInput,
|
|
200
|
-
{
|
|
201
|
-
placeholder: t("dataEntry.treeSelect.searchPlaceholder"),
|
|
202
|
-
value: search,
|
|
203
|
-
onValueChange: setSearch
|
|
204
|
-
}
|
|
205
|
-
) }) }),
|
|
206
|
-
/* @__PURE__ */ jsx(ScrollArea, { className: "max-h-[min(300px,50vh)]", children: /* @__PURE__ */ jsx(
|
|
207
|
-
"div",
|
|
208
|
-
{
|
|
209
|
-
role: "tree",
|
|
210
|
-
"aria-multiselectable": Boolean(checkable) || Boolean(multiple),
|
|
211
|
-
className: "p-1",
|
|
212
|
-
children: visible.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground py-6 text-center text-sm", children: t("dataEntry.treeSelect.empty") }) : visible.map(({ node, depth, hasChildren }) => {
|
|
213
|
-
const expanded = expandedKeys.has(node.value);
|
|
214
|
-
const isSelected = selected.includes(node.value);
|
|
215
|
-
return /* @__PURE__ */ jsxs(
|
|
216
|
-
"div",
|
|
217
|
-
{
|
|
218
|
-
ref: (el) => {
|
|
219
|
-
treeItemRefs.current.set(node.value, el);
|
|
220
|
-
},
|
|
221
|
-
role: "treeitem",
|
|
222
|
-
tabIndex: node.disabled ? -1 : rovingKey === node.value ? 0 : -1,
|
|
223
|
-
"aria-expanded": hasChildren ? expanded : void 0,
|
|
224
|
-
"aria-selected": isSelected,
|
|
225
|
-
onFocus: () => setActiveKey(node.value),
|
|
226
|
-
onKeyDown: (event) => onTreeItemKeyDown(event, node, hasChildren, expanded),
|
|
227
|
-
className: cn(
|
|
228
|
-
"flex items-center rounded-sm py-1.5 pe-2 text-sm outline-none",
|
|
229
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
230
|
-
"focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-1",
|
|
231
|
-
isSelected && "bg-accent/60",
|
|
232
|
-
node.disabled && "pointer-events-none opacity-50"
|
|
233
|
-
),
|
|
234
|
-
style: { paddingInlineStart: `${depth * 1.25 + 0.5}rem` },
|
|
235
|
-
children: [
|
|
236
|
-
/* @__PURE__ */ jsx(
|
|
237
|
-
"button",
|
|
238
|
-
{
|
|
239
|
-
type: "button",
|
|
240
|
-
tabIndex: -1,
|
|
241
|
-
"aria-label": expanded ? t("dataEntry.treeSelect.collapse") : t("dataEntry.treeSelect.expand"),
|
|
242
|
-
className: cn(
|
|
243
|
-
"me-1 flex size-5 shrink-0 items-center justify-center rounded-sm",
|
|
244
|
-
!hasChildren && "invisible"
|
|
245
|
-
),
|
|
246
|
-
onClick: () => toggleExpand(node.value),
|
|
247
|
-
children: expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-4", "aria-hidden": "true" })
|
|
248
|
-
}
|
|
249
|
-
),
|
|
250
|
-
checkable ? /* @__PURE__ */ jsxs("label", { className: "flex flex-1 cursor-pointer items-center gap-2", children: [
|
|
251
|
-
/* @__PURE__ */ jsx(
|
|
252
|
-
Checkbox,
|
|
253
|
-
{
|
|
254
|
-
checked: isSelected,
|
|
255
|
-
tabIndex: -1,
|
|
256
|
-
disabled: Boolean(node.disabled) || Boolean(node.disableCheckbox),
|
|
257
|
-
onCheckedChange: () => toggleSelect(node)
|
|
258
|
-
}
|
|
259
|
-
),
|
|
260
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: node.label })
|
|
261
|
-
] }) : /* @__PURE__ */ jsx(
|
|
262
|
-
"button",
|
|
263
|
-
{
|
|
264
|
-
type: "button",
|
|
265
|
-
tabIndex: -1,
|
|
266
|
-
className: "flex-1 truncate text-start",
|
|
267
|
-
disabled: node.disabled,
|
|
268
|
-
onClick: () => toggleSelect(node),
|
|
269
|
-
children: node.label
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
]
|
|
273
|
-
},
|
|
274
|
-
node.value
|
|
275
|
-
);
|
|
276
|
-
})
|
|
277
|
-
}
|
|
278
|
-
) })
|
|
279
|
-
] })
|
|
280
|
-
] });
|
|
281
|
-
}
|
|
282
|
-
var TreeSelect = Object.assign(TreeSelectRoot, {
|
|
283
|
-
SHOW_CHILD,
|
|
284
|
-
SHOW_PARENT,
|
|
285
|
-
SHOW_ALL
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
export { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeSelect };
|
package/dist/chunk-ES4Q3KGL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { toast as sonnerToast } from 'sonner';
|
package/dist/chunk-FQGGF7GQ.js
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import { normalizeTreeOptions, formatPathLabels, getNodeByPath, filterTreeOptions, pathsEqual, pathKey } from './chunk-SMLKNECP.js';
|
|
2
|
-
import { Command, CommandInput } from './chunk-2RGPEFAW.js';
|
|
3
|
-
import { Button } from './chunk-XBFUROAY.js';
|
|
4
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
5
|
-
import { ScrollArea, ScrollBar } from './chunk-J2DEWIYY.js';
|
|
6
|
-
import { controlOpenRingClass } from './chunk-B4K4BXEF.js';
|
|
7
|
-
import { useTranslation } from './chunk-B6S6LTWT.js';
|
|
8
|
-
import { cn } from './chunk-U7N2A7A3.js';
|
|
9
|
-
import * as React from 'react';
|
|
10
|
-
import { Check, X, ChevronsUpDown, ChevronRight, Minus } from 'lucide-react';
|
|
11
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
function pathInValues(path, values) {
|
|
14
|
-
return values.some((v) => pathsEqual(v, path));
|
|
15
|
-
}
|
|
16
|
-
function togglePath(values, path) {
|
|
17
|
-
if (pathInValues(path, values)) return values.filter((v) => !pathsEqual(v, path));
|
|
18
|
-
return [...values, path];
|
|
19
|
-
}
|
|
20
|
-
function CheckboxVisual({
|
|
21
|
-
checked,
|
|
22
|
-
indeterminate,
|
|
23
|
-
disabled,
|
|
24
|
-
className
|
|
25
|
-
}) {
|
|
26
|
-
const state = indeterminate ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
-
"span",
|
|
29
|
-
{
|
|
30
|
-
"aria-hidden": "true",
|
|
31
|
-
"data-slot": "checkbox",
|
|
32
|
-
"data-state": state,
|
|
33
|
-
className: cn(
|
|
34
|
-
"ui-checkbox inline-flex items-center justify-center",
|
|
35
|
-
// The shared CSS fills the box for [data-state=checked]; mirror that fill for the
|
|
36
|
-
// indeterminate ("some children selected") state so a partial parent reads as partial.
|
|
37
|
-
"data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",
|
|
38
|
-
disabled && "cursor-not-allowed opacity-50",
|
|
39
|
-
className
|
|
40
|
-
),
|
|
41
|
-
children: indeterminate ? /* @__PURE__ */ jsx(Minus, { className: "ui-checkbox-icon", "aria-hidden": "true" }) : checked ? /* @__PURE__ */ jsx(Check, { className: "ui-checkbox-icon", "aria-hidden": "true" }) : null
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function aggregateCheckState(node, path, values) {
|
|
46
|
-
let total = 0;
|
|
47
|
-
let selected = 0;
|
|
48
|
-
const walk = (n, p) => {
|
|
49
|
-
const isLeaf = (n.children?.length ?? 0) === 0 || n.isLeaf === true;
|
|
50
|
-
if (isLeaf) {
|
|
51
|
-
if (n.disabled || n.disableCheckbox) return;
|
|
52
|
-
total += 1;
|
|
53
|
-
if (pathInValues(p, values)) selected += 1;
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
for (const child of n.children) walk(child, [...p, child.value]);
|
|
57
|
-
};
|
|
58
|
-
for (const child of node.children ?? []) walk(child, [...path, child.value]);
|
|
59
|
-
if (total === 0 || selected === 0) return "none";
|
|
60
|
-
return selected === total ? "checked" : "indeterminate";
|
|
61
|
-
}
|
|
62
|
-
function Cascader({
|
|
63
|
-
options: optionsProp,
|
|
64
|
-
value,
|
|
65
|
-
defaultValue,
|
|
66
|
-
onValueChange,
|
|
67
|
-
multiple,
|
|
68
|
-
changeOnSelect,
|
|
69
|
-
showSearch,
|
|
70
|
-
placeholder,
|
|
71
|
-
disabled,
|
|
72
|
-
className,
|
|
73
|
-
id,
|
|
74
|
-
expandTrigger = "click",
|
|
75
|
-
fieldNames,
|
|
76
|
-
allowClear = true
|
|
77
|
-
}) {
|
|
78
|
-
const { t } = useTranslation();
|
|
79
|
-
const options = React.useMemo(
|
|
80
|
-
() => normalizeTreeOptions(optionsProp, fieldNames),
|
|
81
|
-
[optionsProp, fieldNames]
|
|
82
|
-
);
|
|
83
|
-
const [open, setOpen] = React.useState(false);
|
|
84
|
-
const [activePath, setActivePath] = React.useState([]);
|
|
85
|
-
const [search, setSearch] = React.useState("");
|
|
86
|
-
const isControlledSingle = !multiple && value !== void 0;
|
|
87
|
-
const isControlledMulti = multiple && value !== void 0;
|
|
88
|
-
const [internalSingle, setInternalSingle] = React.useState(
|
|
89
|
-
multiple ? [] : defaultValue ?? []
|
|
90
|
-
);
|
|
91
|
-
const [internalMulti, setInternalMulti] = React.useState(
|
|
92
|
-
defaultValue ?? []
|
|
93
|
-
);
|
|
94
|
-
const singleValue = isControlledSingle ? value : internalSingle;
|
|
95
|
-
const multiValue = isControlledMulti ? value : internalMulti;
|
|
96
|
-
const resolvedPlaceholder = placeholder ?? t("dataEntry.cascader.placeholder");
|
|
97
|
-
const displayLabel = React.useMemo(() => {
|
|
98
|
-
if (multiple) {
|
|
99
|
-
if (!multiValue.length) return null;
|
|
100
|
-
return multiValue.map((path) => formatPathLabels(getNodeByPath(options, path))).join(", ");
|
|
101
|
-
}
|
|
102
|
-
if (!singleValue.length) return null;
|
|
103
|
-
return formatPathLabels(getNodeByPath(options, singleValue));
|
|
104
|
-
}, [multiple, multiValue, singleValue, options]);
|
|
105
|
-
const setSingleValue = (path) => {
|
|
106
|
-
if (!isControlledSingle) setInternalSingle(path);
|
|
107
|
-
onValueChange?.(path, getNodeByPath(options, path));
|
|
108
|
-
};
|
|
109
|
-
const commitSingle = (path) => {
|
|
110
|
-
setSingleValue(path);
|
|
111
|
-
setOpen(false);
|
|
112
|
-
setActivePath([]);
|
|
113
|
-
setSearch("");
|
|
114
|
-
};
|
|
115
|
-
const commitMulti = (paths) => {
|
|
116
|
-
if (!isControlledMulti) setInternalMulti(paths);
|
|
117
|
-
onValueChange?.(
|
|
118
|
-
paths,
|
|
119
|
-
paths.map((p) => getNodeByPath(options, p))
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
const columns = React.useMemo(() => {
|
|
123
|
-
const cols = [options];
|
|
124
|
-
for (const segment of activePath) {
|
|
125
|
-
const col = cols.at(-1);
|
|
126
|
-
const node = col?.find((n) => n.value === segment);
|
|
127
|
-
if (node?.children?.length) cols.push(node.children);
|
|
128
|
-
else break;
|
|
129
|
-
}
|
|
130
|
-
return cols;
|
|
131
|
-
}, [options, activePath]);
|
|
132
|
-
const handleSelectNode = (node, path) => {
|
|
133
|
-
const hasChildren = (node.children?.length ?? 0) > 0 && node.isLeaf !== true;
|
|
134
|
-
if (multiple) {
|
|
135
|
-
if (hasChildren && !changeOnSelect) setActivePath(path);
|
|
136
|
-
else if (!node.disableCheckbox) commitMulti(togglePath(multiValue, path));
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (hasChildren) {
|
|
140
|
-
if (changeOnSelect) setSingleValue(path);
|
|
141
|
-
setActivePath(path);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
commitSingle(path);
|
|
145
|
-
};
|
|
146
|
-
const isSearching = showSearch && search.trim().length > 0;
|
|
147
|
-
const searchResults = React.useMemo(
|
|
148
|
-
() => isSearching ? filterTreeOptions(options, search) : [],
|
|
149
|
-
[options, search, isSearching]
|
|
150
|
-
);
|
|
151
|
-
const handleOpenChange = (next) => {
|
|
152
|
-
setOpen(next);
|
|
153
|
-
if (next) {
|
|
154
|
-
setActivePath(multiple ? [] : singleValue);
|
|
155
|
-
} else {
|
|
156
|
-
setSearch("");
|
|
157
|
-
setActivePath([]);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const clearValue = (e) => {
|
|
161
|
-
e.stopPropagation();
|
|
162
|
-
if (multiple) commitMulti([]);
|
|
163
|
-
else commitSingle([]);
|
|
164
|
-
};
|
|
165
|
-
const renderCascadeColumns = () => /* @__PURE__ */ jsxs(ScrollArea, { className: "w-full", children: [
|
|
166
|
-
/* @__PURE__ */ jsx("div", { className: "flex max-h-[min(280px,50vh)]", children: columns.map((col, colIndex) => /* @__PURE__ */ jsx(
|
|
167
|
-
"ul",
|
|
168
|
-
{
|
|
169
|
-
role: "listbox",
|
|
170
|
-
"aria-orientation": "vertical",
|
|
171
|
-
"aria-multiselectable": multiple ? true : void 0,
|
|
172
|
-
className: "min-w-[9rem] border-e last:border-e-0",
|
|
173
|
-
children: col.map((node) => {
|
|
174
|
-
const path = [...activePath.slice(0, colIndex), node.value];
|
|
175
|
-
const hasChildren = (node.children?.length ?? 0) > 0 && node.isLeaf !== true;
|
|
176
|
-
const active = activePath[colIndex] === node.value;
|
|
177
|
-
const selected = multiple ? pathInValues(path, multiValue) : pathsEqual(path, singleValue);
|
|
178
|
-
const aggregate = multiple && hasChildren ? aggregateCheckState(node, path, multiValue) : void 0;
|
|
179
|
-
return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsxs(
|
|
180
|
-
"button",
|
|
181
|
-
{
|
|
182
|
-
type: "button",
|
|
183
|
-
role: "option",
|
|
184
|
-
"aria-selected": selected,
|
|
185
|
-
"aria-haspopup": hasChildren ? "menu" : void 0,
|
|
186
|
-
"aria-expanded": hasChildren ? active : void 0,
|
|
187
|
-
disabled: node.disabled,
|
|
188
|
-
className: cn(
|
|
189
|
-
"flex w-full items-center gap-1 px-3 py-2 text-sm outline-none",
|
|
190
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
191
|
-
active && "bg-accent/70 font-medium",
|
|
192
|
-
node.disabled && "pointer-events-none opacity-50"
|
|
193
|
-
),
|
|
194
|
-
onMouseEnter: (
|
|
195
|
-
// Hover-expand: a parent opens its children column; a leaf collapses any
|
|
196
|
-
// deeper column but keeps its own. Never collapse on the column's mouseleave
|
|
197
|
-
// — moving the pointer toward the next column would strand the deeper levels
|
|
198
|
-
// and make a depth-3 leaf unreachable.
|
|
199
|
-
expandTrigger === "hover" && !node.disabled ? () => setActivePath(hasChildren ? path : path.slice(0, -1)) : void 0
|
|
200
|
-
),
|
|
201
|
-
onClick: () => !node.disabled && handleSelectNode(node, path),
|
|
202
|
-
children: [
|
|
203
|
-
multiple && /* @__PURE__ */ jsx(
|
|
204
|
-
CheckboxVisual,
|
|
205
|
-
{
|
|
206
|
-
checked: aggregate ? aggregate === "checked" : selected,
|
|
207
|
-
indeterminate: aggregate === "indeterminate",
|
|
208
|
-
disabled: node.disabled || node.disableCheckbox,
|
|
209
|
-
className: "me-1"
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
!multiple && selected && /* @__PURE__ */ jsx(Check, { className: "me-1 size-4 shrink-0", "aria-hidden": "true" }),
|
|
213
|
-
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-start", children: node.label }),
|
|
214
|
-
hasChildren && /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 shrink-0 opacity-50", "aria-hidden": "true" })
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
|
-
) }, node.value);
|
|
218
|
-
})
|
|
219
|
-
},
|
|
220
|
-
colIndex
|
|
221
|
-
)) }),
|
|
222
|
-
/* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" })
|
|
223
|
-
] });
|
|
224
|
-
const showClear = allowClear && displayLabel && !disabled;
|
|
225
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
226
|
-
/* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
227
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
228
|
-
Button,
|
|
229
|
-
{
|
|
230
|
-
id,
|
|
231
|
-
type: "button",
|
|
232
|
-
variant: "outline",
|
|
233
|
-
role: "combobox",
|
|
234
|
-
"aria-expanded": open,
|
|
235
|
-
disabled,
|
|
236
|
-
className: cn(
|
|
237
|
-
"w-full justify-start font-normal",
|
|
238
|
-
controlOpenRingClass,
|
|
239
|
-
// Reserve trailing room for the clear + chevron overlay rendered below.
|
|
240
|
-
showClear ? "pe-14" : "pe-9",
|
|
241
|
-
!displayLabel && "text-muted-foreground"
|
|
242
|
-
),
|
|
243
|
-
children: /* @__PURE__ */ jsx("span", { className: "truncate", children: displayLabel ?? resolvedPlaceholder })
|
|
244
|
-
}
|
|
245
|
-
) }),
|
|
246
|
-
/* @__PURE__ */ jsxs(
|
|
247
|
-
PopoverContent,
|
|
248
|
-
{
|
|
249
|
-
className: "w-auto min-w-[var(--radix-popover-trigger-width)] p-0",
|
|
250
|
-
align: "start",
|
|
251
|
-
children: [
|
|
252
|
-
showSearch && /* @__PURE__ */ jsx("div", { className: "border-b p-2", children: /* @__PURE__ */ jsx(Command, { shouldFilter: false, children: /* @__PURE__ */ jsx(
|
|
253
|
-
CommandInput,
|
|
254
|
-
{
|
|
255
|
-
placeholder: t("dataEntry.cascader.searchPlaceholder"),
|
|
256
|
-
value: search,
|
|
257
|
-
onValueChange: setSearch
|
|
258
|
-
}
|
|
259
|
-
) }) }),
|
|
260
|
-
isSearching ? /* @__PURE__ */ jsx(ScrollArea, { className: "max-h-[min(300px,50vh)]", children: /* @__PURE__ */ jsx(
|
|
261
|
-
"div",
|
|
262
|
-
{
|
|
263
|
-
className: "p-1",
|
|
264
|
-
role: "listbox",
|
|
265
|
-
"aria-multiselectable": multiple ? true : void 0,
|
|
266
|
-
children: searchResults.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground py-6 text-center text-sm", children: t("dataEntry.cascader.empty") }) : searchResults.map(({ path, labels }) => {
|
|
267
|
-
const label = labels.join(" / ");
|
|
268
|
-
const selected = multiple ? pathInValues(path, multiValue) : pathsEqual(path, singleValue);
|
|
269
|
-
return /* @__PURE__ */ jsxs(
|
|
270
|
-
"button",
|
|
271
|
-
{
|
|
272
|
-
type: "button",
|
|
273
|
-
role: "option",
|
|
274
|
-
"aria-selected": selected,
|
|
275
|
-
className: cn(
|
|
276
|
-
"flex w-full items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
277
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
278
|
-
selected && "bg-accent/60"
|
|
279
|
-
),
|
|
280
|
-
onClick: () => handleSelectNode({ value: path.at(-1)}, path),
|
|
281
|
-
children: [
|
|
282
|
-
multiple ? /* @__PURE__ */ jsx(CheckboxVisual, { checked: selected, className: "me-2" }) : /* @__PURE__ */ jsx(
|
|
283
|
-
Check,
|
|
284
|
-
{
|
|
285
|
-
className: cn(
|
|
286
|
-
"me-2 size-4 shrink-0",
|
|
287
|
-
selected ? "opacity-100" : "opacity-0"
|
|
288
|
-
),
|
|
289
|
-
"aria-hidden": "true"
|
|
290
|
-
}
|
|
291
|
-
),
|
|
292
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-start", children: label })
|
|
293
|
-
]
|
|
294
|
-
},
|
|
295
|
-
pathKey(path)
|
|
296
|
-
);
|
|
297
|
-
})
|
|
298
|
-
}
|
|
299
|
-
) }) : renderCascadeColumns()
|
|
300
|
-
]
|
|
301
|
-
}
|
|
302
|
-
)
|
|
303
|
-
] }),
|
|
304
|
-
/* @__PURE__ */ jsxs("div", { className: "pointer-events-none absolute inset-y-0 end-3 flex items-center gap-1", children: [
|
|
305
|
-
showClear && /* @__PURE__ */ jsx(
|
|
306
|
-
"button",
|
|
307
|
-
{
|
|
308
|
-
type: "button",
|
|
309
|
-
"aria-label": t("dataEntry.cascader.clear"),
|
|
310
|
-
className: "pointer-events-auto flex size-4 items-center justify-center rounded-sm opacity-50 hover:opacity-100 focus-visible:opacity-100",
|
|
311
|
-
onClick: clearValue,
|
|
312
|
-
children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "size-4 shrink-0 opacity-50", "aria-hidden": "true" })
|
|
316
|
-
] })
|
|
317
|
-
] });
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export { Cascader };
|
package/dist/chunk-GJXOBDER.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|