@godxjp/ui 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/dist/types-mvzYGrma.d.ts +37 -0
- package/dist/use-toast-Dol5bdY3.d.ts +34 -0
- package/package.json +233 -67
- 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/control.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,167 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
AlertCircle,
|
|
4
|
-
CheckCircle2,
|
|
5
|
-
Info,
|
|
6
|
-
RefreshCw,
|
|
7
|
-
TriangleAlert,
|
|
8
|
-
X,
|
|
9
|
-
type LucideIcon,
|
|
10
|
-
} from "lucide-react";
|
|
11
|
-
|
|
12
|
-
import { useTranslation } from "../../i18n/use-translation";
|
|
13
|
-
import { humanError } from "../../lib/format";
|
|
14
|
-
import { cn } from "../../lib/utils";
|
|
15
|
-
import { Inline } from "../layout/inline";
|
|
16
|
-
import { Button } from "../general/button";
|
|
17
|
-
import type { AlertVariantProp } from "../../props/vocabulary";
|
|
18
|
-
import type {
|
|
19
|
-
AlertActionsProp,
|
|
20
|
-
AlertContentProp,
|
|
21
|
-
AlertDescriptionProp,
|
|
22
|
-
AlertProp,
|
|
23
|
-
AlertQueryErrorProp,
|
|
24
|
-
AlertTitleProp,
|
|
25
|
-
} from "../../props/components/feedback.prop";
|
|
26
|
-
|
|
27
|
-
export type {
|
|
28
|
-
AlertProp,
|
|
29
|
-
AlertProp as AlertProps,
|
|
30
|
-
AlertTitleProp,
|
|
31
|
-
AlertTitleProp as AlertTitleProps,
|
|
32
|
-
AlertContentProp,
|
|
33
|
-
AlertContentProp as AlertContentProps,
|
|
34
|
-
AlertDescriptionProp,
|
|
35
|
-
AlertDescriptionProp as AlertDescriptionProps,
|
|
36
|
-
AlertActionsProp,
|
|
37
|
-
AlertActionsProp as AlertActionsProps,
|
|
38
|
-
AlertQueryErrorProp,
|
|
39
|
-
AlertQueryErrorProp as AlertQueryErrorProps,
|
|
40
|
-
} from "../../props/components/feedback.prop";
|
|
41
|
-
|
|
42
|
-
const AlertContext = React.createContext<AlertVariantProp>("default");
|
|
43
|
-
|
|
44
|
-
const DEFAULT_ICONS: Record<AlertVariantProp, LucideIcon> = {
|
|
45
|
-
default: Info,
|
|
46
|
-
destructive: AlertCircle,
|
|
47
|
-
warning: TriangleAlert,
|
|
48
|
-
success: CheckCircle2,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const AlertBase = React.forwardRef<HTMLDivElement, AlertProp>(
|
|
52
|
-
({ variant = "default", icon, onDismiss, className, children, ...props }, ref) => {
|
|
53
|
-
const IconComponent = icon === false ? null : (icon ?? DEFAULT_ICONS[variant]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<AlertContext.Provider value={variant}>
|
|
57
|
-
<div
|
|
58
|
-
ref={ref}
|
|
59
|
-
role="alert"
|
|
60
|
-
data-slot="alert"
|
|
61
|
-
data-variant={variant}
|
|
62
|
-
data-dismissible={onDismiss ? "" : undefined}
|
|
63
|
-
className={className}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
{IconComponent && (
|
|
67
|
-
<IconComponent data-slot="alert-icon" data-variant={variant} aria-hidden="true" />
|
|
68
|
-
)}
|
|
69
|
-
<div data-slot="alert-body">{children}</div>
|
|
70
|
-
{onDismiss && (
|
|
71
|
-
<button
|
|
72
|
-
type="button"
|
|
73
|
-
onClick={() => {
|
|
74
|
-
void onDismiss();
|
|
75
|
-
}}
|
|
76
|
-
data-slot="alert-dismiss"
|
|
77
|
-
className="ring-offset-background focus-visible:ring-ring transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none"
|
|
78
|
-
aria-label="Dismiss"
|
|
79
|
-
>
|
|
80
|
-
<X className="size-4" aria-hidden="true" />
|
|
81
|
-
</button>
|
|
82
|
-
)}
|
|
83
|
-
</div>
|
|
84
|
-
</AlertContext.Provider>
|
|
85
|
-
);
|
|
86
|
-
},
|
|
87
|
-
);
|
|
88
|
-
AlertBase.displayName = "Alert";
|
|
89
|
-
|
|
90
|
-
export const AlertTitle = React.forwardRef<HTMLParagraphElement, AlertTitleProp>(
|
|
91
|
-
({ className, ...props }, ref) => {
|
|
92
|
-
const variant = React.useContext(AlertContext);
|
|
93
|
-
return (
|
|
94
|
-
<p
|
|
95
|
-
ref={ref}
|
|
96
|
-
data-slot="alert-title"
|
|
97
|
-
data-variant={variant}
|
|
98
|
-
className={className}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
);
|
|
102
|
-
},
|
|
103
|
-
);
|
|
104
|
-
AlertTitle.displayName = "AlertTitle";
|
|
105
|
-
|
|
106
|
-
export const AlertContent = React.forwardRef<HTMLDivElement, AlertContentProp>(
|
|
107
|
-
({ className, ...props }, ref) => (
|
|
108
|
-
<div
|
|
109
|
-
ref={ref}
|
|
110
|
-
data-slot="alert-content"
|
|
111
|
-
className={cn("min-w-0 flex-1", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
),
|
|
115
|
-
);
|
|
116
|
-
AlertContent.displayName = "AlertContent";
|
|
117
|
-
|
|
118
|
-
export const AlertDescription = React.forwardRef<HTMLParagraphElement, AlertDescriptionProp>(
|
|
119
|
-
({ className, ...props }, ref) => (
|
|
120
|
-
<p ref={ref} data-slot="alert-description" className={className} {...props} />
|
|
121
|
-
),
|
|
122
|
-
);
|
|
123
|
-
AlertDescription.displayName = "AlertDescription";
|
|
124
|
-
|
|
125
|
-
export const AlertActions = React.forwardRef<HTMLDivElement, AlertActionsProp>(
|
|
126
|
-
({ className, ...props }, ref) => (
|
|
127
|
-
<div ref={ref} data-slot="alert-actions" className={className} {...props} />
|
|
128
|
-
),
|
|
129
|
-
);
|
|
130
|
-
AlertActions.displayName = "AlertActions";
|
|
131
|
-
|
|
132
|
-
/** TanStack Query / API failure preset — same visual as `Alert variant="destructive"`. Used by `DataState` (@godxjp/ui/query). */
|
|
133
|
-
export function AlertQueryError({ error, onRetry, className }: AlertQueryErrorProp) {
|
|
134
|
-
const { t } = useTranslation();
|
|
135
|
-
return (
|
|
136
|
-
<Alert variant="destructive" className={className}>
|
|
137
|
-
<AlertTitle>{t("common.error")}</AlertTitle>
|
|
138
|
-
<AlertDescription>{humanError(error)}</AlertDescription>
|
|
139
|
-
{onRetry && (
|
|
140
|
-
<AlertActions>
|
|
141
|
-
<Button
|
|
142
|
-
variant="outline"
|
|
143
|
-
size="sm"
|
|
144
|
-
onClick={() => {
|
|
145
|
-
void onRetry();
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
<Inline gap="xs">
|
|
149
|
-
<RefreshCw className="size-4" aria-hidden="true" />
|
|
150
|
-
{t("common.retry")}
|
|
151
|
-
</Inline>
|
|
152
|
-
</Button>
|
|
153
|
-
</AlertActions>
|
|
154
|
-
)}
|
|
155
|
-
</Alert>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export const Alert = Object.assign(AlertBase, {
|
|
160
|
-
Title: AlertTitle,
|
|
161
|
-
Content: AlertContent,
|
|
162
|
-
Description: AlertDescription,
|
|
163
|
-
Actions: AlertActions,
|
|
164
|
-
QueryError: AlertQueryError,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
export { AlertBase };
|
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
-
import { X } from "lucide-react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
7
|
-
import { buttonVariants } from "../general/button";
|
|
8
|
-
import { useTranslation } from "../../i18n/use-translation";
|
|
9
|
-
import { Button } from "../general/button";
|
|
10
|
-
import { Input } from "../data-entry/input";
|
|
11
|
-
import { Label } from "../data-entry/label";
|
|
12
|
-
import type { DialogConfirmProp } from "../../props/components/feedback.prop";
|
|
13
|
-
|
|
14
|
-
export type {
|
|
15
|
-
DialogConfirmProp,
|
|
16
|
-
DialogConfirmProp as DialogConfirmProps,
|
|
17
|
-
} from "../../props/components/feedback.prop";
|
|
18
|
-
|
|
19
|
-
/** form = nhập liệu / wizard (role=dialog, có nút X). confirm = quyết định (role=alertdialog, không X). */
|
|
20
|
-
export type DialogMode = "form" | "confirm";
|
|
21
|
-
|
|
22
|
-
const DialogModeContext = React.createContext<DialogMode>("form");
|
|
23
|
-
|
|
24
|
-
function useDialogMode(): DialogMode {
|
|
25
|
-
return React.useContext(DialogModeContext);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type DialogRootProps = React.ComponentProps<typeof DialogPrimitive.Root> & {
|
|
29
|
-
mode?: DialogMode;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
function DialogRoot({ mode = "form", ...props }: DialogRootProps) {
|
|
33
|
-
if (mode === "confirm") {
|
|
34
|
-
return (
|
|
35
|
-
<DialogModeContext.Provider value="confirm">
|
|
36
|
-
<AlertDialogPrimitive.Root data-slot="dialog" {...props} />
|
|
37
|
-
</DialogModeContext.Provider>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
return (
|
|
41
|
-
<DialogModeContext.Provider value="form">
|
|
42
|
-
<DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
43
|
-
</DialogModeContext.Provider>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
48
|
-
const mode = useDialogMode();
|
|
49
|
-
if (mode === "confirm") {
|
|
50
|
-
return <AlertDialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
51
|
-
}
|
|
52
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
56
|
-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
60
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const DialogOverlay = React.forwardRef<
|
|
64
|
-
React.ComponentRef<typeof DialogPrimitive.Overlay>,
|
|
65
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
66
|
-
>(({ className, ...props }, ref) => (
|
|
67
|
-
<DialogPrimitive.Overlay
|
|
68
|
-
ref={ref}
|
|
69
|
-
data-slot="dialog-overlay"
|
|
70
|
-
className={cn(
|
|
71
|
-
"ui-dialog-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
72
|
-
className,
|
|
73
|
-
)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
));
|
|
77
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
78
|
-
|
|
79
|
-
const DialogContent = React.forwardRef<
|
|
80
|
-
HTMLDivElement,
|
|
81
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
82
|
-
showClose?: boolean;
|
|
83
|
-
showCloseButton?: boolean;
|
|
84
|
-
}
|
|
85
|
-
>(({ className, children, showClose, showCloseButton: showCloseButtonProp, ...props }, ref) => {
|
|
86
|
-
const mode = useDialogMode();
|
|
87
|
-
|
|
88
|
-
if (mode === "confirm") {
|
|
89
|
-
return (
|
|
90
|
-
<AlertDialogPrimitive.Portal>
|
|
91
|
-
<AlertDialogPrimitive.Overlay
|
|
92
|
-
data-slot="dialog-overlay"
|
|
93
|
-
className="ui-dialog-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
|
|
94
|
-
/>
|
|
95
|
-
<AlertDialogPrimitive.Content
|
|
96
|
-
ref={ref}
|
|
97
|
-
data-slot="dialog-content"
|
|
98
|
-
className={cn(
|
|
99
|
-
"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 duration-200 outline-none",
|
|
100
|
-
className,
|
|
101
|
-
)}
|
|
102
|
-
{...props}
|
|
103
|
-
>
|
|
104
|
-
{children}
|
|
105
|
-
</AlertDialogPrimitive.Content>
|
|
106
|
-
</AlertDialogPrimitive.Portal>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const showCloseButton = showCloseButtonProp ?? showClose ?? true;
|
|
111
|
-
return (
|
|
112
|
-
<DialogPortal>
|
|
113
|
-
<DialogOverlay />
|
|
114
|
-
<DialogPrimitive.Content
|
|
115
|
-
ref={ref}
|
|
116
|
-
data-slot="dialog-content"
|
|
117
|
-
className={cn(
|
|
118
|
-
"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 duration-200 outline-none",
|
|
119
|
-
className,
|
|
120
|
-
)}
|
|
121
|
-
{...props}
|
|
122
|
-
>
|
|
123
|
-
{children}
|
|
124
|
-
{showCloseButton ? (
|
|
125
|
-
<DialogPrimitive.Close
|
|
126
|
-
data-slot="dialog-close"
|
|
127
|
-
className="ring-offset-background focus:ring-ring transition-opacity focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none"
|
|
128
|
-
>
|
|
129
|
-
<X className="size-4" aria-hidden="true" />
|
|
130
|
-
<span className="sr-only">Close</span>
|
|
131
|
-
</DialogPrimitive.Close>
|
|
132
|
-
) : null}
|
|
133
|
-
</DialogPrimitive.Content>
|
|
134
|
-
</DialogPortal>
|
|
135
|
-
);
|
|
136
|
-
});
|
|
137
|
-
DialogContent.displayName = "DialogContent";
|
|
138
|
-
|
|
139
|
-
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
140
|
-
<div data-slot="dialog-header" className={className} {...props} />
|
|
141
|
-
);
|
|
142
|
-
DialogHeader.displayName = "DialogHeader";
|
|
143
|
-
|
|
144
|
-
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
145
|
-
<div data-slot="dialog-footer" className={className} {...props} />
|
|
146
|
-
);
|
|
147
|
-
DialogFooter.displayName = "DialogFooter";
|
|
148
|
-
|
|
149
|
-
const DialogTitle = React.forwardRef<
|
|
150
|
-
HTMLHeadingElement,
|
|
151
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
152
|
-
>(({ className, ...props }, ref) => {
|
|
153
|
-
const mode = useDialogMode();
|
|
154
|
-
const cls = cn(className);
|
|
155
|
-
if (mode === "confirm") {
|
|
156
|
-
return (
|
|
157
|
-
<AlertDialogPrimitive.Title ref={ref} data-slot="dialog-title" className={cls} {...props} />
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
return <DialogPrimitive.Title ref={ref} data-slot="dialog-title" className={cls} {...props} />;
|
|
161
|
-
});
|
|
162
|
-
DialogTitle.displayName = "DialogTitle";
|
|
163
|
-
|
|
164
|
-
const DialogDescription = React.forwardRef<
|
|
165
|
-
HTMLParagraphElement,
|
|
166
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
167
|
-
>(({ className, ...props }, ref) => {
|
|
168
|
-
const mode = useDialogMode();
|
|
169
|
-
const cls = cn(className);
|
|
170
|
-
if (mode === "confirm") {
|
|
171
|
-
return (
|
|
172
|
-
<AlertDialogPrimitive.Description
|
|
173
|
-
ref={ref}
|
|
174
|
-
data-slot="dialog-description"
|
|
175
|
-
className={cls}
|
|
176
|
-
{...props}
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
return (
|
|
181
|
-
<DialogPrimitive.Description
|
|
182
|
-
ref={ref}
|
|
183
|
-
data-slot="dialog-description"
|
|
184
|
-
className={cls}
|
|
185
|
-
{...props}
|
|
186
|
-
/>
|
|
187
|
-
);
|
|
188
|
-
});
|
|
189
|
-
DialogDescription.displayName = "DialogDescription";
|
|
190
|
-
|
|
191
|
-
/** Confirm mode — primary action (maps to Radix AlertDialogAction). */
|
|
192
|
-
const DialogAction = React.forwardRef<
|
|
193
|
-
HTMLButtonElement,
|
|
194
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
195
|
-
>(({ className, ...props }, ref) => (
|
|
196
|
-
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
|
|
197
|
-
));
|
|
198
|
-
DialogAction.displayName = "DialogAction";
|
|
199
|
-
|
|
200
|
-
/** Confirm mode — dismiss without action (maps to Radix AlertDialogCancel). */
|
|
201
|
-
const DialogCancel = React.forwardRef<
|
|
202
|
-
HTMLButtonElement,
|
|
203
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
204
|
-
>(({ className, ...props }, ref) => (
|
|
205
|
-
<AlertDialogPrimitive.Cancel
|
|
206
|
-
ref={ref}
|
|
207
|
-
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
208
|
-
{...props}
|
|
209
|
-
/>
|
|
210
|
-
));
|
|
211
|
-
DialogCancel.displayName = "DialogCancel";
|
|
212
|
-
|
|
213
|
-
/** Preset: confirm / destructive / type-to-confirm — use case `mode="confirm"` without compound markup. */
|
|
214
|
-
function DialogConfirm({
|
|
215
|
-
open,
|
|
216
|
-
onOpenChange,
|
|
217
|
-
title,
|
|
218
|
-
description,
|
|
219
|
-
confirmLabel,
|
|
220
|
-
cancelLabel,
|
|
221
|
-
variant = "default",
|
|
222
|
-
confirmPhrase,
|
|
223
|
-
onConfirm,
|
|
224
|
-
keepOpenOnConfirm = false,
|
|
225
|
-
pending = false,
|
|
226
|
-
}: DialogConfirmProp) {
|
|
227
|
-
const { t } = useTranslation();
|
|
228
|
-
const [typed, setTyped] = React.useState("");
|
|
229
|
-
const inputId = React.useId();
|
|
230
|
-
|
|
231
|
-
const needsPhrase = confirmPhrase != null && confirmPhrase.length > 0;
|
|
232
|
-
const phraseMatches = !needsPhrase || typed === confirmPhrase;
|
|
233
|
-
const effectiveVariant = needsPhrase ? "destructive" : variant;
|
|
234
|
-
const resolvedConfirm = confirmLabel ?? (needsPhrase ? t("common.delete") : t("common.continue"));
|
|
235
|
-
const resolvedCancel = cancelLabel ?? t("common.cancel");
|
|
236
|
-
|
|
237
|
-
const handleOpenChange = (next: boolean) => {
|
|
238
|
-
setTyped("");
|
|
239
|
-
onOpenChange(next);
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const handleConfirm = () => {
|
|
243
|
-
if (!phraseMatches) return;
|
|
244
|
-
void (async () => {
|
|
245
|
-
await onConfirm();
|
|
246
|
-
if (!keepOpenOnConfirm) onOpenChange(false);
|
|
247
|
-
})();
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
return (
|
|
251
|
-
<DialogRoot mode="confirm" open={open} onOpenChange={handleOpenChange}>
|
|
252
|
-
<DialogContent>
|
|
253
|
-
<DialogHeader>
|
|
254
|
-
<DialogTitle>{title}</DialogTitle>
|
|
255
|
-
{description ? <DialogDescription>{description}</DialogDescription> : null}
|
|
256
|
-
</DialogHeader>
|
|
257
|
-
|
|
258
|
-
{needsPhrase && (
|
|
259
|
-
<div className="ui-stack-xs">
|
|
260
|
-
<Label htmlFor={inputId} className="text-sm">
|
|
261
|
-
{t("common.typeToConfirm", { phrase: confirmPhrase })}
|
|
262
|
-
</Label>
|
|
263
|
-
<Input
|
|
264
|
-
id={inputId}
|
|
265
|
-
value={typed}
|
|
266
|
-
onChange={(e) => {
|
|
267
|
-
setTyped(e.target.value);
|
|
268
|
-
}}
|
|
269
|
-
autoComplete="off"
|
|
270
|
-
spellCheck={false}
|
|
271
|
-
placeholder={confirmPhrase}
|
|
272
|
-
aria-required="true"
|
|
273
|
-
/>
|
|
274
|
-
</div>
|
|
275
|
-
)}
|
|
276
|
-
|
|
277
|
-
<DialogFooter>
|
|
278
|
-
<DialogCancel asChild>
|
|
279
|
-
<Button variant="ghost" disabled={pending}>
|
|
280
|
-
{resolvedCancel}
|
|
281
|
-
</Button>
|
|
282
|
-
</DialogCancel>
|
|
283
|
-
<Button
|
|
284
|
-
variant={effectiveVariant === "destructive" ? "destructive" : "default"}
|
|
285
|
-
onClick={handleConfirm}
|
|
286
|
-
disabled={pending || !phraseMatches}
|
|
287
|
-
>
|
|
288
|
-
{pending ? t("common.working") : resolvedConfirm}
|
|
289
|
-
</Button>
|
|
290
|
-
</DialogFooter>
|
|
291
|
-
</DialogContent>
|
|
292
|
-
</DialogRoot>
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export const Dialog = Object.assign(DialogRoot, {
|
|
297
|
-
Trigger: DialogTrigger,
|
|
298
|
-
Portal: DialogPortal,
|
|
299
|
-
Overlay: DialogOverlay,
|
|
300
|
-
Content: DialogContent,
|
|
301
|
-
Header: DialogHeader,
|
|
302
|
-
Footer: DialogFooter,
|
|
303
|
-
Title: DialogTitle,
|
|
304
|
-
Description: DialogDescription,
|
|
305
|
-
Close: DialogClose,
|
|
306
|
-
Action: DialogAction,
|
|
307
|
-
Cancel: DialogCancel,
|
|
308
|
-
Confirm: DialogConfirm,
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
export {
|
|
312
|
-
DialogRoot,
|
|
313
|
-
DialogTrigger,
|
|
314
|
-
DialogPortal,
|
|
315
|
-
DialogOverlay,
|
|
316
|
-
DialogContent,
|
|
317
|
-
DialogHeader,
|
|
318
|
-
DialogFooter,
|
|
319
|
-
DialogTitle,
|
|
320
|
-
DialogDescription,
|
|
321
|
-
DialogClose,
|
|
322
|
-
DialogAction,
|
|
323
|
-
DialogCancel,
|
|
324
|
-
DialogConfirm,
|
|
325
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Dialog,
|
|
3
|
-
DialogClose,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogDescription,
|
|
6
|
-
DialogFooter,
|
|
7
|
-
DialogHeader,
|
|
8
|
-
DialogOverlay,
|
|
9
|
-
DialogPortal,
|
|
10
|
-
DialogTitle,
|
|
11
|
-
DialogTrigger,
|
|
12
|
-
DialogAction,
|
|
13
|
-
DialogCancel,
|
|
14
|
-
DialogConfirm,
|
|
15
|
-
} from "./dialog";
|
|
16
|
-
export type { DialogMode, DialogConfirmProp, DialogConfirmProps } from "./dialog";
|
|
17
|
-
export {
|
|
18
|
-
Sheet,
|
|
19
|
-
SheetClose,
|
|
20
|
-
SheetContent,
|
|
21
|
-
SheetDescription,
|
|
22
|
-
SheetFooter,
|
|
23
|
-
SheetHeader,
|
|
24
|
-
SheetOverlay,
|
|
25
|
-
SheetPortal,
|
|
26
|
-
SheetTitle,
|
|
27
|
-
SheetTrigger,
|
|
28
|
-
} from "./sheet";
|
|
29
|
-
export { Toaster } from "./sonner";
|
|
30
|
-
export { toast, useToast, type LegacyToastOptions } from "./use-toast";
|
|
31
|
-
export { SkeletonRows, SkeletonTable, SkeletonDetail, SkeletonCard } from "./skeleton";
|
|
32
|
-
export {
|
|
33
|
-
Alert,
|
|
34
|
-
AlertTitle,
|
|
35
|
-
AlertContent,
|
|
36
|
-
AlertDescription,
|
|
37
|
-
AlertActions,
|
|
38
|
-
AlertQueryError,
|
|
39
|
-
} from "./alert";
|
|
40
|
-
export type {
|
|
41
|
-
AlertProp,
|
|
42
|
-
AlertProps,
|
|
43
|
-
AlertTitleProp,
|
|
44
|
-
AlertTitleProps,
|
|
45
|
-
AlertContentProp,
|
|
46
|
-
AlertContentProps,
|
|
47
|
-
AlertDescriptionProp,
|
|
48
|
-
AlertDescriptionProps,
|
|
49
|
-
AlertActionsProp,
|
|
50
|
-
AlertActionsProps,
|
|
51
|
-
AlertQueryErrorProp,
|
|
52
|
-
AlertQueryErrorProps,
|
|
53
|
-
} from "./alert";
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
import { X } from "lucide-react";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
export function Sheet(props: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
8
|
-
return <DialogPrimitive.Root data-slot="sheet" {...props} />;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function SheetTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
12
|
-
return <DialogPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function SheetClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
16
|
-
return <DialogPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function SheetPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
20
|
-
return <DialogPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const SheetOverlay = React.forwardRef<
|
|
24
|
-
React.ComponentRef<typeof DialogPrimitive.Overlay>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<DialogPrimitive.Overlay
|
|
28
|
-
ref={ref}
|
|
29
|
-
data-slot="sheet-overlay"
|
|
30
|
-
className={cn(
|
|
31
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
32
|
-
className,
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
));
|
|
37
|
-
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
38
|
-
|
|
39
|
-
const sheetVariants = cva(
|
|
40
|
-
"fixed z-50 flex flex-col gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
41
|
-
{
|
|
42
|
-
variants: {
|
|
43
|
-
side: {
|
|
44
|
-
right:
|
|
45
|
-
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-md",
|
|
46
|
-
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-md",
|
|
47
|
-
top: "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
48
|
-
bottom:
|
|
49
|
-
"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: { side: "right" },
|
|
53
|
-
},
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
interface SheetContentProps
|
|
57
|
-
extends
|
|
58
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,
|
|
59
|
-
VariantProps<typeof sheetVariants> {
|
|
60
|
-
showCloseButton?: boolean;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const SheetContent = React.forwardRef<
|
|
64
|
-
React.ComponentRef<typeof DialogPrimitive.Content>,
|
|
65
|
-
SheetContentProps
|
|
66
|
-
>(({ side = "right", className, children, showCloseButton = true, ...props }, ref) => (
|
|
67
|
-
<SheetPortal>
|
|
68
|
-
<SheetOverlay />
|
|
69
|
-
<DialogPrimitive.Content
|
|
70
|
-
ref={ref}
|
|
71
|
-
data-slot="sheet-content"
|
|
72
|
-
className={cn(sheetVariants({ side }), className)}
|
|
73
|
-
{...props}
|
|
74
|
-
>
|
|
75
|
-
{children}
|
|
76
|
-
{showCloseButton ? (
|
|
77
|
-
<DialogPrimitive.Close
|
|
78
|
-
data-slot="sheet-close"
|
|
79
|
-
className="ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none"
|
|
80
|
-
>
|
|
81
|
-
<X className="size-4" aria-hidden="true" />
|
|
82
|
-
<span className="sr-only">Close</span>
|
|
83
|
-
</DialogPrimitive.Close>
|
|
84
|
-
) : null}
|
|
85
|
-
</DialogPrimitive.Content>
|
|
86
|
-
</SheetPortal>
|
|
87
|
-
));
|
|
88
|
-
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
89
|
-
|
|
90
|
-
export const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
91
|
-
<div
|
|
92
|
-
data-slot="sheet-header"
|
|
93
|
-
className={cn("flex flex-col gap-1.5 text-center sm:text-left", className)}
|
|
94
|
-
{...props}
|
|
95
|
-
/>
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
export const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
99
|
-
<div
|
|
100
|
-
data-slot="sheet-footer"
|
|
101
|
-
className={cn("mt-auto flex flex-col gap-2", className)}
|
|
102
|
-
{...props}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
export const SheetTitle = React.forwardRef<
|
|
107
|
-
React.ComponentRef<typeof DialogPrimitive.Title>,
|
|
108
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
109
|
-
>(({ className, ...props }, ref) => (
|
|
110
|
-
<DialogPrimitive.Title
|
|
111
|
-
ref={ref}
|
|
112
|
-
data-slot="sheet-title"
|
|
113
|
-
className={cn("text-foreground text-lg font-semibold", className)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
));
|
|
117
|
-
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
118
|
-
|
|
119
|
-
export const SheetDescription = React.forwardRef<
|
|
120
|
-
React.ComponentRef<typeof DialogPrimitive.Description>,
|
|
121
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
122
|
-
>(({ className, ...props }, ref) => (
|
|
123
|
-
<DialogPrimitive.Description
|
|
124
|
-
ref={ref}
|
|
125
|
-
data-slot="sheet-description"
|
|
126
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
));
|
|
130
|
-
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|