@godxjp/ui 13.9.3 → 13.11.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/components/data-display/data-table.js +424 -0
- 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 +45 -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/dist/styles/table-layout.css +38 -0
- package/dist/tokens/components/table.css +2 -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-NVTZ2EDW.js +0 -389
- 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
|
@@ -1,5 +1,150 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, Circle, Loader2, X } from "lucide-react";
|
|
3
|
+
import { useTranslation } from "../../i18n/use-translation";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { controlIconClass } from "../../lib/control-styles";
|
|
6
|
+
function resolveStepStatus(index, current, itemStatus, currentStatus) {
|
|
7
|
+
if (itemStatus) return itemStatus;
|
|
8
|
+
if (index < current) return "finish";
|
|
9
|
+
if (index === current) return currentStatus ?? "process";
|
|
10
|
+
return "wait";
|
|
11
|
+
}
|
|
12
|
+
function StepIcon({
|
|
13
|
+
status,
|
|
14
|
+
icon,
|
|
15
|
+
type
|
|
16
|
+
}) {
|
|
17
|
+
if (icon)
|
|
18
|
+
return /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", controlIconClass), children: icon });
|
|
19
|
+
if (type === "dot") {
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"span",
|
|
22
|
+
{
|
|
23
|
+
className: cn(
|
|
24
|
+
"block size-2.5 rounded-full",
|
|
25
|
+
status === "finish" && "bg-primary",
|
|
26
|
+
status === "process" && "bg-primary ring-primary/20 ring-4",
|
|
27
|
+
status === "error" && "bg-destructive",
|
|
28
|
+
status === "wait" && "bg-muted-foreground/30"
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
34
|
+
"span",
|
|
35
|
+
{
|
|
36
|
+
className: cn(
|
|
37
|
+
"flex items-center justify-center",
|
|
38
|
+
controlIconClass,
|
|
39
|
+
"rounded-full border-2 text-sm font-medium",
|
|
40
|
+
status === "finish" && "border-primary bg-primary text-primary-foreground",
|
|
41
|
+
status === "process" && "border-primary text-primary",
|
|
42
|
+
status === "error" && "border-destructive bg-destructive text-destructive-foreground",
|
|
43
|
+
status === "wait" && "border-muted-foreground/30 text-muted-foreground"
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
status === "finish" && /* @__PURE__ */ jsx(Check, { className: "size-4", "aria-hidden": "true" }),
|
|
47
|
+
status === "process" && /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
|
|
48
|
+
status === "error" && /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" }),
|
|
49
|
+
status === "wait" && /* @__PURE__ */ jsx(Circle, { className: "size-3 fill-current", "aria-hidden": "true" })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function Steps({
|
|
55
|
+
items = [],
|
|
56
|
+
value: current = 0,
|
|
57
|
+
defaultValue = 0,
|
|
58
|
+
status: currentStatus = "process",
|
|
59
|
+
orientation = "horizontal",
|
|
60
|
+
type = "default",
|
|
61
|
+
size = "md",
|
|
62
|
+
titlePlacement = "horizontal",
|
|
63
|
+
onValueChange,
|
|
64
|
+
className
|
|
65
|
+
}) {
|
|
66
|
+
const { t } = useTranslation();
|
|
67
|
+
const base = defaultValue;
|
|
68
|
+
const isVertical = orientation === "vertical";
|
|
69
|
+
const compact = size === "sm";
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"ol",
|
|
72
|
+
{
|
|
73
|
+
className: cn(
|
|
74
|
+
"flex w-full",
|
|
75
|
+
isVertical ? "flex-col gap-0" : "flex-row items-start",
|
|
76
|
+
className
|
|
77
|
+
),
|
|
78
|
+
"aria-label": t("navigation.steps.ariaLabel"),
|
|
79
|
+
children: items.map((item, index) => {
|
|
80
|
+
const absoluteIndex = base + index;
|
|
81
|
+
const stepStatus = resolveStepStatus(absoluteIndex, current, item.status, currentStatus);
|
|
82
|
+
const interactive = Boolean(onValueChange);
|
|
83
|
+
const clickable = interactive && !item.disabled;
|
|
84
|
+
const description = item.description;
|
|
85
|
+
const isCurrent = absoluteIndex === current;
|
|
86
|
+
const stepClassName = cn(
|
|
87
|
+
"group flex min-w-0",
|
|
88
|
+
isVertical ? "flex-row items-start gap-3" : "flex-col items-center",
|
|
89
|
+
clickable ? "cursor-pointer" : "cursor-default"
|
|
90
|
+
);
|
|
91
|
+
const stepInner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx(StepIcon, { status: stepStatus, icon: item.icon, type }),
|
|
93
|
+
/* @__PURE__ */ jsxs(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
className: cn(
|
|
97
|
+
"min-w-0",
|
|
98
|
+
isVertical ? "pt-1 text-start" : "mt-2 px-2",
|
|
99
|
+
titlePlacement === "vertical" && !isVertical && "mt-1"
|
|
100
|
+
),
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
className: cn(
|
|
106
|
+
"font-medium",
|
|
107
|
+
compact ? "text-xs" : "text-sm",
|
|
108
|
+
stepStatus === "process" && "text-foreground",
|
|
109
|
+
stepStatus === "wait" && "text-muted-foreground",
|
|
110
|
+
stepStatus === "error" && "text-destructive"
|
|
111
|
+
),
|
|
112
|
+
children: item.title
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
item.subtitle && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-xs", children: item.subtitle }),
|
|
116
|
+
description && /* @__PURE__ */ jsx("div", { className: cn("text-muted-foreground", compact ? "text-xs" : "text-sm"), children: description })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] });
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
"li",
|
|
123
|
+
{
|
|
124
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
125
|
+
className: cn(
|
|
126
|
+
"relative flex min-w-0 flex-1",
|
|
127
|
+
isVertical ? "flex-row gap-3 pb-8 last:pb-0" : "flex-col items-center text-center",
|
|
128
|
+
!isVertical && index < items.length - 1 && "after:bg-border after:absolute after:top-4 after:h-px",
|
|
129
|
+
!isVertical && index < items.length - 1 && "after:left-[calc(50%+1.25rem)] after:w-[calc(100%-2.5rem)]"
|
|
130
|
+
),
|
|
131
|
+
children: interactive ? /* @__PURE__ */ jsx(
|
|
132
|
+
"button",
|
|
133
|
+
{
|
|
134
|
+
type: "button",
|
|
135
|
+
disabled: !clickable,
|
|
136
|
+
onClick: clickable ? () => onValueChange?.(absoluteIndex) : void 0,
|
|
137
|
+
className: stepClassName,
|
|
138
|
+
children: stepInner
|
|
139
|
+
}
|
|
140
|
+
) : /* @__PURE__ */ jsx("span", { className: stepClassName, children: stepInner })
|
|
141
|
+
},
|
|
142
|
+
index
|
|
143
|
+
);
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
Steps
|
|
150
|
+
};
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type TabsItem = {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
export type TabsItem = {
|
|
6
4
|
value: string;
|
|
7
5
|
label: React.ReactNode;
|
|
8
6
|
content: React.ReactNode;
|
|
9
7
|
disabled?: boolean;
|
|
10
8
|
};
|
|
11
|
-
type TabsProps = React.ComponentProps<typeof TabsPrimitive.Root> & {
|
|
9
|
+
export type TabsProps = React.ComponentProps<typeof TabsPrimitive.Root> & {
|
|
12
10
|
items?: TabsItem[];
|
|
13
11
|
variant?: "default" | "line" | "card";
|
|
14
12
|
listClassName?: string;
|
|
15
13
|
contentClassName?: string;
|
|
16
14
|
};
|
|
17
|
-
declare function Tabs({ className, orientation, items, value, defaultValue, variant, listClassName, contentClassName, ...props }: TabsProps):
|
|
18
|
-
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
export declare function Tabs({ className, orientation, items, value, defaultValue, variant, listClassName, contentClassName, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
17
|
variant?: "default" | "line";
|
|
20
18
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
-
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
-
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
|
|
24
|
-
export { Tabs, TabsContent, type TabsItem, TabsList, type TabsProps, TabsTrigger };
|
|
19
|
+
export declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
function Tabs({
|
|
6
|
+
className,
|
|
7
|
+
orientation = "horizontal",
|
|
8
|
+
items,
|
|
9
|
+
value,
|
|
10
|
+
defaultValue,
|
|
11
|
+
variant = "default",
|
|
12
|
+
listClassName,
|
|
13
|
+
contentClassName,
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
const firstValue = items?.[0]?.value;
|
|
17
|
+
const resolvedDefault = defaultValue ?? firstValue;
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
TabsPrimitive.Root,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "tabs",
|
|
22
|
+
"data-orientation": orientation,
|
|
23
|
+
orientation,
|
|
24
|
+
value,
|
|
25
|
+
defaultValue: value === void 0 ? resolvedDefault : void 0,
|
|
26
|
+
className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className),
|
|
27
|
+
...props,
|
|
28
|
+
children: items ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
TabsList,
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "tabs-list",
|
|
33
|
+
className: cn(
|
|
34
|
+
variant === "line" && "h-auto w-full justify-start rounded-none border-b bg-transparent p-0",
|
|
35
|
+
variant === "card" && "w-full justify-start",
|
|
36
|
+
listClassName
|
|
37
|
+
),
|
|
38
|
+
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
39
|
+
TabsTrigger,
|
|
40
|
+
{
|
|
41
|
+
value: item.value,
|
|
42
|
+
disabled: item.disabled,
|
|
43
|
+
className: cn(
|
|
44
|
+
variant === "line" && "data-[state=active]:border-primary rounded-none border-b-2 border-transparent bg-transparent px-4 py-2 shadow-none data-[state=active]:bg-transparent data-[state=active]:shadow-none",
|
|
45
|
+
variant === "card" && "data-[state=active]:shadow-sm"
|
|
46
|
+
),
|
|
47
|
+
children: item.label
|
|
48
|
+
},
|
|
49
|
+
item.value
|
|
50
|
+
))
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
items.map((item) => /* @__PURE__ */ jsx(
|
|
54
|
+
TabsContent,
|
|
55
|
+
{
|
|
56
|
+
value: item.value,
|
|
57
|
+
"data-slot": "tabs-panel",
|
|
58
|
+
className: cn(variant === "line" && "mt-0", contentClassName),
|
|
59
|
+
children: item.content
|
|
60
|
+
},
|
|
61
|
+
item.value
|
|
62
|
+
))
|
|
63
|
+
] }) : props.children
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
const TabsList = React.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
68
|
+
TabsPrimitive.List,
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
"data-slot": "tabs-list",
|
|
72
|
+
"data-variant": variant,
|
|
73
|
+
className: cn(
|
|
74
|
+
"group/tabs-list text-muted-foreground data-[variant=default]:bg-muted inline-flex w-fit items-center justify-center rounded-lg p-1 group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:gap-1 data-[variant=line]:rounded-none data-[variant=line]:bg-transparent",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
81
|
+
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
82
|
+
TabsPrimitive.Trigger,
|
|
83
|
+
{
|
|
84
|
+
ref,
|
|
85
|
+
"data-slot": "tabs-trigger",
|
|
86
|
+
className: cn(
|
|
87
|
+
"text-foreground/60 ring-offset-background hover:text-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-ring/50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:ring-primary/25 after:bg-foreground relative inline-flex flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-3 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:ring-1 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
|
|
88
|
+
className
|
|
89
|
+
),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
94
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
95
|
+
TabsPrimitive.Content,
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
"data-slot": "tabs-content",
|
|
99
|
+
className: cn("focus-visible:ring-ring flex-1 outline-none focus-visible:ring-2", className),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
));
|
|
103
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
104
|
+
export {
|
|
105
|
+
Tabs,
|
|
106
|
+
TabsContent,
|
|
107
|
+
TabsList,
|
|
108
|
+
TabsTrigger
|
|
109
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DataStateProp } from "../../props/components/query.prop";
|
|
2
|
+
export type { DataStateProp, DataStateProp as DataStateProps, } from "../../props/components/query.prop";
|
|
3
|
+
/**
|
|
4
|
+
* Query lifecycle widget — orchestrates skeleton / error / empty / success for one `useQuery` block.
|
|
5
|
+
* Not a visual component; prefer `@godxjp/ui/query`. Apps may also import via `@godxjp/ui/admin`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function DataState<T>({ query, skeleton, empty, isEmpty, errorRenderer, showRetry, onRetry, children, }: DataStateProp<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { AlertQueryError } from "../feedback/alert";
|
|
4
|
+
function defaultIsEmpty(data) {
|
|
5
|
+
if (!data) return true;
|
|
6
|
+
if (Array.isArray(data)) return data.length === 0;
|
|
7
|
+
if (typeof data === "object" && data !== null) {
|
|
8
|
+
const obj = data;
|
|
9
|
+
if (Array.isArray(obj.items)) return obj.items.length === 0;
|
|
10
|
+
if (typeof obj.length === "number") return obj.length === 0;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
function DataState({
|
|
15
|
+
query,
|
|
16
|
+
skeleton,
|
|
17
|
+
empty,
|
|
18
|
+
isEmpty = defaultIsEmpty,
|
|
19
|
+
errorRenderer,
|
|
20
|
+
showRetry = true,
|
|
21
|
+
onRetry,
|
|
22
|
+
children
|
|
23
|
+
}) {
|
|
24
|
+
const retry = React.useCallback(() => {
|
|
25
|
+
if (onRetry) {
|
|
26
|
+
void onRetry();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
void query.refetch();
|
|
30
|
+
}, [onRetry, query]);
|
|
31
|
+
if (query.isPending) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
32
|
+
if (query.isError) {
|
|
33
|
+
if (query.isFetching) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
34
|
+
if (errorRenderer) return /* @__PURE__ */ jsx(Fragment, { children: errorRenderer(query.error, retry) });
|
|
35
|
+
return /* @__PURE__ */ jsx(AlertQueryError, { error: query.error, onRetry: showRetry ? retry : void 0 });
|
|
36
|
+
}
|
|
37
|
+
const data = query.data;
|
|
38
|
+
if (data === void 0) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
39
|
+
if (empty && (data === null || isEmpty(data))) return /* @__PURE__ */ jsx(Fragment, { children: empty });
|
|
40
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
DataState
|
|
44
|
+
};
|
|
@@ -1,43 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Query lifecycle widget — orchestrates skeleton / error / empty / success for one `useQuery` block.
|
|
12
|
-
* Not a visual component; prefer `@godxjp/ui/query`. Apps may also import via `@godxjp/ui/admin`.
|
|
13
|
-
*/
|
|
14
|
-
declare function DataState<T>({ query, skeleton, empty, isEmpty, errorRenderer, showRetry, onRetry, children, }: DataStateProp<T>): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Inline mutation error — renders nothing when idle/success.
|
|
18
|
-
* Prefer toast for transient saves; use this for blocking form sections (SimulatorPage).
|
|
19
|
-
*/
|
|
20
|
-
declare function AlertMutationFeedback({ mutation, onRetry, showRetry, pending, className, }: AlertMutationFeedbackProp): react_jsx_runtime.JSX.Element | null;
|
|
21
|
-
|
|
22
|
-
/** Page-header Refresh — spins while `query.isFetching`, calls `query.refetch()`. */
|
|
23
|
-
declare function ButtonRefetch({ query, label, children, variant, size, className, ...props }: ButtonRefetchProp): react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
/** Flatten `{ pages: [{ items }] }` — default GODX paginated API shape. */
|
|
26
|
-
declare function flattenItemPages<TItem, TPage extends {
|
|
27
|
-
items: TItem[];
|
|
28
|
-
}>(data: {
|
|
29
|
-
pages: TPage[];
|
|
30
|
-
} | undefined): TItem[];
|
|
31
|
-
/**
|
|
32
|
-
* `useInfiniteQuery` lifecycle widget — flatten pages, load-more footer.
|
|
33
|
-
* Cursor / activity feeds where user accumulates pages (vs DataTable cursor buttons).
|
|
34
|
-
*/
|
|
35
|
-
declare function InfiniteQueryState<TPage, TFlat>({ query, skeleton, empty, flatten, isEmpty, errorRenderer, showRetry, onRetry, loadingMore, loadMore, showLoadMore, children, }: InfiniteQueryStateProp<TPage, TFlat>): react_jsx_runtime.JSX.Element;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* React Router `Link` + `queryClient.prefetchQuery` on hover/focus.
|
|
39
|
-
* Detail routes feel instant when list rows are hovered.
|
|
40
|
-
*/
|
|
41
|
-
declare function PrefetchLink({ queryKey, queryFn, prefetchOn, staleTime, onMouseEnter, onFocus, ...linkProps }: PrefetchLinkProp): react_jsx_runtime.JSX.Element;
|
|
42
|
-
|
|
43
|
-
export { AlertMutationFeedback, AlertMutationFeedbackProp, AlertMutationFeedbackProp as AlertMutationFeedbackProps, ButtonRefetch, ButtonRefetchProp, ButtonRefetchProp as ButtonRefetchProps, DataState, DataStateProp, DataStateProp as DataStateProps, InfiniteQueryState, InfiniteQueryStateProp, InfiniteQueryStateProp as InfiniteQueryStateProps, PrefetchLink, PrefetchLinkProp, PrefetchLinkProp as PrefetchLinkProps, flattenItemPages };
|
|
1
|
+
export { DataState } from "./data-state";
|
|
2
|
+
export type { DataStateProp, DataStateProps } from "./data-state";
|
|
3
|
+
export { AlertMutationFeedback } from "./mutation-feedback";
|
|
4
|
+
export type { AlertMutationFeedbackProp, AlertMutationFeedbackProps } from "./mutation-feedback";
|
|
5
|
+
export { ButtonRefetch } from "./query-refetch-button";
|
|
6
|
+
export type { ButtonRefetchProp, ButtonRefetchProps } from "./query-refetch-button";
|
|
7
|
+
export { InfiniteQueryState, flattenItemPages } from "./infinite-query-state";
|
|
8
|
+
export type { InfiniteQueryStateProp, InfiniteQueryStateProps } from "./infinite-query-state";
|
|
9
|
+
export { PrefetchLink } from "./prefetch-link";
|
|
10
|
+
export type { PrefetchLinkProp, PrefetchLinkProps } from "./prefetch-link";
|
|
@@ -1,195 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function defaultIsEmpty(data) {
|
|
15
|
-
if (!data) return true;
|
|
16
|
-
if (Array.isArray(data)) return data.length === 0;
|
|
17
|
-
if (typeof data === "object" && data !== null) {
|
|
18
|
-
const obj = data;
|
|
19
|
-
if (Array.isArray(obj.items)) return obj.items.length === 0;
|
|
20
|
-
if (typeof obj.length === "number") return obj.length === 0;
|
|
21
|
-
}
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
function DataState({
|
|
25
|
-
query,
|
|
26
|
-
skeleton,
|
|
27
|
-
empty,
|
|
28
|
-
isEmpty = defaultIsEmpty,
|
|
29
|
-
errorRenderer,
|
|
30
|
-
showRetry = true,
|
|
31
|
-
onRetry,
|
|
32
|
-
children
|
|
33
|
-
}) {
|
|
34
|
-
const retry = React.useCallback(() => {
|
|
35
|
-
if (onRetry) {
|
|
36
|
-
void onRetry();
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
void query.refetch();
|
|
40
|
-
}, [onRetry, query]);
|
|
41
|
-
if (query.isPending) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
42
|
-
if (query.isError) {
|
|
43
|
-
if (query.isFetching) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
44
|
-
if (errorRenderer) return /* @__PURE__ */ jsx(Fragment, { children: errorRenderer(query.error, retry) });
|
|
45
|
-
return /* @__PURE__ */ jsx(AlertQueryError, { error: query.error, onRetry: showRetry ? retry : void 0 });
|
|
46
|
-
}
|
|
47
|
-
const data = query.data;
|
|
48
|
-
if (data === void 0) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
49
|
-
if (empty && (data === null || isEmpty(data))) return /* @__PURE__ */ jsx(Fragment, { children: empty });
|
|
50
|
-
return /* @__PURE__ */ jsx(Fragment, { children: children(data) });
|
|
51
|
-
}
|
|
52
|
-
function AlertMutationFeedback({
|
|
53
|
-
mutation,
|
|
54
|
-
onRetry,
|
|
55
|
-
showRetry = true,
|
|
56
|
-
pending,
|
|
57
|
-
className
|
|
58
|
-
}) {
|
|
59
|
-
if (mutation.isPending && pending) return /* @__PURE__ */ jsx(Fragment, { children: pending });
|
|
60
|
-
if (!mutation.isError || mutation.error == null) return null;
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
AlertQueryError,
|
|
63
|
-
{
|
|
64
|
-
className,
|
|
65
|
-
error: mutation.error,
|
|
66
|
-
onRetry: showRetry ? onRetry : void 0
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
function ButtonRefetch({
|
|
71
|
-
query,
|
|
72
|
-
label = "Refresh",
|
|
73
|
-
children,
|
|
74
|
-
variant = "outline",
|
|
75
|
-
size = "sm",
|
|
76
|
-
className,
|
|
77
|
-
...props
|
|
78
|
-
}) {
|
|
79
|
-
const text = children ?? label;
|
|
80
|
-
return /* @__PURE__ */ jsxs(
|
|
81
|
-
Button,
|
|
82
|
-
{
|
|
83
|
-
type: "button",
|
|
84
|
-
variant,
|
|
85
|
-
size,
|
|
86
|
-
className,
|
|
87
|
-
onClick: () => void query.refetch(),
|
|
88
|
-
disabled: query.isFetching,
|
|
89
|
-
...props,
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsx(
|
|
92
|
-
RefreshCw,
|
|
93
|
-
{
|
|
94
|
-
className: "ui-query-refetch-icon",
|
|
95
|
-
"data-fetching": query.isFetching,
|
|
96
|
-
"aria-hidden": "true"
|
|
97
|
-
}
|
|
98
|
-
),
|
|
99
|
-
text
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
function flattenItemPages(data) {
|
|
105
|
-
if (!data) return [];
|
|
106
|
-
return data.pages.flatMap((page) => page.items);
|
|
107
|
-
}
|
|
108
|
-
function defaultIsEmptyFlat(flat) {
|
|
109
|
-
if (Array.isArray(flat)) return flat.length === 0;
|
|
110
|
-
return !flat;
|
|
111
|
-
}
|
|
112
|
-
function InfiniteQueryState({
|
|
113
|
-
query,
|
|
114
|
-
skeleton,
|
|
115
|
-
empty,
|
|
116
|
-
flatten,
|
|
117
|
-
isEmpty = defaultIsEmptyFlat,
|
|
118
|
-
errorRenderer,
|
|
119
|
-
showRetry = true,
|
|
120
|
-
onRetry,
|
|
121
|
-
loadingMore,
|
|
122
|
-
loadMore,
|
|
123
|
-
showLoadMore = true,
|
|
124
|
-
children
|
|
125
|
-
}) {
|
|
126
|
-
const { t } = useTranslation();
|
|
127
|
-
const retry = React.useCallback(() => {
|
|
128
|
-
if (onRetry) {
|
|
129
|
-
void onRetry();
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
void query.refetch();
|
|
133
|
-
}, [onRetry, query]);
|
|
134
|
-
if (query.isPending) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
135
|
-
if (query.isError) {
|
|
136
|
-
if (query.isFetching && !query.isFetchingNextPage) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
137
|
-
if (errorRenderer) return /* @__PURE__ */ jsx(Fragment, { children: errorRenderer(query.error, retry) });
|
|
138
|
-
return /* @__PURE__ */ jsx(AlertQueryError, { error: query.error, onRetry: showRetry ? retry : void 0 });
|
|
139
|
-
}
|
|
140
|
-
const data = query.data;
|
|
141
|
-
if (!data) return /* @__PURE__ */ jsx(Fragment, { children: skeleton });
|
|
142
|
-
const flat = flatten(data);
|
|
143
|
-
if (empty && isEmpty(flat)) return /* @__PURE__ */ jsx(Fragment, { children: empty });
|
|
144
|
-
const footer = showLoadMore && query.hasNextPage ? loadMore ?? /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ jsx(
|
|
145
|
-
Button,
|
|
146
|
-
{
|
|
147
|
-
type: "button",
|
|
148
|
-
variant: "outline",
|
|
149
|
-
size: "sm",
|
|
150
|
-
disabled: query.isFetchingNextPage,
|
|
151
|
-
onClick: () => void query.fetchNextPage(),
|
|
152
|
-
children: query.isFetchingNextPage ? t("common.working") : t("query.loadMore")
|
|
153
|
-
}
|
|
154
|
-
) }) : null;
|
|
155
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
-
children(flat, {
|
|
157
|
-
fetchNextPage: () => void query.fetchNextPage(),
|
|
158
|
-
hasNextPage: !!query.hasNextPage,
|
|
159
|
-
isFetchingNextPage: query.isFetchingNextPage
|
|
160
|
-
}),
|
|
161
|
-
query.isFetchingNextPage && (loadingMore ?? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground pt-2 text-center text-xs", children: t("common.working") })),
|
|
162
|
-
footer
|
|
163
|
-
] });
|
|
164
|
-
}
|
|
165
|
-
function PrefetchLink({
|
|
166
|
-
queryKey,
|
|
167
|
-
queryFn,
|
|
168
|
-
prefetchOn = "both",
|
|
169
|
-
staleTime = 3e4,
|
|
170
|
-
onMouseEnter,
|
|
171
|
-
onFocus,
|
|
172
|
-
...linkProps
|
|
173
|
-
}) {
|
|
174
|
-
const queryClient = useQueryClient();
|
|
175
|
-
const prefetch = React.useCallback(() => {
|
|
176
|
-
if (prefetchOn === "none") return;
|
|
177
|
-
void queryClient.prefetchQuery({ queryKey, queryFn, staleTime });
|
|
178
|
-
}, [prefetchOn, queryClient, queryFn, queryKey, staleTime]);
|
|
179
|
-
return /* @__PURE__ */ jsx(
|
|
180
|
-
Link,
|
|
181
|
-
{
|
|
182
|
-
...linkProps,
|
|
183
|
-
onMouseEnter: (event) => {
|
|
184
|
-
if (prefetchOn === "hover" || prefetchOn === "both") prefetch();
|
|
185
|
-
onMouseEnter?.(event);
|
|
186
|
-
},
|
|
187
|
-
onFocus: (event) => {
|
|
188
|
-
if (prefetchOn === "focus" || prefetchOn === "both") prefetch();
|
|
189
|
-
onFocus?.(event);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export { AlertMutationFeedback, ButtonRefetch, DataState, InfiniteQueryState, PrefetchLink, flattenItemPages };
|
|
1
|
+
import { DataState } from "./data-state";
|
|
2
|
+
import { AlertMutationFeedback } from "./mutation-feedback";
|
|
3
|
+
import { ButtonRefetch } from "./query-refetch-button";
|
|
4
|
+
import { InfiniteQueryState, flattenItemPages } from "./infinite-query-state";
|
|
5
|
+
import { PrefetchLink } from "./prefetch-link";
|
|
6
|
+
export {
|
|
7
|
+
AlertMutationFeedback,
|
|
8
|
+
ButtonRefetch,
|
|
9
|
+
DataState,
|
|
10
|
+
InfiniteQueryState,
|
|
11
|
+
PrefetchLink,
|
|
12
|
+
flattenItemPages
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InfiniteQueryStateProp } from "../../props/components/query.prop";
|
|
2
|
+
export type { InfiniteQueryStateProp, InfiniteQueryStateProp as InfiniteQueryStateProps, } from "../../props/components/query.prop";
|
|
3
|
+
/** Flatten `{ pages: [{ items }] }` — default GODX paginated API shape. */
|
|
4
|
+
export declare function flattenItemPages<TItem, TPage extends {
|
|
5
|
+
items: TItem[];
|
|
6
|
+
}>(data: {
|
|
7
|
+
pages: TPage[];
|
|
8
|
+
} | undefined): TItem[];
|
|
9
|
+
/**
|
|
10
|
+
* `useInfiniteQuery` lifecycle widget — flatten pages, load-more footer.
|
|
11
|
+
* Cursor / activity feeds where user accumulates pages (vs DataTable cursor buttons).
|
|
12
|
+
*/
|
|
13
|
+
export declare function InfiniteQueryState<TPage, TFlat>({ query, skeleton, empty, flatten, isEmpty, errorRenderer, showRetry, onRetry, loadingMore, loadMore, showLoadMore, children, }: InfiniteQueryStateProp<TPage, TFlat>): import("react/jsx-runtime").JSX.Element;
|