@eifi1/ui-kit 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +32 -0
- package/README.md +498 -57
- package/dist/chart.d.ts +10 -0
- package/dist/chart.js +10 -0
- package/dist/chart.js.map +1 -0
- package/dist/components/account-settings.d.ts +11 -0
- package/dist/components/account-settings.js +19 -12
- package/dist/components/account-settings.js.map +1 -1
- package/dist/components/alert-banner.d.ts +10 -6
- package/dist/components/alert-banner.js +20 -16
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +30 -4
- package/dist/components/amount-input.js +36 -14
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/calculator.d.ts +24 -7
- package/dist/components/calculator.js +37 -20
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/chart-zoom.d.ts +156 -0
- package/dist/components/chart-zoom.js +262 -0
- package/dist/components/chart-zoom.js.map +1 -0
- package/dist/components/chart.d.ts +28 -3
- package/dist/components/chart.js +71 -32
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.d.ts +51 -0
- package/dist/components/checkbox.js +123 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/chip.d.ts +128 -0
- package/dist/components/chip.js +357 -0
- package/dist/components/chip.js.map +1 -0
- package/dist/components/choice-parts.d.ts +24 -0
- package/dist/components/choice-parts.js +18 -0
- package/dist/components/choice-parts.js.map +1 -0
- package/dist/components/combobox-core.d.ts +52 -9
- package/dist/components/combobox-core.js +89 -19
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.d.ts +43 -33
- package/dist/components/combobox.js +409 -340
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/currency-select.d.ts +48 -8
- package/dist/components/currency-select.js +107 -65
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +15 -3
- package/dist/components/data-table-filter-popover.js +23 -17
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table-filters.js +3 -2
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-labels.d.ts +53 -2
- package/dist/components/data-table-labels.js +31 -2
- package/dist/components/data-table-labels.js.map +1 -1
- package/dist/components/data-table-pagination.d.ts +3 -1
- package/dist/components/data-table-pagination.js +16 -10
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table-sort.js +1 -0
- package/dist/components/data-table-sort.js.map +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +201 -85
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.d.ts +25 -9
- package/dist/components/date-picker.js +232 -94
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dropdown.d.ts +74 -19
- package/dist/components/dropdown.js +72 -22
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/entity-combobox.d.ts +5 -4
- package/dist/components/entity-combobox.js +107 -76
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/facing-pair.d.ts +36 -0
- package/dist/components/facing-pair.js +40 -0
- package/dist/components/facing-pair.js.map +1 -0
- package/dist/components/field-sync.d.ts +164 -0
- package/dist/components/field-sync.js +264 -0
- package/dist/components/field-sync.js.map +1 -0
- package/dist/components/file-dropzone.d.ts +21 -7
- package/dist/components/file-dropzone.js +28 -7
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/full-bleed-dialog.d.ts +37 -26
- package/dist/components/full-bleed-dialog.js +20 -5
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/grouped-picker.d.ts +21 -10
- package/dist/components/grouped-picker.js +66 -52
- package/dist/components/grouped-picker.js.map +1 -1
- package/dist/components/hover-menu.d.ts +20 -4
- package/dist/components/hover-menu.js +15 -4
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/mini-calendar.d.ts +102 -14
- package/dist/components/mini-calendar.js +256 -70
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +9 -3
- package/dist/components/modal.js +34 -45
- package/dist/components/modal.js.map +1 -1
- package/dist/components/month-picker.d.ts +79 -0
- package/dist/components/month-picker.js +342 -0
- package/dist/components/month-picker.js.map +1 -0
- package/dist/components/multi-entity-combobox.d.ts +7 -6
- package/dist/components/multi-entity-combobox.js +112 -72
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.d.ts +13 -11
- package/dist/components/multi-select.js +161 -84
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/number-field.d.ts +92 -0
- package/dist/components/number-field.js +111 -0
- package/dist/components/number-field.js.map +1 -0
- package/dist/components/number-input.d.ts +21 -2
- package/dist/components/number-input.js +2 -1
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.d.ts +25 -4
- package/dist/components/numpad-sheet.js +30 -13
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/page-contents.d.ts +90 -0
- package/dist/components/page-contents.js +170 -0
- package/dist/components/page-contents.js.map +1 -0
- package/dist/components/password-strength.d.ts +106 -0
- package/dist/components/password-strength.js +132 -0
- package/dist/components/password-strength.js.map +1 -0
- package/dist/components/picker-sheet.d.ts +23 -15
- package/dist/components/picker-sheet.js +34 -14
- package/dist/components/picker-sheet.js.map +1 -1
- package/dist/components/popover.d.ts +62 -4
- package/dist/components/popover.js +52 -2
- package/dist/components/popover.js.map +1 -1
- package/dist/components/search-field.d.ts +25 -7
- package/dist/components/search-field.js +7 -5
- package/dist/components/search-field.js.map +1 -1
- package/dist/components/series-chart-labels.d.ts +14 -0
- package/dist/components/series-chart-labels.js +11 -0
- package/dist/components/series-chart-labels.js.map +1 -0
- package/dist/components/series-chart.d.ts +207 -0
- package/dist/components/series-chart.js +223 -0
- package/dist/components/series-chart.js.map +1 -0
- package/dist/components/settings-fields.d.ts +14 -4
- package/dist/components/settings-fields.js +19 -8
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/signature-pad.d.ts +119 -0
- package/dist/components/signature-pad.js +405 -0
- package/dist/components/signature-pad.js.map +1 -0
- package/dist/components/slider.d.ts +80 -0
- package/dist/components/slider.js +155 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sparkline.d.ts +93 -0
- package/dist/components/sparkline.js +205 -0
- package/dist/components/sparkline.js.map +1 -0
- package/dist/components/stat-tile.d.ts +151 -0
- package/dist/components/stat-tile.js +236 -0
- package/dist/components/stat-tile.js.map +1 -0
- package/dist/components/swipeable-row.d.ts +25 -2
- package/dist/components/swipeable-row.js +31 -0
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/switch.d.ts +60 -0
- package/dist/components/switch.js +81 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/time-input.d.ts +58 -0
- package/dist/components/time-input.js +50 -0
- package/dist/components/time-input.js.map +1 -0
- package/dist/components/toggle-group.d.ts +18 -3
- package/dist/components/toggle-group.js +10 -6
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle-legend.d.ts +115 -0
- package/dist/components/toggle-legend.js +114 -0
- package/dist/components/toggle-legend.js.map +1 -0
- package/dist/components/tooltip.d.ts +40 -11
- package/dist/components/tooltip.js +77 -20
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/treemap.d.ts +132 -0
- package/dist/components/treemap.js +179 -0
- package/dist/components/treemap.js.map +1 -0
- package/dist/components/ui.d.ts +159 -46
- package/dist/components/ui.js +220 -115
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-mobile-reveal.js +1 -0
- package/dist/components/use-mobile-reveal.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/components/use-table-state.js +38 -17
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/components/user-avatar.d.ts +5 -3
- package/dist/components/user-avatar.js +4 -2
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/wizard-stepper.js +3 -2
- package/dist/components/wizard-stepper.js.map +1 -1
- package/dist/{data-table-filters-aXyf0Xub.d.ts → data-table-filters-DM1auUfH.d.ts} +27 -5
- package/dist/data-table.d.ts +7 -0
- package/dist/data-table.js +12 -0
- package/dist/data-table.js.map +1 -0
- package/dist/feedback/feedback-attachment.js +12 -11
- package/dist/feedback/feedback-attachment.js.map +1 -1
- package/dist/feedback/feedback-dialog.js +2 -1
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.d.ts +33 -7
- package/dist/feedback/feedback-inbox.js +49 -37
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.js +5 -0
- package/dist/feedback.js.map +1 -0
- package/dist/hooks/use-anchored-panel.js +1 -0
- package/dist/hooks/use-anchored-panel.js.map +1 -1
- package/dist/hooks/use-anchored-rect.js +1 -0
- package/dist/hooks/use-anchored-rect.js.map +1 -1
- package/dist/hooks/use-announce.d.ts +46 -0
- package/dist/hooks/use-announce.js +37 -0
- package/dist/hooks/use-announce.js.map +1 -0
- package/dist/hooks/use-body-scroll-lock.js +1 -0
- package/dist/hooks/use-body-scroll-lock.js.map +1 -1
- package/dist/hooks/use-close-transition.js +1 -0
- package/dist/hooks/use-close-transition.js.map +1 -1
- package/dist/hooks/use-dismiss.js +1 -0
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/hooks/use-focus-trap.d.ts +16 -0
- package/dist/hooks/use-focus-trap.js +67 -0
- package/dist/hooks/use-focus-trap.js.map +1 -0
- package/dist/hooks/use-media-query.js +1 -0
- package/dist/hooks/use-media-query.js.map +1 -1
- package/dist/hooks/use-overlay-history.js +27 -1
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/hooks/use-row-swipe.js +1 -0
- package/dist/hooks/use-row-swipe.js.map +1 -1
- package/dist/i18n/defaults.d.ts +31 -0
- package/dist/i18n/defaults.js +63 -0
- package/dist/i18n/defaults.js.map +1 -0
- package/dist/i18n/kit-labels.d.ts +250 -0
- package/dist/i18n/kit-labels.js +184 -0
- package/dist/i18n/kit-labels.js.map +1 -0
- package/dist/index.d.ts +47 -22
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/calc.js +1 -0
- package/dist/lib/calc.js.map +1 -1
- package/dist/lib/cn.js +1 -0
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/dates.js +1 -0
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/logger.js +1 -0
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/safe-storage.js +1 -0
- package/dist/lib/safe-storage.js.map +1 -1
- package/dist/search/command-palette.d.ts +11 -1
- package/dist/search/command-palette.js +21 -15
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search.d.ts +2 -0
- package/dist/search.js +3 -0
- package/dist/search.js.map +1 -0
- package/dist/shell/app-shell.d.ts +33 -4
- package/dist/shell/app-shell.js +275 -78
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/option-switcher-menu.js +3 -2
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/role-switcher.d.ts +6 -0
- package/dist/shell/role-switcher.js +7 -4
- package/dist/shell/role-switcher.js.map +1 -1
- package/dist/shell/top-bar.d.ts +15 -7
- package/dist/shell/top-bar.js +3 -5
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/shell/topbar-action-menu.js +3 -2
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.d.ts +5 -2
- package/dist/shell/topbar-controls.js +20 -15
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/shell.d.ts +13 -0
- package/dist/shell.js +8 -0
- package/dist/shell.js.map +1 -0
- package/dist/theme/chart-palette.d.ts +19 -12
- package/dist/theme/chart-palette.js +24 -30
- package/dist/theme/chart-palette.js.map +1 -1
- package/dist/theme/color.d.ts +78 -0
- package/dist/theme/color.js +148 -0
- package/dist/theme/color.js.map +1 -0
- package/dist/theme/palette-derive.d.ts +140 -0
- package/dist/theme/palette-derive.js +376 -0
- package/dist/theme/palette-derive.js.map +1 -0
- package/dist/theme/palette-presets.d.ts +14 -1
- package/dist/theme/palette-presets.js +231 -3
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/theme/palette-store.js +1 -0
- package/dist/theme/palette-store.js.map +1 -1
- package/dist/theme/theme-store.js +1 -0
- package/dist/theme/theme-store.js.map +1 -1
- package/dist/tour/tour.d.ts +2 -1
- package/dist/tour/tour.js +15 -9
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour.d.ts +2 -0
- package/dist/tour.js +3 -0
- package/dist/tour.js.map +1 -0
- package/dist/wizard/stepper-nav.js +10 -8
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.d.ts +18 -2
- package/dist/wizard/types.js +4 -1
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.js +12 -4
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/validation.js +1 -0
- package/dist/wizard/validation.js.map +1 -1
- package/dist/wizard/wizard-context.js +1 -0
- package/dist/wizard/wizard-context.js.map +1 -1
- package/dist/wizard/wizard-step.js +1 -0
- package/dist/wizard/wizard-step.js.map +1 -1
- package/dist/wizard/wizard-summary.js +5 -3
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/dist/wizard.d.ts +8 -0
- package/dist/wizard.js +9 -0
- package/dist/wizard.js.map +1 -0
- package/package.json +66 -13
- package/src/chart.ts +22 -0
- package/src/components/account-settings.tsx +275 -0
- package/src/components/alert-banner.tsx +75 -0
- package/src/components/amount-input.tsx +471 -0
- package/src/components/calculator.tsx +252 -0
- package/src/components/chart-zoom.tsx +499 -0
- package/src/components/chart.tsx +363 -0
- package/src/components/checkbox.tsx +222 -0
- package/src/components/chip.tsx +570 -0
- package/src/components/choice-parts.ts +33 -0
- package/src/components/combobox-core.tsx +540 -0
- package/src/components/combobox.tsx +1026 -0
- package/src/components/currency-select.tsx +269 -0
- package/src/components/data-table-filter-popover.tsx +252 -0
- package/src/components/data-table-filters.ts +176 -0
- package/src/components/data-table-labels.ts +190 -0
- package/src/components/data-table-pagination.tsx +126 -0
- package/src/components/data-table-sort.ts +70 -0
- package/src/components/data-table.tsx +1740 -0
- package/src/components/date-picker.tsx +631 -0
- package/src/components/dropdown.tsx +341 -0
- package/src/components/entity-combobox.tsx +215 -0
- package/src/components/facing-pair.ts +86 -0
- package/src/components/field-sync.tsx +472 -0
- package/src/components/file-dropzone.tsx +181 -0
- package/src/components/full-bleed-dialog.tsx +179 -0
- package/src/components/grouped-picker.tsx +157 -0
- package/src/components/hover-menu.tsx +183 -0
- package/src/components/mini-calendar.tsx +554 -0
- package/src/components/modal.tsx +287 -0
- package/src/components/month-picker.tsx +549 -0
- package/src/components/multi-entity-combobox.tsx +226 -0
- package/src/components/multi-select.tsx +303 -0
- package/src/components/number-field.tsx +225 -0
- package/src/components/number-input.tsx +211 -0
- package/src/components/numpad-sheet.tsx +264 -0
- package/src/components/page-contents.tsx +289 -0
- package/src/components/password-strength.tsx +258 -0
- package/src/components/picker-sheet.tsx +251 -0
- package/src/components/popover.tsx +195 -0
- package/src/components/search-field.tsx +146 -0
- package/src/components/series-chart-labels.ts +26 -0
- package/src/components/series-chart.tsx +481 -0
- package/src/components/settings-fields.tsx +68 -0
- package/src/components/signature-pad.tsx +630 -0
- package/src/components/slider.tsx +313 -0
- package/src/components/sparkline.tsx +329 -0
- package/src/components/stat-tile.tsx +448 -0
- package/src/components/swipeable-row.tsx +271 -0
- package/src/components/switch.tsx +170 -0
- package/src/components/time-input.tsx +107 -0
- package/src/components/toggle-group.tsx +153 -0
- package/src/components/toggle-legend.tsx +229 -0
- package/src/components/tooltip.tsx +477 -0
- package/src/components/treemap.tsx +390 -0
- package/src/components/ui.tsx +1284 -0
- package/src/components/use-mobile-reveal.ts +54 -0
- package/src/components/use-table-state.ts +295 -0
- package/src/components/user-avatar.tsx +61 -0
- package/src/components/wizard-stepper.tsx +37 -0
- package/src/data-table.ts +19 -0
- package/src/feedback/feedback-attachment.tsx +246 -0
- package/src/feedback/feedback-dialog.tsx +209 -0
- package/src/feedback/feedback-inbox.tsx +615 -0
- package/src/feedback.ts +8 -0
- package/src/hooks/use-anchored-panel.ts +169 -0
- package/src/hooks/use-anchored-rect.ts +78 -0
- package/src/hooks/use-announce.ts +85 -0
- package/src/hooks/use-body-scroll-lock.ts +94 -0
- package/src/hooks/use-close-transition.ts +99 -0
- package/src/hooks/use-dismiss.ts +77 -0
- package/src/hooks/use-focus-trap.ts +160 -0
- package/src/hooks/use-media-query.ts +23 -0
- package/src/hooks/use-overlay-history.ts +345 -0
- package/src/hooks/use-row-swipe.ts +212 -0
- package/src/i18n/defaults.ts +68 -0
- package/src/i18n/kit-labels.tsx +447 -0
- package/src/index.ts +169 -0
- package/src/lib/calc.ts +309 -0
- package/src/lib/cn.ts +5 -0
- package/src/lib/dates.ts +187 -0
- package/src/lib/logger.ts +73 -0
- package/src/lib/safe-storage.ts +37 -0
- package/src/search/command-palette.tsx +342 -0
- package/src/search.ts +3 -0
- package/src/shell/app-shell.tsx +772 -0
- package/src/shell/option-switcher-menu.tsx +72 -0
- package/src/shell/role-switcher.tsx +46 -0
- package/src/shell/top-bar.tsx +39 -0
- package/src/shell/topbar-action-menu.tsx +91 -0
- package/src/shell/topbar-controls.tsx +229 -0
- package/src/shell.ts +10 -0
- package/src/theme/chart-palette.ts +145 -0
- package/src/theme/color.ts +266 -0
- package/src/theme/palette-derive.ts +681 -0
- package/src/theme/palette-presets.ts +760 -0
- package/src/theme/palette-store.ts +94 -0
- package/src/theme/theme-store.ts +145 -0
- package/src/tour/tour.tsx +586 -0
- package/src/tour.ts +3 -0
- package/src/vite-env.d.ts +26 -0
- package/src/wizard/stepper-nav.tsx +221 -0
- package/src/wizard/types.ts +178 -0
- package/src/wizard/use-wizard.ts +345 -0
- package/src/wizard/validation.ts +37 -0
- package/src/wizard/wizard-context.tsx +29 -0
- package/src/wizard/wizard-step.tsx +14 -0
- package/src/wizard/wizard-summary.tsx +69 -0
- package/src/wizard.ts +14 -0
- package/tokens.css +222 -20
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo } from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { DataTableLabels } from "../components/data-table-labels";
|
|
4
|
+
import type { MiniCalendarLabels } from "../components/mini-calendar";
|
|
5
|
+
import type { PopoverLabels } from "../components/popover";
|
|
6
|
+
import type { ChipInputLabels } from "../components/chip";
|
|
7
|
+
import type { FieldSyncLabels } from "../components/field-sync";
|
|
8
|
+
import type { PasswordRevealLabels } from "../components/ui";
|
|
9
|
+
import type { WizardLabels } from "../wizard/types";
|
|
10
|
+
import type { TourLabels } from "../tour/tour";
|
|
11
|
+
import type { CommandPaletteLabels } from "../search/command-palette";
|
|
12
|
+
import type { MonthPickerLabels } from "../components/month-picker";
|
|
13
|
+
import type { PageContentsLabels } from "../components/page-contents";
|
|
14
|
+
import type { SeriesChartLabels } from "../components/series-chart-labels";
|
|
15
|
+
import type { SparklineLabels } from "../components/sparkline";
|
|
16
|
+
import type { StatTileLabels } from "../components/stat-tile";
|
|
17
|
+
import type { SignaturePadLabels } from "../components/signature-pad";
|
|
18
|
+
import type { PasswordStrengthLabels } from "../components/password-strength";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* EVERY string the kit renders, as one typed tree — and an optional provider that
|
|
22
|
+
* hands it to every component at once.
|
|
23
|
+
*
|
|
24
|
+
* WHY THIS EXISTS. The kit ships no catalogue and resolves no strings, and that stays
|
|
25
|
+
* true: the app supplies every word. What was wrong was HOW it had to supply them —
|
|
26
|
+
* one `labels` prop per component instance, under a different prop name per
|
|
27
|
+
* component (`labels`, `calendarLabels`, `passwordLabels`, `clearLabel`,
|
|
28
|
+
* `searchPlaceholder`, `ariaLabel` …). A translated app therefore rendered English
|
|
29
|
+
* wherever one call site forgot one prop, and nothing told it so: a German showcase
|
|
30
|
+
* still said "Rows per page", "Collapse sidebar" and "Popover" in seven languages.
|
|
31
|
+
*
|
|
32
|
+
* Now there is one key per string, addressed by a dot path (`dataTable.pageSize`,
|
|
33
|
+
* `datePicker.today`), and three sources in a fixed order of precedence:
|
|
34
|
+
*
|
|
35
|
+
* the component's own prop > <UiKitProvider labels> > English default
|
|
36
|
+
*
|
|
37
|
+
* A consumer writes its translation ONCE, as a `UiKitLabels` (or a partial of it),
|
|
38
|
+
* mounts `<UiKitProvider labels={…} locale={…}>` at the root, and every kit component
|
|
39
|
+
* below speaks that language — including the ones nested inside other kit components
|
|
40
|
+
* (the calendar inside the data table's date filter, the popover inside the date
|
|
41
|
+
* picker), which no prop at the outer call site could reach before.
|
|
42
|
+
*
|
|
43
|
+
* Messages that carry a value are FUNCTIONS of that value, never a template to fill:
|
|
44
|
+
* a number glued into an English sentence is untranslatable, because the grammar
|
|
45
|
+
* around it moves with it in most languages.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/* ── Namespaces that had no labels type of their own ─────────────────────── */
|
|
49
|
+
|
|
50
|
+
/** The words several components share. A component's own namespace wins over these
|
|
51
|
+
* where both exist; these are what a new component reaches for first. */
|
|
52
|
+
export interface CommonLabels {
|
|
53
|
+
close: string;
|
|
54
|
+
clear: string;
|
|
55
|
+
search: string;
|
|
56
|
+
done: string;
|
|
57
|
+
cancel: string;
|
|
58
|
+
save: string;
|
|
59
|
+
back: string;
|
|
60
|
+
next: string;
|
|
61
|
+
remove: string;
|
|
62
|
+
loading: string;
|
|
63
|
+
noResults: string;
|
|
64
|
+
/** "Name: value" — how a field's accessible name is composed with its value.
|
|
65
|
+
* A colon-and-space is not universal punctuation (French puts a space before
|
|
66
|
+
* the colon, Chinese uses a full-width one). */
|
|
67
|
+
fieldValue: (field: string, value: string) => string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** `DatePicker` / `DateRangePicker` chrome. The calendar inside has its own
|
|
71
|
+
* namespace, `miniCalendar`. */
|
|
72
|
+
export interface DatePickerLabels {
|
|
73
|
+
/** Accessible name of the popover panel the calendar opens in. */
|
|
74
|
+
panel: string;
|
|
75
|
+
/** The same, for `DateRangePicker`'s panel. */
|
|
76
|
+
rangePanel: string;
|
|
77
|
+
clear: string;
|
|
78
|
+
previousDay: string;
|
|
79
|
+
nextDay: string;
|
|
80
|
+
today: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The whole combobox family: `Combobox`, `EntityCombobox`,
|
|
84
|
+
* `MultiEntityCombobox`, `InlineEntityCombobox`. */
|
|
85
|
+
export interface ComboboxLabels {
|
|
86
|
+
search: string;
|
|
87
|
+
noResults: string;
|
|
88
|
+
clear: string;
|
|
89
|
+
loading: string;
|
|
90
|
+
/** The "add this" row when free entry is allowed. */
|
|
91
|
+
create: (query: string) => string;
|
|
92
|
+
/** Trigger summary once more than one value is picked. */
|
|
93
|
+
selectedCount: (count: number) => string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface MultiSelectLabels {
|
|
97
|
+
search: string;
|
|
98
|
+
selectAll: string;
|
|
99
|
+
clear: string;
|
|
100
|
+
/** Trigger text when nothing is picked, which a multi-select reads as "all". */
|
|
101
|
+
all: string;
|
|
102
|
+
/** Trigger summary once some (but not all) values are picked. The English
|
|
103
|
+
* default is the bare count, which is what the trigger has always shown. */
|
|
104
|
+
selectedCount: (count: number) => string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** `CalculatorButton` (desktop popover keypad) and `NumberPadSheet` (phone sheet). */
|
|
108
|
+
export interface CalculatorLabels {
|
|
109
|
+
/** The button that opens the calculator. */
|
|
110
|
+
open: string;
|
|
111
|
+
/** The popover / sheet itself. */
|
|
112
|
+
panel: string;
|
|
113
|
+
calculation: string;
|
|
114
|
+
backspace: string;
|
|
115
|
+
clear: string;
|
|
116
|
+
equals: string;
|
|
117
|
+
/** The primary key of the phone pad — visible text, not an aria-label. */
|
|
118
|
+
done: string;
|
|
119
|
+
/** Names of the operator keys and the decimal key. Their glyphs are not names a
|
|
120
|
+
* screen reader agrees on — "÷" is read as "division sign", "divided by" or
|
|
121
|
+
* nothing at all depending on the reader — so each says what it does. */
|
|
122
|
+
plus: string;
|
|
123
|
+
minus: string;
|
|
124
|
+
times: string;
|
|
125
|
+
divide: string;
|
|
126
|
+
decimal: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** `CurrencySelect` and the currency half of `AmountInput`. */
|
|
130
|
+
export interface CurrencyLabels {
|
|
131
|
+
currency: string;
|
|
132
|
+
search: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface AppShellLabels {
|
|
136
|
+
collapse: string;
|
|
137
|
+
expand: string;
|
|
138
|
+
/** Accessible name of an inline group's disclosure button (`subNav="inline"`). */
|
|
139
|
+
toggleGroup: (groupLabel: string) => string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface TopBarLabels {
|
|
143
|
+
theme: string;
|
|
144
|
+
palette: string;
|
|
145
|
+
language: string;
|
|
146
|
+
switchRole: string;
|
|
147
|
+
/** The role switcher's tooltip, given the active role's name. */
|
|
148
|
+
role: (value: string) => string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface PickerSheetLabels {
|
|
152
|
+
close: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface SwipeableRowLabels {
|
|
156
|
+
actions: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface FileLabels {
|
|
160
|
+
/** A file size for display, given its size in BYTES. The default uses
|
|
161
|
+
* `Intl.NumberFormat`'s unit formatting in the provider's locale. */
|
|
162
|
+
size: (bytes: number) => string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** The complete tree. `UiKitProvider` takes any partial of it. */
|
|
166
|
+
export interface UiKitLabels {
|
|
167
|
+
common: CommonLabels;
|
|
168
|
+
dataTable: DataTableLabels;
|
|
169
|
+
miniCalendar: MiniCalendarLabels;
|
|
170
|
+
datePicker: DatePickerLabels;
|
|
171
|
+
monthPicker: MonthPickerLabels;
|
|
172
|
+
popover: PopoverLabels;
|
|
173
|
+
combobox: ComboboxLabels;
|
|
174
|
+
multiSelect: MultiSelectLabels;
|
|
175
|
+
calculator: CalculatorLabels;
|
|
176
|
+
currency: CurrencyLabels;
|
|
177
|
+
chipInput: ChipInputLabels;
|
|
178
|
+
fieldSync: FieldSyncLabels;
|
|
179
|
+
passwordReveal: PasswordRevealLabels;
|
|
180
|
+
appShell: AppShellLabels;
|
|
181
|
+
pageContents: PageContentsLabels;
|
|
182
|
+
topBar: TopBarLabels;
|
|
183
|
+
pickerSheet: PickerSheetLabels;
|
|
184
|
+
swipeableRow: SwipeableRowLabels;
|
|
185
|
+
file: FileLabels;
|
|
186
|
+
wizard: WizardLabels;
|
|
187
|
+
tour: TourLabels;
|
|
188
|
+
commandPalette: CommandPaletteLabels;
|
|
189
|
+
seriesChart: SeriesChartLabels;
|
|
190
|
+
sparkline: SparklineLabels;
|
|
191
|
+
statTile: StatTileLabels;
|
|
192
|
+
signaturePad: SignaturePadLabels;
|
|
193
|
+
passwordStrength: PasswordStrengthLabels;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Any subset of the tree, one level deep — each namespace may be partial, and a
|
|
197
|
+
* namespace that holds a record (`dataTable.presets`) is merged key by key. */
|
|
198
|
+
export type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: Partial<UiKitLabels[K]> };
|
|
199
|
+
|
|
200
|
+
/* ── English defaults for the namespaces defined here ────────────────────── */
|
|
201
|
+
|
|
202
|
+
export const DEFAULT_COMMON_LABELS: CommonLabels = {
|
|
203
|
+
close: "Close",
|
|
204
|
+
clear: "Clear",
|
|
205
|
+
search: "Search",
|
|
206
|
+
done: "Done",
|
|
207
|
+
cancel: "Cancel",
|
|
208
|
+
save: "Save",
|
|
209
|
+
back: "Back",
|
|
210
|
+
next: "Next",
|
|
211
|
+
remove: "Remove",
|
|
212
|
+
loading: "Loading…",
|
|
213
|
+
noResults: "No results",
|
|
214
|
+
fieldValue: (field, value) => `${field}: ${value}`,
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels = {
|
|
218
|
+
panel: "Choose a date",
|
|
219
|
+
rangePanel: "Choose a date range",
|
|
220
|
+
clear: "Clear",
|
|
221
|
+
previousDay: "Previous day",
|
|
222
|
+
nextDay: "Next day",
|
|
223
|
+
today: "Today",
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const DEFAULT_COMBOBOX_LABELS: ComboboxLabels = {
|
|
227
|
+
search: "Search",
|
|
228
|
+
noResults: "No results",
|
|
229
|
+
clear: "Clear",
|
|
230
|
+
loading: "Loading…",
|
|
231
|
+
create: (query) => `Create “${query}”`,
|
|
232
|
+
selectedCount: (count) => `${count} selected`,
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
export const DEFAULT_MULTI_SELECT_LABELS: MultiSelectLabels = {
|
|
236
|
+
search: "Search",
|
|
237
|
+
selectAll: "Select all",
|
|
238
|
+
clear: "Clear",
|
|
239
|
+
all: "All",
|
|
240
|
+
selectedCount: (count) => String(count),
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export const DEFAULT_CALCULATOR_LABELS: CalculatorLabels = {
|
|
244
|
+
open: "Open calculator",
|
|
245
|
+
panel: "Calculator",
|
|
246
|
+
calculation: "Calculation",
|
|
247
|
+
backspace: "Backspace",
|
|
248
|
+
clear: "Clear",
|
|
249
|
+
equals: "Equals",
|
|
250
|
+
done: "Done",
|
|
251
|
+
plus: "Plus",
|
|
252
|
+
minus: "Minus",
|
|
253
|
+
times: "Times",
|
|
254
|
+
divide: "Divide",
|
|
255
|
+
decimal: "Decimal point",
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export const DEFAULT_CURRENCY_LABELS: CurrencyLabels = {
|
|
259
|
+
currency: "Currency",
|
|
260
|
+
search: "Search currency",
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const DEFAULT_APP_SHELL_LABELS: AppShellLabels = {
|
|
264
|
+
collapse: "Collapse sidebar",
|
|
265
|
+
expand: "Expand sidebar",
|
|
266
|
+
toggleGroup: (groupLabel) => `${groupLabel}: pages`,
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export const DEFAULT_TOP_BAR_LABELS: TopBarLabels = {
|
|
270
|
+
theme: "Toggle theme",
|
|
271
|
+
palette: "Appearance preset",
|
|
272
|
+
language: "Language",
|
|
273
|
+
switchRole: "Switch role",
|
|
274
|
+
role: (value) => `Role: ${value}`,
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export const DEFAULT_PICKER_SHEET_LABELS: PickerSheetLabels = { close: "Close" };
|
|
278
|
+
|
|
279
|
+
export const DEFAULT_SWIPEABLE_ROW_LABELS: SwipeableRowLabels = { actions: "Row actions" };
|
|
280
|
+
|
|
281
|
+
/** Formats with the locale the provider was given (see {@link useKitFileLabels}).
|
|
282
|
+
* This static default has no locale to hand and falls back to the runtime's. */
|
|
283
|
+
export const DEFAULT_FILE_LABELS: FileLabels = {
|
|
284
|
+
size: (bytes) => formatFileSize(bytes),
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
/** "12 kB", "3.4 MB" — `Intl`'s unit formatting, so the digits, the decimal mark and
|
|
288
|
+
* the unit's spelling all follow `locale`. */
|
|
289
|
+
export function formatFileSize(bytes: number, locale?: string): string {
|
|
290
|
+
const units = ["byte", "kilobyte", "megabyte", "gigabyte"] as const;
|
|
291
|
+
let value = bytes;
|
|
292
|
+
let i = 0;
|
|
293
|
+
while (value >= 1000 && i < units.length - 1) {
|
|
294
|
+
value /= 1000;
|
|
295
|
+
i += 1;
|
|
296
|
+
}
|
|
297
|
+
return new Intl.NumberFormat(locale, {
|
|
298
|
+
style: "unit",
|
|
299
|
+
unit: units[i],
|
|
300
|
+
unitDisplay: i === 0 ? "long" : "short",
|
|
301
|
+
maximumFractionDigits: value < 10 && i > 0 ? 1 : 0,
|
|
302
|
+
}).format(value);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* ── The provider ────────────────────────────────────────────────────────── */
|
|
306
|
+
|
|
307
|
+
interface KitI18n {
|
|
308
|
+
labels?: UiKitLabelOverrides;
|
|
309
|
+
locale?: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const KitI18nContext = createContext<KitI18n>({});
|
|
313
|
+
|
|
314
|
+
export interface UiKitProviderProps {
|
|
315
|
+
/** Any part of {@link UiKitLabels}. Missing keys fall back to English. */
|
|
316
|
+
labels?: UiKitLabelOverrides;
|
|
317
|
+
/**
|
|
318
|
+
* BCP 47 tag used by every kit component that formats something — dates, numbers,
|
|
319
|
+
* month and weekday names, file sizes — when it is not handed a `locale` prop of
|
|
320
|
+
* its own. Without a provider, and without a prop, those use the runtime default.
|
|
321
|
+
*/
|
|
322
|
+
locale?: string;
|
|
323
|
+
children: ReactNode;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Hand every kit component below this point its strings and its locale.
|
|
328
|
+
*
|
|
329
|
+
* Optional: a component outside any provider behaves exactly as it did before the
|
|
330
|
+
* provider existed. Nesting works as a merge — an inner provider overrides only what
|
|
331
|
+
* it names, so a page can re-label one table's `dataTable.table` without restating
|
|
332
|
+
* the language.
|
|
333
|
+
*/
|
|
334
|
+
export function UiKitProvider({ labels, locale, children }: UiKitProviderProps) {
|
|
335
|
+
const outer = useContext(KitI18nContext);
|
|
336
|
+
const value = useMemo<KitI18n>(
|
|
337
|
+
() => ({
|
|
338
|
+
locale: locale ?? outer.locale,
|
|
339
|
+
labels: mergeOverrides(outer.labels, labels),
|
|
340
|
+
}),
|
|
341
|
+
[outer, labels, locale],
|
|
342
|
+
);
|
|
343
|
+
return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function isRecord(v: unknown): v is Record<string, unknown> {
|
|
347
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/** Two levels: namespaces, and inside a namespace a record-valued key (presets). */
|
|
351
|
+
function mergeNamespace<T extends object>(base: T, over: Partial<T> | undefined): T {
|
|
352
|
+
if (!over) return base;
|
|
353
|
+
const out = { ...base } as Record<string, unknown>;
|
|
354
|
+
for (const [k, v] of Object.entries(over)) {
|
|
355
|
+
if (v === undefined) continue;
|
|
356
|
+
const prev = out[k];
|
|
357
|
+
out[k] = isRecord(prev) && isRecord(v) ? { ...prev, ...v } : v;
|
|
358
|
+
}
|
|
359
|
+
return out as T;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function mergeOverrides(
|
|
363
|
+
a: UiKitLabelOverrides | undefined,
|
|
364
|
+
b: UiKitLabelOverrides | undefined,
|
|
365
|
+
): UiKitLabelOverrides | undefined {
|
|
366
|
+
if (!a) return b;
|
|
367
|
+
if (!b) return a;
|
|
368
|
+
const out: Record<string, unknown> = { ...a };
|
|
369
|
+
for (const [ns, v] of Object.entries(b)) {
|
|
370
|
+
out[ns] = mergeNamespace((out[ns] as object | undefined) ?? {}, v as object);
|
|
371
|
+
}
|
|
372
|
+
return out as UiKitLabelOverrides;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** What the nearest provider says about one namespace — `undefined` outside one.
|
|
376
|
+
* For a component whose own resolver does more than a merge (the data table
|
|
377
|
+
* derives `columnsCount` from `columns`): feed `{ ...overrides, ...props }` to it. */
|
|
378
|
+
export function useKitLabelOverrides<K extends keyof UiKitLabels>(
|
|
379
|
+
ns: K,
|
|
380
|
+
): Partial<UiKitLabels[K]> | undefined {
|
|
381
|
+
return useContext(KitI18nContext).labels?.[ns] as Partial<UiKitLabels[K]> | undefined;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* One namespace, resolved: `defaults`, then the provider, then the component's own
|
|
386
|
+
* `prop`. Record-valued keys are merged key by key at each step.
|
|
387
|
+
*/
|
|
388
|
+
export function useKitLabels<K extends keyof UiKitLabels>(
|
|
389
|
+
ns: K,
|
|
390
|
+
defaults: UiKitLabels[K],
|
|
391
|
+
prop?: Partial<UiKitLabels[K]>,
|
|
392
|
+
): UiKitLabels[K] {
|
|
393
|
+
const fromProvider = useKitLabelOverrides(ns);
|
|
394
|
+
return useMemo(
|
|
395
|
+
() => mergeNamespace(mergeNamespace(defaults, fromProvider), prop),
|
|
396
|
+
[defaults, fromProvider, prop],
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/** The component's own `locale` prop, else the provider's, else `undefined` (which
|
|
401
|
+
* every `Intl` API reads as "the runtime's default"). */
|
|
402
|
+
export function useKitLocale(prop?: string): string | undefined {
|
|
403
|
+
const fromProvider = useContext(KitI18nContext).locale;
|
|
404
|
+
return prop ?? fromProvider;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** {@link DEFAULT_FILE_LABELS}, but formatting in the provider's locale. */
|
|
408
|
+
export function useKitFileLabels(prop?: Partial<FileLabels>): FileLabels {
|
|
409
|
+
const locale = useKitLocale();
|
|
410
|
+
const defaults = useMemo<FileLabels>(
|
|
411
|
+
() => ({ size: (bytes) => formatFileSize(bytes, locale) }),
|
|
412
|
+
[locale],
|
|
413
|
+
);
|
|
414
|
+
return useKitLabels("file", defaults, prop);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* The dot paths of every key `labels` does NOT supply — the ones a translated app is
|
|
419
|
+
* still showing in English. Assert on it in the app's own test:
|
|
420
|
+
*
|
|
421
|
+
* expect(missingKitLabels(de)).toEqual([]);
|
|
422
|
+
*
|
|
423
|
+
* `reference` is the complete tree to check against — pass
|
|
424
|
+
* {@link DEFAULT_UI_KIT_LABELS} (src/i18n/defaults.ts). It is a parameter rather than an import
|
|
425
|
+
* because the defaults live beside their components, and this module is imported BY
|
|
426
|
+
* those components.
|
|
427
|
+
*/
|
|
428
|
+
export function missingKitLabels(
|
|
429
|
+
labels: UiKitLabelOverrides | undefined,
|
|
430
|
+
reference: UiKitLabels,
|
|
431
|
+
): string[] {
|
|
432
|
+
const missing: string[] = [];
|
|
433
|
+
for (const [ns, keys] of Object.entries(reference)) {
|
|
434
|
+
const given = (labels as Record<string, Record<string, unknown> | undefined> | undefined)?.[ns];
|
|
435
|
+
for (const [key, value] of Object.entries(keys as Record<string, unknown>)) {
|
|
436
|
+
const got = given?.[key];
|
|
437
|
+
if (got === undefined) {
|
|
438
|
+
missing.push(`${ns}.${key}`);
|
|
439
|
+
} else if (isRecord(value) && isRecord(got)) {
|
|
440
|
+
for (const sub of Object.keys(value)) {
|
|
441
|
+
if (got[sub] === undefined) missing.push(`${ns}.${key}.${sub}`);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return missing;
|
|
447
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// @eifi1/ui-kit — shared design-system barrel.
|
|
2
|
+
//
|
|
3
|
+
// Domain-free UI + theme surface shared across apps (lead app: Keksdose). Consumers import
|
|
4
|
+
// components/theme from "@eifi1/ui-kit" and the token stylesheet from "@eifi1/ui-kit/tokens.css".
|
|
5
|
+
|
|
6
|
+
// ── lib ────────────────────────────────────────────────────────────────────
|
|
7
|
+
export * from "./lib/calc";
|
|
8
|
+
export { cn } from "./lib/cn";
|
|
9
|
+
export { logger, setStoreLog } from "./lib/logger";
|
|
10
|
+
// Date helpers are also available via the "@eifi1/ui-kit/dates" subpath.
|
|
11
|
+
|
|
12
|
+
// ── hooks ────────────────────────────────────────────────────────────────────
|
|
13
|
+
export { useMediaQuery } from "./hooks/use-media-query";
|
|
14
|
+
export { useBodyScrollLock } from "./hooks/use-body-scroll-lock";
|
|
15
|
+
export { useAnchoredRect } from "./hooks/use-anchored-rect";
|
|
16
|
+
export type { AnchorRect } from "./hooks/use-anchored-rect";
|
|
17
|
+
export { useAnchoredPanel, anchoredPanelPlacement, useVisualViewport } from "./hooks/use-anchored-panel";
|
|
18
|
+
export type {
|
|
19
|
+
AnchoredPanel,
|
|
20
|
+
AnchoredPanelOptions,
|
|
21
|
+
ViewportBox,
|
|
22
|
+
} from "./hooks/use-anchored-panel";
|
|
23
|
+
export { useEscapeKey, useOutsideClick } from "./hooks/use-dismiss";
|
|
24
|
+
// Focus containment for an overlay, and a live region for a change that moves no focus.
|
|
25
|
+
// Both were extracted from the two components that already did them correctly (Modal and
|
|
26
|
+
// CommandPalette) so the rest of the kit stops being the exception.
|
|
27
|
+
export { useFocusTrap } from "./hooks/use-focus-trap";
|
|
28
|
+
export type { FocusTrapOptions } from "./hooks/use-focus-trap";
|
|
29
|
+
export { useAnnounce } from "./hooks/use-announce";
|
|
30
|
+
export type { UseAnnounceReturn, UseAnnounceOptions, AnnounceRegionProps } from "./hooks/use-announce";
|
|
31
|
+
export { useOverlayHistory } from "./hooks/use-overlay-history";
|
|
32
|
+
export { useCloseTransition, OVERLAY_EXIT_MS } from "./hooks/use-close-transition";
|
|
33
|
+
export { useRowSwipe } from "./hooks/use-row-swipe";
|
|
34
|
+
export type { SwipeStage, RowSwipeOptions, RowSwipeReturn } from "./hooks/use-row-swipe";
|
|
35
|
+
|
|
36
|
+
// ── theme / palettes ─────────────────────────────────────────────────────────
|
|
37
|
+
export * from "./theme/chart-palette";
|
|
38
|
+
// Colour maths (sRGB ↔ OKLCH, WCAG contrast, CVD simulation) and the palette deriver
|
|
39
|
+
// that builds a whole, contrast-solved palette from one brand colour plus any colours
|
|
40
|
+
// pinned by hand. `auditPalette` / `auditChartRamp` measure a palette rather than
|
|
41
|
+
// trusting a comment about it.
|
|
42
|
+
export * from "./theme/color";
|
|
43
|
+
export * from "./theme/palette-derive";
|
|
44
|
+
export * from "./theme/palette-presets";
|
|
45
|
+
export * from "./theme/theme-store";
|
|
46
|
+
export * from "./theme/palette-store";
|
|
47
|
+
|
|
48
|
+
// ── components ───────────────────────────────────────────────────────────────
|
|
49
|
+
export * from "./components/ui";
|
|
50
|
+
export * from "./components/search-field";
|
|
51
|
+
export * from "./components/dropdown";
|
|
52
|
+
export * from "./components/popover";
|
|
53
|
+
export { SwipeableRow } from "./components/swipeable-row";
|
|
54
|
+
export type { SwipeAction, SwipeableRowProps } from "./components/swipeable-row";
|
|
55
|
+
export * from "./components/calculator";
|
|
56
|
+
export * from "./components/numpad-sheet";
|
|
57
|
+
export * from "./components/number-input";
|
|
58
|
+
export * from "./components/currency-select";
|
|
59
|
+
export * from "./components/amount-input";
|
|
60
|
+
export * from "./components/combobox";
|
|
61
|
+
export * from "./components/picker-sheet";
|
|
62
|
+
export * from "./components/entity-combobox";
|
|
63
|
+
export * from "./components/multi-entity-combobox";
|
|
64
|
+
export * from "./components/multi-select";
|
|
65
|
+
export * from "./components/tooltip";
|
|
66
|
+
export * from "./components/user-avatar";
|
|
67
|
+
export * from "./components/settings-fields";
|
|
68
|
+
// Sync state for a database-backed field: the engine (`useFieldSync`) and the
|
|
69
|
+
// affordance (`FieldSyncIndicator`), kept separate because the state is useful
|
|
70
|
+
// without the dot — a form can gate its submit on any field being `pending`.
|
|
71
|
+
export * from "./components/field-sync";
|
|
72
|
+
export * from "./components/month-picker";
|
|
73
|
+
export * from "./components/checkbox";
|
|
74
|
+
export * from "./components/switch";
|
|
75
|
+
export * from "./components/slider";
|
|
76
|
+
export * from "./components/time-input";
|
|
77
|
+
export * from "./components/number-field";
|
|
78
|
+
export * from "./components/sparkline";
|
|
79
|
+
export * from "./components/stat-tile";
|
|
80
|
+
export * from "./components/signature-pad";
|
|
81
|
+
export * from "./components/password-strength";
|
|
82
|
+
export * from "./components/page-contents";
|
|
83
|
+
export * from "./components/treemap";
|
|
84
|
+
export * from "./components/series-chart";
|
|
85
|
+
export * from "./components/chart-zoom";
|
|
86
|
+
export * from "./components/toggle-legend";
|
|
87
|
+
export * from "./components/facing-pair";
|
|
88
|
+
export * from "./components/series-chart-labels";
|
|
89
|
+
export * from "./components/account-settings";
|
|
90
|
+
export * from "./components/alert-banner";
|
|
91
|
+
export * from "./components/toggle-group";
|
|
92
|
+
// A pill carrying one VALUE — inert, a link, or a toggle, depending on which prop it is
|
|
93
|
+
// given — and the list field built from it. Distinct from Button on purpose: a row of
|
|
94
|
+
// buttons reads as "choose an action", a row of chips as "here are the things".
|
|
95
|
+
export * from "./components/chip";
|
|
96
|
+
export * from "./components/wizard-stepper";
|
|
97
|
+
export * from "./components/hover-menu";
|
|
98
|
+
export * from "./components/modal";
|
|
99
|
+
export * from "./components/full-bleed-dialog";
|
|
100
|
+
export * from "./components/grouped-picker";
|
|
101
|
+
export * from "./components/file-dropzone";
|
|
102
|
+
export * from "./components/mini-calendar";
|
|
103
|
+
export * from "./components/date-picker";
|
|
104
|
+
export * from "./components/chart";
|
|
105
|
+
|
|
106
|
+
// ── data-table suite ─────────────────────────────────────────────────────────
|
|
107
|
+
export * from "./components/data-table-labels";
|
|
108
|
+
export * from "./components/data-table-sort";
|
|
109
|
+
export * from "./components/data-table-filters";
|
|
110
|
+
export * from "./components/data-table-pagination";
|
|
111
|
+
export { FilterPopover } from "./components/data-table-filter-popover";
|
|
112
|
+
// data-table re-exports SortState internally; export the rest explicitly to
|
|
113
|
+
// avoid a duplicate SortState star-export (it comes from data-table-sort).
|
|
114
|
+
export { DataTable } from "./components/data-table";
|
|
115
|
+
export type { DataTableColumn, DataTableProps, ServerPagination, FilterState } from "./components/data-table";
|
|
116
|
+
|
|
117
|
+
// ── shell (composable app chrome) ────────────────────────────────────────────
|
|
118
|
+
export * from "./shell/topbar-controls";
|
|
119
|
+
export * from "./shell/top-bar";
|
|
120
|
+
export * from "./shell/app-shell";
|
|
121
|
+
export * from "./shell/option-switcher-menu";
|
|
122
|
+
export * from "./shell/role-switcher";
|
|
123
|
+
export * from "./shell/topbar-action-menu";
|
|
124
|
+
|
|
125
|
+
// ── feedback ─────────────────────────────────────────────────────────────────
|
|
126
|
+
// The form somebody files a report with, and the parts an inbox is built from:
|
|
127
|
+
// the status vocabulary both apps share value for value, the policy about what a
|
|
128
|
+
// row may move to from where it stands, and the look of a status control, a
|
|
129
|
+
// category badge and an opened report. The app still wires its own API, columns
|
|
130
|
+
// and strings — see the note at the top of `feedback-inbox.tsx` for what is
|
|
131
|
+
// deliberately left to it.
|
|
132
|
+
export * from "./feedback/feedback-attachment";
|
|
133
|
+
export * from "./feedback/feedback-dialog";
|
|
134
|
+
export * from "./feedback/feedback-inbox";
|
|
135
|
+
|
|
136
|
+
// ── multi-step wizard ────────────────────────────────────────────────────────
|
|
137
|
+
// The engine (step machine, validators, collected data), the chrome around it
|
|
138
|
+
// (indicator + nav bar + cancel confirm) and the review step it ends on.
|
|
139
|
+
// `components/wizard-stepper` next door is a different, much smaller thing: a bare
|
|
140
|
+
// step indicator for a two-step import flow, with no engine.
|
|
141
|
+
//
|
|
142
|
+
// Two modules were removed here rather than kept as stock. `wizard-field` held a
|
|
143
|
+
// `WizardField`/`WizardSelectField` pair that had never been rendered in any app —
|
|
144
|
+
// a field group nothing was built from, which this comment used to advertise. And
|
|
145
|
+
// `use-rhf-wizard-step` was the only thing in the package that touched
|
|
146
|
+
// react-hook-form, for a hook neither consumer called: keeping it meant an optional
|
|
147
|
+
// peer, a dev dependency and a type import in every consumer's typecheck, bought
|
|
148
|
+
// for nobody. A design system may carry stock; untested stock nothing has ever
|
|
149
|
+
// rendered is not stock, it is a liability with an export.
|
|
150
|
+
export * from "./wizard/types";
|
|
151
|
+
export * from "./wizard/use-wizard";
|
|
152
|
+
export * from "./wizard/wizard-context";
|
|
153
|
+
export * from "./wizard/validation";
|
|
154
|
+
export * from "./wizard/wizard-step";
|
|
155
|
+
export * from "./wizard/wizard-summary";
|
|
156
|
+
export * from "./wizard/stepper-nav";
|
|
157
|
+
|
|
158
|
+
// ── guided tours ─────────────────────────────────────────────────────────────
|
|
159
|
+
export * from "./tour/tour";
|
|
160
|
+
|
|
161
|
+
// ── command palette / global search ──────────────────────────────────────────
|
|
162
|
+
export * from "./search/command-palette";
|
|
163
|
+
|
|
164
|
+
// ── i18n: one label tree, one optional provider ──────────────────────────────
|
|
165
|
+
// `UiKitLabels` names every string the kit renders; `<UiKitProvider labels locale>`
|
|
166
|
+
// hands a translation to every component below it. Precedence: a component's own
|
|
167
|
+
// prop > the provider > the English default. See src/i18n/kit-labels.tsx.
|
|
168
|
+
export * from "./i18n/kit-labels";
|
|
169
|
+
export * from "./i18n/defaults";
|