@godxjp/ui 6.0.0 → 6.0.2
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/index.d.ts +140 -0
- package/dist/app/index.js +38 -0
- package/dist/app.prop-IobwLwaM.d.ts +90 -0
- package/dist/checkbox-NkFkqsQ8.d.ts +13 -0
- package/dist/chunk-2XW7J3EI.js +226 -0
- package/dist/chunk-3F2AKYRD.js +416 -0
- package/dist/chunk-3KPEZ5CF.js +37 -0
- package/dist/chunk-3UGU5TYP.js +89 -0
- package/{src/props/registry.ts → dist/chunk-6RA3KSVK.js} +118 -133
- package/dist/chunk-7NZFVD24.js +122 -0
- package/dist/chunk-7PWBC4BY.js +25 -0
- package/dist/chunk-7S7MYFXE.js +61 -0
- package/dist/chunk-7WRZG2IG.js +71 -0
- package/dist/chunk-B775Y6BE.js +1 -0
- package/dist/chunk-BHV2FUOA.js +111 -0
- package/dist/chunk-BI3HERR7.js +70 -0
- package/dist/chunk-BPSKQUL2.js +68 -0
- package/dist/chunk-CDWPQ5RP.js +187 -0
- package/dist/chunk-CP2LET6N.js +244 -0
- package/dist/chunk-CQBADMFG.js +20 -0
- package/dist/chunk-CRERCLIZ.js +33 -0
- package/dist/chunk-DU6ZYZRP.js +238 -0
- package/dist/chunk-DY5C44UP.js +55 -0
- package/dist/chunk-E4HJNQ62.js +117 -0
- package/dist/chunk-E76QIYSY.js +93 -0
- package/dist/chunk-F7PG4OEV.js +37 -0
- package/dist/chunk-GDSVW62T.js +171 -0
- package/dist/chunk-H2FHJOLU.js +178 -0
- package/dist/chunk-HJEBRCXL.js +55 -0
- package/dist/chunk-ICM6XBST.js +16 -0
- package/{src/components/data-entry/calendar.tsx → dist/chunk-IK7I3ABN.js} +33 -35
- package/dist/chunk-L6J44O74.js +144 -0
- package/dist/chunk-LDSLS6HE.js +1 -0
- package/dist/chunk-LVNUHUEZ.js +191 -0
- package/dist/chunk-M64MVRLS.js +92 -0
- package/dist/chunk-NGQW3KEM.js +402 -0
- package/dist/chunk-NZ4FOC5N.js +559 -0
- package/dist/chunk-PIIRNAXA.js +26 -0
- package/dist/chunk-S66TJXJU.js +33 -0
- package/dist/chunk-SMLKNECP.js +133 -0
- package/dist/chunk-TAHBM3F2.js +66 -0
- package/dist/chunk-TO33OY4L.js +150 -0
- package/dist/chunk-TO7URV7U.js +51 -0
- package/dist/chunk-TOO5AEKL.js +81 -0
- package/dist/chunk-U3GHAOIJ.js +299 -0
- package/dist/chunk-U7N2A7A3.js +9 -0
- package/dist/chunk-UX634MYF.js +123 -0
- package/dist/chunk-V6UWJKZF.js +28 -0
- package/{src/components/data-entry/input.tsx → dist/chunk-VOHTRR5X.js} +18 -16
- package/dist/chunk-WRFKVUPW.js +332 -0
- package/dist/chunk-WXW43RK5.js +24 -0
- package/{src/components/navigation/tabs.tsx → dist/chunk-XG7XDYIM.js} +46 -53
- package/dist/chunk-YFCQKO3B.js +842 -0
- package/dist/chunk-ZDWXGWLY.js +73 -0
- package/dist/chunk-ZLK5SPT6.js +11 -0
- package/dist/chunk-ZS6DTAM2.js +31 -0
- package/dist/chunk-ZT5UEUBO.js +1 -0
- package/dist/components/admin/index.d.ts +80 -0
- package/dist/components/admin/index.js +38 -0
- package/dist/components/data-display/badge.d.ts +12 -0
- package/dist/components/data-display/badge.js +3 -0
- package/dist/components/data-display/card.d.ts +87 -0
- package/dist/components/data-display/card.js +2 -0
- package/dist/components/data-display/index.d.ts +72 -0
- package/dist/components/data-display/index.js +89 -0
- package/dist/components/data-display/popover.d.ts +13 -0
- package/dist/components/data-display/popover.js +2 -0
- package/dist/components/data-display/scroll-area.d.ts +7 -0
- package/dist/components/data-display/scroll-area.js +2 -0
- package/dist/components/data-display/table.d.ts +10 -0
- package/dist/components/data-display/table.js +3 -0
- package/dist/components/data-entry/autocomplete.d.ts +16 -0
- package/dist/components/data-entry/autocomplete.js +8 -0
- package/dist/components/data-entry/calendar.d.ts +16 -0
- package/dist/components/data-entry/calendar.js +4 -0
- package/dist/components/data-entry/cascader.d.ts +32 -0
- package/dist/components/data-entry/cascader.js +13 -0
- package/dist/components/data-entry/checkbox.d.ts +13 -0
- package/dist/components/data-entry/checkbox.js +4 -0
- package/dist/components/data-entry/color-picker.d.ts +16 -0
- package/dist/components/data-entry/color-picker.js +6 -0
- package/dist/components/data-entry/command.d.ts +69 -0
- package/dist/components/data-entry/command.js +3 -0
- package/dist/components/data-entry/date-picker.d.ts +16 -0
- package/dist/components/data-entry/date-picker.js +8 -0
- package/dist/components/data-entry/date-range-picker.d.ts +16 -0
- package/dist/components/data-entry/date-range-picker.js +8 -0
- package/dist/components/data-entry/index.d.ts +53 -0
- package/dist/components/data-entry/index.js +152 -0
- package/dist/components/data-entry/input.d.ts +6 -0
- package/dist/components/data-entry/input.js +2 -0
- package/dist/components/data-entry/label.d.ts +8 -0
- package/dist/components/data-entry/label.js +2 -0
- package/dist/components/data-entry/radio.d.ts +24 -0
- package/dist/components/data-entry/radio.js +4 -0
- package/dist/components/data-entry/select.d.ts +18 -0
- package/dist/components/data-entry/select.js +3 -0
- package/dist/components/data-entry/slider.d.ts +16 -0
- package/dist/components/data-entry/slider.js +2 -0
- package/dist/components/data-entry/switch.d.ts +17 -0
- package/dist/components/data-entry/switch.js +2 -0
- package/dist/components/data-entry/textarea.d.ts +6 -0
- package/dist/components/data-entry/textarea.js +3 -0
- package/dist/components/data-entry/time-picker.d.ts +16 -0
- package/dist/components/data-entry/time-picker.js +7 -0
- package/dist/components/data-entry/transfer.d.ts +17 -0
- package/dist/components/data-entry/transfer.js +11 -0
- package/dist/components/data-entry/tree-select.d.ts +26 -0
- package/dist/components/data-entry/tree-select.js +13 -0
- package/dist/components/data-entry/upload.d.ts +42 -0
- package/dist/components/data-entry/upload.js +11 -0
- package/dist/components/feedback/alert.d.ts +60 -0
- package/dist/components/feedback/alert.js +7 -0
- package/dist/components/feedback/dialog.d.ts +64 -0
- package/dist/components/feedback/dialog.js +7 -0
- package/dist/components/feedback/index.d.ts +16 -0
- package/dist/components/feedback/index.js +14 -0
- package/dist/components/feedback/sheet.d.ts +24 -0
- package/dist/components/feedback/sheet.js +2 -0
- package/dist/components/feedback/sonner.d.ts +6 -0
- package/dist/components/feedback/sonner.js +1 -0
- package/dist/components/general/button.d.ts +20 -0
- package/dist/components/general/button.js +2 -0
- package/dist/components/general/index.d.ts +6 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/layout/index.d.ts +71 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/navigation/dropdown-menu.d.ts +28 -0
- package/dist/components/navigation/dropdown-menu.js +2 -0
- package/dist/components/navigation/index.d.ts +32 -0
- package/dist/components/navigation/index.js +12 -0
- package/dist/components/navigation/pagination.d.ts +11 -0
- package/dist/components/navigation/pagination.js +7 -0
- package/dist/components/navigation/steps.d.ts +12 -0
- package/dist/components/navigation/steps.js +3 -0
- package/dist/components/navigation/tabs-items.d.ts +12 -0
- package/dist/components/navigation/tabs-items.js +3 -0
- package/dist/components/navigation/tabs.d.ts +12 -0
- package/dist/components/navigation/tabs.js +2 -0
- package/dist/components/query/index.d.ts +43 -0
- package/dist/components/query/index.js +8 -0
- package/dist/components/ui/index.d.ts +57 -0
- package/dist/components/ui/index.js +37 -0
- package/{src/props/vocabulary/content.prop.ts → dist/content.prop-D1Dd3TAc.d.ts} +16 -20
- package/dist/data-display.prop-DNTAzmDy.d.ts +58 -0
- package/dist/data-entry.prop-BEGA1lTq.d.ts +323 -0
- package/dist/data-table-D1u_rKLK.d.ts +83 -0
- package/dist/data.prop-BVvfKC_g.d.ts +41 -0
- package/dist/feedback.prop-BmxUlpAW.d.ts +64 -0
- package/dist/filter-bar-B7OGFO9S.d.ts +10 -0
- package/dist/form/index.d.ts +21 -0
- package/dist/form/index.js +4 -0
- package/dist/form.prop-BHgpuFFm.d.ts +41 -0
- package/dist/format-date-ByyZoqI5.d.ts +51 -0
- package/dist/general.prop-D7brMPNL.d.ts +16 -0
- package/dist/i18n/index.d.ts +217 -0
- package/dist/i18n/index.js +2 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +39 -0
- package/dist/inline-C5u6ptJV.d.ts +10 -0
- package/dist/interaction.prop-Cdn7wOtq.d.ts +25 -0
- package/{src/props/vocabulary/layout.prop.ts → dist/layout.prop-4TCNvyQZ.d.ts} +9 -14
- package/dist/layout.prop-C795F0qg.d.ts +112 -0
- package/dist/lib/datetime/index.d.ts +31 -0
- package/dist/lib/datetime/index.js +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +1 -0
- package/dist/navigation.prop-DpZqcXey.d.ts +78 -0
- package/dist/navigation.prop-DxBiClEH.d.ts +20 -0
- package/dist/props/components/index.d.ts +27 -0
- package/dist/props/components/index.js +1 -0
- package/dist/props/index.d.ts +28 -0
- package/dist/props/index.js +3 -0
- package/dist/props/registry.d.ts +649 -0
- package/dist/props/registry.js +1 -0
- package/dist/props/vocabulary/index.d.ts +7 -0
- package/dist/props/vocabulary/index.js +1 -0
- package/dist/query.prop-hIPrk2zI.d.ts +71 -0
- package/dist/search-input-uP01rY1L.d.ts +22 -0
- package/dist/shared.prop-BNRJc9K0.d.ts +45 -0
- package/{src → dist}/styles/control.css +1 -1
- package/dist/types-mvzYGrma.d.ts +37 -0
- package/dist/use-toast-Dol5bdY3.d.ts +34 -0
- package/package.json +234 -68
- package/src/app/__tests__/app-provider.test.tsx +0 -232
- package/src/app/__tests__/date-format-labels.test.ts +0 -36
- package/src/app/__tests__/date-formats.test.ts +0 -44
- package/src/app/__tests__/timezones.test.ts +0 -65
- package/src/app/app-provider.tsx +0 -227
- package/src/app/date-format-labels.ts +0 -21
- package/src/app/date-formats.ts +0 -30
- package/src/app/index.ts +0 -40
- package/src/app/locales.ts +0 -32
- package/src/app/request-headers.ts +0 -31
- package/src/app/storage.ts +0 -44
- package/src/app/time-format-labels.ts +0 -19
- package/src/app/time-formats.ts +0 -15
- package/src/app/timezones.ts +0 -208
- package/src/app/types.ts +0 -39
- package/src/app/use-formatting.ts +0 -47
- package/src/components/__tests__/accessibility-primitives.test.tsx +0 -65
- package/src/components/__tests__/docs-parity.test.ts +0 -41
- package/src/components/__tests__/shadcn-release-guardrails.test.ts +0 -71
- package/src/components/__tests__/theme-axes-integration.test.tsx +0 -242
- package/src/components/admin/index.ts +0 -76
- package/src/components/data-display/__tests__/card-table.test.tsx +0 -328
- package/src/components/data-display/__tests__/data-display.test.tsx +0 -73
- package/src/components/data-display/__tests__/data-table.test.tsx +0 -84
- package/src/components/data-display/__tests__/popover.test.tsx +0 -92
- package/src/components/data-display/__tests__/scroll-area-collapsible.test.tsx +0 -66
- package/src/components/data-display/badge.tsx +0 -27
- package/src/components/data-display/card.tsx +0 -194
- package/src/components/data-display/code-badge.tsx +0 -28
- package/src/components/data-display/collapsible.tsx +0 -5
- package/src/components/data-display/data-table.tsx +0 -476
- package/src/components/data-display/empty-state.tsx +0 -22
- package/src/components/data-display/index.ts +0 -41
- package/src/components/data-display/key-value-grid.tsx +0 -46
- package/src/components/data-display/popover.tsx +0 -62
- package/src/components/data-display/progress-meter.tsx +0 -20
- package/src/components/data-display/scan-panel.tsx +0 -16
- package/src/components/data-display/scroll-area.tsx +0 -42
- package/src/components/data-display/status-badge.tsx +0 -83
- package/src/components/data-display/table.tsx +0 -59
- package/src/components/data-display/timeline.tsx +0 -42
- package/src/components/data-display/tree-list.tsx +0 -42
- package/src/components/data-entry/__fixtures__/tree-options.ts +0 -80
- package/src/components/data-entry/__tests__/cascader-tree-transfer.test.tsx +0 -417
- package/src/components/data-entry/__tests__/checkbox-group.test.tsx +0 -40
- package/src/components/data-entry/__tests__/checkbox.test.tsx +0 -20
- package/src/components/data-entry/__tests__/date-autocomplete.test.tsx +0 -94
- package/src/components/data-entry/__tests__/form-field.test.tsx +0 -49
- package/src/components/data-entry/__tests__/input-textarea.test.tsx +0 -38
- package/src/components/data-entry/__tests__/label-select.test.tsx +0 -62
- package/src/components/data-entry/__tests__/pickers.test.tsx +0 -74
- package/src/components/data-entry/__tests__/radio.test.tsx +0 -46
- package/src/components/data-entry/__tests__/search-input.test.tsx +0 -32
- package/src/components/data-entry/__tests__/switch-field.test.tsx +0 -52
- package/src/components/data-entry/__tests__/upload.test.tsx +0 -125
- package/src/components/data-entry/autocomplete.tsx +0 -91
- package/src/components/data-entry/cascader.tsx +0 -305
- package/src/components/data-entry/checkbox-group.tsx +0 -90
- package/src/components/data-entry/checkbox.tsx +0 -30
- package/src/components/data-entry/choice-field.tsx +0 -27
- package/src/components/data-entry/choice-option.ts +0 -20
- package/src/components/data-entry/color-picker.tsx +0 -75
- package/src/components/data-entry/command.tsx +0 -56
- package/src/components/data-entry/country-select.tsx +0 -88
- package/src/components/data-entry/date-picker.tsx +0 -69
- package/src/components/data-entry/date-range-picker.tsx +0 -75
- package/src/components/data-entry/form-field.tsx +0 -59
- package/src/components/data-entry/index.ts +0 -62
- package/src/components/data-entry/label.tsx +0 -25
- package/src/components/data-entry/radio.tsx +0 -109
- package/src/components/data-entry/search-input.tsx +0 -103
- package/src/components/data-entry/select.tsx +0 -149
- package/src/components/data-entry/slider.tsx +0 -38
- package/src/components/data-entry/switch-field.tsx +0 -91
- package/src/components/data-entry/switch.tsx +0 -24
- package/src/components/data-entry/textarea.tsx +0 -12
- package/src/components/data-entry/time-picker.tsx +0 -214
- package/src/components/data-entry/transfer.tsx +0 -231
- package/src/components/data-entry/tree-select-strategy.ts +0 -6
- package/src/components/data-entry/tree-select.tsx +0 -279
- package/src/components/data-entry/tree-utils.ts +0 -221
- package/src/components/data-entry/upload-crop-dialog.tsx +0 -109
- package/src/components/data-entry/upload-types.ts +0 -86
- package/src/components/data-entry/upload.tsx +0 -498
- package/src/components/data-entry/use-upload-draft.ts +0 -93
- package/src/components/feedback/__tests__/alert.test.tsx +0 -127
- package/src/components/feedback/__tests__/dialog.test.tsx +0 -290
- package/src/components/feedback/__tests__/sheet.test.tsx +0 -94
- package/src/components/feedback/__tests__/skeleton.test.tsx +0 -25
- package/src/components/feedback/__tests__/toast.test.tsx +0 -52
- package/src/components/feedback/alert.tsx +0 -167
- package/src/components/feedback/dialog.tsx +0 -325
- package/src/components/feedback/index.ts +0 -53
- package/src/components/feedback/sheet.tsx +0 -130
- package/src/components/feedback/skeleton.tsx +0 -95
- package/src/components/feedback/sonner.tsx +0 -54
- package/src/components/feedback/toaster.tsx +0 -1
- package/src/components/feedback/use-toast.ts +0 -62
- package/src/components/general/__tests__/button.test.tsx +0 -71
- package/src/components/general/button.tsx +0 -61
- package/src/components/general/index.ts +0 -2
- package/src/components/layout/__tests__/page-container.test.tsx +0 -69
- package/src/components/layout/__tests__/page-inset.test.tsx +0 -14
- package/src/components/layout/__tests__/stack-inline.test.tsx +0 -39
- package/src/components/layout/app-shell.tsx +0 -42
- package/src/components/layout/breadcrumb.tsx +0 -35
- package/src/components/layout/index.ts +0 -31
- package/src/components/layout/inline.tsx +0 -13
- package/src/components/layout/menu.tsx +0 -34
- package/src/components/layout/mobile-frame.tsx +0 -57
- package/src/components/layout/page-container.tsx +0 -81
- package/src/components/layout/page-inset.tsx +0 -16
- package/src/components/layout/responsive-grid.tsx +0 -14
- package/src/components/layout/shell-app.tsx +0 -30
- package/src/components/layout/sidebar.tsx +0 -98
- package/src/components/layout/split-pane.tsx +0 -16
- package/src/components/layout/stack.tsx +0 -13
- package/src/components/layout/topbar.tsx +0 -108
- package/src/components/navigation/__tests__/app-pickers.test.tsx +0 -118
- package/src/components/navigation/__tests__/dropdown-menu.test.tsx +0 -104
- package/src/components/navigation/__tests__/navigation.test.tsx +0 -61
- package/src/components/navigation/__tests__/pagination-steps-tabs.test.tsx +0 -76
- package/src/components/navigation/date-format-picker.tsx +0 -55
- package/src/components/navigation/dropdown-menu.tsx +0 -190
- package/src/components/navigation/filter-bar.tsx +0 -38
- package/src/components/navigation/index.ts +0 -28
- package/src/components/navigation/locale-picker.tsx +0 -49
- package/src/components/navigation/page-header.tsx +0 -50
- package/src/components/navigation/pagination-utils.ts +0 -35
- package/src/components/navigation/pagination.tsx +0 -168
- package/src/components/navigation/steps.tsx +0 -163
- package/src/components/navigation/tabs-items.tsx +0 -69
- package/src/components/navigation/time-format-picker.tsx +0 -55
- package/src/components/navigation/timezone-picker.tsx +0 -63
- package/src/components/query/__tests__/data-state.test.tsx +0 -214
- package/src/components/query/__tests__/infinite-prefetch.test.tsx +0 -105
- package/src/components/query/__tests__/query-helpers.test.tsx +0 -61
- package/src/components/query/data-state.tsx +0 -58
- package/src/components/query/index.ts +0 -10
- package/src/components/query/infinite-query-state.tsx +0 -99
- package/src/components/query/mutation-feedback.tsx +0 -31
- package/src/components/query/prefetch-link.tsx +0 -45
- package/src/components/query/query-refetch-button.tsx +0 -41
- package/src/components/ui/alert-dialog.tsx +0 -1
- package/src/components/ui/alert.tsx +0 -1
- package/src/components/ui/autocomplete.tsx +0 -1
- package/src/components/ui/badge.tsx +0 -1
- package/src/components/ui/button.tsx +0 -1
- package/src/components/ui/calendar.tsx +0 -1
- package/src/components/ui/card.tsx +0 -1
- package/src/components/ui/checkbox.tsx +0 -1
- package/src/components/ui/color-picker.tsx +0 -1
- package/src/components/ui/command.tsx +0 -1
- package/src/components/ui/date-picker.tsx +0 -1
- package/src/components/ui/date-range-picker.tsx +0 -1
- package/src/components/ui/dialog.tsx +0 -1
- package/src/components/ui/dropdown-menu.tsx +0 -1
- package/src/components/ui/index.tsx +0 -31
- package/src/components/ui/input.tsx +0 -1
- package/src/components/ui/label.tsx +0 -1
- package/src/components/ui/pagination.tsx +0 -1
- package/src/components/ui/popover.tsx +0 -1
- package/src/components/ui/radio.tsx +0 -1
- package/src/components/ui/scroll-area.tsx +0 -1
- package/src/components/ui/select.tsx +0 -1
- package/src/components/ui/sheet.tsx +0 -1
- package/src/components/ui/slider.tsx +0 -1
- package/src/components/ui/sonner.tsx +0 -1
- package/src/components/ui/switch.tsx +0 -1
- package/src/components/ui/table.tsx +0 -1
- package/src/components/ui/tabs-items.tsx +0 -1
- package/src/components/ui/tabs.tsx +0 -1
- package/src/components/ui/textarea.tsx +0 -1
- package/src/components/ui/time-picker.tsx +0 -1
- package/src/components/ui/upload.tsx +0 -1
- package/src/form/__tests__/use-zod-form.test.tsx +0 -97
- package/src/form/form-field-control.tsx +0 -44
- package/src/form/form-root.tsx +0 -29
- package/src/form/index.ts +0 -7
- package/src/form/use-zod-form.ts +0 -29
- package/src/i18n/__tests__/translate.test.ts +0 -23
- package/src/i18n/index.ts +0 -9
- package/src/i18n/messages/en.json +0 -171
- package/src/i18n/messages/ja.json +0 -171
- package/src/i18n/messages/vi.json +0 -171
- package/src/i18n/translate.ts +0 -74
- package/src/i18n/use-translation.ts +0 -53
- package/src/index.ts +0 -3
- package/src/lib/__tests__/control-styles.test.ts +0 -78
- package/src/lib/__tests__/datetime.test.ts +0 -77
- package/src/lib/__tests__/format-date.test.ts +0 -97
- package/src/lib/__tests__/format.test.ts +0 -62
- package/src/lib/__tests__/theme-tokens-audit.test.ts +0 -176
- package/src/lib/__tests__/theme-tokens-css.test.ts +0 -118
- package/src/lib/__tests__/token-governance.test.ts +0 -191
- package/src/lib/__tests__/variants.test.ts +0 -18
- package/src/lib/control-styles.ts +0 -33
- package/src/lib/datetime/detect.ts +0 -25
- package/src/lib/datetime/format-date.ts +0 -100
- package/src/lib/datetime/format.ts +0 -140
- package/src/lib/datetime/index.ts +0 -25
- package/src/lib/datetime/parse.ts +0 -51
- package/src/lib/datetime/sync.ts +0 -48
- package/src/lib/format.ts +0 -114
- package/src/lib/hooks.ts +0 -54
- package/src/lib/utils.ts +0 -6
- package/src/lib/variants.ts +0 -40
- package/src/props/components/app.prop.ts +0 -99
- package/src/props/components/data-display.prop.ts +0 -73
- package/src/props/components/data-entry.prop.ts +0 -334
- package/src/props/components/feedback.prop.ts +0 -80
- package/src/props/components/form.prop.ts +0 -46
- package/src/props/components/general.prop.ts +0 -18
- package/src/props/components/index.ts +0 -99
- package/src/props/components/layout.prop.ts +0 -130
- package/src/props/components/navigation.prop.ts +0 -88
- package/src/props/components/query.prop.ts +0 -94
- package/src/props/index.ts +0 -17
- package/src/props/vocabulary/data.prop.ts +0 -46
- package/src/props/vocabulary/index.ts +0 -73
- package/src/props/vocabulary/interaction.prop.ts +0 -42
- package/src/props/vocabulary/navigation.prop.ts +0 -19
- package/src/props/vocabulary/shared.prop.ts +0 -59
- package/src/test/__tests__/render-loop-guard.test.tsx +0 -38
- package/src/test/jest-dom.d.ts +0 -4
- package/src/test/render-loop-guard.tsx +0 -50
- package/src/test/render.tsx +0 -29
- package/src/test/theme-globals.test.ts +0 -77
- package/src/test/theme-globals.ts +0 -134
- package/src/test/theme-test-utils.tsx +0 -67
- /package/{src → dist}/styles/alert-layout.css +0 -0
- /package/{src → dist}/styles/badge-layout.css +0 -0
- /package/{src → dist}/styles/card-layout.css +0 -0
- /package/{src → dist}/styles/data-display-layout.css +0 -0
- /package/{src → dist}/styles/density.css +0 -0
- /package/{src → dist}/styles/dialog-layout.css +0 -0
- /package/{src → dist}/styles/index.css +0 -0
- /package/{src → dist}/styles/layout.css +0 -0
- /package/{src → dist}/styles/shell-layout.css +0 -0
- /package/{src → dist}/styles/table-layout.css +0 -0
- /package/{src → dist}/theme/example.service.css +0 -0
- /package/{src → dist}/tokens/base.css +0 -0
- /package/{src → dist}/tokens/foundation.css +0 -0
- /package/{src → dist}/tokens/primitives/badge.css +0 -0
- /package/{src → dist}/tokens/primitives/card.css +0 -0
- /package/{src → dist}/tokens/primitives/control.css +0 -0
- /package/{src → dist}/tokens/primitives/feedback.css +0 -0
- /package/{src → dist}/tokens/primitives/layout.css +0 -0
- /package/{src → dist}/tokens/primitives/navigation.css +0 -0
- /package/{src → dist}/tokens/primitives/table.css +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { renderWithUi, screen, userEvent } from "@/test/render";
|
|
3
|
-
import { FilterBar, FilterGroup } from "../filter-bar";
|
|
4
|
-
import { PageHeader } from "../page-header";
|
|
5
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../tabs";
|
|
6
|
-
|
|
7
|
-
describe("FilterBar", () => {
|
|
8
|
-
it("shows clear button when filters active", async () => {
|
|
9
|
-
const user = userEvent.setup();
|
|
10
|
-
const onClear = vi.fn();
|
|
11
|
-
renderWithUi(
|
|
12
|
-
<FilterBar onClear={onClear} hasActiveFilters>
|
|
13
|
-
<FilterGroup label="Status">
|
|
14
|
-
<span>Active</span>
|
|
15
|
-
</FilterGroup>
|
|
16
|
-
</FilterBar>,
|
|
17
|
-
);
|
|
18
|
-
await user.click(screen.getByRole("button", { name: /xóa bộ lọc/i }));
|
|
19
|
-
expect(onClear).toHaveBeenCalledOnce();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("hides clear when hasActiveFilters=false", () => {
|
|
23
|
-
renderWithUi(
|
|
24
|
-
<FilterBar onClear={() => undefined} hasActiveFilters={false}>
|
|
25
|
-
<span>f</span>
|
|
26
|
-
</FilterBar>,
|
|
27
|
-
);
|
|
28
|
-
expect(screen.queryByRole("button", { name: /xóa bộ lọc/i })).not.toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
describe("PageHeader", () => {
|
|
33
|
-
it("renders title and description (legacy)", () => {
|
|
34
|
-
renderWithUi(
|
|
35
|
-
<PageHeader title="Legacy" description="Sub" actions={<button type="button">Go</button>} />,
|
|
36
|
-
);
|
|
37
|
-
expect(screen.getByRole("heading", { name: "Legacy" })).toBeInTheDocument();
|
|
38
|
-
expect(screen.getByText("Sub")).toBeInTheDocument();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe("Tabs", () => {
|
|
43
|
-
it("switches tab panels", async () => {
|
|
44
|
-
const user = userEvent.setup();
|
|
45
|
-
renderWithUi(
|
|
46
|
-
<Tabs defaultValue="a">
|
|
47
|
-
<TabsList>
|
|
48
|
-
<TabsTrigger value="a">Tab A</TabsTrigger>
|
|
49
|
-
<TabsTrigger value="b">Tab B</TabsTrigger>
|
|
50
|
-
</TabsList>
|
|
51
|
-
<TabsContent value="a">Content A</TabsContent>
|
|
52
|
-
<TabsContent value="b">Content B</TabsContent>
|
|
53
|
-
</Tabs>,
|
|
54
|
-
);
|
|
55
|
-
expect(screen.getByText("Content A")).toBeInTheDocument();
|
|
56
|
-
expect(screen.getByRole("tablist")).toHaveAttribute("data-slot", "tabs-list");
|
|
57
|
-
await user.click(screen.getByRole("tab", { name: "Tab B" }));
|
|
58
|
-
expect(screen.getByRole("tab", { name: "Tab B" })).toHaveAttribute("data-slot", "tabs-trigger");
|
|
59
|
-
expect(screen.getByText("Content B")).toBeInTheDocument();
|
|
60
|
-
});
|
|
61
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { renderWithUi, screen, userEvent } from "@/test/render";
|
|
3
|
-
import { Pagination } from "../pagination";
|
|
4
|
-
import { buildPageRange } from "../pagination-utils";
|
|
5
|
-
import { Steps } from "../steps";
|
|
6
|
-
import { TabsItems } from "../tabs-items";
|
|
7
|
-
|
|
8
|
-
describe("buildPageRange", () => {
|
|
9
|
-
it("returns all pages when total is small", () => {
|
|
10
|
-
expect(buildPageRange(2, 5)).toEqual([1, 2, 3, 4, 5]);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("inserts ellipsis for large totals", () => {
|
|
14
|
-
expect(buildPageRange(5, 20)).toContain("ellipsis");
|
|
15
|
-
expect(buildPageRange(5, 20)[0]).toBe(1);
|
|
16
|
-
expect(buildPageRange(5, 20).at(-1)).toBe(20);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
describe("Pagination", () => {
|
|
21
|
-
it("changes page on click", async () => {
|
|
22
|
-
const user = userEvent.setup();
|
|
23
|
-
const onChange = vi.fn();
|
|
24
|
-
|
|
25
|
-
renderWithUi(<Pagination current={1} total={100} pageSize={10} onChange={onChange} />);
|
|
26
|
-
|
|
27
|
-
await user.click(screen.getByRole("button", { name: /trang 2/i }));
|
|
28
|
-
expect(onChange).toHaveBeenCalledWith(2, 10);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("renders simple mode", () => {
|
|
32
|
-
renderWithUi(<Pagination simple current={2} total={50} pageSize={10} />);
|
|
33
|
-
expect(screen.getByText("2 / 5")).toBeInTheDocument();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
describe("Steps", () => {
|
|
38
|
-
it("renders step titles", () => {
|
|
39
|
-
renderWithUi(
|
|
40
|
-
<Steps
|
|
41
|
-
current={1}
|
|
42
|
-
items={[{ title: "Tạo đơn" }, { title: "Thanh toán" }, { title: "Giao hàng" }]}
|
|
43
|
-
/>,
|
|
44
|
-
);
|
|
45
|
-
expect(screen.getByText("Tạo đơn")).toBeInTheDocument();
|
|
46
|
-
expect(screen.getByText("Thanh toán")).toBeInTheDocument();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("calls onChange when clickable", async () => {
|
|
50
|
-
const user = userEvent.setup();
|
|
51
|
-
const onChange = vi.fn();
|
|
52
|
-
renderWithUi(
|
|
53
|
-
<Steps current={0} onChange={onChange} items={[{ title: "A" }, { title: "B" }]} />,
|
|
54
|
-
);
|
|
55
|
-
await user.click(screen.getByText("B"));
|
|
56
|
-
expect(onChange).toHaveBeenCalledWith(1);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
describe("TabsItems", () => {
|
|
61
|
-
it("switches panels via items API", async () => {
|
|
62
|
-
const user = userEvent.setup();
|
|
63
|
-
renderWithUi(
|
|
64
|
-
<TabsItems
|
|
65
|
-
defaultValue="orders"
|
|
66
|
-
items={[
|
|
67
|
-
{ key: "orders", label: "Đơn hàng", children: "Panel đơn" },
|
|
68
|
-
{ key: "shipments", label: "Kiện hàng", children: "Panel kiện" },
|
|
69
|
-
]}
|
|
70
|
-
/>,
|
|
71
|
-
);
|
|
72
|
-
expect(screen.getByText("Panel đơn")).toBeInTheDocument();
|
|
73
|
-
await user.click(screen.getByRole("tab", { name: "Kiện hàng" }));
|
|
74
|
-
expect(screen.getByText("Panel kiện")).toBeInTheDocument();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { CalendarDays } from "lucide-react";
|
|
2
|
-
import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from "../../app/date-format-labels";
|
|
3
|
-
import { useOptionalAppContext } from "../../app/app-provider";
|
|
4
|
-
import { useTranslation } from "../../i18n/use-translation";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
import type { DateFormatPickerProp } from "../../props/components/app.prop";
|
|
7
|
-
import {
|
|
8
|
-
Select,
|
|
9
|
-
SelectContent,
|
|
10
|
-
SelectItem,
|
|
11
|
-
SelectTrigger,
|
|
12
|
-
SelectValue,
|
|
13
|
-
} from "../data-entry/select";
|
|
14
|
-
|
|
15
|
-
export type {
|
|
16
|
-
DateFormatPickerProp,
|
|
17
|
-
DateFormatPickerProp as DateFormatPickerProps,
|
|
18
|
-
} from "../../props/components/app.prop";
|
|
19
|
-
|
|
20
|
-
export function DateFormatPicker({
|
|
21
|
-
className,
|
|
22
|
-
disabled,
|
|
23
|
-
id,
|
|
24
|
-
value,
|
|
25
|
-
onChange,
|
|
26
|
-
}: DateFormatPickerProp) {
|
|
27
|
-
const ctx = useOptionalAppContext();
|
|
28
|
-
const { t, locale, fallbackLocale } = useTranslation();
|
|
29
|
-
const current = value ?? ctx?.dateFormat;
|
|
30
|
-
const handleChange = onChange ?? ctx?.setDateFormat;
|
|
31
|
-
|
|
32
|
-
if (current === undefined || !handleChange) {
|
|
33
|
-
throw new Error("DateFormatPicker requires <AppProvider> or controlled value + onChange");
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Select value={current} onValueChange={handleChange} disabled={disabled}>
|
|
38
|
-
<SelectTrigger
|
|
39
|
-
id={id}
|
|
40
|
-
className={cn("w-full sm:w-44", className)}
|
|
41
|
-
aria-label={t("navigation.dateFormatPicker.ariaLabel")}
|
|
42
|
-
>
|
|
43
|
-
<CalendarDays className="mr-2 size-4 shrink-0 opacity-70" aria-hidden="true" />
|
|
44
|
-
<SelectValue />
|
|
45
|
-
</SelectTrigger>
|
|
46
|
-
<SelectContent>
|
|
47
|
-
{APP_DATE_FORMAT_OPTIONS.map((option) => (
|
|
48
|
-
<SelectItem key={option.value} value={option.value}>
|
|
49
|
-
{getDateFormatLabel(option.value, locale, fallbackLocale)}
|
|
50
|
-
</SelectItem>
|
|
51
|
-
))}
|
|
52
|
-
</SelectContent>
|
|
53
|
-
</Select>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
-
import { Check, ChevronRight } from "lucide-react";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
export function DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
7
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function DropdownMenuTrigger(
|
|
11
|
-
props: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>,
|
|
12
|
-
) {
|
|
13
|
-
return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function DropdownMenuPortal(
|
|
17
|
-
props: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>,
|
|
18
|
-
) {
|
|
19
|
-
return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function DropdownMenuGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
23
|
-
return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function DropdownMenuRadioGroup(
|
|
27
|
-
props: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>,
|
|
28
|
-
) {
|
|
29
|
-
return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function DropdownMenuSub(props: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
33
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const DropdownMenuContent = React.forwardRef<
|
|
37
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.Content>,
|
|
38
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
39
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
40
|
-
<DropdownMenuPortal>
|
|
41
|
-
<DropdownMenuPrimitive.Content
|
|
42
|
-
ref={ref}
|
|
43
|
-
data-slot="dropdown-menu-content"
|
|
44
|
-
sideOffset={sideOffset}
|
|
45
|
-
className={cn(
|
|
46
|
-
"bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-32 origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
47
|
-
className,
|
|
48
|
-
)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
</DropdownMenuPortal>
|
|
52
|
-
));
|
|
53
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
54
|
-
|
|
55
|
-
export const DropdownMenuItem = React.forwardRef<
|
|
56
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.Item>,
|
|
57
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
58
|
-
inset?: boolean;
|
|
59
|
-
variant?: "default" | "destructive";
|
|
60
|
-
}
|
|
61
|
-
>(({ className, inset, variant = "default", ...props }, ref) => (
|
|
62
|
-
<DropdownMenuPrimitive.Item
|
|
63
|
-
ref={ref}
|
|
64
|
-
data-slot="dropdown-menu-item"
|
|
65
|
-
data-inset={inset}
|
|
66
|
-
data-variant={variant}
|
|
67
|
-
className={cn(
|
|
68
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset=true]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
69
|
-
className,
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
));
|
|
74
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
75
|
-
|
|
76
|
-
export const DropdownMenuLabel = React.forwardRef<
|
|
77
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.Label>,
|
|
78
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }
|
|
79
|
-
>(({ className, inset, ...props }, ref) => (
|
|
80
|
-
<DropdownMenuPrimitive.Label
|
|
81
|
-
ref={ref}
|
|
82
|
-
data-slot="dropdown-menu-label"
|
|
83
|
-
data-inset={inset}
|
|
84
|
-
className={cn("px-2 py-1.5 text-sm font-semibold data-[inset=true]:ps-8", className)}
|
|
85
|
-
{...props}
|
|
86
|
-
/>
|
|
87
|
-
));
|
|
88
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
89
|
-
|
|
90
|
-
export const DropdownMenuSeparator = React.forwardRef<
|
|
91
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,
|
|
92
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
93
|
-
>(({ className, ...props }, ref) => (
|
|
94
|
-
<DropdownMenuPrimitive.Separator
|
|
95
|
-
ref={ref}
|
|
96
|
-
data-slot="dropdown-menu-separator"
|
|
97
|
-
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
));
|
|
101
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
102
|
-
|
|
103
|
-
export const DropdownMenuCheckboxItem = React.forwardRef<
|
|
104
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
105
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
106
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
107
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
108
|
-
ref={ref}
|
|
109
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
110
|
-
className={cn(
|
|
111
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
112
|
-
className,
|
|
113
|
-
)}
|
|
114
|
-
checked={checked}
|
|
115
|
-
{...props}
|
|
116
|
-
>
|
|
117
|
-
<span className="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center">
|
|
118
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
119
|
-
<Check className="size-4" aria-hidden="true" />
|
|
120
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
121
|
-
</span>
|
|
122
|
-
{children}
|
|
123
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
124
|
-
));
|
|
125
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
126
|
-
|
|
127
|
-
export const DropdownMenuRadioItem = React.forwardRef<
|
|
128
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
129
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
130
|
-
>(({ className, children, ...props }, ref) => (
|
|
131
|
-
<DropdownMenuPrimitive.RadioItem
|
|
132
|
-
ref={ref}
|
|
133
|
-
data-slot="dropdown-menu-radio-item"
|
|
134
|
-
className={cn(
|
|
135
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=checked]:bg-primary/10 data-[state=checked]:text-primary relative flex cursor-default items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[state=checked]:font-medium [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
136
|
-
className,
|
|
137
|
-
)}
|
|
138
|
-
{...props}
|
|
139
|
-
>
|
|
140
|
-
{children}
|
|
141
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
142
|
-
));
|
|
143
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
144
|
-
|
|
145
|
-
export const DropdownMenuSubTrigger = React.forwardRef<
|
|
146
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
147
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }
|
|
148
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
149
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
150
|
-
ref={ref}
|
|
151
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
152
|
-
data-inset={inset}
|
|
153
|
-
className={cn(
|
|
154
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[inset=true]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
155
|
-
className,
|
|
156
|
-
)}
|
|
157
|
-
{...props}
|
|
158
|
-
>
|
|
159
|
-
{children}
|
|
160
|
-
<ChevronRight className="ms-auto size-4" aria-hidden="true" />
|
|
161
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
162
|
-
));
|
|
163
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
164
|
-
|
|
165
|
-
export const DropdownMenuSubContent = React.forwardRef<
|
|
166
|
-
React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
167
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
168
|
-
>(({ className, ...props }, ref) => (
|
|
169
|
-
<DropdownMenuPrimitive.SubContent
|
|
170
|
-
ref={ref}
|
|
171
|
-
data-slot="dropdown-menu-sub-content"
|
|
172
|
-
className={cn(
|
|
173
|
-
"bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 min-w-32 origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-hidden rounded-md border p-1 shadow-lg",
|
|
174
|
-
className,
|
|
175
|
-
)}
|
|
176
|
-
{...props}
|
|
177
|
-
/>
|
|
178
|
-
));
|
|
179
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
180
|
-
|
|
181
|
-
export const DropdownMenuShortcut = ({
|
|
182
|
-
className,
|
|
183
|
-
...props
|
|
184
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => (
|
|
185
|
-
<span
|
|
186
|
-
data-slot="dropdown-menu-shortcut"
|
|
187
|
-
className={cn("text-muted-foreground ms-auto text-xs tracking-widest", className)}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
190
|
-
);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { X } from "lucide-react";
|
|
2
|
-
|
|
3
|
-
import { useTranslation } from "../../i18n/use-translation";
|
|
4
|
-
import { Button } from "../general/button";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
import type { FilterBarProp, FilterGroupProp } from "../../props/components/navigation.prop";
|
|
7
|
-
|
|
8
|
-
export type { FilterBarProp, FilterGroupProp } from "../../props/components/navigation.prop";
|
|
9
|
-
|
|
10
|
-
export function FilterBar({
|
|
11
|
-
onClear,
|
|
12
|
-
hasActiveFilters = true,
|
|
13
|
-
className,
|
|
14
|
-
children,
|
|
15
|
-
}: FilterBarProp) {
|
|
16
|
-
const { t } = useTranslation();
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className={cn("ui-filter-bar", className)}>
|
|
20
|
-
{children}
|
|
21
|
-
{onClear && hasActiveFilters && (
|
|
22
|
-
<Button variant="ghost" size="sm" onClick={onClear} className="ui-filter-clear">
|
|
23
|
-
<X aria-hidden="true" />
|
|
24
|
-
{t("common.clearFilters")}
|
|
25
|
-
</Button>
|
|
26
|
-
)}
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function FilterGroup({ label, className, children }: FilterGroupProp) {
|
|
32
|
-
return (
|
|
33
|
-
<div className={cn("ui-stack-xs ui-filter-group", className)}>
|
|
34
|
-
<div className="ui-filter-label">{label}</div>
|
|
35
|
-
{children}
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs";
|
|
2
|
-
export { TabsItems } from "./tabs-items";
|
|
3
|
-
export { Pagination } from "./pagination";
|
|
4
|
-
export { Steps } from "./steps";
|
|
5
|
-
export { FilterBar, FilterGroup } from "./filter-bar";
|
|
6
|
-
export { PageHeader } from "./page-header";
|
|
7
|
-
export { LocalePicker } from "./locale-picker";
|
|
8
|
-
export { TimezonePicker } from "./timezone-picker";
|
|
9
|
-
export { TimeFormatPicker } from "./time-format-picker";
|
|
10
|
-
export { DateFormatPicker } from "./date-format-picker";
|
|
11
|
-
export type { BreadcrumbItem } from "./page-header";
|
|
12
|
-
export {
|
|
13
|
-
DropdownMenu,
|
|
14
|
-
DropdownMenuCheckboxItem,
|
|
15
|
-
DropdownMenuContent,
|
|
16
|
-
DropdownMenuGroup,
|
|
17
|
-
DropdownMenuItem,
|
|
18
|
-
DropdownMenuLabel,
|
|
19
|
-
DropdownMenuPortal,
|
|
20
|
-
DropdownMenuRadioGroup,
|
|
21
|
-
DropdownMenuRadioItem,
|
|
22
|
-
DropdownMenuSeparator,
|
|
23
|
-
DropdownMenuShortcut,
|
|
24
|
-
DropdownMenuSub,
|
|
25
|
-
DropdownMenuSubContent,
|
|
26
|
-
DropdownMenuSubTrigger,
|
|
27
|
-
DropdownMenuTrigger,
|
|
28
|
-
} from "./dropdown-menu";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Languages } from "lucide-react";
|
|
2
|
-
import { APP_LOCALES } from "../../app/types";
|
|
3
|
-
import { useOptionalAppContext } from "../../app/app-provider";
|
|
4
|
-
import { useTranslation } from "../../i18n/use-translation";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
import type { LocalePickerProp } from "../../props/components/app.prop";
|
|
7
|
-
import {
|
|
8
|
-
Select,
|
|
9
|
-
SelectContent,
|
|
10
|
-
SelectItem,
|
|
11
|
-
SelectTrigger,
|
|
12
|
-
SelectValue,
|
|
13
|
-
} from "../data-entry/select";
|
|
14
|
-
|
|
15
|
-
export type {
|
|
16
|
-
LocalePickerProp,
|
|
17
|
-
LocalePickerProp as LocalePickerProps,
|
|
18
|
-
} from "../../props/components/app.prop";
|
|
19
|
-
|
|
20
|
-
export function LocalePicker({ className, disabled, id, value, onChange }: LocalePickerProp) {
|
|
21
|
-
const ctx = useOptionalAppContext();
|
|
22
|
-
const { t } = useTranslation();
|
|
23
|
-
const current = value ?? ctx?.locale;
|
|
24
|
-
const handleChange = onChange ?? ctx?.setLocale;
|
|
25
|
-
|
|
26
|
-
if (current === undefined || !handleChange) {
|
|
27
|
-
throw new Error("LocalePicker requires <AppProvider> or controlled value + onChange");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Select value={current} onValueChange={handleChange} disabled={disabled}>
|
|
32
|
-
<SelectTrigger
|
|
33
|
-
id={id}
|
|
34
|
-
className={cn("w-full sm:w-40", className)}
|
|
35
|
-
aria-label={t("navigation.localePicker.ariaLabel")}
|
|
36
|
-
>
|
|
37
|
-
<Languages className="mr-2 size-4 shrink-0 opacity-70" aria-hidden="true" />
|
|
38
|
-
<SelectValue />
|
|
39
|
-
</SelectTrigger>
|
|
40
|
-
<SelectContent>
|
|
41
|
-
{APP_LOCALES.map((code) => (
|
|
42
|
-
<SelectItem key={code} value={code}>
|
|
43
|
-
{t(`locale.${code}`)}
|
|
44
|
-
</SelectItem>
|
|
45
|
-
))}
|
|
46
|
-
</SelectContent>
|
|
47
|
-
</Select>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/** @deprecated Prefer PageContainer. Header-only legacy shell. */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- legacy component intentionally uses PageHeaderProp */
|
|
3
|
-
import { Link } from "react-router-dom";
|
|
4
|
-
import { ChevronRight } from "lucide-react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
7
|
-
import type { PageHeaderProp } from "../../props/components/layout.prop";
|
|
8
|
-
|
|
9
|
-
export type { PageHeaderProp } from "../../props/components/layout.prop";
|
|
10
|
-
export type { BreadcrumbItemProp as BreadcrumbItem } from "../../props/vocabulary/navigation.prop";
|
|
11
|
-
|
|
12
|
-
export function PageHeader({ title, description, breadcrumb, actions, className }: PageHeaderProp) {
|
|
13
|
-
return (
|
|
14
|
-
<header className={cn("ui-page-header", className)}>
|
|
15
|
-
{breadcrumb && breadcrumb.length > 0 && (
|
|
16
|
-
<nav aria-label="Breadcrumb" className="ui-breadcrumb">
|
|
17
|
-
<ol className="ui-breadcrumb-list">
|
|
18
|
-
{breadcrumb.map((item, i) => {
|
|
19
|
-
const isLast = i === breadcrumb.length - 1;
|
|
20
|
-
return (
|
|
21
|
-
<li key={i} className="ui-inline-xs">
|
|
22
|
-
{item.to && !isLast ? (
|
|
23
|
-
<Link to={item.to} className="hover:text-foreground hover:underline">
|
|
24
|
-
{item.label}
|
|
25
|
-
</Link>
|
|
26
|
-
) : (
|
|
27
|
-
<span
|
|
28
|
-
className={isLast ? "text-foreground" : ""}
|
|
29
|
-
aria-current={isLast ? "page" : undefined}
|
|
30
|
-
>
|
|
31
|
-
{item.label}
|
|
32
|
-
</span>
|
|
33
|
-
)}
|
|
34
|
-
{!isLast && <ChevronRight className="size-3" aria-hidden="true" />}
|
|
35
|
-
</li>
|
|
36
|
-
);
|
|
37
|
-
})}
|
|
38
|
-
</ol>
|
|
39
|
-
</nav>
|
|
40
|
-
)}
|
|
41
|
-
<div className="ui-page-header-row">
|
|
42
|
-
<div className="min-w-0">
|
|
43
|
-
<h1 className="ui-page-title">{title}</h1>
|
|
44
|
-
{description && <p className="ui-page-subtitle">{description}</p>}
|
|
45
|
-
</div>
|
|
46
|
-
{actions && <div className="ui-inline-sm shrink-0">{actions}</div>}
|
|
47
|
-
</div>
|
|
48
|
-
</header>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** Build visible page numbers with ellipsis — Ant Design pagination style. */
|
|
2
|
-
export function buildPageRange(
|
|
3
|
-
current: number,
|
|
4
|
-
totalPages: number,
|
|
5
|
-
siblingCount = 1,
|
|
6
|
-
): (number | "ellipsis")[] {
|
|
7
|
-
if (totalPages <= 1) return totalPages === 1 ? [1] : [];
|
|
8
|
-
|
|
9
|
-
const totalNumbers = siblingCount * 2 + 5;
|
|
10
|
-
if (totalPages <= totalNumbers) {
|
|
11
|
-
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const left = Math.max(current - siblingCount, 1);
|
|
15
|
-
const right = Math.min(current + siblingCount, totalPages);
|
|
16
|
-
const showLeftEllipsis = left > 2;
|
|
17
|
-
const showRightEllipsis = right < totalPages - 1;
|
|
18
|
-
|
|
19
|
-
const range: (number | "ellipsis")[] = [];
|
|
20
|
-
range.push(1);
|
|
21
|
-
|
|
22
|
-
if (showLeftEllipsis) range.push("ellipsis");
|
|
23
|
-
else for (let i = 2; i < left; i++) range.push(i);
|
|
24
|
-
|
|
25
|
-
for (let i = left; i <= right; i++) {
|
|
26
|
-
if (i !== 1 && i !== totalPages) range.push(i);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (showRightEllipsis) range.push("ellipsis");
|
|
30
|
-
else for (let i = right + 1; i < totalPages; i++) range.push(i);
|
|
31
|
-
|
|
32
|
-
if (totalPages > 1) range.push(totalPages);
|
|
33
|
-
|
|
34
|
-
return range;
|
|
35
|
-
}
|