@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
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { Input } from './chunk-VOHTRR5X.js';
|
|
2
|
+
import { buttonVariants, Button } from './chunk-HJEBRCXL.js';
|
|
3
|
+
import { Label } from './chunk-7PWBC4BY.js';
|
|
4
|
+
import { useTranslation } from './chunk-3F2AKYRD.js';
|
|
5
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
8
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
9
|
+
import { X } from 'lucide-react';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var DialogModeContext = React.createContext("form");
|
|
13
|
+
function useDialogMode() {
|
|
14
|
+
return React.useContext(DialogModeContext);
|
|
15
|
+
}
|
|
16
|
+
function DialogRoot({ mode = "form", ...props }) {
|
|
17
|
+
if (mode === "confirm") {
|
|
18
|
+
return /* @__PURE__ */ jsx(DialogModeContext.Provider, { value: "confirm", children: /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "dialog", ...props }) });
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(DialogModeContext.Provider, { value: "form", children: /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props }) });
|
|
21
|
+
}
|
|
22
|
+
function DialogTrigger(props) {
|
|
23
|
+
const mode = useDialogMode();
|
|
24
|
+
if (mode === "confirm") {
|
|
25
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
28
|
+
}
|
|
29
|
+
function DialogPortal(props) {
|
|
30
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
31
|
+
}
|
|
32
|
+
function DialogClose(props) {
|
|
33
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
34
|
+
}
|
|
35
|
+
var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
36
|
+
DialogPrimitive.Overlay,
|
|
37
|
+
{
|
|
38
|
+
ref,
|
|
39
|
+
"data-slot": "dialog-overlay",
|
|
40
|
+
className: cn(
|
|
41
|
+
"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",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
));
|
|
47
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
48
|
+
var DialogContent = React.forwardRef(({ className, children, showClose, showCloseButton: showCloseButtonProp, ...props }, ref) => {
|
|
49
|
+
const mode = useDialogMode();
|
|
50
|
+
if (mode === "confirm") {
|
|
51
|
+
return /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
AlertDialogPrimitive.Overlay,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "dialog-overlay",
|
|
56
|
+
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"
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
AlertDialogPrimitive.Content,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
"data-slot": "dialog-content",
|
|
64
|
+
className: cn(
|
|
65
|
+
"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",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
...props,
|
|
69
|
+
children
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
const showCloseButton = showCloseButtonProp ?? showClose ?? true;
|
|
75
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
77
|
+
/* @__PURE__ */ jsxs(
|
|
78
|
+
DialogPrimitive.Content,
|
|
79
|
+
{
|
|
80
|
+
ref,
|
|
81
|
+
"data-slot": "dialog-content",
|
|
82
|
+
className: cn(
|
|
83
|
+
"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",
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
...props,
|
|
87
|
+
children: [
|
|
88
|
+
children,
|
|
89
|
+
showCloseButton ? /* @__PURE__ */ jsxs(
|
|
90
|
+
DialogPrimitive.Close,
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "dialog-close",
|
|
93
|
+
className: "ring-offset-background focus:ring-ring transition-opacity focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" }),
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
) : null
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] });
|
|
104
|
+
});
|
|
105
|
+
DialogContent.displayName = "DialogContent";
|
|
106
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-header", className, ...props });
|
|
107
|
+
DialogHeader.displayName = "DialogHeader";
|
|
108
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-footer", className, ...props });
|
|
109
|
+
DialogFooter.displayName = "DialogFooter";
|
|
110
|
+
var DialogTitle = React.forwardRef(({ className, ...props }, ref) => {
|
|
111
|
+
const mode = useDialogMode();
|
|
112
|
+
const cls = cn(className);
|
|
113
|
+
if (mode === "confirm") {
|
|
114
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, { ref, "data-slot": "dialog-title", className: cls, ...props });
|
|
115
|
+
}
|
|
116
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, "data-slot": "dialog-title", className: cls, ...props });
|
|
117
|
+
});
|
|
118
|
+
DialogTitle.displayName = "DialogTitle";
|
|
119
|
+
var DialogDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
120
|
+
const mode = useDialogMode();
|
|
121
|
+
const cls = cn(className);
|
|
122
|
+
if (mode === "confirm") {
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
AlertDialogPrimitive.Description,
|
|
125
|
+
{
|
|
126
|
+
ref,
|
|
127
|
+
"data-slot": "dialog-description",
|
|
128
|
+
className: cls,
|
|
129
|
+
...props
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
DialogPrimitive.Description,
|
|
135
|
+
{
|
|
136
|
+
ref,
|
|
137
|
+
"data-slot": "dialog-description",
|
|
138
|
+
className: cls,
|
|
139
|
+
...props
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
DialogDescription.displayName = "DialogDescription";
|
|
144
|
+
var DialogAction = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, { ref, className: cn(buttonVariants(), className), ...props }));
|
|
145
|
+
DialogAction.displayName = "DialogAction";
|
|
146
|
+
var DialogCancel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
147
|
+
AlertDialogPrimitive.Cancel,
|
|
148
|
+
{
|
|
149
|
+
ref,
|
|
150
|
+
className: cn(buttonVariants({ variant: "outline" }), className),
|
|
151
|
+
...props
|
|
152
|
+
}
|
|
153
|
+
));
|
|
154
|
+
DialogCancel.displayName = "DialogCancel";
|
|
155
|
+
function DialogConfirm({
|
|
156
|
+
open,
|
|
157
|
+
onOpenChange,
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
160
|
+
confirmLabel,
|
|
161
|
+
cancelLabel,
|
|
162
|
+
variant = "default",
|
|
163
|
+
confirmPhrase,
|
|
164
|
+
onConfirm,
|
|
165
|
+
keepOpenOnConfirm = false,
|
|
166
|
+
pending = false
|
|
167
|
+
}) {
|
|
168
|
+
const { t } = useTranslation();
|
|
169
|
+
const [typed, setTyped] = React.useState("");
|
|
170
|
+
const inputId = React.useId();
|
|
171
|
+
const needsPhrase = confirmPhrase != null && confirmPhrase.length > 0;
|
|
172
|
+
const phraseMatches = !needsPhrase || typed === confirmPhrase;
|
|
173
|
+
const effectiveVariant = needsPhrase ? "destructive" : variant;
|
|
174
|
+
const resolvedConfirm = confirmLabel ?? (needsPhrase ? t("common.delete") : t("common.continue"));
|
|
175
|
+
const resolvedCancel = cancelLabel ?? t("common.cancel");
|
|
176
|
+
const handleOpenChange = (next) => {
|
|
177
|
+
setTyped("");
|
|
178
|
+
onOpenChange(next);
|
|
179
|
+
};
|
|
180
|
+
const handleConfirm = () => {
|
|
181
|
+
if (!phraseMatches) return;
|
|
182
|
+
void (async () => {
|
|
183
|
+
await onConfirm();
|
|
184
|
+
if (!keepOpenOnConfirm) onOpenChange(false);
|
|
185
|
+
})();
|
|
186
|
+
};
|
|
187
|
+
return /* @__PURE__ */ jsx(DialogRoot, { mode: "confirm", open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
188
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
189
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
190
|
+
description ? /* @__PURE__ */ jsx(DialogDescription, { children: description }) : null
|
|
191
|
+
] }),
|
|
192
|
+
needsPhrase && /* @__PURE__ */ jsxs("div", { className: "ui-stack-xs", children: [
|
|
193
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: inputId, className: "text-sm", children: t("common.typeToConfirm", { phrase: confirmPhrase }) }),
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
Input,
|
|
196
|
+
{
|
|
197
|
+
id: inputId,
|
|
198
|
+
value: typed,
|
|
199
|
+
onChange: (e) => {
|
|
200
|
+
setTyped(e.target.value);
|
|
201
|
+
},
|
|
202
|
+
autoComplete: "off",
|
|
203
|
+
spellCheck: false,
|
|
204
|
+
placeholder: confirmPhrase,
|
|
205
|
+
"aria-required": "true"
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
210
|
+
/* @__PURE__ */ jsx(DialogCancel, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", disabled: pending, children: resolvedCancel }) }),
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
Button,
|
|
213
|
+
{
|
|
214
|
+
variant: effectiveVariant === "destructive" ? "destructive" : "default",
|
|
215
|
+
onClick: handleConfirm,
|
|
216
|
+
disabled: pending || !phraseMatches,
|
|
217
|
+
children: pending ? t("common.working") : resolvedConfirm
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] })
|
|
221
|
+
] }) });
|
|
222
|
+
}
|
|
223
|
+
var Dialog = Object.assign(DialogRoot, {
|
|
224
|
+
Trigger: DialogTrigger,
|
|
225
|
+
Portal: DialogPortal,
|
|
226
|
+
Overlay: DialogOverlay,
|
|
227
|
+
Content: DialogContent,
|
|
228
|
+
Header: DialogHeader,
|
|
229
|
+
Footer: DialogFooter,
|
|
230
|
+
Title: DialogTitle,
|
|
231
|
+
Description: DialogDescription,
|
|
232
|
+
Close: DialogClose,
|
|
233
|
+
Action: DialogAction,
|
|
234
|
+
Cancel: DialogCancel,
|
|
235
|
+
Confirm: DialogConfirm
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Popover(props) {
|
|
7
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
8
|
+
}
|
|
9
|
+
function PopoverTrigger(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
11
|
+
}
|
|
12
|
+
function PopoverAnchor(props) {
|
|
13
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
14
|
+
}
|
|
15
|
+
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
16
|
+
PopoverPrimitive.Content,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
"data-slot": "popover-content",
|
|
20
|
+
align,
|
|
21
|
+
sideOffset,
|
|
22
|
+
className: cn(
|
|
23
|
+
"bg-popover text-popover-foreground z-50 w-72 origin-[var(--radix-popover-content-transform-origin)] rounded-md border p-4 shadow-md outline-none",
|
|
24
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
25
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
26
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
27
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
) }));
|
|
33
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
34
|
+
var PopoverHeader = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "popover-header",
|
|
38
|
+
className: cn("flex flex-col gap-1 text-sm", className),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
var PopoverTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "popover-title", className: cn("font-medium", className), ...props });
|
|
43
|
+
var PopoverDescription = ({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) => /* @__PURE__ */ jsx(
|
|
47
|
+
"p",
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "popover-description",
|
|
50
|
+
className: cn("text-muted-foreground", className),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { humanError } from './chunk-7S7MYFXE.js';
|
|
2
|
+
import { Inline } from './chunk-S66TJXJU.js';
|
|
3
|
+
import { Button } from './chunk-HJEBRCXL.js';
|
|
4
|
+
import { useTranslation } from './chunk-3F2AKYRD.js';
|
|
5
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { CheckCircle2, TriangleAlert, AlertCircle, Info, X, RefreshCw } from 'lucide-react';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var AlertContext = React.createContext("default");
|
|
11
|
+
var DEFAULT_ICONS = {
|
|
12
|
+
default: Info,
|
|
13
|
+
destructive: AlertCircle,
|
|
14
|
+
warning: TriangleAlert,
|
|
15
|
+
success: CheckCircle2
|
|
16
|
+
};
|
|
17
|
+
var AlertBase = React.forwardRef(
|
|
18
|
+
({ variant = "default", icon, onDismiss, className, children, ...props }, ref) => {
|
|
19
|
+
const IconComponent = icon === false ? null : icon ?? DEFAULT_ICONS[variant];
|
|
20
|
+
return /* @__PURE__ */ jsx(AlertContext.Provider, { value: variant, children: /* @__PURE__ */ jsxs(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
role: "alert",
|
|
25
|
+
"data-slot": "alert",
|
|
26
|
+
"data-variant": variant,
|
|
27
|
+
"data-dismissible": onDismiss ? "" : void 0,
|
|
28
|
+
className,
|
|
29
|
+
...props,
|
|
30
|
+
children: [
|
|
31
|
+
IconComponent && /* @__PURE__ */ jsx(IconComponent, { "data-slot": "alert-icon", "data-variant": variant, "aria-hidden": "true" }),
|
|
32
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "alert-body", children }),
|
|
33
|
+
onDismiss && /* @__PURE__ */ jsx(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
onClick: () => {
|
|
38
|
+
void onDismiss();
|
|
39
|
+
},
|
|
40
|
+
"data-slot": "alert-dismiss",
|
|
41
|
+
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",
|
|
42
|
+
"aria-label": "Dismiss",
|
|
43
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
AlertBase.displayName = "Alert";
|
|
52
|
+
var AlertTitle = React.forwardRef(
|
|
53
|
+
({ className, ...props }, ref) => {
|
|
54
|
+
const variant = React.useContext(AlertContext);
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"p",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
"data-slot": "alert-title",
|
|
60
|
+
"data-variant": variant,
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
AlertTitle.displayName = "AlertTitle";
|
|
68
|
+
var AlertContent = React.forwardRef(
|
|
69
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
"data-slot": "alert-content",
|
|
74
|
+
className: cn("min-w-0 flex-1", className),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
AlertContent.displayName = "AlertContent";
|
|
80
|
+
var AlertDescription = React.forwardRef(
|
|
81
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, "data-slot": "alert-description", className, ...props })
|
|
82
|
+
);
|
|
83
|
+
AlertDescription.displayName = "AlertDescription";
|
|
84
|
+
var AlertActions = React.forwardRef(
|
|
85
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "alert-actions", className, ...props })
|
|
86
|
+
);
|
|
87
|
+
AlertActions.displayName = "AlertActions";
|
|
88
|
+
function AlertQueryError({ error, onRetry, className }) {
|
|
89
|
+
const { t } = useTranslation();
|
|
90
|
+
return /* @__PURE__ */ jsxs(Alert, { variant: "destructive", className, children: [
|
|
91
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("common.error") }),
|
|
92
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: humanError(error) }),
|
|
93
|
+
onRetry && /* @__PURE__ */ jsx(AlertActions, { children: /* @__PURE__ */ jsx(
|
|
94
|
+
Button,
|
|
95
|
+
{
|
|
96
|
+
variant: "outline",
|
|
97
|
+
size: "sm",
|
|
98
|
+
onClick: () => {
|
|
99
|
+
void onRetry();
|
|
100
|
+
},
|
|
101
|
+
children: /* @__PURE__ */ jsxs(Inline, { gap: "xs", children: [
|
|
102
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "size-4", "aria-hidden": "true" }),
|
|
103
|
+
t("common.retry")
|
|
104
|
+
] })
|
|
105
|
+
}
|
|
106
|
+
) })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
109
|
+
var Alert = Object.assign(AlertBase, {
|
|
110
|
+
Title: AlertTitle,
|
|
111
|
+
Content: AlertContent,
|
|
112
|
+
Description: AlertDescription,
|
|
113
|
+
Actions: AlertActions,
|
|
114
|
+
QueryError: AlertQueryError
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export { Alert, AlertActions, AlertBase, AlertContent, AlertDescription, AlertQueryError, AlertTitle };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ChoiceField, choiceGroupClassName } from './chunk-CQBADMFG.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function useControllableArray(controlled, defaultValue) {
|
|
9
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
10
|
+
const value = controlled ?? internal;
|
|
11
|
+
const setValue = React.useCallback(
|
|
12
|
+
(next) => {
|
|
13
|
+
if (controlled === void 0) setInternal(next);
|
|
14
|
+
},
|
|
15
|
+
[controlled]
|
|
16
|
+
);
|
|
17
|
+
return [value, setValue];
|
|
18
|
+
}
|
|
19
|
+
function CheckboxGroup({
|
|
20
|
+
value: controlledValue,
|
|
21
|
+
defaultValue = [],
|
|
22
|
+
onChange,
|
|
23
|
+
options,
|
|
24
|
+
orientation = "vertical",
|
|
25
|
+
disabled,
|
|
26
|
+
name,
|
|
27
|
+
className,
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
const reactId = React.useId();
|
|
31
|
+
const [value, setValue] = useControllableArray(controlledValue, defaultValue);
|
|
32
|
+
const toggle = (optionValue) => {
|
|
33
|
+
const next = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
|
|
34
|
+
setValue(next);
|
|
35
|
+
onChange?.(next);
|
|
36
|
+
};
|
|
37
|
+
if (options && options.length > 0) {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
role: "group",
|
|
42
|
+
"aria-disabled": disabled ? true : void 0,
|
|
43
|
+
"data-orientation": orientation,
|
|
44
|
+
className: choiceGroupClassName(orientation, className),
|
|
45
|
+
children: options.map((opt, index) => {
|
|
46
|
+
const id = `${reactId}-${opt.value}-${index}`;
|
|
47
|
+
const checked = value.includes(opt.value);
|
|
48
|
+
return /* @__PURE__ */ jsx(ChoiceField, { id, label: opt.label, description: opt.description, children: /* @__PURE__ */ jsx(
|
|
49
|
+
Checkbox,
|
|
50
|
+
{
|
|
51
|
+
id,
|
|
52
|
+
name,
|
|
53
|
+
value: opt.value,
|
|
54
|
+
checked,
|
|
55
|
+
disabled: Boolean(disabled) || Boolean(opt.disabled),
|
|
56
|
+
onCheckedChange: () => {
|
|
57
|
+
toggle(opt.value);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
) }, opt.value);
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
role: "group",
|
|
69
|
+
"data-orientation": orientation,
|
|
70
|
+
className: cn(choiceGroupClassName(orientation), className),
|
|
71
|
+
children
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
var CheckboxRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
76
|
+
CheckboxPrimitive.Root,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
"data-slot": "checkbox",
|
|
80
|
+
className: cn(
|
|
81
|
+
"peer ui-checkbox focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground shrink-0 shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
...props,
|
|
85
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "ui-choice-indicator", children: /* @__PURE__ */ jsx(Check, { className: "ui-checkbox-icon", "aria-hidden": "true" }) })
|
|
86
|
+
}
|
|
87
|
+
));
|
|
88
|
+
CheckboxRoot.displayName = CheckboxPrimitive.Root.displayName;
|
|
89
|
+
var Checkbox = Object.assign(CheckboxRoot, {
|
|
90
|
+
Group: CheckboxGroup
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export { Checkbox, CheckboxGroup };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Label } from './chunk-7PWBC4BY.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function FormField({
|
|
7
|
+
id,
|
|
8
|
+
label,
|
|
9
|
+
required,
|
|
10
|
+
helper,
|
|
11
|
+
error,
|
|
12
|
+
labelAddon,
|
|
13
|
+
className,
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
16
|
+
const helperId = helper && !error ? `${id}-helper` : void 0;
|
|
17
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
18
|
+
const describedBy = errorId ?? helperId;
|
|
19
|
+
const childWithA11y = React.isValidElement(children) ? React.cloneElement(children, {
|
|
20
|
+
"aria-describedby": describedBy,
|
|
21
|
+
"aria-required": required ? true : void 0,
|
|
22
|
+
"aria-invalid": !!error || void 0
|
|
23
|
+
}) : children;
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ui-stack-sm", className), children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs(Label, { htmlFor: id, className: "ui-inline-xs", children: [
|
|
27
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
28
|
+
required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-destructive", children: "*" })
|
|
29
|
+
] }),
|
|
30
|
+
labelAddon
|
|
31
|
+
] }),
|
|
32
|
+
childWithA11y,
|
|
33
|
+
error ? /* @__PURE__ */ jsx("p", { id: errorId, role: "alert", className: "text-destructive text-xs", children: error }) : helper ? /* @__PURE__ */ jsx("p", { id: helperId, className: "text-muted-foreground text-xs", children: helper }) : null
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { FormField };
|