@forthtilliath/forth-ui 0.3.0 → 0.4.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/README.md +75 -22
- package/dist/components/accordion/accordion-items.d.ts +1 -1
- package/dist/components/accordion/accordion-items.d.ts.map +1 -1
- package/dist/components/accordion/accordion-items.js +3 -2
- package/dist/components/accordion/accordion-multiple.d.ts +1 -1
- package/dist/components/accordion/accordion-multiple.d.ts.map +1 -1
- package/dist/components/accordion/accordion-multiple.js +2 -2
- package/dist/components/accordion/accordion-single.d.ts +1 -1
- package/dist/components/accordion/accordion-single.d.ts.map +1 -1
- package/dist/components/accordion/accordion-single.js +2 -2
- package/dist/components/accordion/accordion-trigger.d.ts +15 -0
- package/dist/components/accordion/accordion-trigger.d.ts.map +1 -0
- package/dist/components/accordion/accordion-trigger.js +25 -0
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +2 -2
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.d.ts.map +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/types.d.ts +1 -1
- package/dist/components/accordion/types.d.ts.map +1 -1
- package/dist/components/alert/alert.d.ts +8 -2
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +5 -3
- package/dist/components/alert/index.d.ts +3 -3
- package/dist/components/alert/index.d.ts.map +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/alert/variants.d.ts.map +1 -1
- package/dist/components/alert/variants.js +11 -4
- package/dist/components/avatar/avatar-group.d.ts +1 -1
- package/dist/components/avatar/avatar-group.d.ts.map +1 -1
- package/dist/components/avatar/avatar-group.js +1 -1
- package/dist/components/avatar/avatar.d.ts +9 -3
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +7 -4
- package/dist/components/avatar/index.d.ts +4 -4
- package/dist/components/avatar/index.d.ts.map +1 -1
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/avatar/variants.d.ts.map +1 -1
- package/dist/components/avatar/variants.js +39 -39
- package/dist/components/badge/badge.d.ts +8 -2
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +5 -3
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/badge/index.d.ts.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/variants.d.ts.map +1 -1
- package/dist/components/badge/variants.js +8 -4
- package/dist/components/banner/banner.d.ts +8 -2
- package/dist/components/banner/banner.d.ts.map +1 -1
- package/dist/components/banner/banner.js +5 -3
- package/dist/components/banner/index.d.ts +3 -3
- package/dist/components/banner/index.d.ts.map +1 -1
- package/dist/components/banner/index.js +1 -1
- package/dist/components/bento-grid/index.d.ts +2 -2
- package/dist/components/bento-grid/index.d.ts.map +1 -1
- package/dist/components/bento-grid/index.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +8 -2
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +8 -3
- package/dist/components/breadcrumb/index.d.ts +2 -2
- package/dist/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/index.d.ts +5 -5
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/chip/chip.d.ts +2 -2
- package/dist/components/chip/chip.d.ts.map +1 -1
- package/dist/components/chip/chip.js +2 -2
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.d.ts.map +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/code-block/code-block.d.ts +7 -1
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +4 -2
- package/dist/components/code-block/index.d.ts +2 -2
- package/dist/components/code-block/index.d.ts.map +1 -1
- package/dist/components/code-block/index.js +1 -1
- package/dist/components/collapsible/index.d.ts +6 -6
- package/dist/components/collapsible/index.d.ts.map +1 -1
- package/dist/components/collapsible/index.js +3 -3
- package/dist/components/color-picker/color-picker.d.ts +7 -1
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker.js +12 -4
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/color-picker/index.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/column-menu/column-menu.d.ts +1 -1
- package/dist/components/column-menu/column-menu.d.ts.map +1 -1
- package/dist/components/column-menu/column-menu.js +3 -3
- package/dist/components/column-menu/index.d.ts +5 -5
- package/dist/components/column-menu/index.d.ts.map +1 -1
- package/dist/components/column-menu/index.js +3 -3
- package/dist/components/column-menu/sortable-column-row.d.ts +1 -1
- package/dist/components/column-menu/sortable-column-row.d.ts.map +1 -1
- package/dist/components/column-menu/sortable-column-row.js +1 -1
- package/dist/components/combobox/combobox.d.ts +16 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +7 -3
- package/dist/components/combobox/index.d.ts +4 -4
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/index.js +2 -2
- package/dist/components/combobox/multi-select.d.ts +17 -2
- package/dist/components/combobox/multi-select.d.ts.map +1 -1
- package/dist/components/combobox/multi-select.js +8 -4
- package/dist/components/command-palette/command-palette.d.ts +7 -1
- package/dist/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/components/command-palette/command-palette.js +6 -2
- package/dist/components/command-palette/index.d.ts +2 -2
- package/dist/components/command-palette/index.d.ts.map +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +7 -1
- package/dist/components/confirm-dialog/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.js +12 -6
- package/dist/components/confirm-dialog/index.d.ts +3 -3
- package/dist/components/confirm-dialog/index.d.ts.map +1 -1
- package/dist/components/confirm-dialog/index.js +2 -2
- package/dist/components/confirm-dialog/use-confirm.d.ts +1 -1
- package/dist/components/confirm-dialog/use-confirm.d.ts.map +1 -1
- package/dist/components/confirm-dialog/use-confirm.js +1 -1
- package/dist/components/copy-menu-item/copy-menu-item.d.ts +18 -0
- package/dist/components/copy-menu-item/copy-menu-item.d.ts.map +1 -0
- package/dist/components/copy-menu-item/copy-menu-item.js +23 -0
- package/dist/components/copy-menu-item/index.d.ts +3 -0
- package/dist/components/copy-menu-item/index.d.ts.map +1 -0
- package/dist/components/copy-menu-item/index.js +1 -0
- package/dist/components/count-animation/index.d.ts +2 -2
- package/dist/components/count-animation/index.d.ts.map +1 -1
- package/dist/components/count-animation/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts +7 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +6 -3
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/description-list/index.d.ts +1 -1
- package/dist/components/description-list/index.d.ts.map +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dropdrawer/index.d.ts +2 -2
- package/dist/components/dropdrawer/index.d.ts.map +1 -1
- package/dist/components/dropdrawer/index.js +1 -1
- package/dist/components/dropzone/dropzone.d.ts +7 -1
- package/dist/components/dropzone/dropzone.d.ts.map +1 -1
- package/dist/components/dropzone/dropzone.js +5 -3
- package/dist/components/dropzone/index.d.ts +2 -2
- package/dist/components/dropzone/index.d.ts.map +1 -1
- package/dist/components/dropzone/index.js +1 -1
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/field/index.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-list/file-list.d.ts +4 -1
- package/dist/components/file-list/file-list.d.ts.map +1 -1
- package/dist/components/file-list/file-list.js +4 -1
- package/dist/components/file-list/index.d.ts +2 -2
- package/dist/components/file-list/index.d.ts.map +1 -1
- package/dist/components/file-list/index.js +1 -1
- package/dist/components/gradient-frame/index.d.ts +2 -2
- package/dist/components/gradient-frame/index.d.ts.map +1 -1
- package/dist/components/gradient-frame/index.js +1 -1
- package/dist/components/grid/context.d.ts.map +1 -1
- package/dist/components/grid/context.js +1 -0
- package/dist/components/grid/grid-item.d.ts +1 -1
- package/dist/components/grid/grid-item.d.ts.map +1 -1
- package/dist/components/grid/grid-item.js +3 -2
- package/dist/components/grid/grid.d.ts +3 -3
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +4 -3
- package/dist/components/grid/index.d.ts +2 -2
- package/dist/components/grid/index.d.ts.map +1 -1
- package/dist/components/grid/index.js +2 -2
- package/dist/components/grid/variants.d.ts +1 -1
- package/dist/components/icon-bubble/icon-bubble.d.ts +1 -1
- package/dist/components/icon-bubble/icon-bubble.d.ts.map +1 -1
- package/dist/components/icon-bubble/icon-bubble.js +1 -1
- package/dist/components/icon-bubble/index.d.ts +3 -3
- package/dist/components/icon-bubble/index.d.ts.map +1 -1
- package/dist/components/icon-bubble/index.js +1 -1
- package/dist/components/image-input/image-input.d.ts +7 -1
- package/dist/components/image-input/image-input.d.ts.map +1 -1
- package/dist/components/image-input/image-input.js +4 -2
- package/dist/components/image-input/index.d.ts +2 -2
- package/dist/components/image-input/index.d.ts.map +1 -1
- package/dist/components/image-input/index.js +1 -1
- package/dist/components/infinite-scroll/index.d.ts +2 -2
- package/dist/components/infinite-scroll/index.d.ts.map +1 -1
- package/dist/components/infinite-scroll/index.js +1 -1
- package/dist/components/kbd/index.d.ts +1 -1
- package/dist/components/kbd/index.d.ts.map +1 -1
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/link/index.d.ts +6 -6
- package/dist/components/link/index.d.ts.map +1 -1
- package/dist/components/link/index.js +3 -3
- package/dist/components/link/link.d.ts +1 -1
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/link/link.js +1 -1
- package/dist/components/marquee/index.d.ts +2 -2
- package/dist/components/marquee/index.d.ts.map +1 -1
- package/dist/components/marquee/index.js +1 -1
- package/dist/components/mode-toggle/index.d.ts +4 -0
- package/dist/components/mode-toggle/index.d.ts.map +1 -0
- package/dist/components/mode-toggle/index.js +2 -0
- package/dist/components/mode-toggle/mode-toggle.d.ts +22 -0
- package/dist/components/mode-toggle/mode-toggle.d.ts.map +1 -0
- package/dist/components/mode-toggle/mode-toggle.js +26 -0
- package/dist/components/mode-toggle/theme-provider.d.ts +13 -0
- package/dist/components/mode-toggle/theme-provider.d.ts.map +1 -0
- package/dist/components/mode-toggle/theme-provider.js +15 -0
- package/dist/components/multi-step-loader/index.d.ts +2 -2
- package/dist/components/multi-step-loader/index.d.ts.map +1 -1
- package/dist/components/multi-step-loader/index.js +1 -1
- package/dist/components/multi-step-loader/multi-step-loader.js +2 -2
- package/dist/components/navbar/index.d.ts +4 -4
- package/dist/components/navbar/index.d.ts.map +1 -1
- package/dist/components/navbar/index.js +2 -2
- package/dist/components/navbar/navbar-mobile-menu.d.ts +7 -1
- package/dist/components/navbar/navbar-mobile-menu.d.ts.map +1 -1
- package/dist/components/navbar/navbar-mobile-menu.js +5 -3
- package/dist/components/notification-center/index.d.ts +2 -2
- package/dist/components/notification-center/index.d.ts.map +1 -1
- package/dist/components/notification-center/index.js +1 -1
- package/dist/components/notification-center/notification-center.d.ts +7 -1
- package/dist/components/notification-center/notification-center.d.ts.map +1 -1
- package/dist/components/notification-center/notification-center.js +7 -4
- package/dist/components/number-input/index.d.ts +2 -2
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/number-input.d.ts +11 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/number-input/number-input.js +51 -9
- package/dist/components/pagination/index.d.ts +4 -4
- package/dist/components/pagination/index.d.ts.map +1 -1
- package/dist/components/pagination/index.js +2 -2
- package/dist/components/pagination/pagination.d.ts +8 -2
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +12 -9
- package/dist/components/password-input/index.d.ts +4 -4
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +2 -2
- package/dist/components/password-input/password-input.d.ts +9 -2
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/password-input/password-input.js +4 -2
- package/dist/components/progress/index.d.ts +3 -3
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress/progress.d.ts +5 -2
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/progress/progress.js +5 -3
- package/dist/components/qr-code/index.d.ts +2 -2
- package/dist/components/qr-code/index.d.ts.map +1 -1
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/qr-code/qr-code.d.ts +7 -1
- package/dist/components/qr-code/qr-code.d.ts.map +1 -1
- package/dist/components/qr-code/qr-code.js +5 -2
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/radio/index.d.ts.map +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/rating/index.d.ts +2 -2
- package/dist/components/rating/index.d.ts.map +1 -1
- package/dist/components/rating/index.js +1 -1
- package/dist/components/rating/rating.d.ts +7 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/rating/rating.js +23 -2
- package/dist/components/relative-time/index.d.ts +2 -2
- package/dist/components/relative-time/index.d.ts.map +1 -1
- package/dist/components/relative-time/index.js +1 -1
- package/dist/components/reparent/index.d.ts +2 -2
- package/dist/components/reparent/index.d.ts.map +1 -1
- package/dist/components/reparent/index.js +1 -1
- package/dist/components/repeat/index.d.ts +1 -1
- package/dist/components/repeat/index.d.ts.map +1 -1
- package/dist/components/repeat/index.js +1 -1
- package/dist/components/scroll-progress/index.d.ts +2 -2
- package/dist/components/scroll-progress/index.d.ts.map +1 -1
- package/dist/components/scroll-progress/index.js +1 -1
- package/dist/components/scroll-shadow/index.d.ts +2 -2
- package/dist/components/scroll-shadow/index.d.ts.map +1 -1
- package/dist/components/scroll-shadow/index.js +1 -1
- package/dist/components/scroll-shadow/scroll-shadow.d.ts.map +1 -1
- package/dist/components/scroll-shadow/scroll-shadow.js +3 -1
- package/dist/components/scrollspy/index.d.ts +2 -2
- package/dist/components/scrollspy/index.d.ts.map +1 -1
- package/dist/components/scrollspy/index.js +1 -1
- package/dist/components/separator/index.d.ts +2 -2
- package/dist/components/separator/index.d.ts.map +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/snippet/index.d.ts +2 -2
- package/dist/components/snippet/index.d.ts.map +1 -1
- package/dist/components/snippet/index.js +1 -1
- package/dist/components/snippet/snippet.d.ts +7 -1
- package/dist/components/snippet/snippet.d.ts.map +1 -1
- package/dist/components/snippet/snippet.js +6 -2
- package/dist/components/sortable/index.d.ts +2 -2
- package/dist/components/sortable/index.d.ts.map +1 -1
- package/dist/components/sortable/index.js +1 -1
- package/dist/components/spacer/index.d.ts +2 -2
- package/dist/components/spacer/index.d.ts.map +1 -1
- package/dist/components/spacer/index.js +1 -1
- package/dist/components/spinner/index.d.ts +3 -3
- package/dist/components/spinner/index.d.ts.map +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts +8 -2
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +6 -3
- package/dist/components/stepper/index.d.ts +2 -2
- package/dist/components/stepper/index.d.ts.map +1 -1
- package/dist/components/stepper/index.js +1 -1
- package/dist/components/submit-button/index.d.ts +2 -2
- package/dist/components/submit-button/index.d.ts.map +1 -1
- package/dist/components/submit-button/index.js +1 -1
- package/dist/components/submit-button/submit-button.d.ts +1 -1
- package/dist/components/submit-button/submit-button.d.ts.map +1 -1
- package/dist/components/submit-button/submit-button.js +1 -1
- package/dist/components/tags-input/index.d.ts +2 -2
- package/dist/components/tags-input/index.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +1 -1
- package/dist/components/tags-input/tags-input.d.ts +14 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/tags-input.js +7 -4
- package/dist/components/theme-image/index.d.ts +3 -0
- package/dist/components/theme-image/index.d.ts.map +1 -0
- package/dist/components/theme-image/index.js +1 -0
- package/dist/components/theme-image/theme-image.d.ts +25 -0
- package/dist/components/theme-image/theme-image.d.ts.map +1 -0
- package/dist/components/theme-image/theme-image.js +19 -0
- package/dist/components/timeline/index.d.ts +2 -2
- package/dist/components/timeline/index.d.ts.map +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toggle-switch/index.d.ts +3 -3
- package/dist/components/toggle-switch/index.d.ts.map +1 -1
- package/dist/components/toggle-switch/index.js +1 -1
- package/dist/components/toggle-switch/toggle-switch.d.ts +1 -1
- package/dist/components/toggle-switch/toggle-switch.d.ts.map +1 -1
- package/dist/components/toggle-switch/toggle-switch.js +1 -1
- package/dist/components/tree/index.d.ts +2 -2
- package/dist/components/tree/index.d.ts.map +1 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree/tree.js +1 -1
- package/dist/globals.css +1267 -81
- package/dist/locale/UiLocaleProvider.d.ts +19 -0
- package/dist/locale/UiLocaleProvider.d.ts.map +1 -0
- package/dist/locale/UiLocaleProvider.js +17 -0
- package/dist/locale/index.d.ts +4 -0
- package/dist/locale/index.d.ts.map +1 -0
- package/dist/locale/index.js +3 -0
- package/dist/locale/locale.d.ts +15 -0
- package/dist/locale/locale.d.ts.map +1 -0
- package/dist/locale/locale.js +19 -0
- package/dist/locale/messages.d.ts +98 -0
- package/dist/locale/messages.d.ts.map +1 -0
- package/dist/locale/messages.js +99 -0
- package/package.json +31 -15
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CodeBlockProps } from "./code-block";
|
|
2
|
-
export { CodeBlock } from "./code-block";
|
|
1
|
+
export type { CodeBlockProps } from "./code-block.js";
|
|
2
|
+
export { CodeBlock } from "./code-block.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/code-block/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CodeBlock } from "./code-block";
|
|
1
|
+
export { CodeBlock } from "./code-block.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { CollapsibleProps } from "./collapsible";
|
|
2
|
-
export type { CollapsibleContentProps } from "./collapsible";
|
|
3
|
-
export type { CollapsibleTriggerProps } from "./collapsible";
|
|
4
|
-
export { Collapsible } from "./collapsible";
|
|
5
|
-
export { CollapsibleContent } from "./collapsible";
|
|
6
|
-
export { CollapsibleTrigger } from "./collapsible";
|
|
1
|
+
export type { CollapsibleProps } from "./collapsible.js";
|
|
2
|
+
export type { CollapsibleContentProps } from "./collapsible.js";
|
|
3
|
+
export type { CollapsibleTriggerProps } from "./collapsible.js";
|
|
4
|
+
export { Collapsible } from "./collapsible.js";
|
|
5
|
+
export { CollapsibleContent } from "./collapsible.js";
|
|
6
|
+
export { CollapsibleTrigger } from "./collapsible.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/collapsible/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/collapsible/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Collapsible } from "./collapsible";
|
|
2
|
-
export { CollapsibleContent } from "./collapsible";
|
|
3
|
-
export { CollapsibleTrigger } from "./collapsible";
|
|
1
|
+
export { Collapsible } from "./collapsible.js";
|
|
2
|
+
export { CollapsibleContent } from "./collapsible.js";
|
|
3
|
+
export { CollapsibleTrigger } from "./collapsible.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type UiLocale } from "../../locale/locale.js";
|
|
2
3
|
export interface ColorPickerProps {
|
|
3
4
|
value?: string;
|
|
4
5
|
defaultValue?: string;
|
|
@@ -7,6 +8,11 @@ export interface ColorPickerProps {
|
|
|
7
8
|
className?: string;
|
|
8
9
|
/** Accessible name for the color swatch, which otherwise has no visible text. */
|
|
9
10
|
ariaLabel?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
13
|
+
* `UiLocaleProvider`'s. Explicit text props still win.
|
|
14
|
+
*/
|
|
15
|
+
locale?: UiLocale;
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
18
|
* A color swatch + hex text input, kept in sync — built on the browser's
|
|
@@ -22,5 +28,5 @@ export interface ColorPickerProps {
|
|
|
22
28
|
* @author Forth
|
|
23
29
|
* @copyright 2026 Forth
|
|
24
30
|
*/
|
|
25
|
-
export declare function ColorPicker({ value, defaultValue, onValueChange, disabled, className, ariaLabel, }: ColorPickerProps): React.JSX.Element;
|
|
31
|
+
export declare function ColorPicker({ value, defaultValue, onValueChange, disabled, className, ariaLabel, locale, }: ColorPickerProps): React.JSX.Element;
|
|
26
32
|
//# sourceMappingURL=color-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/color-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/color-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,wBAAwB,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,YAAwB,EACxB,aAAa,EACb,QAAgB,EAChB,SAAS,EACT,SAAS,EACT,MAAM,GACP,EAAE,gBAAgB,qBA6DlB"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Input } from "@forthtilliath/shadcn-ui/components/input";
|
|
5
5
|
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
6
|
+
import { useUiMessages } from "../../locale/locale.js";
|
|
6
7
|
const HEX_PATTERN = /^#[0-9a-f]{6}$/i;
|
|
7
8
|
/**
|
|
8
9
|
* A color swatch + hex text input, kept in sync — built on the browser's
|
|
@@ -18,18 +19,25 @@ const HEX_PATTERN = /^#[0-9a-f]{6}$/i;
|
|
|
18
19
|
* @author Forth
|
|
19
20
|
* @copyright 2026 Forth
|
|
20
21
|
*/
|
|
21
|
-
export function ColorPicker({ value, defaultValue = "#000000", onValueChange, disabled = false, className, ariaLabel
|
|
22
|
+
export function ColorPicker({ value, defaultValue = "#000000", onValueChange, disabled = false, className, ariaLabel, locale, }) {
|
|
23
|
+
const messages = useUiMessages(locale);
|
|
22
24
|
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);
|
|
23
|
-
const [textValue, setTextValue] = React.useState(defaultValue);
|
|
24
25
|
const color = value ?? uncontrolledValue;
|
|
26
|
+
// Hex text being typed; resynced when the color changes from outside.
|
|
27
|
+
const [textValue, setTextValue] = React.useState(color);
|
|
28
|
+
const [shownColor, setShownColor] = React.useState(color);
|
|
29
|
+
if (color !== shownColor) {
|
|
30
|
+
setShownColor(color);
|
|
31
|
+
setTextValue(color);
|
|
32
|
+
}
|
|
25
33
|
function commit(next) {
|
|
26
34
|
setUncontrolledValue(next);
|
|
27
35
|
setTextValue(next);
|
|
28
36
|
onValueChange?.(next);
|
|
29
37
|
}
|
|
30
|
-
return (_jsxs("div", { "data-slot": "color-picker", className: cn("flex items-center gap-2", className), children: [_jsx("label", { "aria-label": ariaLabel, className: cn("border-input size-9 shrink-0 overflow-hidden rounded-md border shadow-xs", disabled && "pointer-events-none opacity-50"), style: { backgroundColor: color }, children: _jsx("input", { type: "color", value: color, disabled: disabled, onChange: (e) => {
|
|
38
|
+
return (_jsxs("div", { "data-slot": "color-picker", className: cn("flex items-center gap-2", className), children: [_jsx("label", { "aria-label": ariaLabel ?? messages.colorPicker.choose, className: cn("border-input size-9 shrink-0 overflow-hidden rounded-md border shadow-xs", disabled && "pointer-events-none opacity-50"), style: { backgroundColor: color }, children: _jsx("input", { type: "color", value: color, disabled: disabled, onChange: (e) => {
|
|
31
39
|
commit(e.target.value);
|
|
32
|
-
}, className: "size-full cursor-pointer opacity-0" }) }), _jsx(Input, { value: textValue, disabled: disabled, onChange: (e) => {
|
|
40
|
+
}, className: "size-full cursor-pointer opacity-0" }) }), _jsx(Input, { value: textValue, "aria-label": messages.colorPicker.hex, disabled: disabled, onChange: (e) => {
|
|
33
41
|
setTextValue(e.target.value);
|
|
34
42
|
if (HEX_PATTERN.test(e.target.value)) {
|
|
35
43
|
commit(e.target.value);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { ColorPickerProps } from "./color-picker";
|
|
2
|
-
export { ColorPicker } from "./color-picker";
|
|
1
|
+
export type { ColorPickerProps } from "./color-picker.js";
|
|
2
|
+
export { ColorPicker } from "./color-picker.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ColorPicker } from "./color-picker";
|
|
1
|
+
export { ColorPicker } from "./color-picker.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-menu.d.ts","sourceRoot":"","sources":["../../../src/components/column-menu/column-menu.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"column-menu.d.ts","sourceRoot":"","sources":["../../../src/components/column-menu/column-menu.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAIrE,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,gBAAgB;IACzD,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,oCAAoC;IACpC,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,0EAA0E;IAC1E,eAAe,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC;IACtD,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,OAAO,CACjB,MAAM,CACF,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,EACP,MAAM,CACP,CACF,CAAC;CACH;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,gBAAgB,EAAE,EACrD,OAAO,EACP,cAAc,EACd,eAAe,EACf,MAAM,EACN,KAAa,EACb,SAAS,GACV,EAAE,eAAe,CAAC,CAAC,CAAC,+BAyJpB"}
|
|
@@ -5,9 +5,9 @@ import { closestCenter, DndContext } from "@dnd-kit/core";
|
|
|
5
5
|
import { arrayMove, SortableContext, verticalListSortingStrategy, } from "@dnd-kit/sortable";
|
|
6
6
|
import { ChevronDown, RotateCcw } from "lucide-react";
|
|
7
7
|
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
8
|
-
import { SortableColumnRow } from "./sortable-column-row";
|
|
9
|
-
import { DEFAULT_COLUMN_MENU_LABELS } from "./types";
|
|
10
|
-
import { useDndSensors } from "./use-dnd-sensors";
|
|
8
|
+
import { SortableColumnRow } from "./sortable-column-row.js";
|
|
9
|
+
import { DEFAULT_COLUMN_MENU_LABELS } from "./types.js";
|
|
10
|
+
import { useDndSensors } from "./use-dnd-sensors.js";
|
|
11
11
|
/**
|
|
12
12
|
* A dropdown to show/hide and reorder (drag and drop, touch and keyboard
|
|
13
13
|
* included) the columns of a table, with a "visible / total" counter and a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { ColumnMenuProps } from "./column-menu";
|
|
2
|
-
export { ColumnMenu } from "./column-menu";
|
|
3
|
-
export type { ColumnMenuColumn, ColumnMenuLabels } from "./types";
|
|
4
|
-
export { DEFAULT_COLUMN_MENU_LABELS } from "./types";
|
|
5
|
-
export { useDndSensors } from "./use-dnd-sensors";
|
|
1
|
+
export type { ColumnMenuProps } from "./column-menu.js";
|
|
2
|
+
export { ColumnMenu } from "./column-menu.js";
|
|
3
|
+
export type { ColumnMenuColumn, ColumnMenuLabels } from "./types.js";
|
|
4
|
+
export { DEFAULT_COLUMN_MENU_LABELS } from "./types.js";
|
|
5
|
+
export { useDndSensors } from "./use-dnd-sensors.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/column-menu/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/column-menu/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ColumnMenu } from "./column-menu";
|
|
2
|
-
export { DEFAULT_COLUMN_MENU_LABELS } from "./types";
|
|
3
|
-
export { useDndSensors } from "./use-dnd-sensors";
|
|
1
|
+
export { ColumnMenu } from "./column-menu.js";
|
|
2
|
+
export { DEFAULT_COLUMN_MENU_LABELS } from "./types.js";
|
|
3
|
+
export { useDndSensors } from "./use-dnd-sensors.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable-column-row.d.ts","sourceRoot":"","sources":["../../../src/components/column-menu/sortable-column-row.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sortable-column-row.d.ts","sourceRoot":"","sources":["../../../src/components/column-menu/sortable-column-row.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM;IACtD,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EAClD,MAAM,EACN,KAAK,EACL,KAAK,EACL,eAAe,EACf,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,CAAC,CAAC,CAAC,+BAuD3B"}
|
|
@@ -4,7 +4,7 @@ import { useSortable } from "@dnd-kit/sortable";
|
|
|
4
4
|
import { CSS } from "@dnd-kit/utilities";
|
|
5
5
|
import { GripVertical } from "lucide-react";
|
|
6
6
|
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
7
|
-
import { ToggleSwitch } from "../toggle-switch";
|
|
7
|
+
import { ToggleSwitch } from "../toggle-switch/index.js";
|
|
8
8
|
/** One row of `ColumnMenu`: drag handle, visibility switch, position. */
|
|
9
9
|
export function SortableColumnRow({ column, index, total, dragHandleLabel, onToggle, className, }) {
|
|
10
10
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging, } = useSortable({ id: column.key });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type UiLocale } from "../../locale/locale.js";
|
|
2
3
|
export interface ComboboxOption {
|
|
3
4
|
label: string;
|
|
4
5
|
value: string;
|
|
@@ -12,6 +13,20 @@ export interface ComboboxProps {
|
|
|
12
13
|
emptyMessage?: string;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
className?: string;
|
|
16
|
+
/** `id` of the trigger — set by `Field`, or for a `<label htmlFor>`. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Accessible name of the trigger (a combobox takes no name from its text).
|
|
20
|
+
* Defaults to the placeholder, unless a `<label>` targets `id`.
|
|
21
|
+
*/
|
|
22
|
+
ariaLabel?: string;
|
|
23
|
+
"aria-describedby"?: string;
|
|
24
|
+
"aria-invalid"?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
27
|
+
* `UiLocaleProvider`'s. Explicit text props still win.
|
|
28
|
+
*/
|
|
29
|
+
locale?: UiLocale;
|
|
15
30
|
}
|
|
16
31
|
/**
|
|
17
32
|
* An autocomplete/searchable select — shadcn-ui doesn't ship a standalone
|
|
@@ -27,5 +42,5 @@ export interface ComboboxProps {
|
|
|
27
42
|
* @author Forth
|
|
28
43
|
* @copyright 2026 Forth
|
|
29
44
|
*/
|
|
30
|
-
export declare function Combobox({ options, value, onValueChange, placeholder, emptyMessage, disabled, className, }: ComboboxProps): React.JSX.Element;
|
|
45
|
+
export declare function Combobox({ options, value, onValueChange, placeholder, emptyMessage, disabled, className, locale, id, ariaLabel, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, }: ComboboxProps): React.JSX.Element;
|
|
31
46
|
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,wBAAwB,CAAC;AAGtE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACZ,QAAgB,EAChB,SAAS,EACT,MAAM,EACN,EAAE,EACF,SAAS,EACT,kBAAkB,EAAE,eAAe,EACnC,cAAc,EAAE,WAAW,GAC5B,EAAE,aAAa,qBA8Df"}
|
|
@@ -5,7 +5,8 @@ import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
|
|
|
5
5
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@forthtilliath/shadcn-ui/components/command";
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger, } from "@forthtilliath/shadcn-ui/components/popover";
|
|
7
7
|
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
8
|
-
import {
|
|
8
|
+
import { useUiMessages } from "../../locale/locale.js";
|
|
9
|
+
import { Button } from "../button/index.js";
|
|
9
10
|
/**
|
|
10
11
|
* An autocomplete/searchable select — shadcn-ui doesn't ship a standalone
|
|
11
12
|
* Combobox primitive, only a docs recipe combining `Popover` + `Command`
|
|
@@ -20,10 +21,13 @@ import { Button } from "../button";
|
|
|
20
21
|
* @author Forth
|
|
21
22
|
* @copyright 2026 Forth
|
|
22
23
|
*/
|
|
23
|
-
export function Combobox({ options, value, onValueChange, placeholder
|
|
24
|
+
export function Combobox({ options, value, onValueChange, placeholder, emptyMessage, disabled = false, className, locale, id, ariaLabel, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, }) {
|
|
25
|
+
const messages = useUiMessages(locale);
|
|
26
|
+
const emptyMessageText = emptyMessage ?? messages.emptyResults;
|
|
27
|
+
const placeholderText = placeholder ?? messages.combobox.placeholder;
|
|
24
28
|
const [open, setOpen] = React.useState(false);
|
|
25
29
|
const selected = options.find((option) => option.value === value);
|
|
26
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "outline", role: "combobox", "aria-expanded": open, disabled: disabled, className: cn("w-full justify-between font-normal", className), children: [selected?.label ??
|
|
30
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "outline", id: id, role: "combobox", "aria-expanded": open, "aria-label": ariaLabel ?? (id === undefined ? placeholderText : undefined), "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, disabled: disabled, className: cn("w-full justify-between font-normal", className), children: [selected?.label ?? placeholderText, _jsx(ChevronsUpDownIcon, { className: "opacity-50" })] }) }), _jsx(PopoverContent, { "aria-label": ariaLabel ?? placeholderText, className: "w-(--radix-popover-trigger-width) p-0", children: _jsxs(Command, { children: [_jsx(CommandInput, { placeholder: placeholderText }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: emptyMessageText }), _jsx(CommandGroup, { children: options.map((option) => (_jsxs(CommandItem, { value: option.label, disabled: option.disabled, onSelect: () => {
|
|
27
31
|
onValueChange?.(option.value === value ? "" : option.value);
|
|
28
32
|
setOpen(false);
|
|
29
33
|
}, children: [_jsx(CheckIcon, { className: cn("size-4", option.value === value ? "opacity-100" : "opacity-0") }), option.label] }, option.value))) })] })] }) })] }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { ComboboxOption, ComboboxProps } from "./combobox";
|
|
2
|
-
export { Combobox } from "./combobox";
|
|
3
|
-
export type { MultiSelectOption, MultiSelectProps } from "./multi-select";
|
|
4
|
-
export { MultiSelect } from "./multi-select";
|
|
1
|
+
export type { ComboboxOption, ComboboxProps } from "./combobox.js";
|
|
2
|
+
export { Combobox } from "./combobox.js";
|
|
3
|
+
export type { MultiSelectOption, MultiSelectProps } from "./multi-select.js";
|
|
4
|
+
export { MultiSelect } from "./multi-select.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Combobox } from "./combobox";
|
|
2
|
-
export { MultiSelect } from "./multi-select";
|
|
1
|
+
export { Combobox } from "./combobox.js";
|
|
2
|
+
export { MultiSelect } from "./multi-select.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type UiLocale } from "../../locale/locale.js";
|
|
3
|
+
import type { ComboboxOption } from "./combobox.js";
|
|
3
4
|
export type MultiSelectOption = ComboboxOption;
|
|
4
5
|
export interface MultiSelectProps {
|
|
5
6
|
options: MultiSelectOption[];
|
|
@@ -10,6 +11,20 @@ export interface MultiSelectProps {
|
|
|
10
11
|
emptyMessage?: string;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
className?: string;
|
|
14
|
+
/** `id` of the trigger — set by `Field`, or for a `<label htmlFor>`. */
|
|
15
|
+
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible name of the trigger (a combobox takes no name from its text).
|
|
18
|
+
* Defaults to the placeholder, unless a `<label>` targets `id`.
|
|
19
|
+
*/
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
"aria-describedby"?: string;
|
|
22
|
+
"aria-invalid"?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
25
|
+
* `UiLocaleProvider`'s. Explicit text props still win.
|
|
26
|
+
*/
|
|
27
|
+
locale?: UiLocale;
|
|
13
28
|
}
|
|
14
29
|
/**
|
|
15
30
|
* `Combobox`'s multi-value sibling — selected options render as removable
|
|
@@ -26,5 +41,5 @@ export interface MultiSelectProps {
|
|
|
26
41
|
* @author Forth
|
|
27
42
|
* @copyright 2026 Forth
|
|
28
43
|
*/
|
|
29
|
-
export declare function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, emptyMessage, disabled, className, }: MultiSelectProps): React.JSX.Element;
|
|
44
|
+
export declare function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, emptyMessage, disabled, className, locale, id, ariaLabel, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, }: MultiSelectProps): React.JSX.Element;
|
|
30
45
|
//# sourceMappingURL=multi-select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/multi-select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/multi-select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,wBAAwB,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,QAAgB,EAChB,SAAS,EACT,MAAM,EACN,EAAE,EACF,SAAS,EACT,kBAAkB,EAAE,eAAe,EACnC,cAAc,EAAE,WAAW,GAC5B,EAAE,gBAAgB,qBA4HlB"}
|
|
@@ -6,7 +6,8 @@ import { buttonVariants } from "@forthtilliath/shadcn-ui/components/button";
|
|
|
6
6
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@forthtilliath/shadcn-ui/components/command";
|
|
7
7
|
import { Popover, PopoverContent, PopoverTrigger, } from "@forthtilliath/shadcn-ui/components/popover";
|
|
8
8
|
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
9
|
-
import {
|
|
9
|
+
import { useUiMessages } from "../../locale/locale.js";
|
|
10
|
+
import { Badge } from "../badge/index.js";
|
|
10
11
|
/**
|
|
11
12
|
* `Combobox`'s multi-value sibling — selected options render as removable
|
|
12
13
|
* `Badge` chips in the trigger. Fills the same shadcn-ui gap as `Combobox`
|
|
@@ -22,7 +23,10 @@ import { Badge } from "../badge";
|
|
|
22
23
|
* @author Forth
|
|
23
24
|
* @copyright 2026 Forth
|
|
24
25
|
*/
|
|
25
|
-
export function MultiSelect({ options, value, defaultValue, onValueChange, placeholder
|
|
26
|
+
export function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, emptyMessage, disabled = false, className, locale, id, ariaLabel, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, }) {
|
|
27
|
+
const messages = useUiMessages(locale);
|
|
28
|
+
const emptyMessageText = emptyMessage ?? messages.emptyResults;
|
|
29
|
+
const placeholderText = placeholder ?? messages.combobox.placeholder;
|
|
26
30
|
const listboxId = React.useId();
|
|
27
31
|
const [open, setOpen] = React.useState(false);
|
|
28
32
|
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? []);
|
|
@@ -37,7 +41,7 @@ export function MultiSelect({ options, value, defaultValue, onValueChange, place
|
|
|
37
41
|
: [...selected, optionValue]);
|
|
38
42
|
}
|
|
39
43
|
const selectedOptions = options.filter((option) => selected.includes(option.value));
|
|
40
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("div", { role: "combobox", tabIndex: disabled ? -1 : 0, "aria-expanded": open, "aria-controls": listboxId, "aria-disabled": disabled, "data-disabled": disabled, onKeyDown: (e) => {
|
|
44
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("div", { id: id, role: "combobox", tabIndex: disabled ? -1 : 0, "aria-expanded": open, "aria-label": ariaLabel ?? placeholderText, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-controls": listboxId, "aria-disabled": disabled, "data-disabled": disabled, onKeyDown: (e) => {
|
|
41
45
|
if (!disabled && (e.key === "Enter" || e.key === " ")) {
|
|
42
46
|
e.preventDefault();
|
|
43
47
|
setOpen((prev) => !prev);
|
|
@@ -46,7 +50,7 @@ export function MultiSelect({ options, value, defaultValue, onValueChange, place
|
|
|
46
50
|
e.stopPropagation();
|
|
47
51
|
}, onOpenChange: () => {
|
|
48
52
|
toggle(option.value);
|
|
49
|
-
}, children: option.label }, option.value)))) : (_jsx("span", { className: "text-muted-foreground font-normal", children:
|
|
53
|
+
}, children: option.label }, option.value)))) : (_jsx("span", { className: "text-muted-foreground font-normal", children: placeholderText })) }), _jsx(ChevronsUpDownIcon, { className: "shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { id: listboxId, "aria-label": ariaLabel ?? placeholderText, className: "w-(--radix-popover-trigger-width) p-0", children: _jsxs(Command, { children: [_jsx(CommandInput, { placeholder: placeholderText }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: emptyMessageText }), _jsx(CommandGroup, { children: options.map((option) => (_jsxs(CommandItem, { value: option.label, disabled: option.disabled, onSelect: () => {
|
|
50
54
|
toggle(option.value);
|
|
51
55
|
}, children: [_jsx(CheckIcon, { className: cn("size-4", selected.includes(option.value)
|
|
52
56
|
? "opacity-100"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type UiLocale } from "../../locale/locale.js";
|
|
2
3
|
export interface CommandPaletteItem {
|
|
3
4
|
label: React.ReactNode;
|
|
4
5
|
value: string;
|
|
@@ -18,6 +19,11 @@ export interface CommandPaletteProps {
|
|
|
18
19
|
emptyMessage?: string;
|
|
19
20
|
/** Key that toggles the palette alongside Cmd/Ctrl. @default "k" */
|
|
20
21
|
shortcutKey?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
24
|
+
* `UiLocaleProvider`'s. Explicit text props still win.
|
|
25
|
+
*/
|
|
26
|
+
locale?: UiLocale;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
29
|
* A global command menu (`Cmd/Ctrl+<key>` to open) — wraps shadcn-ui's own
|
|
@@ -33,5 +39,5 @@ export interface CommandPaletteProps {
|
|
|
33
39
|
* @author Forth
|
|
34
40
|
* @copyright 2026 Forth
|
|
35
41
|
*/
|
|
36
|
-
export declare function CommandPalette({ groups, open, onOpenChange, placeholder, emptyMessage, shortcutKey, }: CommandPaletteProps): React.JSX.Element;
|
|
42
|
+
export declare function CommandPalette({ groups, open, onOpenChange, placeholder, emptyMessage, shortcutKey, locale, }: CommandPaletteProps): React.JSX.Element;
|
|
37
43
|
//# sourceMappingURL=command-palette.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/command-palette/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,kBAAkB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/command-palette/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,wBAAwB,CAAC;AAEtE,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,kBAAkB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAiB,EACjB,MAAM,GACP,EAAE,mBAAmB,qBA+DrB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandShortcut, } from "@forthtilliath/shadcn-ui/components/command";
|
|
5
|
+
import { useUiMessages } from "../../locale/locale.js";
|
|
5
6
|
/**
|
|
6
7
|
* A global command menu (`Cmd/Ctrl+<key>` to open) — wraps shadcn-ui's own
|
|
7
8
|
* `CommandDialog` (which has no keyboard-shortcut wiring of its own) with
|
|
@@ -16,7 +17,10 @@ import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, C
|
|
|
16
17
|
* @author Forth
|
|
17
18
|
* @copyright 2026 Forth
|
|
18
19
|
*/
|
|
19
|
-
export function CommandPalette({ groups, open, onOpenChange, placeholder
|
|
20
|
+
export function CommandPalette({ groups, open, onOpenChange, placeholder, emptyMessage, shortcutKey = "k", locale, }) {
|
|
21
|
+
const messages = useUiMessages(locale);
|
|
22
|
+
const emptyMessageText = emptyMessage ?? messages.emptyResults;
|
|
23
|
+
const placeholderText = placeholder ?? messages.commandPalette.placeholder;
|
|
20
24
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
|
|
21
25
|
const isOpen = open ?? uncontrolledOpen;
|
|
22
26
|
function setOpen(next) {
|
|
@@ -37,7 +41,7 @@ export function CommandPalette({ groups, open, onOpenChange, placeholder = "Type
|
|
|
37
41
|
};
|
|
38
42
|
// eslint-disable-next-line @eslint-react/exhaustive-deps -- `setOpen` is a plain function redefined every render; including it would re-register this listener every render instead of only when `isOpen`/`shortcutKey` actually change, which is what its own re-closure over `isOpen` depends on
|
|
39
43
|
}, [isOpen, shortcutKey]);
|
|
40
|
-
return (_jsxs(CommandDialog, { open: isOpen, onOpenChange: setOpen, title: "Command Palette", description:
|
|
44
|
+
return (_jsxs(CommandDialog, { open: isOpen, onOpenChange: setOpen, title: "Command Palette", description: placeholderText, children: [_jsx(CommandInput, { placeholder: placeholderText }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: emptyMessageText }), groups.map((group, index) => (
|
|
41
45
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- `heading` is optional and not guaranteed unique
|
|
42
46
|
_jsx(CommandGroup, { heading: group.heading, children: group.items.map((item) => (_jsxs(CommandItem, { value: item.value, onSelect: () => {
|
|
43
47
|
item.onSelect();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CommandPaletteGroup, CommandPaletteItem, CommandPaletteProps, } from "./command-palette";
|
|
2
|
-
export { CommandPalette } from "./command-palette";
|
|
1
|
+
export type { CommandPaletteGroup, CommandPaletteItem, CommandPaletteProps, } from "./command-palette.js";
|
|
2
|
+
export { CommandPalette } from "./command-palette.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/command-palette/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/command-palette/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CommandPalette } from "./command-palette";
|
|
1
|
+
export { CommandPalette } from "./command-palette.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type UiLocale } from "../../locale/locale.js";
|
|
2
3
|
/**
|
|
3
4
|
* Provides `useConfirm`, an imperative `await confirm({...})` alternative
|
|
4
5
|
* to hand-wiring an `AlertDialog`'s open state for every yes/no
|
|
@@ -12,7 +13,12 @@ import * as React from "react";
|
|
|
12
13
|
* @author Forth
|
|
13
14
|
* @copyright 2026 Forth
|
|
14
15
|
*/
|
|
15
|
-
export declare function ConfirmDialogProvider({ children, }: {
|
|
16
|
+
export declare function ConfirmDialogProvider({ children, locale, }: {
|
|
16
17
|
children: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
20
|
+
* `UiLocaleProvider`'s. Explicit text props still win.
|
|
21
|
+
*/
|
|
22
|
+
locale?: UiLocale;
|
|
17
23
|
}): React.JSX.Element;
|
|
18
24
|
//# sourceMappingURL=confirm-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/confirm-dialog/confirm-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/confirm-dialog/confirm-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,wBAAwB,CAAC;AAKtE;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,qBA2DA"}
|
|
@@ -4,7 +4,8 @@ import * as React from "react";
|
|
|
4
4
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@forthtilliath/shadcn-ui/components/alert-dialog";
|
|
5
5
|
import { buttonVariants } from "@forthtilliath/shadcn-ui/components/button";
|
|
6
6
|
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
7
|
-
import {
|
|
7
|
+
import { useUiMessages } from "../../locale/locale.js";
|
|
8
|
+
import { ConfirmContext } from "./confirm-context.js";
|
|
8
9
|
/**
|
|
9
10
|
* Provides `useConfirm`, an imperative `await confirm({...})` alternative
|
|
10
11
|
* to hand-wiring an `AlertDialog`'s open state for every yes/no
|
|
@@ -18,23 +19,28 @@ import { ConfirmContext } from "./confirm-context";
|
|
|
18
19
|
* @author Forth
|
|
19
20
|
* @copyright 2026 Forth
|
|
20
21
|
*/
|
|
21
|
-
export function ConfirmDialogProvider({ children, }) {
|
|
22
|
+
export function ConfirmDialogProvider({ children, locale, }) {
|
|
23
|
+
const messages = useUiMessages(locale);
|
|
22
24
|
const [state, setState] = React.useState(null);
|
|
25
|
+
// Kept apart from `state`, so the last options stay rendered while the
|
|
26
|
+
// dialog animates out (clearing them left an empty, unnamed dialog).
|
|
27
|
+
const [open, setOpen] = React.useState(false);
|
|
23
28
|
const confirm = React.useCallback((options) => {
|
|
24
29
|
return new Promise((resolve) => {
|
|
25
30
|
setState({ ...options, resolve });
|
|
31
|
+
setOpen(true);
|
|
26
32
|
});
|
|
27
33
|
}, []);
|
|
28
34
|
function settle(confirmed) {
|
|
29
35
|
state?.resolve(confirmed);
|
|
30
|
-
|
|
36
|
+
setOpen(false);
|
|
31
37
|
}
|
|
32
|
-
return (_jsxs(ConfirmContext, { value: confirm, children: [children, _jsx(AlertDialog, { open:
|
|
38
|
+
return (_jsxs(ConfirmContext, { value: confirm, children: [children, _jsx(AlertDialog, { open: open, onOpenChange: (open) => {
|
|
33
39
|
if (!open) {
|
|
34
40
|
settle(false);
|
|
35
41
|
}
|
|
36
|
-
}, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: state?.title }), state?.description !== undefined && (_jsx(AlertDialogDescription, { children: state.description }))] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: state?.cancelLabel ??
|
|
42
|
+
}, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: state?.title }), state?.description !== undefined && (_jsx(AlertDialogDescription, { children: state.description }))] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: state?.cancelLabel ?? messages.confirmDialog.cancel }), _jsx(AlertDialogAction, { onClick: () => {
|
|
37
43
|
settle(true);
|
|
38
44
|
}, className: cn(state?.variant === "destructive" &&
|
|
39
|
-
buttonVariants({ variant: "destructive" })), children: state?.confirmLabel ??
|
|
45
|
+
buttonVariants({ variant: "destructive" })), children: state?.confirmLabel ?? messages.confirmDialog.confirm })] })] }) })] }));
|
|
40
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ConfirmOptions } from "./confirm-context";
|
|
2
|
-
export { ConfirmDialogProvider } from "./confirm-dialog";
|
|
3
|
-
export { useConfirm } from "./use-confirm";
|
|
1
|
+
export type { ConfirmOptions } from "./confirm-context.js";
|
|
2
|
+
export { ConfirmDialogProvider } from "./confirm-dialog.js";
|
|
3
|
+
export { useConfirm } from "./use-confirm.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/confirm-dialog/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/confirm-dialog/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ConfirmDialogProvider } from "./confirm-dialog";
|
|
2
|
-
export { useConfirm } from "./use-confirm";
|
|
1
|
+
export { ConfirmDialogProvider } from "./confirm-dialog.js";
|
|
2
|
+
export { useConfirm } from "./use-confirm.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfirmFn } from "./confirm-context";
|
|
1
|
+
import type { ConfirmFn } from "./confirm-context.js";
|
|
2
2
|
/** Must be called from a descendant of `ConfirmDialogProvider`. */
|
|
3
3
|
export declare function useConfirm(): ConfirmFn;
|
|
4
4
|
//# sourceMappingURL=use-confirm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-confirm.d.ts","sourceRoot":"","sources":["../../../src/components/confirm-dialog/use-confirm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-confirm.d.ts","sourceRoot":"","sources":["../../../src/components/confirm-dialog/use-confirm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,mEAAmE;AACnE,wBAAgB,UAAU,IAAI,SAAS,CAMtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { ConfirmContext } from "./confirm-context";
|
|
2
|
+
import { ConfirmContext } from "./confirm-context.js";
|
|
3
3
|
/** Must be called from a descendant of `ConfirmDialogProvider`. */
|
|
4
4
|
export function useConfirm() {
|
|
5
5
|
const confirm = React.use(ConfirmContext);
|