@eifi1/ui-kit 0.51.4 → 0.51.6
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 +5 -5
- package/dist/account/account-settings-labels.js.map +1 -1
- package/dist/account/account-settings.js +11 -9
- package/dist/account/account-settings.js.map +1 -1
- package/dist/account/delete-account-setting.js +56 -65
- package/dist/account/delete-account-setting.js.map +1 -1
- package/dist/account/email-change-setting-labels.js.map +1 -1
- package/dist/account/email-change-setting.js.map +1 -1
- package/dist/account/passkeys-setting.js.map +1 -1
- package/dist/account/sessions-setting.js.map +1 -1
- package/dist/admin/admin-action-confirm.js +1 -3
- package/dist/admin/admin-action-confirm.js.map +1 -1
- package/dist/admin/admin-action-log.js.map +1 -1
- package/dist/admin/admin-area-labels.js +4 -1
- package/dist/admin/admin-area-labels.js.map +1 -1
- package/dist/admin/admin-overview.js +19 -11
- package/dist/admin/admin-overview.js.map +1 -1
- package/dist/admin/admin-sections.js.map +1 -1
- package/dist/admin/admin-tool-links.d.ts +1 -1
- package/dist/admin/admin-tool-links.js +7 -1
- package/dist/admin/admin-tool-links.js.map +1 -1
- package/dist/admin/invitations-panel.js +2 -13
- package/dist/admin/invitations-panel.js.map +1 -1
- package/dist/admin/mail-test-card.js.map +1 -1
- package/dist/admin/reviewer-scope-editor.js +4 -11
- package/dist/admin/reviewer-scope-editor.js.map +1 -1
- package/dist/admin/role-select.js.map +1 -1
- package/dist/admin/user-roster.js +1 -9
- package/dist/admin/user-roster.js.map +1 -1
- package/dist/auth/accept-invitation.js.map +1 -1
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/auth/forgot-password-form.js +23 -31
- package/dist/auth/forgot-password-form.js.map +1 -1
- package/dist/auth/register-form.js.map +1 -1
- package/dist/auth/reset-password-form.js.map +1 -1
- package/dist/auth/sign-in-form.js +13 -5
- package/dist/auth/sign-in-form.js.map +1 -1
- package/dist/auth/verify-email.js +1 -8
- package/dist/auth/verify-email.js.map +1 -1
- package/dist/billing/billing-banner.js.map +1 -1
- package/dist/billing/billing-labels.js.map +1 -1
- package/dist/billing/checkout-processing.js.map +1 -1
- package/dist/billing/plan-card.js +91 -85
- package/dist/billing/plan-card.js.map +1 -1
- package/dist/billing/plan-limit-toast.js.map +1 -1
- package/dist/billing/plan-limit.js.map +1 -1
- package/dist/billing/plan-price.js.map +1 -1
- package/dist/billing/plan-switch.js.map +1 -1
- package/dist/billing/subscription-actions.js.map +1 -1
- package/dist/bin/eifi1-pay-page.mjs +6 -1
- package/dist/components/account-chips.js.map +1 -1
- package/dist/components/alert-banner.js +1 -5
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.js +29 -12
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/authed-image.js.map +1 -1
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/bulk-action-bar.js +1 -4
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button-look.js.map +1 -1
- package/dist/components/button.js +1 -7
- package/dist/components/button.js.map +1 -1
- package/dist/components/calculator.js +5 -5
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/calendar-heatmap.js +4 -10
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/card.js +1 -8
- package/dist/components/card.js.map +1 -1
- package/dist/components/chart-zoom-core.js +3 -17
- package/dist/components/chart-zoom-core.js.map +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +4 -22
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox-group.js +1 -4
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/chip-input.js +4 -1
- package/dist/components/chip-input.js.map +1 -1
- package/dist/components/chip.js +10 -5
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.js +58 -74
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/column-mapper-labels.js.map +1 -1
- package/dist/components/column-mapper.js +167 -227
- package/dist/components/column-mapper.js.map +1 -1
- package/dist/components/combobox-core.js +1 -4
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.js +1 -4
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/country-select.d.ts +5 -4
- package/dist/components/country-select.js +3 -19
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/currency-option-list.js +10 -8
- package/dist/components/currency-option-list.js.map +1 -1
- package/dist/components/currency-select.js +1 -6
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-cells.js.map +1 -1
- package/dist/components/data-table-column-settings.js.map +1 -1
- package/dist/components/data-table-filter-popover.js +2 -18
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-fit.js.map +1 -1
- package/dist/components/data-table-groups.js +3 -1
- package/dist/components/data-table-groups.js.map +1 -1
- package/dist/components/data-table-head.js +44 -56
- package/dist/components/data-table-head.js.map +1 -1
- package/dist/components/data-table-mobile.js +31 -44
- package/dist/components/data-table-mobile.js.map +1 -1
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table-row-actions.js +19 -16
- package/dist/components/data-table-row-actions.js.map +1 -1
- package/dist/components/data-table-row.js.map +1 -1
- package/dist/components/data-table-shared.js.map +1 -1
- package/dist/components/data-table-sort.js.map +1 -1
- package/dist/components/data-table-virtual.js +4 -1
- package/dist/components/data-table-virtual.js.map +1 -1
- package/dist/components/data-table.js +30 -39
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +1 -6
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/description-list.js +10 -10
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.js +9 -2
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.js +17 -27
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/dropdown.js +25 -35
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/error-boundary.js.map +1 -1
- package/dist/components/field-base.js +5 -5
- package/dist/components/field-base.js.map +1 -1
- package/dist/components/field-parts.d.ts +1 -1
- package/dist/components/field-parts.js +10 -14
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-sync.js +8 -10
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/file-button.js.map +1 -1
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel.js +4 -1
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/focus-ring.js.map +1 -1
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/grouped-picker.js +6 -8
- package/dist/components/grouped-picker.js.map +1 -1
- package/dist/components/hover-menu.js +1 -4
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/iban-input-labels.js.map +1 -1
- package/dist/components/icon-button.js +4 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon-picker.js +2 -7
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/image-grid.js +41 -50
- package/dist/components/image-grid.js.map +1 -1
- package/dist/components/inline-edit-field.js.map +1 -1
- package/dist/components/inline-entity-combobox.js +2 -8
- package/dist/components/inline-entity-combobox.js.map +1 -1
- package/dist/components/input.js +14 -2
- package/dist/components/input.js.map +1 -1
- package/dist/components/jump-calendar.js +1 -7
- package/dist/components/jump-calendar.js.map +1 -1
- package/dist/components/legal-labels.js.map +1 -1
- package/dist/components/legal-page.js +14 -2
- package/dist/components/legal-page.js.map +1 -1
- package/dist/components/legal.js +12 -2
- package/dist/components/legal.js.map +1 -1
- package/dist/components/lightbox.js.map +1 -1
- package/dist/components/line-items.js +26 -36
- package/dist/components/line-items.js.map +1 -1
- package/dist/components/list.js +22 -10
- package/dist/components/list.js.map +1 -1
- package/dist/components/measured-grid.js +29 -53
- package/dist/components/measured-grid.js.map +1 -1
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/mini-calendar.js +13 -31
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/money-field.js.map +1 -1
- package/dist/components/month-picker.js +10 -21
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.js +3 -16
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/nav-pills.js +10 -1
- package/dist/components/nav-pills.js.map +1 -1
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/number-input.js +1 -7
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.js +1 -4
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/one-time-code-input.js +1 -7
- package/dist/components/one-time-code-input.js.map +1 -1
- package/dist/components/page-contents.js +13 -22
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/page-header.js +1 -11
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/password-strength-labels.js.map +1 -1
- package/dist/components/password-strength.js +2 -8
- package/dist/components/password-strength.js.map +1 -1
- package/dist/components/phone-input.js +42 -57
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/picker-sheet.js.map +1 -1
- package/dist/components/pie-chart.js +1 -8
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress-bar.js +16 -9
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/qr-code.js +1 -8
- package/dist/components/qr-code.js.map +1 -1
- package/dist/components/row-actions.js +5 -1
- package/dist/components/row-actions.js.map +1 -1
- package/dist/components/search-field.js.map +1 -1
- package/dist/components/select.js +28 -38
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +1 -5
- package/dist/components/separator.js.map +1 -1
- package/dist/components/series-chart-axes.js +4 -1
- package/dist/components/series-chart-axes.js.map +1 -1
- package/dist/components/series-chart-budget.js.map +1 -1
- package/dist/components/series-chart-ticks.js.map +1 -1
- package/dist/components/series-chart.js +29 -45
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/settings-fields.js +21 -17
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/share-card.js +4 -9
- package/dist/components/share-card.js.map +1 -1
- package/dist/components/sign-chip.js.map +1 -1
- package/dist/components/signature-pad.js +4 -13
- package/dist/components/signature-pad.js.map +1 -1
- package/dist/components/signed-amount.js +12 -5
- package/dist/components/signed-amount.js.map +1 -1
- package/dist/components/skeleton.js +2 -17
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js +13 -36
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sparkline.js.map +1 -1
- package/dist/components/stat-tile.js +14 -10
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/swatch-picker.js +14 -4
- package/dist/components/swatch-picker.js.map +1 -1
- package/dist/components/swipeable-row.d.ts +1 -1
- package/dist/components/swipeable-row.js +1 -8
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/table-skeleton.js +4 -1
- package/dist/components/table-skeleton.js.map +1 -1
- package/dist/components/table.js +12 -9
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +5 -24
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text-link.js.map +1 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/tile-radio.js +1 -7
- package/dist/components/tile-radio.js.map +1 -1
- package/dist/components/time-input.js.map +1 -1
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +6 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle-legend.js +2 -11
- package/dist/components/toggle-legend.js.map +1 -1
- package/dist/components/tooltip.js +2 -22
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/translation-review-editor.js +1 -4
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-parts.d.ts +1 -1
- package/dist/components/translation-review-parts.js +7 -1
- package/dist/components/translation-review-parts.js.map +1 -1
- package/dist/components/translation-review.js +18 -7
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/tree-view.js +14 -10
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/treemap.d.ts +24 -2
- package/dist/components/treemap.js +28 -4
- package/dist/components/treemap.js.map +1 -1
- package/dist/components/trigger-aria.js.map +1 -1
- package/dist/components/use-table-state.js +14 -11
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/components/user-avatar.js +3 -26
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/demo/demo-start.js +8 -4
- package/dist/demo/demo-start.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/feedback/feedback-attachment-labels.js.map +1 -1
- package/dist/feedback/feedback-attachment.js +1 -8
- package/dist/feedback/feedback-attachment.js.map +1 -1
- package/dist/feedback/feedback-capture.d.ts +1 -1
- package/dist/feedback/feedback-capture.js +3 -1
- package/dist/feedback/feedback-capture.js.map +1 -1
- package/dist/feedback/feedback-comment-thread.js +27 -13
- package/dist/feedback/feedback-comment-thread.js.map +1 -1
- package/dist/feedback/feedback-context.js +1 -4
- package/dist/feedback/feedback-context.js.map +1 -1
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-public-list.js +7 -1
- package/dist/feedback/feedback-public-list.js.map +1 -1
- package/dist/feedback/feedback-record.js +1 -5
- package/dist/feedback/feedback-record.js.map +1 -1
- package/dist/feedback/feedback-replies.js +25 -10
- package/dist/feedback/feedback-replies.js.map +1 -1
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-status-undo.js.map +1 -1
- package/dist/feedback/feedback-submit-dialog.js.map +1 -1
- package/dist/feedback/feedback-table.js +4 -1
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/feedback/feedback-thread.js +2 -13
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/feedback/feedback-vocabulary.js.map +1 -1
- package/dist/feedback/feedback-vote-button.js.map +1 -1
- package/dist/hooks/use-anchored-rect.js.map +1 -1
- package/dist/hooks/use-document-title.js.map +1 -1
- package/dist/hooks/use-file-drop.js.map +1 -1
- package/dist/hooks/use-file-picker-labels.js.map +1 -1
- package/dist/hooks/use-file-picker.js.map +1 -1
- package/dist/hooks/use-focus-trap.js.map +1 -1
- package/dist/hooks/use-overlay-history.js +10 -5
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/hooks/use-row-swipe.d.ts +1 -1
- package/dist/hooks/use-row-swipe.js +1 -6
- package/dist/hooks/use-row-swipe.js.map +1 -1
- package/dist/i18n/defaults.js +1 -4
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +4 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.js +2 -8
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.js.map +1 -1
- package/dist/i18n/locales/en.js +4 -1
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/es.js +4 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +4 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +4 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +4 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/plurals.js.map +1 -1
- package/dist/i18n/review.js +13 -7
- package/dist/i18n/review.js.map +1 -1
- package/dist/i18n/shared-labels.js.map +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +40 -23
- package/dist/index.js.map +1 -1
- package/dist/landing/access.js +1 -4
- package/dist/landing/access.js.map +1 -1
- package/dist/landing/landing-sections.js +35 -38
- package/dist/landing/landing-sections.js.map +1 -1
- package/dist/landing/page-seo.js.map +1 -1
- package/dist/lib/calc.js.map +1 -1
- package/dist/lib/clipboard-minus.js.map +1 -1
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/decimal-marks.js.map +1 -1
- package/dist/lib/device-settings.js +2 -1
- package/dist/lib/device-settings.js.map +1 -1
- package/dist/lib/direction.js.map +1 -1
- package/dist/lib/iban.js.map +1 -1
- package/dist/lib/logger.js +1 -5
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/person-name.js.map +1 -1
- package/dist/lib/phone.js.map +1 -1
- package/dist/lib/qr-encode.js +344 -8
- package/dist/lib/qr-encode.js.map +1 -1
- package/dist/lib/session-refresh.js.map +1 -1
- package/dist/lib/table-text.js +15 -3
- package/dist/lib/table-text.js.map +1 -1
- package/dist/lib/text-match.d.ts +4 -0
- package/dist/lib/text-match.js.map +1 -1
- package/dist/lib/translation-review.js.map +1 -1
- package/dist/notifications/notification-inbox.js +63 -44
- package/dist/notifications/notification-inbox.js.map +1 -1
- package/dist/notifications/notification-parts.js.map +1 -1
- package/dist/notifications/notification-types-setting.js.map +1 -1
- package/dist/notifications/notifications-labels.js.map +1 -1
- package/dist/notifications/push-device-setting.js +6 -1
- package/dist/notifications/push-device-setting.js.map +1 -1
- package/dist/notifications/push-devices-setting.js.map +1 -1
- package/dist/notifications/push-worker.js.map +1 -1
- package/dist/notifications/quiet-hours-setting.js.map +1 -1
- package/dist/notifications/use-push-device.js +4 -1
- package/dist/notifications/use-push-device.js.map +1 -1
- package/dist/offline/pwa-update-prompt.d.ts +1 -1
- package/dist/offline/pwa-update-prompt.js +7 -1
- package/dist/offline/pwa-update-prompt.js.map +1 -1
- package/dist/offline/query-persistence.js.map +1 -1
- package/dist/offline.d.ts +1 -1
- package/dist/offline.js +6 -1
- package/dist/offline.js.map +1 -1
- package/dist/pay/pay.css +8 -1
- package/dist/rhf/fields.d.ts +1 -2
- package/dist/rhf/fields.js +1 -10
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form-core.js +1 -4
- package/dist/rhf/form-core.js.map +1 -1
- package/dist/rhf/line-items.js.map +1 -1
- package/dist/rhf/use-rhf-wizard-step.js.map +1 -1
- package/dist/search/command-palette.js +71 -62
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search.js +34 -5
- package/dist/search/global-search.js.map +1 -1
- package/dist/search/search-index.js.map +1 -1
- package/dist/settings/device-reset-setting.js +1 -6
- package/dist/settings/device-reset-setting.js.map +1 -1
- package/dist/settings/settings-heading.js.map +1 -1
- package/dist/settings/settings-layout.js +9 -20
- package/dist/settings/settings-layout.js.map +1 -1
- package/dist/settings/use-settings-route.js.map +1 -1
- package/dist/shell/app-shell.js +62 -31
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/auth-layout.js +1 -10
- package/dist/shell/auth-layout.js.map +1 -1
- package/dist/shell/dev-menu.js +12 -6
- package/dist/shell/dev-menu.js.map +1 -1
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/sync-status-indicator.js +7 -6
- package/dist/shell/sync-status-indicator.js.map +1 -1
- package/dist/shell/top-bar-parts-labels.js.map +1 -1
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.js +1 -10
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/shell/tour-menu.js +9 -1
- package/dist/shell/tour-menu.js.map +1 -1
- package/dist/sync/db.js.map +1 -1
- package/dist/sync/engine.js +24 -6
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync.d.ts +2 -2
- package/dist/sync.js +7 -1
- package/dist/sync.js.map +1 -1
- package/dist/testing/css-variables.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -3
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/react.js.map +1 -1
- package/dist/testing/viewport.js +7 -4
- package/dist/testing/viewport.js.map +1 -1
- package/dist/theme/contrast-tokens.js +13 -2
- package/dist/theme/contrast-tokens.js.map +1 -1
- package/dist/theme/contrast.d.ts +2 -2
- package/dist/theme/palette-derive.d.ts +1 -1
- package/dist/theme/palette-derive.js +18 -29
- package/dist/theme/palette-derive.js.map +1 -1
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/theme/palette-store.js.map +1 -1
- package/dist/theme/text-size.js.map +1 -1
- package/dist/theme/theme-store.js +1 -3
- package/dist/theme/theme-store.js.map +1 -1
- package/dist/tour/tour-catalogue.js.map +1 -1
- package/dist/tour/tour-dock.js +5 -1
- package/dist/tour/tour-dock.js.map +1 -1
- package/dist/tour/tour-engine.js +1 -4
- package/dist/tour/tour-engine.js.map +1 -1
- package/dist/tour/tour.js +21 -12
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour/use-tour-progress.js.map +1 -1
- package/dist/tour/use-tour-url-sync.js.map +1 -1
- package/dist/wizard/stepper-nav.js +3 -24
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.js +24 -28
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/validation.js.map +1 -1
- package/dist/wizard/wizard-context.js.map +1 -1
- package/dist/wizard/wizard-step.d.ts +1 -1
- package/dist/wizard/wizard-step.js +1 -8
- package/dist/wizard/wizard-step.js.map +1 -1
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/package.json +5 -2
- package/src/account/account-settings-labels.ts +1 -2
- package/src/account/account-settings.tsx +11 -17
- package/src/account/delete-account-setting.tsx +1 -6
- package/src/account/email-change-setting-labels.ts +1 -2
- package/src/account/email-change-setting.tsx +3 -1
- package/src/account/passkeys-setting.tsx +1 -3
- package/src/account/sessions-setting.tsx +4 -2
- package/src/admin/admin-action-confirm.tsx +4 -7
- package/src/admin/admin-action-log.tsx +29 -29
- package/src/admin/admin-area-labels.ts +4 -1
- package/src/admin/admin-overview.tsx +8 -2
- package/src/admin/admin-sections.tsx +3 -1
- package/src/admin/admin-tool-links.tsx +7 -1
- package/src/admin/invitations-panel.tsx +5 -11
- package/src/admin/mail-test-card.tsx +1 -2
- package/src/admin/reviewer-scope-editor.tsx +4 -9
- package/src/admin/role-select.tsx +4 -2
- package/src/admin/user-roster.tsx +2 -11
- package/src/auth/accept-invitation.tsx +1 -7
- package/src/auth/auth-errors.ts +1 -6
- package/src/auth/forgot-password-form.tsx +2 -7
- package/src/auth/register-form.tsx +7 -8
- package/src/auth/reset-password-form.tsx +2 -5
- package/src/auth/sign-in-form.tsx +15 -14
- package/src/auth/verify-email.tsx +2 -7
- package/src/billing/billing-banner.tsx +3 -7
- package/src/billing/billing-labels.ts +6 -4
- package/src/billing/checkout-processing.ts +0 -1
- package/src/billing/plan-card.tsx +9 -8
- package/src/billing/plan-limit-toast.tsx +1 -2
- package/src/billing/plan-limit.ts +1 -2
- package/src/billing/plan-price.ts +1 -4
- package/src/billing/plan-switch.tsx +1 -2
- package/src/billing/subscription-actions.tsx +5 -2
- package/src/components/account-chips.tsx +1 -7
- package/src/components/alert-banner.tsx +2 -8
- package/src/components/amount-input.tsx +206 -178
- package/src/components/authed-image.tsx +7 -4
- package/src/components/autocomplete.tsx +7 -9
- package/src/components/bulk-action-bar.tsx +2 -7
- package/src/components/button-group.tsx +1 -2
- package/src/components/button-look.ts +6 -17
- package/src/components/button.tsx +1 -4
- package/src/components/calculator.tsx +6 -9
- package/src/components/calendar-heatmap.tsx +5 -10
- package/src/components/card.tsx +9 -13
- package/src/components/chart-zoom-core.tsx +6 -33
- package/src/components/chart.tsx +8 -31
- package/src/components/checkbox-group.tsx +1 -4
- package/src/components/chip-input.tsx +6 -6
- package/src/components/chip.tsx +14 -26
- package/src/components/choice-card.tsx +4 -18
- package/src/components/column-mapper-labels.ts +3 -10
- package/src/components/column-mapper.tsx +33 -122
- package/src/components/combobox-core.tsx +12 -42
- package/src/components/combobox.tsx +2 -6
- package/src/components/confirm-dialog.tsx +1 -3
- package/src/components/copy-button.tsx +2 -4
- package/src/components/country-select.tsx +9 -21
- package/src/components/currency-option-list.tsx +13 -14
- package/src/components/currency-select.tsx +2 -7
- package/src/components/danger-confirm.tsx +8 -9
- package/src/components/data-table-cells.tsx +1 -2
- package/src/components/data-table-column-settings.tsx +1 -3
- package/src/components/data-table-filter-popover.tsx +5 -19
- package/src/components/data-table-filters.ts +1 -6
- package/src/components/data-table-fit.ts +1 -3
- package/src/components/data-table-groups.tsx +3 -1
- package/src/components/data-table-head.tsx +27 -45
- package/src/components/data-table-mobile.tsx +99 -108
- package/src/components/data-table-pagination.tsx +2 -6
- package/src/components/data-table-row-actions.tsx +25 -24
- package/src/components/data-table-row.tsx +16 -17
- package/src/components/data-table-shared.tsx +10 -16
- package/src/components/data-table-sort.ts +1 -2
- package/src/components/data-table-virtual.ts +9 -4
- package/src/components/data-table.tsx +489 -501
- package/src/components/date-picker.tsx +1 -7
- package/src/components/date-range-picker.tsx +3 -13
- package/src/components/description-list.tsx +7 -13
- package/src/components/dialog-frame.tsx +12 -3
- package/src/components/disclosure.tsx +8 -12
- package/src/components/dropdown.tsx +3 -11
- package/src/components/empty-state.tsx +1 -3
- package/src/components/entity-combobox.tsx +2 -6
- package/src/components/error-boundary.tsx +7 -7
- package/src/components/field-base.tsx +8 -14
- package/src/components/field-parts.tsx +12 -23
- package/src/components/field-sync.tsx +7 -11
- package/src/components/file-button.tsx +7 -3
- package/src/components/file-dropzone.tsx +7 -12
- package/src/components/floating-panel.tsx +44 -51
- package/src/components/focus-ring.ts +1 -2
- package/src/components/form-actions.tsx +1 -4
- package/src/components/grouped-picker.tsx +6 -8
- package/src/components/hover-menu.tsx +1 -4
- package/src/components/iban-input-labels.ts +1 -2
- package/src/components/icon-button.tsx +46 -48
- package/src/components/icon-picker.tsx +4 -17
- package/src/components/image-grid.tsx +1 -6
- package/src/components/inline-edit-field.tsx +1 -5
- package/src/components/inline-entity-combobox.tsx +6 -21
- package/src/components/input.tsx +14 -2
- package/src/components/jump-calendar.tsx +2 -6
- package/src/components/legal-labels.ts +1 -2
- package/src/components/legal-page.tsx +18 -7
- package/src/components/legal.tsx +14 -5
- package/src/components/lightbox.tsx +1 -3
- package/src/components/line-items.tsx +7 -15
- package/src/components/list.tsx +29 -25
- package/src/components/measured-grid.tsx +8 -30
- package/src/components/menu-item.tsx +1 -3
- package/src/components/mini-calendar.tsx +129 -159
- package/src/components/money-field.tsx +4 -2
- package/src/components/month-picker.tsx +14 -21
- package/src/components/multi-entity-combobox.tsx +6 -26
- package/src/components/multi-select.tsx +5 -9
- package/src/components/nav-pills.tsx +10 -2
- package/src/components/number-field.tsx +18 -15
- package/src/components/number-input.tsx +3 -19
- package/src/components/numpad-sheet.tsx +9 -13
- package/src/components/one-time-code-input.tsx +6 -11
- package/src/components/page-contents.tsx +2 -9
- package/src/components/page-header.tsx +5 -10
- package/src/components/password-strength-labels.ts +1 -2
- package/src/components/password-strength.tsx +6 -9
- package/src/components/phone-input.tsx +2 -13
- package/src/components/picker-sheet.tsx +2 -5
- package/src/components/pie-chart.tsx +6 -12
- package/src/components/popover.tsx +2 -1
- package/src/components/progress-bar.tsx +16 -25
- package/src/components/qr-code.tsx +2 -9
- package/src/components/row-actions.tsx +9 -1
- package/src/components/search-field.tsx +4 -5
- package/src/components/select.tsx +2 -10
- package/src/components/separator.tsx +1 -5
- package/src/components/series-chart-axes.ts +5 -5
- package/src/components/series-chart-budget.ts +1 -4
- package/src/components/series-chart-ticks.ts +1 -4
- package/src/components/series-chart.tsx +43 -83
- package/src/components/settings-fields.tsx +20 -15
- package/src/components/share-card.tsx +6 -14
- package/src/components/sign-chip.tsx +16 -16
- package/src/components/signature-pad.tsx +21 -13
- package/src/components/signed-amount.tsx +6 -14
- package/src/components/skeleton.tsx +2 -13
- package/src/components/slider.tsx +9 -20
- package/src/components/sparkline.tsx +2 -13
- package/src/components/stat-tile.tsx +13 -24
- package/src/components/swatch-picker.tsx +8 -3
- package/src/components/swipeable-row.tsx +2 -11
- package/src/components/table-skeleton.tsx +4 -1
- package/src/components/table.tsx +12 -8
- package/src/components/tabs.tsx +24 -39
- package/src/components/text-link.tsx +6 -6
- package/src/components/text.tsx +1 -2
- package/src/components/tile-radio.tsx +6 -19
- package/src/components/time-input.tsx +4 -5
- package/src/components/toast.tsx +3 -12
- package/src/components/toggle-group.tsx +9 -9
- package/src/components/toggle-legend.tsx +4 -16
- package/src/components/tooltip.tsx +9 -48
- package/src/components/translation-review-editor.tsx +4 -4
- package/src/components/translation-review-parts.tsx +7 -1
- package/src/components/translation-review.tsx +15 -16
- package/src/components/tree-view.tsx +17 -20
- package/src/components/treemap.tsx +59 -9
- package/src/components/trigger-aria.ts +1 -4
- package/src/components/use-table-state.ts +16 -17
- package/src/components/user-avatar.tsx +4 -21
- package/src/demo/demo-start.tsx +8 -4
- package/src/feedback/feedback-attachment-labels.ts +2 -1
- package/src/feedback/feedback-attachment.tsx +16 -29
- package/src/feedback/feedback-capture.ts +3 -1
- package/src/feedback/feedback-comment-thread.tsx +9 -6
- package/src/feedback/feedback-context.tsx +1 -4
- package/src/feedback/feedback-dialog.tsx +3 -4
- package/src/feedback/feedback-inbox.tsx +3 -9
- package/src/feedback/feedback-public-list.tsx +7 -1
- package/src/feedback/feedback-record.ts +6 -14
- package/src/feedback/feedback-replies.tsx +10 -5
- package/src/feedback/feedback-row-detail.tsx +2 -5
- package/src/feedback/feedback-status-undo.ts +1 -4
- package/src/feedback/feedback-submit-dialog.tsx +4 -4
- package/src/feedback/feedback-table.tsx +12 -8
- package/src/feedback/feedback-thread.tsx +4 -16
- package/src/feedback/feedback-vocabulary.ts +72 -82
- package/src/feedback/feedback-vote-button.tsx +9 -8
- package/src/hooks/use-anchored-rect.ts +1 -4
- package/src/hooks/use-document-title.ts +3 -1
- package/src/hooks/use-file-drop.ts +1 -3
- package/src/hooks/use-file-picker-labels.ts +1 -2
- package/src/hooks/use-file-picker.tsx +1 -5
- package/src/hooks/use-focus-trap.ts +1 -2
- package/src/hooks/use-overlay-history.ts +10 -5
- package/src/hooks/use-row-swipe.ts +1 -6
- package/src/i18n/defaults.ts +1 -4
- package/src/i18n/german.ts +33 -49
- package/src/i18n/kit-labels.tsx +5 -20
- package/src/i18n/languages.ts +2 -8
- package/src/i18n/locales/en.ts +11 -31
- package/src/i18n/locales/es.ts +35 -49
- package/src/i18n/locales/fr.ts +34 -51
- package/src/i18n/locales/hu.ts +26 -37
- package/src/i18n/locales/it.ts +35 -52
- package/src/i18n/locales/zh.ts +14 -32
- package/src/i18n/plurals.ts +4 -1
- package/src/i18n/review.ts +18 -7
- package/src/i18n/shared-labels.ts +1 -2
- package/src/index.ts +106 -32
- package/src/landing/access.ts +2 -7
- package/src/landing/landing-sections.tsx +14 -15
- package/src/landing/page-seo.ts +1 -3
- package/src/lib/calc.ts +4 -1
- package/src/lib/clipboard-minus.ts +4 -1
- package/src/lib/dates.ts +2 -10
- package/src/lib/decimal-marks.ts +1 -3
- package/src/lib/device-settings.ts +2 -1
- package/src/lib/direction.ts +1 -3
- package/src/lib/iban.ts +89 -9
- package/src/lib/logger.ts +1 -5
- package/src/lib/person-name.ts +1 -3
- package/src/lib/phone.ts +5 -8
- package/src/lib/qr-encode.ts +32 -8
- package/src/lib/session-refresh.ts +5 -6
- package/src/lib/table-text.ts +24 -6
- package/src/lib/text-match.ts +15 -3
- package/src/lib/translation-review.ts +1 -3
- package/src/notifications/notification-inbox.tsx +17 -4
- package/src/notifications/notification-parts.tsx +1 -2
- package/src/notifications/notification-types-setting.tsx +19 -18
- package/src/notifications/notifications-labels.ts +1 -2
- package/src/notifications/push-device-setting.tsx +7 -1
- package/src/notifications/push-devices-setting.tsx +7 -3
- package/src/notifications/push-worker.ts +10 -2
- package/src/notifications/quiet-hours-setting.tsx +4 -1
- package/src/notifications/use-push-device.ts +4 -1
- package/src/offline/pwa-update-prompt.tsx +7 -1
- package/src/offline/query-persistence.ts +9 -6
- package/src/offline.ts +6 -1
- package/src/rhf/fields.tsx +50 -19
- package/src/rhf/form-core.tsx +2 -6
- package/src/rhf/line-items.tsx +5 -7
- package/src/rhf/use-rhf-wizard-step.ts +3 -12
- package/src/search/command-palette.tsx +15 -23
- package/src/search/global-search.tsx +38 -8
- package/src/search/search-index.ts +5 -1
- package/src/settings/device-reset-setting.tsx +5 -8
- package/src/settings/settings-heading.tsx +3 -1
- package/src/settings/settings-layout.tsx +6 -13
- package/src/settings/use-settings-route.ts +4 -3
- package/src/shell/app-shell.tsx +48 -24
- package/src/shell/auth-layout.tsx +1 -6
- package/src/shell/dev-menu.tsx +12 -6
- package/src/shell/option-switcher-menu.tsx +1 -3
- package/src/shell/sync-status-indicator.tsx +14 -12
- package/src/shell/top-bar-parts-labels.ts +1 -3
- package/src/shell/topbar-action-menu.tsx +9 -8
- package/src/shell/topbar-controls.tsx +5 -19
- package/src/shell/tour-menu.tsx +9 -1
- package/src/sync/db.ts +5 -1
- package/src/sync/engine.ts +44 -12
- package/src/sync.ts +16 -2
- package/src/testing/css-variables.ts +1 -2
- package/src/testing/index.ts +1 -6
- package/src/testing/react.ts +1 -2
- package/src/testing/viewport.ts +9 -9
- package/src/theme/contrast-tokens.ts +13 -2
- package/src/theme/palette-derive.ts +24 -50
- package/src/theme/palette-presets.ts +0 -1
- package/src/theme/palette-store.ts +1 -4
- package/src/theme/text-size.ts +1 -1
- package/src/theme/theme-store.ts +2 -6
- package/src/tour/tour-catalogue.tsx +4 -2
- package/src/tour/tour-dock.ts +5 -1
- package/src/tour/tour-engine.ts +2 -6
- package/src/tour/tour.tsx +28 -12
- package/src/tour/use-tour-progress.ts +8 -2
- package/src/tour/use-tour-url-sync.ts +3 -1
- package/src/vite-env.d.ts +1 -4
- package/src/wizard/stepper-nav.tsx +10 -35
- package/src/wizard/types.ts +1 -4
- package/src/wizard/use-wizard.ts +28 -43
- package/src/wizard/validation.ts +1 -5
- package/src/wizard/wizard-context.tsx +2 -6
- package/src/wizard/wizard-step.tsx +1 -8
- package/src/wizard/wizard-summary.tsx +2 -6
- package/tokens.css +393 -152
package/dist/i18n/kit-labels.js
CHANGED
|
@@ -129,10 +129,7 @@ function useKitLabelOverrides(ns) {
|
|
|
129
129
|
}
|
|
130
130
|
function useKitLabels(ns, defaults, prop) {
|
|
131
131
|
const fromProvider = useKitLabelOverrides(ns);
|
|
132
|
-
return useMemo(
|
|
133
|
-
() => mergeNamespace(mergeNamespace(defaults, fromProvider), prop),
|
|
134
|
-
[defaults, fromProvider, prop]
|
|
135
|
-
);
|
|
132
|
+
return useMemo(() => mergeNamespace(mergeNamespace(defaults, fromProvider), prop), [defaults, fromProvider, prop]);
|
|
136
133
|
}
|
|
137
134
|
function useKitLocale(prop) {
|
|
138
135
|
const fromProvider = useContext(KitI18nContext).locale;
|
|
@@ -162,10 +159,7 @@ function useKitDocumentTitle() {
|
|
|
162
159
|
}
|
|
163
160
|
function useKitFileLabels(prop) {
|
|
164
161
|
const locale = useKitLocale();
|
|
165
|
-
const defaults = useMemo(
|
|
166
|
-
() => ({ size: (bytes) => formatFileSize(bytes, locale) }),
|
|
167
|
-
[locale]
|
|
168
|
-
);
|
|
162
|
+
const defaults = useMemo(() => ({ size: (bytes) => formatFileSize(bytes, locale) }), [locale]);
|
|
169
163
|
return useKitLabels("file", defaults, prop);
|
|
170
164
|
}
|
|
171
165
|
function missingKitLabels(labels, reference) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i18n/kit-labels.tsx"],"sourcesContent":["import { createContext, useContext, useEffect, useMemo } from \"react\";\nimport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n} from \"./shared-labels\";\nimport type { AnchorHTMLAttributes, ReactElement, Ref } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { DataTableLabels } from \"../components/data-table-labels\";\nimport type { MiniCalendarLabels, WeekDay } from \"../components/mini-calendar\";\nimport type { CalendarHeatmapLabels } from \"../components/calendar-heatmap\";\nimport type { PopoverLabels } from \"../components/popover\";\nimport type { ChipInputLabels } from \"../components/chip\";\nimport type { FieldSyncLabels } from \"../components/field-sync\";\nimport type { CharacterCountLabels, PasswordRevealLabels } from \"../components/field-base\";\nimport type { TabsLabels } from \"../components/tabs\";\nimport type { WizardLabels } from \"../wizard/types\";\nimport type { TourLabels } from \"../tour/tour\";\nimport type { TourCatalogueLabels } from \"../tour/tour-catalogue-labels\";\nimport type { TourGuideLabels } from \"../tour/tour-guide-labels\";\nimport type { CommandPaletteLabels } from \"../search/command-palette\";\nimport type { GlobalSearchLabels } from \"../search/global-search\";\nimport type { MonthPickerLabels } from \"../components/month-picker\";\nimport type { PageContentsLabels } from \"../components/page-contents\";\nimport type { SeriesChartLabels } from \"../components/series-chart-labels\";\nimport type { PieChartLabels } from \"../components/pie-chart-labels\";\nimport type { SparklineLabels } from \"../components/sparkline\";\nimport type { StatTileLabels } from \"../components/stat-tile\";\nimport type { SignaturePadLabels } from \"../components/signature-pad\";\nimport type { PasswordStrengthLabels } from \"../components/password-strength\";\nimport type { DangerConfirmLabels } from \"../components/danger-confirm\";\nimport type { SwatchPickerLabels } from \"../components/swatch-picker\";\nimport type { IconPickerLabels } from \"../components/icon-picker\";\nimport type { DialogFrameLabels } from \"../components/dialog-frame\";\nimport type { FilePickerLabels } from \"../components/file-button\";\nimport type { MeasuredGridLabels } from \"../components/measured-grid\";\nimport type { FeedbackAttachmentFieldLabels } from \"../feedback/feedback-attachment\";\nimport type { FeedbackDialogTextLabels } from \"../feedback/feedback-dialog\";\nimport type { FeedbackComposerLabels, FeedbackThreadLabels } from \"../feedback/feedback-thread\";\nimport type {\n FeedbackCategoryLabels,\n FeedbackStatusLabels,\n FeedbackToastLabels,\n} from \"../feedback/feedback-labels\";\nimport type { FeedbackMenuLabels } from \"../feedback/feedback-menu\";\nimport type { FeedbackPublicLabels } from \"../feedback/feedback-public-labels\";\nimport type { FeedbackNotificationTypesLabels } from \"../notifications/feedback-notification-types-labels\";\nimport type { FeedbackContextLabels } from \"../feedback/feedback-context\";\nimport type { FeedbackPageLabels } from \"../feedback/feedback-table\";\nimport type { FeedbackDetailLabels } from \"../feedback/feedback-row-detail\";\nimport type { FeedbackVoteLabels } from \"../feedback/feedback-vote-button\";\nimport type { FeedbackCommentsLabels } from \"../feedback/feedback-comment-thread\";\nimport type { FeedbackRepliesLabels } from \"../feedback/feedback-replies\";\nimport type { AccountSettingsLabels } from \"../account/account-settings-labels\";\nimport type { ConfirmDialogLabels } from \"../components/confirm-dialog\";\nimport type { FloatingPanelLabels } from \"../components/floating-panel\";\nimport type { CopyButtonLabels } from \"../components/copy-button\";\nimport type { BulkActionBarLabels } from \"../components/bulk-action-bar\";\nimport type { ListLabels } from \"../components/list\";\nimport type { BreadcrumbsLabels } from \"../components/breadcrumbs\";\nimport type { ToastLabels } from \"../components/toast\";\nimport type { FormActionsLabels } from \"../components/form-actions\";\nimport type { DescriptionListLabels } from \"../components/description-list\";\nimport type { LineItemsLabels } from \"../components/line-items\";\nimport type { ProgressBarLabels } from \"../components/progress-bar\";\nimport type { SignedAmountLabels } from \"../components/signed-amount\";\nimport type { ErrorBoundaryLabels } from \"../components/error-boundary\";\nimport type { AuthedImageLabels } from \"../components/authed-image\";\nimport type { ImageGridLabels } from \"../components/image-grid\";\nimport type { LightboxLabels } from \"../components/lightbox\";\nimport type { WriteLockLabels } from \"../components/write-lock\";\nimport type { LegalLabels } from \"../components/legal\";\nimport type { SignInLabels } from \"../auth/sign-in-form\";\nimport type { RegisterLabels } from \"../auth/register-form\";\nimport type { CompleteNameLabels } from \"../auth/complete-name-dialog\";\nimport type { ForgotPasswordLabels } from \"../auth/forgot-password-form\";\nimport type { ResetPasswordLabels } from \"../auth/reset-password-form\";\nimport type { VerifyEmailLabels } from \"../auth/verify-email\";\nimport type { NotFoundLabels } from \"../auth/not-found-page\";\nimport type { AcceptInvitationLabels } from \"../auth/accept-invitation\";\nimport type { CompanySwitcherLabels } from \"../shell/company-switcher\";\nimport type { EmailChangeLabels } from \"../account/email-change-setting\";\nimport type { SessionsLabels } from \"../account/sessions-setting\";\nimport type { DeleteAccountLabels } from \"../account/delete-account-setting\";\nimport type { DataExportLabels } from \"../account/data-export-setting\";\nimport type { UserRosterLabels } from \"../admin/user-roster\";\nimport type { RoleSelectLabels } from \"../admin/role-select\";\nimport type { ReviewerScopeLabels } from \"../admin/reviewer-scope-editor\";\nimport type { AdminActionLabels } from \"../admin/admin-action-confirm\";\nimport type { AdminActionLogLabels } from \"../admin/admin-action-log\";\nimport type { TransferOwnershipLabels } from \"../admin/transfer-ownership-dialog\";\nimport type { InvitationsLabels } from \"../admin/invitations-panel\";\nimport type { SettingsLabels } from \"../settings/settings-labels\";\nimport type { LandingLabels } from \"../landing/landing-labels\";\nimport type { DemoLabels } from \"../demo/demo-labels\";\nimport type { BillingLabels } from \"../billing/billing-labels\";\nimport type { PlanChangeLabels } from \"../admin/plan-change\";\nimport type { AppearanceLabels } from \"../components/appearance-labels\";\nimport type { DeviceResetLabels } from \"../settings/device-reset-setting\";\nimport type { RowActionsLabels } from \"../components/row-actions\";\nimport type { AppShellMoreLabels } from \"../shell/app-shell\";\nimport type { AccountStateLabels } from \"../components/account-chips\";\nimport type { ShareCardLabels } from \"../components/share-card\";\nimport type { ReauthDialogLabels } from \"../components/reauth-dialog\";\nimport type { ServerWakeLabels } from \"../components/server-wake\";\nimport type { TranslationReviewLabels } from \"../components/translation-review-labels\";\nimport type { CountrySelectLabels } from \"../components/country-select\";\nimport type { InlineEditLabels } from \"../components/inline-edit-field\";\nimport type { IbanInputLabels } from \"../components/iban-input\";\nimport type { PhoneInputLabels } from \"../components/phone-input\";\nimport type { SignChipLabels } from \"../components/sign-chip\";\nimport type { ColumnMapperLabels } from \"../components/column-mapper\";\nimport type { NotificationsLabels } from \"../notifications/notifications-labels\";\nimport type { AdminAreaLabels } from \"../admin/admin-area-labels\";\nimport type { MailTestCardLabels } from \"../admin/mail-test-card\";\nimport type { TopBarPartsLabels } from \"../shell/top-bar-parts-labels\";\nimport type { SignOutPendingDialogLabels } from \"../offline/sign-out-pending-dialog\";\nimport type { PwaUpdatePromptLabels } from \"../offline/pwa-update-prompt\";\nimport type { SharedComputerLabels } from \"../offline/shared-computer\";\n\n/**\n * EVERY string the kit renders, as one typed tree — and an optional provider that\n * hands it to every component at once.\n *\n * WHY THIS EXISTS. The kit renders only labels; it ships seven catalogues (since 0.7.0,\n * `@eifi1/ui-kit/i18n/<code>`); the app decides the language and hands the words in.\n * What was wrong was HOW it had to hand them in —\n * one `labels` prop per component instance, under a different prop name per\n * component (`labels`, `calendarLabels`, `passwordLabels`, `clearLabel`,\n * `searchPlaceholder`, `ariaLabel` …). A translated app therefore rendered English\n * wherever one call site forgot one prop, and nothing told it so: a German showcase\n * still said \"Rows per page\", \"Collapse sidebar\" and \"Popover\" in seven languages.\n *\n * Now there is one key per string, addressed by a dot path (`dataTable.pageSize`,\n * `datePicker.today`), and three sources in a fixed order of precedence:\n *\n * the component's own prop > <UiKitProvider labels> > English default\n *\n * A consumer loads a shipped catalogue (`loadUiKitLabels(code)`) or writes its own\n * `UiKitLabels` (or a partial of one), mounts `<UiKitProvider labels={…} locale={…}>`\n * at the root, and every kit component\n * below speaks that language — including the ones nested inside other kit components\n * (the calendar inside the data table's date filter, the popover inside the date\n * picker), which no prop at the outer call site could reach before.\n *\n * Messages that carry a value are FUNCTIONS of that value, never a template to fill:\n * a number glued into an English sentence is untranslatable, because the grammar\n * around it moves with it in most languages.\n */\n\n/* ── Namespaces that had no labels type of their own ─────────────────────── */\n\n/** The words several components share. A component's own namespace wins over these\n * where both exist; these are what a new component reaches for first. */\nexport interface CommonLabels {\n close: string;\n clear: string;\n search: string;\n done: string;\n cancel: string;\n save: string;\n back: string;\n next: string;\n remove: string;\n loading: string;\n noResults: string;\n /** \"Name: value\" — how a field's accessible name is composed with its value.\n * A colon-and-space is not universal punctuation (French puts a space before\n * the colon, Chinese uses a full-width one). */\n fieldValue: (field: string, value: string) => string;\n /** The × that puts away a banner or a notice (`AlertBanner onDismiss`). Not `close`:\n * nothing opened, and \"Close\" on a banner reads as closing the page it sits on. */\n dismiss: string;\n /** Read after a link that opens a new tab (`<Button href external>`, TextLink):\n * nothing else tells a screen reader the page is about to change tabs. */\n opensInNewTab: string;\n /** The name of a field's `help` \"?\" and its panel (round 0.36): \"About “<field>”\", the\n * field's label as the argument, quoted so a capitalised label reads as a name — \"About\n * “Jerk shape”\" (round 0.37; the other locales quoted it already). A `HelpPopover`\n * passed as `help` keeps its own name. */\n aboutField: (field: string) => string;\n /** …and of a `help` \"?\" on a field with no label and no `aria-label` to name it by. */\n help: string;\n /** 0.48: the toggle that shows the rest of a clamped text (`AlertBanner clampMobile`)… */\n showMore: string;\n /** …and folds it back to its one line. */\n showLess: string;\n}\n\n/** `DatePicker` / `DateRangePicker` chrome. The calendar inside has its own\n * namespace, `miniCalendar`. */\nexport interface DatePickerLabels {\n /** Accessible name of the popover panel the calendar opens in. */\n panel: string;\n /** The same, for `DateRangePicker`'s panel. */\n rangePanel: string;\n clear: string;\n previousDay: string;\n nextDay: string;\n today: string;\n /** `DateRangePicker commit=\"apply\"`: the button that commits the drafted range. */\n apply: string;\n /** …and the one that discards it. */\n cancel: string;\n /** Accessible name of `DateRangePicker`'s preset column. */\n presets: string;\n}\n\n/** The whole combobox family: `Combobox`, `EntityCombobox`,\n * `MultiEntityCombobox`, `InlineEntityCombobox`, `Autocomplete`. */\nexport interface ComboboxLabels {\n search: string;\n noResults: string;\n clear: string;\n loading: string;\n /** The \"add this\" row when free entry is allowed. */\n create: (query: string) => string;\n /** Trigger summary once more than one value is picked. */\n selectedCount: (count: number) => string;\n /** An async lookup (`loadOptions`) failed. */\n loadError: string;\n /** Announced (live region) when the list settles on `count` > 0 rows. */\n resultCount: (count: number) => string;\n /** The query is shorter than the `minChars` a lookup needs. */\n minChars: (count: number) => string;\n}\n\nexport interface MultiSelectLabels {\n search: string;\n selectAll: string;\n clear: string;\n /** Trigger text when nothing is picked, which a multi-select reads as \"all\". */\n all: string;\n /** Trigger summary once some (but not all) values are picked. The English\n * default is the bare count, which is what the trigger has always shown. */\n selectedCount: (count: number) => string;\n}\n\n/** `CalculatorButton` (desktop popover keypad) and `NumberPadSheet` (phone sheet). */\nexport interface CalculatorLabels {\n /** The button that opens the calculator. */\n open: string;\n /** The popover / sheet itself. */\n panel: string;\n calculation: string;\n backspace: string;\n clear: string;\n equals: string;\n /** The primary key of the phone pad — visible text, not an aria-label. */\n done: string;\n /** Names of the operator keys and the decimal key. Their glyphs are not names a\n * screen reader agrees on — \"÷\" is read as \"division sign\", \"divided by\" or\n * nothing at all depending on the reader — so each says what it does. */\n plus: string;\n minus: string;\n times: string;\n divide: string;\n decimal: string;\n}\n\n/** `CurrencySelect` and the currency half of `AmountInput`. */\nexport interface CurrencyLabels {\n currency: string;\n search: string;\n}\n\nexport interface AppShellLabels {\n collapse: string;\n expand: string;\n /** Accessible name of an inline group's disclosure button (`subNav=\"inline\"`). */\n toggleGroup: (groupLabel: string) => string;\n}\n\nexport interface TopBarLabels {\n theme: string;\n palette: string;\n language: string;\n /** 0.49 KIT-10: the language menu's trigger, given the current language's name —\n * \"Choose language, current: Deutsch\". */\n languageCurrent: (name: string) => string;\n switchRole: string;\n /** The role switcher's tooltip, given the active role's name. */\n role: (value: string) => string;\n}\n\nexport interface PickerSheetLabels {\n close: string;\n /** The sticky footer button that closes a multi-select sheet once the rows are ticked\n * (0.40) — the ticks are already applied, so it confirms rather than saves. */\n done: string;\n}\n\nexport interface SwipeableRowLabels {\n actions: string;\n}\n\nexport interface FileLabels {\n /** A file size for display, given its size in BYTES. The default uses\n * `Intl.NumberFormat`'s unit formatting in the provider's locale. */\n size: (bytes: number) => string;\n}\n\n/** The complete tree. `UiKitProvider` takes any partial of it. */\nexport interface UiKitLabels {\n common: CommonLabels;\n dataTable: DataTableLabels;\n miniCalendar: MiniCalendarLabels;\n calendarHeatmap: CalendarHeatmapLabels;\n datePicker: DatePickerLabels;\n monthPicker: MonthPickerLabels;\n popover: PopoverLabels;\n combobox: ComboboxLabels;\n multiSelect: MultiSelectLabels;\n calculator: CalculatorLabels;\n currency: CurrencyLabels;\n chipInput: ChipInputLabels;\n fieldSync: FieldSyncLabels;\n passwordReveal: PasswordRevealLabels;\n tabs: TabsLabels;\n appShell: AppShellLabels;\n pageContents: PageContentsLabels;\n topBar: TopBarLabels;\n pickerSheet: PickerSheetLabels;\n swipeableRow: SwipeableRowLabels;\n file: FileLabels;\n wizard: WizardLabels;\n tour: TourLabels;\n /** 0.43.0: the tours page — `TourCatalogue` and its card (docs/tours-harmonization.md §3). */\n tourCatalogue: TourCatalogueLabels;\n /** 0.50: the form's \"Guide me\" — `TourGuideButton` (docs/tours-harmonization.md §11). */\n tourGuide: TourGuideLabels;\n commandPalette: CommandPaletteLabels;\n globalSearch: GlobalSearchLabels;\n seriesChart: SeriesChartLabels;\n pieChart: PieChartLabels;\n sparkline: SparklineLabels;\n statTile: StatTileLabels;\n signaturePad: SignaturePadLabels;\n passwordStrength: PasswordStrengthLabels;\n dangerConfirm: DangerConfirmLabels;\n swatchPicker: SwatchPickerLabels;\n iconPicker: IconPickerLabels;\n dialogFrame: DialogFrameLabels;\n filePicker: FilePickerLabels;\n measuredGrid: MeasuredGridLabels;\n feedbackAttachment: FeedbackAttachmentFieldLabels;\n /** 0.12.0: `FeedbackDialog`'s own strings; `FeedbackThread` / `FeedbackComposer`. */\n feedbackDialog: FeedbackDialogTextLabels;\n feedbackThread: FeedbackThreadLabels;\n feedbackComposer: FeedbackComposerLabels;\n /** 0.27.0: the feedback harmonisation (docs/feedback-harmonization.md §4) — a report's\n * status and category words, keyed by the enum value; the toasts a feedback page\n * shows; `FeedbackMenu`; `FeedbackContextBox`; the two pages' table; the row detail.\n * keksdose's wording is the canon, in every language. */\n feedbackStatus: FeedbackStatusLabels;\n feedbackCategory: FeedbackCategoryLabels;\n feedbackToast: FeedbackToastLabels;\n feedbackMenu: FeedbackMenuLabels;\n /** 0.38.0: the public feedback pages — `FeedbackPublicList`, `FeedbackPublicDetail`,\n * `FeedbackPublicSwitch` (docs/feedback-harmonization.md §9.15). */\n feedbackPublic: FeedbackPublicLabels;\n /** 0.38.0: `useFeedbackNotificationTypes` — the two feedback types' setting words\n * (§9.11). */\n feedbackNotificationTypes: FeedbackNotificationTypesLabels;\n feedbackContext: FeedbackContextLabels;\n feedbackPage: FeedbackPageLabels;\n feedbackDetail: FeedbackDetailLabels;\n /** 0.38.0: public feedback (docs/feedback-harmonization.md §9.15) — the vote button,\n * the comment thread, the replies' timeline and composer. */\n feedbackVote: FeedbackVoteLabels;\n feedbackComments: FeedbackCommentsLabels;\n feedbackReplies: FeedbackRepliesLabels;\n /** 0.12.0: `ProfileSetting`, `PasswordSetting`, `TwoFactorSetting`, `PasskeysSetting`\n * — one record per section. The provider takes a whole section record; the\n * components merge it key by key, as a prop. */\n accountSettings: AccountSettingsLabels;\n confirmDialog: ConfirmDialogLabels;\n floatingPanel: FloatingPanelLabels;\n copyButton: CopyButtonLabels;\n bulkActionBar: BulkActionBarLabels;\n list: ListLabels;\n breadcrumbs: BreadcrumbsLabels;\n toast: ToastLabels;\n form: FormActionsLabels;\n descriptionList: DescriptionListLabels;\n lineItems: LineItemsLabels;\n progressBar: ProgressBarLabels;\n signedAmount: SignedAmountLabels;\n errorBoundary: ErrorBoundaryLabels;\n authedImage: AuthedImageLabels;\n imageGrid: ImageGridLabels;\n lightbox: LightboxLabels;\n /** 0.18.0: `WriteLockProvider`'s fallback reason, `AccountStateChip`, `SharePanel` /\n * `ShareCard` / `ShareDialog`, `ReauthDialog`. */\n writeLock: WriteLockLabels;\n accountState: AccountStateLabels;\n shareCard: ShareCardLabels;\n reauthDialog: ReauthDialogLabels;\n /** 0.18.0: `ServerWakeNotice` — keksdose's cold-start notice, for every app. */\n serverWake: ServerWakeLabels;\n /** 0.19.0: the translation-review parts (`TranslationReviewPanel`, its editor, chip,\n * progress, locale tabs and export) — keksdose's /translations, for every app. */\n translationReview: TranslationReviewLabels;\n /** 0.19.0: `LegalLinks`' navigation name. 0.28.0: every kit-owned word of the legal\n * pages — the link labels, titles, back link, terms checkbox and notices, and the\n * sections that are the same in every app, filled in with the app's operator\n * (docs/legal-harmonization.md §4.3/§4.4). */\n legal: LegalLabels;\n /** 0.29.0: sign-in form: credentials, passkey, 2FA, forced new password (docs/auth-harmonization.md §5). */\n signIn: SignInLabels;\n /** 0.29.0: the sign-up form, with the +app address tag (§4.1, §4.5). */\n register: RegisterLabels;\n /** 0.29.0: asking a migrated account for first and last name once (§3.3). */\n completeName: CompleteNameLabels;\n /** 0.29.0: requesting a reset link (always the same answer). */\n forgotPassword: ForgotPasswordLabels;\n /** 0.29.0: choosing a new password from a reset link; not a sign-in (§6.3). */\n resetPassword: ResetPasswordLabels;\n /** 0.29.0: the verify-email page and the unverified banner. */\n verifyEmail: VerifyEmailLabels;\n /** 0.29.0: the 404 page. */\n notFound: NotFoundLabels;\n /** 0.29.0: accepting an invitation with an account (§4.4). */\n acceptInvitation: AcceptInvitationLabels;\n /** 0.29.0: kastlan's switcher between a user's companies (§5.3). */\n companySwitcher: CompanySwitcherLabels;\n /** 0.30.0: changing the account's address with re-verification (docs/user-admin-harmonization.md §6.2). */\n emailChange: EmailChangeLabels;\n /** 0.30.0: sign out everywhere, and kastlan's device list (§6.3). */\n sessions: SessionsLabels;\n /** 0.30.0: deletion in two stages (§6.4). */\n deleteAccount: DeleteAccountLabels;\n /** 0.30.0: the self-service JSON export (§6.5). */\n dataExport: DataExportLabels;\n /** 0.30.0: the admin user list's columns (§3). */\n userRoster: UserRosterLabels;\n /** 0.30.0: picking one or several roles, with the reasons a choice is locked (§4.1). */\n roleSelect: RoleSelectLabels;\n /** 0.30.0: a translation reviewer's languages and areas. */\n reviewerScope: ReviewerScopeLabels;\n /** 0.30.0: an admin action's confirmation and refusals (§4.2). */\n adminAction: AdminActionLabels;\n /** 0.30.0: the admin_actions list (§4.3). */\n adminActionLog: AdminActionLogLabels;\n /** 0.30.0: handing an account's work to another (Kurvenschmiede). */\n transferOwnership: TransferOwnershipLabels;\n /** 0.30.0: the invitations panel (§5). */\n invitations: InvitationsLabels;\n /** 0.31.0: the settings and admin pages' shell (docs/settings-harmonization.md §4.3). */\n settings: SettingsLabels;\n /** 0.31.0: the public landing page's kit words (docs/landing-demo-harmonization.md §4). */\n landing: LandingLabels;\n /** 0.31.0: the demo's start, banner and end (§5). */\n demo: DemoLabels;\n /** 0.32.0: plans, standing, banners and the limit notice (docs/billing-harmonization.md §7). */\n billing: BillingLabels;\n /** 0.33.0: the operator's plan parts — `planColumn`, `PlanChangeConfirm` and the\n * lines of `usePlanChangeResult` (docs/billing-harmonization.md §14.12). */\n planChange: PlanChangeLabels;\n /** 0.32.0: the text-size and contrast settings (docs/text-size-harmonization.md §6). */\n appearance: AppearanceLabels;\n /** 0.36.0: resetting this device's settings, the appearance group's last card\n * (docs/settings-harmonization.md §11.3). */\n deviceReset: DeviceResetLabels;\n /** 0.32.0: a row's actions folded into a \"⋯\" menu at Large (text size §10.8). */\n rowActions: RowActionsLabels;\n /** 0.32.0: the phone bar's \"More\" cell and sheet (text size §10.7). */\n appShellMore: AppShellMoreLabels;\n /** 0.22.0: the screen-reader words of `Input` / `Textarea`'s `showCount` counter. */\n characterCount: CharacterCountLabels;\n /** 0.22.0: `CountrySelect`. Its list's \"no results\" and counts are `combobox`'s. */\n countrySelect: CountrySelectLabels;\n /** 0.22.0: `InlineEditField` — keksdose K9. */\n inlineEdit: InlineEditLabels;\n /** 0.22.0: `IbanInput`'s messages, one per problem. */\n ibanInput: IbanInputLabels;\n /** 0.22.0: `PhoneInput`'s country-code select. */\n phoneInput: PhoneInputLabels;\n /** 0.22.0: `SignChip` — the outflow / inflow toggle beside an amount. */\n signChip: SignChipLabels;\n /** 0.23.0: `ColumnMapper` / `ColumnRoleTable` — a pasted or dropped table, a role per\n * column. */\n columnMapper: ColumnMapperLabels;\n /** 0.36.0: the notification cards — the types, quiet hours and the zone picker, this\n * device's push, the device list, and the unsubscribe page\n * (docs/notifications-harmonization.md §4.2). */\n notifications: NotificationsLabels;\n /** 0.42.0: the admin area's shared words — the account menu's \"Administration\" row, the\n * 403 page, the shared sections, the overview's tiles and the Tools list\n * (docs/admin-harmonization.md §3.1). */\n adminArea: AdminAreaLabels;\n /** 0.42.0: the top bar's shared parts — `TourMenu`, `SyncStatusIndicator`, `DevMenu`\n * (0.42's `DevSwitchers`; docs/top-bar-harmonization.md §3.1, §2.7.1). */\n topBarParts: TopBarPartsLabels;\n /** 0.45.0: \"Send a test mail to me\" (docs/admin-harmonization.md §9.2.4). */\n mailTestCard: MailTestCardLabels;\n /** 0.45.0: the sign-out question while changes wait to sync (`@eifi1/ui-kit/offline`,\n * docs/local-first-harmonization.md §1.6). */\n signOutPending: SignOutPendingDialogLabels;\n /** 0.45.0: the service-worker update toast (local-first §1.5 D8). */\n pwaUpdate: PwaUpdatePromptLabels;\n /** 0.45.0: \"This is a shared computer\" on the sign-in form (local-first §1.5 D6). */\n sharedComputer: SharedComputerLabels;\n}\n\n/**\n * A label override, as deep as the labels go: an object of labels (a namespace, or a\n * record inside one such as `accountSettings.passkeys` or `dataTable.presets`) may be\n * partial at every level, because the provider merges it key by key at every level.\n * A leaf stays as it is: a string, a function-valued label (`(n) => …`), and anything\n * that is not purely an object (a `ReactNode` union) is given whole.\n */\nexport type LabelOverride<T> = [T] extends [(...args: never[]) => unknown]\n ? T\n : [T] extends [readonly unknown[]]\n ? T\n : [T] extends [object]\n ? { [K in keyof T]?: LabelOverride<T[K]> }\n : T;\n\n/** Any subset of the tree — each namespace may be partial, and so may any record\n * inside one (`accountSettings.passkeys`, `dataTable.presets`): they are merged key\n * by key, at every depth. */\nexport type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: LabelOverride<UiKitLabels[K]> };\n\n/* ── English defaults for the namespaces defined here ────────────────────── */\n\n// They live in ./shared-labels, a module of words, as every component's defaults live in\n// its `*-labels.ts` (round 0.34). Imported and exported as this module's own, as each\n// component does with its defaults: the names, and where the README lists them, stay.\nexport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n};\n\n/* ── The provider ────────────────────────────────────────────────────────── */\n\ninterface KitI18n {\n labels?: UiKitLabelOverrides;\n locale?: string;\n weekStartsOn?: WeekDay;\n linkComponent?: KitLinkComponent;\n chartTooltipPlacement?: ChartTooltipPlacement;\n formatDate?: KitDateFormatter;\n tableStorageKeyPrefix?: string;\n timeZone?: string;\n documentTitleFormat?: string;\n appName?: string;\n}\n\n/** What a {@link KitDateFormatter} is told about the date it is formatting. */\nexport interface KitDateFormatContext {\n /**\n * How much of a date the string is: `\"day\"` — the `iso` is `\"YYYY-MM-DD\"`; `\"month\"` —\n * `\"YYYY-MM\"` (a `MonthPicker`); `\"year\"` — `\"YYYY\"` (`MonthPicker mode=\"year\"`).\n */\n unit: \"day\" | \"month\" | \"year\";\n /** Which kit surface asks: the trigger of a `DatePicker`, of a `DateRangePicker`\n * (called once per end), of a `MonthPicker`, or a `DateMark`. */\n source: \"datePicker\" | \"dateRangePicker\" | \"monthPicker\" | \"dateMark\";\n /** The locale the kit would have formatted in — the component's `locale` prop, else\n * the provider's — or `undefined` for the runtime's. */\n locale: string | undefined;\n /**\n * The kit's suggestion: whether this date stands alone where the day of the week\n * helps — `true` for a `DatePicker`'s trigger and a `DateMark`, `false` for the two\n * ends of a range (twice the width, in a sentence-like \"from – to\") and for a month\n * or a year. keksdose's rule, which this follows: *\"A date in a COLUMN carries the\n * weekday. A date in a SENTENCE does not.\"* (date-cell.tsx, dev#546). A formatter\n * is free to ignore it.\n */\n weekday: boolean;\n}\n\n/**\n * The app's ONE answer to \"what does a date look like here\" — keksdose K12. Returns the\n * text for an ISO date (see {@link KitDateFormatContext.unit} for the three shapes).\n * Return `\"\"` to fall back to the kit's own formatting for that date.\n */\nexport type KitDateFormatter = (iso: string, context: KitDateFormatContext) => string;\n\n/** Where a chart shows the values under the pointer — see `SeriesChartTooltip.placement`. */\nexport type ChartTooltipPlacement = \"cursor\" | \"above\" | \"below\" | \"auto\";\n\n/**\n * What every kit link receives: the anchor attributes the kit decided (href, class,\n * aria-current, handlers, children, ref). An app's router link maps them —\n * `({ href, ...p }) => <Link to={href} {...p} />` — ONCE, on the provider.\n *\n * `replace` is the one prop that is not an anchor attribute: see there. Map it\n * explicitly if your router link is not react-router's —\n * `({ href, replace, ...p }) => <Link to={href} replace={replace} {...p} />` — and never\n * spread it onto a DOM `<a>`, where React warns about an unknown attribute.\n */\nexport type KitLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n ref?: Ref<HTMLAnchorElement>;\n /**\n * Navigate by REPLACING the current history entry, so Back skips it — keksdose F1:\n * a one-shot URL (a magic-link landing, `?checkout=done`, a wizard's \"finish\" hop)\n * that must not come back when the user presses Back. Present ONLY when the kit link\n * was given `replace` (`true`), so a provider link that spreads its props onto a\n * plain `<a>` keeps working for every link that never asks for it. react-router's\n * `<Link>` takes the same prop, so `({ href, ...p }) => <Link to={href} {...p} />`\n * honours it with no change; any other router maps it to its own replace option.\n * The kit never puts it on a DOM element itself.\n */\n replace?: boolean;\n};\nexport type KitLinkComponent = (props: KitLinkProps) => ReactElement;\n\nconst KitI18nContext = createContext<KitI18n>({});\n\nexport interface UiKitProviderProps {\n /** Any part of {@link UiKitLabels}. Missing keys fall back to English. */\n labels?: UiKitLabelOverrides;\n /**\n * BCP 47 tag used by every kit component that formats something — dates, numbers,\n * month and weekday names, file sizes — when it is not handed a `locale` prop of\n * its own. Without a provider, and without a prop, those use the runtime default.\n */\n locale?: string;\n /**\n * The first day of the week (0 = Sunday, 1 = Monday …) for every calendar below —\n * `MiniCalendar` and the pickers built on it — that is not handed a `weekStartsOn`\n * of its own. Without it the week start follows `locale`'s week info.\n *\n * Separate from `locale` because the two are separate decisions: a German-built\n * app running in English (`locale=\"en\"`) would otherwise start its weeks on Sunday,\n * and switching it to `en-GB` to get Monday changes every date and number format.\n */\n weekStartsOn?: WeekDay;\n /**\n * The app's router link, used by every kit component that renders an in-app link\n * and was not handed its own `renderLink` — so `renderLink` stops being repeated on\n * each ListItem, Breadcrumbs, StatTile, Chip… (kastlan). A component's own\n * `renderLink` wins; external links and in-page `#anchor`s stay plain `<a>`, and a\n * hash-router `#/path` is handed to it like `/path` (see `pickLinkRenderer`).\n */\n linkComponent?: KitLinkComponent;\n /**\n * Where every `SeriesChart` below shows its tooltip when it does not say so itself\n * (`tooltip.placement`) — set once so an app's phone charts stop putting the box under\n * the reader's finger (keksdose #359). Default: `\"cursor\"`, the box that follows the\n * pointer, as before.\n */\n chartTooltipPlacement?: ChartTooltipPlacement;\n /**\n * How every kit date below is written, when the component is not told otherwise —\n * keksdose K12. keksdose has a date-format preference (Settings ▸ date format, feedback\n * #180) that is not the UI language, and a weekday in the UI language beside digits\n * in the preference's order (live #246, dev#546): two locales in one string, which\n * no `locale` + `Intl` options can say. Its `DateField` wraps every `DatePicker` to\n * pass `formatValue`, and its report range field formats both ends by hand; with this\n * set once on the provider, those wrappers thin to nothing.\n *\n * Used for the trigger text of `DatePicker`, `DateRangePicker` and `MonthPicker`\n * (month and year mode), and for `DateMark display=\"date\"`. A component's own\n * `formatValue` or `formatOptions` (`dateStyle` on a DateMark) wins: prop >\n * provider > the kit's `Intl` default, the order every kit setting resolves in. Left\n * out (or returning `\"\"`), everything formats exactly as before.\n *\n * Keep it stable (`useCallback`, or a module function): it is in the provider's\n * context value, so a new function every render re-renders every consumer.\n */\n formatDate?: KitDateFormatter;\n /**\n * The `localStorage` prefix every kit table below keeps its view under (sort, filters,\n * page size, widths, hidden columns), when the table is not handed a\n * `storageKeyPrefix` of its own — round 0.34 C5, KS U4. Left out, it is the kit's\n * `\"hbui-table:\"`, as before.\n *\n * Set once here rather than per table because not every table is the app's to pass a\n * prop to: `TranslationReviewPanel` wraps a `DataTable`, and until this the panel's\n * view landed under the kit's prefix whatever the app's was — so an app that lists\n * what it stores (a privacy page) had to list the kit's prefix as a key of its own.\n * Resolves like every kit setting: the table's own prop > this > the default. The\n * key is the prefix plus the table's `storageKey`, verbatim, so an app that wrapped\n * `DataTable` to pass its prefix (Keksdose's `keksdose-table:`) keeps every stored\n * view when it moves the prefix here.\n */\n tableStorageKeyPrefix?: string;\n /**\n * 0.46 (docs/notifications-harmonization.md §10.3): the IANA zone (\"Europe/Zurich\") every\n * TIMESTAMP below is shown in through `useKitFormat().formatDate` /\n * `formatRelativeTime`, when the call names none — the account's picked zone, for an app\n * that shows times in it. A bare \"YYYY-MM-DD\" is never shifted (a calendar day is the day\n * it names in every zone). Left out, timestamps follow the device, as before.\n */\n timeZone?: string;\n /**\n * 0.49 KIT-9: how `useDocumentTitle` and every `PageHeader`'s `h1` write the window's\n * title, from `{page}`, `{section}` and `{app}`. Default\n * `\"{page} · {section} · {app}\"` (`DEFAULT_DOCUMENT_TITLE_FORMAT`); a missing part\n * drops with its separator.\n */\n documentTitleFormat?: string;\n /** 0.49 KIT-9: the app's name, the `{app}` of the window's title (\"Kastlan\"). Left\n * out, titles end at the page or section. */\n appName?: string;\n /**\n * 0.49 KIT-1b: while a person copies a selection in the page, a U+2212 minus standing\n * before a number (\"−CHF 1,250.50\") goes to the clipboard as \"-\", in `text/plain` and\n * `text/html` (what Excel pastes), so a spreadsheet reads a number; the page keeps \"−\".\n * A copy out of an input, a textarea or an editable element is left alone. Installed\n * once per document, by the first provider that has it on. Default `true`; `false` on\n * the outermost provider leaves the clipboard to the browser.\n */\n copyAsciiMinus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Hand every kit component below this point its strings and its locale.\n *\n * Optional: a component outside any provider behaves exactly as it did before the\n * provider existed. Nesting works as a merge — an inner provider overrides only what\n * it names, so a page can re-label one table's `dataTable.table` without restating\n * the language.\n */\nexport function UiKitProvider({\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n documentTitleFormat,\n appName,\n copyAsciiMinus = true,\n children,\n}: UiKitProviderProps) {\n const outer = useContext(KitI18nContext);\n const value = useMemo<KitI18n>(\n () => ({\n locale: locale ?? outer.locale,\n weekStartsOn: weekStartsOn ?? outer.weekStartsOn,\n labels: mergeOverrides(outer.labels, labels),\n linkComponent: linkComponent ?? outer.linkComponent,\n chartTooltipPlacement: chartTooltipPlacement ?? outer.chartTooltipPlacement,\n formatDate: formatDate ?? outer.formatDate,\n tableStorageKeyPrefix: tableStorageKeyPrefix ?? outer.tableStorageKeyPrefix,\n timeZone: timeZone ?? outer.timeZone,\n documentTitleFormat: documentTitleFormat ?? outer.documentTitleFormat,\n appName: appName ?? outer.appName,\n }),\n [\n outer,\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n documentTitleFormat,\n appName,\n ],\n );\n useTableViewsJoin(value.tableStorageKeyPrefix ?? DEFAULT_TABLE_STORAGE_KEY_PREFIX);\n useClipboardMinus(copyAsciiMinus);\n return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;\n}\n\n/** The kit's own table prefix: `DEFAULT_PERSIST_PREFIX` of components/use-table-state,\n * restated because that module imports the router (a test pins the two equal). */\nconst DEFAULT_TABLE_STORAGE_KEY_PREFIX = \"hbui-table:\";\n\n/**\n * Reset this device's settings (docs/settings-harmonization.md §11.4): the tables below a\n * provider keep their views under its prefix, so the provider joins the registry with\n * that prefix — a view, no `reset`, since a table reads its view when it next mounts —\n * while it is mounted. Nested providers with one prefix hold one entry.\n *\n * Through a literal `import()`, not a static import: every catalogue reaches this module,\n * and a catalogue may reach nothing outside i18n/ (scripts/check-module-graph.mjs,\n * english-catalogue-graph.test.ts). The theme stores and the shell import the registry\n * statically, so it is loaded already and the join lands a microtask after the mount.\n */\nfunction useTableViewsJoin(prefix: string): void {\n useEffect(() => {\n let leave: (() => void) | undefined;\n let gone = false;\n import(\"../lib/device-settings\").then(\n ({ registerDeviceSetting }) => {\n if (!gone) leave = registerDeviceSetting({ key: prefix, prefix: true, kind: \"view\" });\n },\n // A module of the kit's own that fails to load has nothing to join; the provider\n // and its tables work as before.\n () => undefined,\n );\n return () => {\n gone = true;\n leave?.();\n };\n }, [prefix]);\n}\n\n/**\n * The copy handler (lib/clipboard-minus, 0.49 KIT-1b), through a literal `import()` for\n * the reason {@link useTableViewsJoin} gives: a catalogue may reach nothing outside i18n/.\n * It is in place a microtask after the mount — long before a person selects and copies.\n */\nfunction useClipboardMinus(on: boolean): void {\n useEffect(() => {\n if (!on || typeof document === \"undefined\") return;\n let uninstall: (() => void) | undefined;\n let gone = false;\n import(\"../lib/clipboard-minus\").then(\n ({ installClipboardMinus }) => {\n if (!gone) uninstall = installClipboardMinus(document);\n },\n // Not loaded: copying works as the browser does it.\n () => undefined,\n );\n return () => {\n gone = true;\n uninstall?.();\n };\n }, [on]);\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/** A record of labels to merge into — not a React element, which is an object too but\n * is a label given whole. */\nfunction isLabelRecord(v: unknown): v is Record<string, unknown> {\n return isRecord(v) && !(\"$$typeof\" in v);\n}\n\n/** Merged key by key at EVERY depth — a namespace, a record inside it\n * (`accountSettings.passkeys`, `dataTable.presets`), and so on down — to match\n * {@link LabelOverride}. An `undefined` is skipped at every depth, so it never blanks\n * out what is under it. */\nfunction mergeNamespace<T extends object>(base: T, over: LabelOverride<T> | Partial<T> | undefined): T {\n if (!over) return base;\n const out = { ...base } as Record<string, unknown>;\n for (const [k, v] of Object.entries(over)) {\n if (v === undefined) continue;\n const prev = out[k];\n out[k] = isLabelRecord(prev) && isLabelRecord(v) ? mergeNamespace(prev, v) : v;\n }\n return out as T;\n}\n\nfunction mergeOverrides(\n a: UiKitLabelOverrides | undefined,\n b: UiKitLabelOverrides | undefined,\n): UiKitLabelOverrides | undefined {\n if (!a) return b;\n if (!b) return a;\n const out: Record<string, unknown> = { ...a };\n for (const [ns, v] of Object.entries(b)) {\n out[ns] = mergeNamespace((out[ns] as object | undefined) ?? {}, v as object);\n }\n return out as UiKitLabelOverrides;\n}\n\n/**\n * What the nearest provider says about one namespace — `undefined` outside one. Nested\n * providers' words come merged, at every depth; no English default is filled in.\n *\n * A {@link LabelOverride}, partial at every depth, like the components' `labels` props\n * that take it: a provider that names one key of a section (`accountSettings.passkeys`)\n * or one preset (`dataTable.presets`) hands over just that (round 0.35 R3 — until then\n * it was typed partial at the top only, so a nested section read as complete).\n *\n * For a component whose own resolver does more than a merge (the data table derives\n * `columnsCount` from `columns`): merge the component's prop over it — a record key by\n * key — and feed the result to that resolver.\n */\nexport function useKitLabelOverrides<K extends keyof UiKitLabels>(\n ns: K,\n): LabelOverride<UiKitLabels[K]> | undefined {\n return useContext(KitI18nContext).labels?.[ns];\n}\n\n/**\n * One namespace, resolved: `defaults`, then the provider, then the component's own\n * `prop`. Record-valued keys are merged key by key at each step — so `prop` is a\n * {@link LabelOverride}, partial at every depth as the provider's labels are, and a\n * component's `labels` prop, typed the same, is handed over without a cast (refactor\n * audit 2026-10, API-9).\n */\nexport function useKitLabels<K extends keyof UiKitLabels>(\n ns: K,\n defaults: UiKitLabels[K],\n prop?: LabelOverride<UiKitLabels[K]>,\n): UiKitLabels[K] {\n const fromProvider = useKitLabelOverrides(ns);\n return useMemo(\n () => mergeNamespace(mergeNamespace(defaults, fromProvider), prop),\n [defaults, fromProvider, prop],\n );\n}\n\n/** The component's own `locale` prop, else the provider's, else `undefined` (which\n * every `Intl` API reads as \"the runtime's default\"). */\nexport function useKitLocale(prop?: string): string | undefined {\n const fromProvider = useContext(KitI18nContext).locale;\n return prop ?? fromProvider;\n}\n\n/** The week start the nearest `<UiKitProvider weekStartsOn>` pins, else `undefined`\n * (the caller then asks the locale). A component's own prop goes first:\n * `prop ?? useKitWeekStart()`. */\n/** The provider's router link, or `undefined` — a component's own `renderLink` should\n * win over it: `const Link = renderLink ?? useKitLink()`. */\nexport function useKitLink(): KitLinkComponent | undefined {\n return useContext(KitI18nContext).linkComponent;\n}\n\nexport function useKitWeekStart(): WeekDay | undefined {\n return useContext(KitI18nContext).weekStartsOn;\n}\n\n/** The provider's `chartTooltipPlacement`, or `undefined` — a chart's own prop wins. */\nexport function useKitChartTooltipPlacement(): ChartTooltipPlacement | undefined {\n return useContext(KitI18nContext).chartTooltipPlacement;\n}\n\n/** The nearest provider's `formatDate`, or `undefined` — a component's own\n * `formatValue` / `formatOptions` wins over it. See {@link KitDateFormatter}. */\nexport function useKitDateFormatter(): KitDateFormatter | undefined {\n return useContext(KitI18nContext).formatDate;\n}\n\n/** The nearest provider's `tableStorageKeyPrefix`, or `undefined` — a table's own\n * `storageKeyPrefix` wins over it, and the kit's `\"hbui-table:\"` comes after both. */\nexport function useKitTableStorageKeyPrefix(): string | undefined {\n return useContext(KitI18nContext).tableStorageKeyPrefix;\n}\n\n/** The nearest provider's `timeZone` (0.46), or `undefined` — the device's. A call's own\n * `timeZone` wins over it. */\nexport function useKitTimeZone(): string | undefined {\n return useContext(KitI18nContext).timeZone;\n}\n\n/** The nearest provider's `documentTitleFormat` and `appName`, or `undefined` each —\n * what `useDocumentTitle` writes with (the format's default is\n * `DEFAULT_DOCUMENT_TITLE_FORMAT`, applied there: this module reaches nothing outside\n * i18n/). */\nexport function useKitDocumentTitle(): { format: string | undefined; appName: string | undefined } {\n const { documentTitleFormat, appName } = useContext(KitI18nContext);\n return { format: documentTitleFormat, appName };\n}\n\n/** {@link DEFAULT_FILE_LABELS}, but formatting in the provider's locale. */\nexport function useKitFileLabels(prop?: Partial<FileLabels>): FileLabels {\n const locale = useKitLocale();\n const defaults = useMemo<FileLabels>(\n () => ({ size: (bytes) => formatFileSize(bytes, locale) }),\n [locale],\n );\n return useKitLabels(\"file\", defaults, prop);\n}\n\n/**\n * The dot paths of every key `labels` does NOT supply — the ones a translated app is\n * still showing in English. Assert on it in the app's own test:\n *\n * expect(missingKitLabels(labels, DEFAULT_UI_KIT_LABELS)).toEqual([]);\n *\n * `reference` is the complete tree to check against — pass\n * {@link DEFAULT_UI_KIT_LABELS} (src/i18n/defaults.ts). It is a parameter rather than an import\n * because the defaults live beside their components, and this module is imported BY\n * those components. Left out (a test file is not type-checked), it throws saying so\n * rather than \"Cannot convert undefined or null to object\" (keksdose, 0.18).\n */\nexport function missingKitLabels(\n labels: UiKitLabelOverrides | undefined,\n reference: UiKitLabels,\n): string[] {\n if (!isRecord(reference)) {\n throw new TypeError(\n \"missingKitLabels(labels, reference): pass DEFAULT_UI_KIT_LABELS as the reference — \" +\n \"it is the tree the labels are checked against.\",\n );\n }\n const missing: string[] = [];\n for (const [ns, keys] of Object.entries(reference)) {\n const given = (labels as Record<string, Record<string, unknown> | undefined> | undefined)?.[ns];\n for (const [key, value] of Object.entries(keys as Record<string, unknown>)) {\n const got = given?.[key];\n if (got === undefined) {\n missing.push(`${ns}.${key}`);\n } else if (isRecord(value) && isRecord(got)) {\n for (const sub of Object.keys(value)) {\n if (got[sub] === undefined) missing.push(`${ns}.${key}.${sub}`);\n }\n }\n }\n }\n return missing;\n}\n"],"mappings":";AA+wBS;AA/wBT,SAAS,eAAe,YAAY,WAAW,eAAe;AAC9D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAwmBP,MAAM,iBAAiB,cAAuB,CAAC,CAAC;AA6GzC,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACj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S,KAAK,KAAK,SAAS,GAAG,GAAG;AAC3C,mBAAW,OAAO,OAAO,KAAK,KAAK,GAAG;AACpC,cAAI,IAAI,GAAG,MAAM,OAAW,SAAQ,KAAK,GAAG,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;AAAA,QAChE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/i18n/kit-labels.tsx"],"sourcesContent":["import { createContext, useContext, useEffect, useMemo } from \"react\";\nimport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n} from \"./shared-labels\";\nimport type { AnchorHTMLAttributes, ReactElement, Ref } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { DataTableLabels } from \"../components/data-table-labels\";\nimport type { MiniCalendarLabels, WeekDay } from \"../components/mini-calendar\";\nimport type { CalendarHeatmapLabels } from \"../components/calendar-heatmap\";\nimport type { PopoverLabels } from \"../components/popover\";\nimport type { ChipInputLabels } from \"../components/chip\";\nimport type { FieldSyncLabels } from \"../components/field-sync\";\nimport type { CharacterCountLabels, PasswordRevealLabels } from \"../components/field-base\";\nimport type { TabsLabels } from \"../components/tabs\";\nimport type { WizardLabels } from \"../wizard/types\";\nimport type { TourLabels } from \"../tour/tour\";\nimport type { TourCatalogueLabels } from \"../tour/tour-catalogue-labels\";\nimport type { TourGuideLabels } from \"../tour/tour-guide-labels\";\nimport type { CommandPaletteLabels } from \"../search/command-palette\";\nimport type { GlobalSearchLabels } from \"../search/global-search\";\nimport type { MonthPickerLabels } from \"../components/month-picker\";\nimport type { PageContentsLabels } from \"../components/page-contents\";\nimport type { SeriesChartLabels } from \"../components/series-chart-labels\";\nimport type { PieChartLabels } from \"../components/pie-chart-labels\";\nimport type { SparklineLabels } from \"../components/sparkline\";\nimport type { StatTileLabels } from \"../components/stat-tile\";\nimport type { SignaturePadLabels } from \"../components/signature-pad\";\nimport type { PasswordStrengthLabels } from \"../components/password-strength\";\nimport type { DangerConfirmLabels } from \"../components/danger-confirm\";\nimport type { SwatchPickerLabels } from \"../components/swatch-picker\";\nimport type { IconPickerLabels } from \"../components/icon-picker\";\nimport type { DialogFrameLabels } from \"../components/dialog-frame\";\nimport type { FilePickerLabels } from \"../components/file-button\";\nimport type { MeasuredGridLabels } from \"../components/measured-grid\";\nimport type { FeedbackAttachmentFieldLabels } from \"../feedback/feedback-attachment\";\nimport type { FeedbackDialogTextLabels } from \"../feedback/feedback-dialog\";\nimport type { FeedbackComposerLabels, FeedbackThreadLabels } from \"../feedback/feedback-thread\";\nimport type { FeedbackCategoryLabels, FeedbackStatusLabels, FeedbackToastLabels } from \"../feedback/feedback-labels\";\nimport type { FeedbackMenuLabels } from \"../feedback/feedback-menu\";\nimport type { FeedbackPublicLabels } from \"../feedback/feedback-public-labels\";\nimport type { FeedbackNotificationTypesLabels } from \"../notifications/feedback-notification-types-labels\";\nimport type { FeedbackContextLabels } from \"../feedback/feedback-context\";\nimport type { FeedbackPageLabels } from \"../feedback/feedback-table\";\nimport type { FeedbackDetailLabels } from \"../feedback/feedback-row-detail\";\nimport type { FeedbackVoteLabels } from \"../feedback/feedback-vote-button\";\nimport type { FeedbackCommentsLabels } from \"../feedback/feedback-comment-thread\";\nimport type { FeedbackRepliesLabels } from \"../feedback/feedback-replies\";\nimport type { AccountSettingsLabels } from \"../account/account-settings-labels\";\nimport type { ConfirmDialogLabels } from \"../components/confirm-dialog\";\nimport type { FloatingPanelLabels } from \"../components/floating-panel\";\nimport type { CopyButtonLabels } from \"../components/copy-button\";\nimport type { BulkActionBarLabels } from \"../components/bulk-action-bar\";\nimport type { ListLabels } from \"../components/list\";\nimport type { BreadcrumbsLabels } from \"../components/breadcrumbs\";\nimport type { ToastLabels } from \"../components/toast\";\nimport type { FormActionsLabels } from \"../components/form-actions\";\nimport type { DescriptionListLabels } from \"../components/description-list\";\nimport type { LineItemsLabels } from \"../components/line-items\";\nimport type { ProgressBarLabels } from \"../components/progress-bar\";\nimport type { SignedAmountLabels } from \"../components/signed-amount\";\nimport type { ErrorBoundaryLabels } from \"../components/error-boundary\";\nimport type { AuthedImageLabels } from \"../components/authed-image\";\nimport type { ImageGridLabels } from \"../components/image-grid\";\nimport type { LightboxLabels } from \"../components/lightbox\";\nimport type { WriteLockLabels } from \"../components/write-lock\";\nimport type { LegalLabels } from \"../components/legal\";\nimport type { SignInLabels } from \"../auth/sign-in-form\";\nimport type { RegisterLabels } from \"../auth/register-form\";\nimport type { CompleteNameLabels } from \"../auth/complete-name-dialog\";\nimport type { ForgotPasswordLabels } from \"../auth/forgot-password-form\";\nimport type { ResetPasswordLabels } from \"../auth/reset-password-form\";\nimport type { VerifyEmailLabels } from \"../auth/verify-email\";\nimport type { NotFoundLabels } from \"../auth/not-found-page\";\nimport type { AcceptInvitationLabels } from \"../auth/accept-invitation\";\nimport type { CompanySwitcherLabels } from \"../shell/company-switcher\";\nimport type { EmailChangeLabels } from \"../account/email-change-setting\";\nimport type { SessionsLabels } from \"../account/sessions-setting\";\nimport type { DeleteAccountLabels } from \"../account/delete-account-setting\";\nimport type { DataExportLabels } from \"../account/data-export-setting\";\nimport type { UserRosterLabels } from \"../admin/user-roster\";\nimport type { RoleSelectLabels } from \"../admin/role-select\";\nimport type { ReviewerScopeLabels } from \"../admin/reviewer-scope-editor\";\nimport type { AdminActionLabels } from \"../admin/admin-action-confirm\";\nimport type { AdminActionLogLabels } from \"../admin/admin-action-log\";\nimport type { TransferOwnershipLabels } from \"../admin/transfer-ownership-dialog\";\nimport type { InvitationsLabels } from \"../admin/invitations-panel\";\nimport type { SettingsLabels } from \"../settings/settings-labels\";\nimport type { LandingLabels } from \"../landing/landing-labels\";\nimport type { DemoLabels } from \"../demo/demo-labels\";\nimport type { BillingLabels } from \"../billing/billing-labels\";\nimport type { PlanChangeLabels } from \"../admin/plan-change\";\nimport type { AppearanceLabels } from \"../components/appearance-labels\";\nimport type { DeviceResetLabels } from \"../settings/device-reset-setting\";\nimport type { RowActionsLabels } from \"../components/row-actions\";\nimport type { AppShellMoreLabels } from \"../shell/app-shell\";\nimport type { AccountStateLabels } from \"../components/account-chips\";\nimport type { ShareCardLabels } from \"../components/share-card\";\nimport type { ReauthDialogLabels } from \"../components/reauth-dialog\";\nimport type { ServerWakeLabels } from \"../components/server-wake\";\nimport type { TranslationReviewLabels } from \"../components/translation-review-labels\";\nimport type { CountrySelectLabels } from \"../components/country-select\";\nimport type { InlineEditLabels } from \"../components/inline-edit-field\";\nimport type { IbanInputLabels } from \"../components/iban-input\";\nimport type { PhoneInputLabels } from \"../components/phone-input\";\nimport type { SignChipLabels } from \"../components/sign-chip\";\nimport type { ColumnMapperLabels } from \"../components/column-mapper\";\nimport type { NotificationsLabels } from \"../notifications/notifications-labels\";\nimport type { AdminAreaLabels } from \"../admin/admin-area-labels\";\nimport type { MailTestCardLabels } from \"../admin/mail-test-card\";\nimport type { TopBarPartsLabels } from \"../shell/top-bar-parts-labels\";\nimport type { SignOutPendingDialogLabels } from \"../offline/sign-out-pending-dialog\";\nimport type { PwaUpdatePromptLabels } from \"../offline/pwa-update-prompt\";\nimport type { SharedComputerLabels } from \"../offline/shared-computer\";\n\n/**\n * EVERY string the kit renders, as one typed tree — and an optional provider that\n * hands it to every component at once.\n *\n * WHY THIS EXISTS. The kit renders only labels; it ships seven catalogues (since 0.7.0,\n * `@eifi1/ui-kit/i18n/<code>`); the app decides the language and hands the words in.\n * What was wrong was HOW it had to hand them in —\n * one `labels` prop per component instance, under a different prop name per\n * component (`labels`, `calendarLabels`, `passwordLabels`, `clearLabel`,\n * `searchPlaceholder`, `ariaLabel` …). A translated app therefore rendered English\n * wherever one call site forgot one prop, and nothing told it so: a German showcase\n * still said \"Rows per page\", \"Collapse sidebar\" and \"Popover\" in seven languages.\n *\n * Now there is one key per string, addressed by a dot path (`dataTable.pageSize`,\n * `datePicker.today`), and three sources in a fixed order of precedence:\n *\n * the component's own prop > <UiKitProvider labels> > English default\n *\n * A consumer loads a shipped catalogue (`loadUiKitLabels(code)`) or writes its own\n * `UiKitLabels` (or a partial of one), mounts `<UiKitProvider labels={…} locale={…}>`\n * at the root, and every kit component\n * below speaks that language — including the ones nested inside other kit components\n * (the calendar inside the data table's date filter, the popover inside the date\n * picker), which no prop at the outer call site could reach before.\n *\n * Messages that carry a value are FUNCTIONS of that value, never a template to fill:\n * a number glued into an English sentence is untranslatable, because the grammar\n * around it moves with it in most languages.\n */\n\n/* ── Namespaces that had no labels type of their own ─────────────────────── */\n\n/** The words several components share. A component's own namespace wins over these\n * where both exist; these are what a new component reaches for first. */\nexport interface CommonLabels {\n close: string;\n clear: string;\n search: string;\n done: string;\n cancel: string;\n save: string;\n back: string;\n next: string;\n remove: string;\n loading: string;\n noResults: string;\n /** \"Name: value\" — how a field's accessible name is composed with its value.\n * A colon-and-space is not universal punctuation (French puts a space before\n * the colon, Chinese uses a full-width one). */\n fieldValue: (field: string, value: string) => string;\n /** The × that puts away a banner or a notice (`AlertBanner onDismiss`). Not `close`:\n * nothing opened, and \"Close\" on a banner reads as closing the page it sits on. */\n dismiss: string;\n /** Read after a link that opens a new tab (`<Button href external>`, TextLink):\n * nothing else tells a screen reader the page is about to change tabs. */\n opensInNewTab: string;\n /** The name of a field's `help` \"?\" and its panel (round 0.36): \"About “<field>”\", the\n * field's label as the argument, quoted so a capitalised label reads as a name — \"About\n * “Jerk shape”\" (round 0.37; the other locales quoted it already). A `HelpPopover`\n * passed as `help` keeps its own name. */\n aboutField: (field: string) => string;\n /** …and of a `help` \"?\" on a field with no label and no `aria-label` to name it by. */\n help: string;\n /** 0.48: the toggle that shows the rest of a clamped text (`AlertBanner clampMobile`)… */\n showMore: string;\n /** …and folds it back to its one line. */\n showLess: string;\n}\n\n/** `DatePicker` / `DateRangePicker` chrome. The calendar inside has its own\n * namespace, `miniCalendar`. */\nexport interface DatePickerLabels {\n /** Accessible name of the popover panel the calendar opens in. */\n panel: string;\n /** The same, for `DateRangePicker`'s panel. */\n rangePanel: string;\n clear: string;\n previousDay: string;\n nextDay: string;\n today: string;\n /** `DateRangePicker commit=\"apply\"`: the button that commits the drafted range. */\n apply: string;\n /** …and the one that discards it. */\n cancel: string;\n /** Accessible name of `DateRangePicker`'s preset column. */\n presets: string;\n}\n\n/** The whole combobox family: `Combobox`, `EntityCombobox`,\n * `MultiEntityCombobox`, `InlineEntityCombobox`, `Autocomplete`. */\nexport interface ComboboxLabels {\n search: string;\n noResults: string;\n clear: string;\n loading: string;\n /** The \"add this\" row when free entry is allowed. */\n create: (query: string) => string;\n /** Trigger summary once more than one value is picked. */\n selectedCount: (count: number) => string;\n /** An async lookup (`loadOptions`) failed. */\n loadError: string;\n /** Announced (live region) when the list settles on `count` > 0 rows. */\n resultCount: (count: number) => string;\n /** The query is shorter than the `minChars` a lookup needs. */\n minChars: (count: number) => string;\n}\n\nexport interface MultiSelectLabels {\n search: string;\n selectAll: string;\n clear: string;\n /** Trigger text when nothing is picked, which a multi-select reads as \"all\". */\n all: string;\n /** Trigger summary once some (but not all) values are picked. The English\n * default is the bare count, which is what the trigger has always shown. */\n selectedCount: (count: number) => string;\n}\n\n/** `CalculatorButton` (desktop popover keypad) and `NumberPadSheet` (phone sheet). */\nexport interface CalculatorLabels {\n /** The button that opens the calculator. */\n open: string;\n /** The popover / sheet itself. */\n panel: string;\n calculation: string;\n backspace: string;\n clear: string;\n equals: string;\n /** The primary key of the phone pad — visible text, not an aria-label. */\n done: string;\n /** Names of the operator keys and the decimal key. Their glyphs are not names a\n * screen reader agrees on — \"÷\" is read as \"division sign\", \"divided by\" or\n * nothing at all depending on the reader — so each says what it does. */\n plus: string;\n minus: string;\n times: string;\n divide: string;\n decimal: string;\n}\n\n/** `CurrencySelect` and the currency half of `AmountInput`. */\nexport interface CurrencyLabels {\n currency: string;\n search: string;\n}\n\nexport interface AppShellLabels {\n collapse: string;\n expand: string;\n /** Accessible name of an inline group's disclosure button (`subNav=\"inline\"`). */\n toggleGroup: (groupLabel: string) => string;\n}\n\nexport interface TopBarLabels {\n theme: string;\n palette: string;\n language: string;\n /** 0.49 KIT-10: the language menu's trigger, given the current language's name —\n * \"Choose language, current: Deutsch\". */\n languageCurrent: (name: string) => string;\n switchRole: string;\n /** The role switcher's tooltip, given the active role's name. */\n role: (value: string) => string;\n}\n\nexport interface PickerSheetLabels {\n close: string;\n /** The sticky footer button that closes a multi-select sheet once the rows are ticked\n * (0.40) — the ticks are already applied, so it confirms rather than saves. */\n done: string;\n}\n\nexport interface SwipeableRowLabels {\n actions: string;\n}\n\nexport interface FileLabels {\n /** A file size for display, given its size in BYTES. The default uses\n * `Intl.NumberFormat`'s unit formatting in the provider's locale. */\n size: (bytes: number) => string;\n}\n\n/** The complete tree. `UiKitProvider` takes any partial of it. */\nexport interface UiKitLabels {\n common: CommonLabels;\n dataTable: DataTableLabels;\n miniCalendar: MiniCalendarLabels;\n calendarHeatmap: CalendarHeatmapLabels;\n datePicker: DatePickerLabels;\n monthPicker: MonthPickerLabels;\n popover: PopoverLabels;\n combobox: ComboboxLabels;\n multiSelect: MultiSelectLabels;\n calculator: CalculatorLabels;\n currency: CurrencyLabels;\n chipInput: ChipInputLabels;\n fieldSync: FieldSyncLabels;\n passwordReveal: PasswordRevealLabels;\n tabs: TabsLabels;\n appShell: AppShellLabels;\n pageContents: PageContentsLabels;\n topBar: TopBarLabels;\n pickerSheet: PickerSheetLabels;\n swipeableRow: SwipeableRowLabels;\n file: FileLabels;\n wizard: WizardLabels;\n tour: TourLabels;\n /** 0.43.0: the tours page — `TourCatalogue` and its card (docs/tours-harmonization.md §3). */\n tourCatalogue: TourCatalogueLabels;\n /** 0.50: the form's \"Guide me\" — `TourGuideButton` (docs/tours-harmonization.md §11). */\n tourGuide: TourGuideLabels;\n commandPalette: CommandPaletteLabels;\n globalSearch: GlobalSearchLabels;\n seriesChart: SeriesChartLabels;\n pieChart: PieChartLabels;\n sparkline: SparklineLabels;\n statTile: StatTileLabels;\n signaturePad: SignaturePadLabels;\n passwordStrength: PasswordStrengthLabels;\n dangerConfirm: DangerConfirmLabels;\n swatchPicker: SwatchPickerLabels;\n iconPicker: IconPickerLabels;\n dialogFrame: DialogFrameLabels;\n filePicker: FilePickerLabels;\n measuredGrid: MeasuredGridLabels;\n feedbackAttachment: FeedbackAttachmentFieldLabels;\n /** 0.12.0: `FeedbackDialog`'s own strings; `FeedbackThread` / `FeedbackComposer`. */\n feedbackDialog: FeedbackDialogTextLabels;\n feedbackThread: FeedbackThreadLabels;\n feedbackComposer: FeedbackComposerLabels;\n /** 0.27.0: the feedback harmonisation (docs/feedback-harmonization.md §4) — a report's\n * status and category words, keyed by the enum value; the toasts a feedback page\n * shows; `FeedbackMenu`; `FeedbackContextBox`; the two pages' table; the row detail.\n * keksdose's wording is the canon, in every language. */\n feedbackStatus: FeedbackStatusLabels;\n feedbackCategory: FeedbackCategoryLabels;\n feedbackToast: FeedbackToastLabels;\n feedbackMenu: FeedbackMenuLabels;\n /** 0.38.0: the public feedback pages — `FeedbackPublicList`, `FeedbackPublicDetail`,\n * `FeedbackPublicSwitch` (docs/feedback-harmonization.md §9.15). */\n feedbackPublic: FeedbackPublicLabels;\n /** 0.38.0: `useFeedbackNotificationTypes` — the two feedback types' setting words\n * (§9.11). */\n feedbackNotificationTypes: FeedbackNotificationTypesLabels;\n feedbackContext: FeedbackContextLabels;\n feedbackPage: FeedbackPageLabels;\n feedbackDetail: FeedbackDetailLabels;\n /** 0.38.0: public feedback (docs/feedback-harmonization.md §9.15) — the vote button,\n * the comment thread, the replies' timeline and composer. */\n feedbackVote: FeedbackVoteLabels;\n feedbackComments: FeedbackCommentsLabels;\n feedbackReplies: FeedbackRepliesLabels;\n /** 0.12.0: `ProfileSetting`, `PasswordSetting`, `TwoFactorSetting`, `PasskeysSetting`\n * — one record per section. The provider takes a whole section record; the\n * components merge it key by key, as a prop. */\n accountSettings: AccountSettingsLabels;\n confirmDialog: ConfirmDialogLabels;\n floatingPanel: FloatingPanelLabels;\n copyButton: CopyButtonLabels;\n bulkActionBar: BulkActionBarLabels;\n list: ListLabels;\n breadcrumbs: BreadcrumbsLabels;\n toast: ToastLabels;\n form: FormActionsLabels;\n descriptionList: DescriptionListLabels;\n lineItems: LineItemsLabels;\n progressBar: ProgressBarLabels;\n signedAmount: SignedAmountLabels;\n errorBoundary: ErrorBoundaryLabels;\n authedImage: AuthedImageLabels;\n imageGrid: ImageGridLabels;\n lightbox: LightboxLabels;\n /** 0.18.0: `WriteLockProvider`'s fallback reason, `AccountStateChip`, `SharePanel` /\n * `ShareCard` / `ShareDialog`, `ReauthDialog`. */\n writeLock: WriteLockLabels;\n accountState: AccountStateLabels;\n shareCard: ShareCardLabels;\n reauthDialog: ReauthDialogLabels;\n /** 0.18.0: `ServerWakeNotice` — keksdose's cold-start notice, for every app. */\n serverWake: ServerWakeLabels;\n /** 0.19.0: the translation-review parts (`TranslationReviewPanel`, its editor, chip,\n * progress, locale tabs and export) — keksdose's /translations, for every app. */\n translationReview: TranslationReviewLabels;\n /** 0.19.0: `LegalLinks`' navigation name. 0.28.0: every kit-owned word of the legal\n * pages — the link labels, titles, back link, terms checkbox and notices, and the\n * sections that are the same in every app, filled in with the app's operator\n * (docs/legal-harmonization.md §4.3/§4.4). */\n legal: LegalLabels;\n /** 0.29.0: sign-in form: credentials, passkey, 2FA, forced new password (docs/auth-harmonization.md §5). */\n signIn: SignInLabels;\n /** 0.29.0: the sign-up form, with the +app address tag (§4.1, §4.5). */\n register: RegisterLabels;\n /** 0.29.0: asking a migrated account for first and last name once (§3.3). */\n completeName: CompleteNameLabels;\n /** 0.29.0: requesting a reset link (always the same answer). */\n forgotPassword: ForgotPasswordLabels;\n /** 0.29.0: choosing a new password from a reset link; not a sign-in (§6.3). */\n resetPassword: ResetPasswordLabels;\n /** 0.29.0: the verify-email page and the unverified banner. */\n verifyEmail: VerifyEmailLabels;\n /** 0.29.0: the 404 page. */\n notFound: NotFoundLabels;\n /** 0.29.0: accepting an invitation with an account (§4.4). */\n acceptInvitation: AcceptInvitationLabels;\n /** 0.29.0: kastlan's switcher between a user's companies (§5.3). */\n companySwitcher: CompanySwitcherLabels;\n /** 0.30.0: changing the account's address with re-verification (docs/user-admin-harmonization.md §6.2). */\n emailChange: EmailChangeLabels;\n /** 0.30.0: sign out everywhere, and kastlan's device list (§6.3). */\n sessions: SessionsLabels;\n /** 0.30.0: deletion in two stages (§6.4). */\n deleteAccount: DeleteAccountLabels;\n /** 0.30.0: the self-service JSON export (§6.5). */\n dataExport: DataExportLabels;\n /** 0.30.0: the admin user list's columns (§3). */\n userRoster: UserRosterLabels;\n /** 0.30.0: picking one or several roles, with the reasons a choice is locked (§4.1). */\n roleSelect: RoleSelectLabels;\n /** 0.30.0: a translation reviewer's languages and areas. */\n reviewerScope: ReviewerScopeLabels;\n /** 0.30.0: an admin action's confirmation and refusals (§4.2). */\n adminAction: AdminActionLabels;\n /** 0.30.0: the admin_actions list (§4.3). */\n adminActionLog: AdminActionLogLabels;\n /** 0.30.0: handing an account's work to another (Kurvenschmiede). */\n transferOwnership: TransferOwnershipLabels;\n /** 0.30.0: the invitations panel (§5). */\n invitations: InvitationsLabels;\n /** 0.31.0: the settings and admin pages' shell (docs/settings-harmonization.md §4.3). */\n settings: SettingsLabels;\n /** 0.31.0: the public landing page's kit words (docs/landing-demo-harmonization.md §4). */\n landing: LandingLabels;\n /** 0.31.0: the demo's start, banner and end (§5). */\n demo: DemoLabels;\n /** 0.32.0: plans, standing, banners and the limit notice (docs/billing-harmonization.md §7). */\n billing: BillingLabels;\n /** 0.33.0: the operator's plan parts — `planColumn`, `PlanChangeConfirm` and the\n * lines of `usePlanChangeResult` (docs/billing-harmonization.md §14.12). */\n planChange: PlanChangeLabels;\n /** 0.32.0: the text-size and contrast settings (docs/text-size-harmonization.md §6). */\n appearance: AppearanceLabels;\n /** 0.36.0: resetting this device's settings, the appearance group's last card\n * (docs/settings-harmonization.md §11.3). */\n deviceReset: DeviceResetLabels;\n /** 0.32.0: a row's actions folded into a \"⋯\" menu at Large (text size §10.8). */\n rowActions: RowActionsLabels;\n /** 0.32.0: the phone bar's \"More\" cell and sheet (text size §10.7). */\n appShellMore: AppShellMoreLabels;\n /** 0.22.0: the screen-reader words of `Input` / `Textarea`'s `showCount` counter. */\n characterCount: CharacterCountLabels;\n /** 0.22.0: `CountrySelect`. Its list's \"no results\" and counts are `combobox`'s. */\n countrySelect: CountrySelectLabels;\n /** 0.22.0: `InlineEditField` — keksdose K9. */\n inlineEdit: InlineEditLabels;\n /** 0.22.0: `IbanInput`'s messages, one per problem. */\n ibanInput: IbanInputLabels;\n /** 0.22.0: `PhoneInput`'s country-code select. */\n phoneInput: PhoneInputLabels;\n /** 0.22.0: `SignChip` — the outflow / inflow toggle beside an amount. */\n signChip: SignChipLabels;\n /** 0.23.0: `ColumnMapper` / `ColumnRoleTable` — a pasted or dropped table, a role per\n * column. */\n columnMapper: ColumnMapperLabels;\n /** 0.36.0: the notification cards — the types, quiet hours and the zone picker, this\n * device's push, the device list, and the unsubscribe page\n * (docs/notifications-harmonization.md §4.2). */\n notifications: NotificationsLabels;\n /** 0.42.0: the admin area's shared words — the account menu's \"Administration\" row, the\n * 403 page, the shared sections, the overview's tiles and the Tools list\n * (docs/admin-harmonization.md §3.1). */\n adminArea: AdminAreaLabels;\n /** 0.42.0: the top bar's shared parts — `TourMenu`, `SyncStatusIndicator`, `DevMenu`\n * (0.42's `DevSwitchers`; docs/top-bar-harmonization.md §3.1, §2.7.1). */\n topBarParts: TopBarPartsLabels;\n /** 0.45.0: \"Send a test mail to me\" (docs/admin-harmonization.md §9.2.4). */\n mailTestCard: MailTestCardLabels;\n /** 0.45.0: the sign-out question while changes wait to sync (`@eifi1/ui-kit/offline`,\n * docs/local-first-harmonization.md §1.6). */\n signOutPending: SignOutPendingDialogLabels;\n /** 0.45.0: the service-worker update toast (local-first §1.5 D8). */\n pwaUpdate: PwaUpdatePromptLabels;\n /** 0.45.0: \"This is a shared computer\" on the sign-in form (local-first §1.5 D6). */\n sharedComputer: SharedComputerLabels;\n}\n\n/**\n * A label override, as deep as the labels go: an object of labels (a namespace, or a\n * record inside one such as `accountSettings.passkeys` or `dataTable.presets`) may be\n * partial at every level, because the provider merges it key by key at every level.\n * A leaf stays as it is: a string, a function-valued label (`(n) => …`), and anything\n * that is not purely an object (a `ReactNode` union) is given whole.\n */\nexport type LabelOverride<T> = [T] extends [(...args: never[]) => unknown]\n ? T\n : [T] extends [readonly unknown[]]\n ? T\n : [T] extends [object]\n ? { [K in keyof T]?: LabelOverride<T[K]> }\n : T;\n\n/** Any subset of the tree — each namespace may be partial, and so may any record\n * inside one (`accountSettings.passkeys`, `dataTable.presets`): they are merged key\n * by key, at every depth. */\nexport type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: LabelOverride<UiKitLabels[K]> };\n\n/* ── English defaults for the namespaces defined here ────────────────────── */\n\n// They live in ./shared-labels, a module of words, as every component's defaults live in\n// its `*-labels.ts` (round 0.34). Imported and exported as this module's own, as each\n// component does with its defaults: the names, and where the README lists them, stay.\nexport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n};\n\n/* ── The provider ────────────────────────────────────────────────────────── */\n\ninterface KitI18n {\n labels?: UiKitLabelOverrides;\n locale?: string;\n weekStartsOn?: WeekDay;\n linkComponent?: KitLinkComponent;\n chartTooltipPlacement?: ChartTooltipPlacement;\n formatDate?: KitDateFormatter;\n tableStorageKeyPrefix?: string;\n timeZone?: string;\n documentTitleFormat?: string;\n appName?: string;\n}\n\n/** What a {@link KitDateFormatter} is told about the date it is formatting. */\nexport interface KitDateFormatContext {\n /**\n * How much of a date the string is: `\"day\"` — the `iso` is `\"YYYY-MM-DD\"`; `\"month\"` —\n * `\"YYYY-MM\"` (a `MonthPicker`); `\"year\"` — `\"YYYY\"` (`MonthPicker mode=\"year\"`).\n */\n unit: \"day\" | \"month\" | \"year\";\n /** Which kit surface asks: the trigger of a `DatePicker`, of a `DateRangePicker`\n * (called once per end), of a `MonthPicker`, or a `DateMark`. */\n source: \"datePicker\" | \"dateRangePicker\" | \"monthPicker\" | \"dateMark\";\n /** The locale the kit would have formatted in — the component's `locale` prop, else\n * the provider's — or `undefined` for the runtime's. */\n locale: string | undefined;\n /**\n * The kit's suggestion: whether this date stands alone where the day of the week\n * helps — `true` for a `DatePicker`'s trigger and a `DateMark`, `false` for the two\n * ends of a range (twice the width, in a sentence-like \"from – to\") and for a month\n * or a year. keksdose's rule, which this follows: *\"A date in a COLUMN carries the\n * weekday. A date in a SENTENCE does not.\"* (date-cell.tsx, dev#546). A formatter\n * is free to ignore it.\n */\n weekday: boolean;\n}\n\n/**\n * The app's ONE answer to \"what does a date look like here\" — keksdose K12. Returns the\n * text for an ISO date (see {@link KitDateFormatContext.unit} for the three shapes).\n * Return `\"\"` to fall back to the kit's own formatting for that date.\n */\nexport type KitDateFormatter = (iso: string, context: KitDateFormatContext) => string;\n\n/** Where a chart shows the values under the pointer — see `SeriesChartTooltip.placement`. */\nexport type ChartTooltipPlacement = \"cursor\" | \"above\" | \"below\" | \"auto\";\n\n/**\n * What every kit link receives: the anchor attributes the kit decided (href, class,\n * aria-current, handlers, children, ref). An app's router link maps them —\n * `({ href, ...p }) => <Link to={href} {...p} />` — ONCE, on the provider.\n *\n * `replace` is the one prop that is not an anchor attribute: see there. Map it\n * explicitly if your router link is not react-router's —\n * `({ href, replace, ...p }) => <Link to={href} replace={replace} {...p} />` — and never\n * spread it onto a DOM `<a>`, where React warns about an unknown attribute.\n */\nexport type KitLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n ref?: Ref<HTMLAnchorElement>;\n /**\n * Navigate by REPLACING the current history entry, so Back skips it — keksdose F1:\n * a one-shot URL (a magic-link landing, `?checkout=done`, a wizard's \"finish\" hop)\n * that must not come back when the user presses Back. Present ONLY when the kit link\n * was given `replace` (`true`), so a provider link that spreads its props onto a\n * plain `<a>` keeps working for every link that never asks for it. react-router's\n * `<Link>` takes the same prop, so `({ href, ...p }) => <Link to={href} {...p} />`\n * honours it with no change; any other router maps it to its own replace option.\n * The kit never puts it on a DOM element itself.\n */\n replace?: boolean;\n};\nexport type KitLinkComponent = (props: KitLinkProps) => ReactElement;\n\nconst KitI18nContext = createContext<KitI18n>({});\n\nexport interface UiKitProviderProps {\n /** Any part of {@link UiKitLabels}. Missing keys fall back to English. */\n labels?: UiKitLabelOverrides;\n /**\n * BCP 47 tag used by every kit component that formats something — dates, numbers,\n * month and weekday names, file sizes — when it is not handed a `locale` prop of\n * its own. Without a provider, and without a prop, those use the runtime default.\n */\n locale?: string;\n /**\n * The first day of the week (0 = Sunday, 1 = Monday …) for every calendar below —\n * `MiniCalendar` and the pickers built on it — that is not handed a `weekStartsOn`\n * of its own. Without it the week start follows `locale`'s week info.\n *\n * Separate from `locale` because the two are separate decisions: a German-built\n * app running in English (`locale=\"en\"`) would otherwise start its weeks on Sunday,\n * and switching it to `en-GB` to get Monday changes every date and number format.\n */\n weekStartsOn?: WeekDay;\n /**\n * The app's router link, used by every kit component that renders an in-app link\n * and was not handed its own `renderLink` — so `renderLink` stops being repeated on\n * each ListItem, Breadcrumbs, StatTile, Chip… (kastlan). A component's own\n * `renderLink` wins; external links and in-page `#anchor`s stay plain `<a>`, and a\n * hash-router `#/path` is handed to it like `/path` (see `pickLinkRenderer`).\n */\n linkComponent?: KitLinkComponent;\n /**\n * Where every `SeriesChart` below shows its tooltip when it does not say so itself\n * (`tooltip.placement`) — set once so an app's phone charts stop putting the box under\n * the reader's finger (keksdose #359). Default: `\"cursor\"`, the box that follows the\n * pointer, as before.\n */\n chartTooltipPlacement?: ChartTooltipPlacement;\n /**\n * How every kit date below is written, when the component is not told otherwise —\n * keksdose K12. keksdose has a date-format preference (Settings ▸ date format, feedback\n * #180) that is not the UI language, and a weekday in the UI language beside digits\n * in the preference's order (live #246, dev#546): two locales in one string, which\n * no `locale` + `Intl` options can say. Its `DateField` wraps every `DatePicker` to\n * pass `formatValue`, and its report range field formats both ends by hand; with this\n * set once on the provider, those wrappers thin to nothing.\n *\n * Used for the trigger text of `DatePicker`, `DateRangePicker` and `MonthPicker`\n * (month and year mode), and for `DateMark display=\"date\"`. A component's own\n * `formatValue` or `formatOptions` (`dateStyle` on a DateMark) wins: prop >\n * provider > the kit's `Intl` default, the order every kit setting resolves in. Left\n * out (or returning `\"\"`), everything formats exactly as before.\n *\n * Keep it stable (`useCallback`, or a module function): it is in the provider's\n * context value, so a new function every render re-renders every consumer.\n */\n formatDate?: KitDateFormatter;\n /**\n * The `localStorage` prefix every kit table below keeps its view under (sort, filters,\n * page size, widths, hidden columns), when the table is not handed a\n * `storageKeyPrefix` of its own — round 0.34 C5, KS U4. Left out, it is the kit's\n * `\"hbui-table:\"`, as before.\n *\n * Set once here rather than per table because not every table is the app's to pass a\n * prop to: `TranslationReviewPanel` wraps a `DataTable`, and until this the panel's\n * view landed under the kit's prefix whatever the app's was — so an app that lists\n * what it stores (a privacy page) had to list the kit's prefix as a key of its own.\n * Resolves like every kit setting: the table's own prop > this > the default. The\n * key is the prefix plus the table's `storageKey`, verbatim, so an app that wrapped\n * `DataTable` to pass its prefix (Keksdose's `keksdose-table:`) keeps every stored\n * view when it moves the prefix here.\n */\n tableStorageKeyPrefix?: string;\n /**\n * 0.46 (docs/notifications-harmonization.md §10.3): the IANA zone (\"Europe/Zurich\") every\n * TIMESTAMP below is shown in through `useKitFormat().formatDate` /\n * `formatRelativeTime`, when the call names none — the account's picked zone, for an app\n * that shows times in it. A bare \"YYYY-MM-DD\" is never shifted (a calendar day is the day\n * it names in every zone). Left out, timestamps follow the device, as before.\n */\n timeZone?: string;\n /**\n * 0.49 KIT-9: how `useDocumentTitle` and every `PageHeader`'s `h1` write the window's\n * title, from `{page}`, `{section}` and `{app}`. Default\n * `\"{page} · {section} · {app}\"` (`DEFAULT_DOCUMENT_TITLE_FORMAT`); a missing part\n * drops with its separator.\n */\n documentTitleFormat?: string;\n /** 0.49 KIT-9: the app's name, the `{app}` of the window's title (\"Kastlan\"). Left\n * out, titles end at the page or section. */\n appName?: string;\n /**\n * 0.49 KIT-1b: while a person copies a selection in the page, a U+2212 minus standing\n * before a number (\"−CHF 1,250.50\") goes to the clipboard as \"-\", in `text/plain` and\n * `text/html` (what Excel pastes), so a spreadsheet reads a number; the page keeps \"−\".\n * A copy out of an input, a textarea or an editable element is left alone. Installed\n * once per document, by the first provider that has it on. Default `true`; `false` on\n * the outermost provider leaves the clipboard to the browser.\n */\n copyAsciiMinus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Hand every kit component below this point its strings and its locale.\n *\n * Optional: a component outside any provider behaves exactly as it did before the\n * provider existed. Nesting works as a merge — an inner provider overrides only what\n * it names, so a page can re-label one table's `dataTable.table` without restating\n * the language.\n */\nexport function UiKitProvider({\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n documentTitleFormat,\n appName,\n copyAsciiMinus = true,\n children,\n}: UiKitProviderProps) {\n const outer = useContext(KitI18nContext);\n const value = useMemo<KitI18n>(\n () => ({\n locale: locale ?? outer.locale,\n weekStartsOn: weekStartsOn ?? outer.weekStartsOn,\n labels: mergeOverrides(outer.labels, labels),\n linkComponent: linkComponent ?? outer.linkComponent,\n chartTooltipPlacement: chartTooltipPlacement ?? outer.chartTooltipPlacement,\n formatDate: formatDate ?? outer.formatDate,\n tableStorageKeyPrefix: tableStorageKeyPrefix ?? outer.tableStorageKeyPrefix,\n timeZone: timeZone ?? outer.timeZone,\n documentTitleFormat: documentTitleFormat ?? outer.documentTitleFormat,\n appName: appName ?? outer.appName,\n }),\n [\n outer,\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n documentTitleFormat,\n appName,\n ],\n );\n useTableViewsJoin(value.tableStorageKeyPrefix ?? DEFAULT_TABLE_STORAGE_KEY_PREFIX);\n useClipboardMinus(copyAsciiMinus);\n return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;\n}\n\n/** The kit's own table prefix: `DEFAULT_PERSIST_PREFIX` of components/use-table-state,\n * restated because that module imports the router (a test pins the two equal). */\nconst DEFAULT_TABLE_STORAGE_KEY_PREFIX = \"hbui-table:\";\n\n/**\n * Reset this device's settings (docs/settings-harmonization.md §11.4): the tables below a\n * provider keep their views under its prefix, so the provider joins the registry with\n * that prefix — a view, no `reset`, since a table reads its view when it next mounts —\n * while it is mounted. Nested providers with one prefix hold one entry.\n *\n * Through a literal `import()`, not a static import: every catalogue reaches this module,\n * and a catalogue may reach nothing outside i18n/ (scripts/check-module-graph.mjs,\n * english-catalogue-graph.test.ts). The theme stores and the shell import the registry\n * statically, so it is loaded already and the join lands a microtask after the mount.\n */\nfunction useTableViewsJoin(prefix: string): void {\n useEffect(() => {\n let leave: (() => void) | undefined;\n let gone = false;\n import(\"../lib/device-settings\").then(\n ({ registerDeviceSetting }) => {\n if (!gone) leave = registerDeviceSetting({ key: prefix, prefix: true, kind: \"view\" });\n },\n // A module of the kit's own that fails to load has nothing to join; the provider\n // and its tables work as before.\n () => undefined,\n );\n return () => {\n gone = true;\n leave?.();\n };\n }, [prefix]);\n}\n\n/**\n * The copy handler (lib/clipboard-minus, 0.49 KIT-1b), through a literal `import()` for\n * the reason {@link useTableViewsJoin} gives: a catalogue may reach nothing outside i18n/.\n * It is in place a microtask after the mount — long before a person selects and copies.\n */\nfunction useClipboardMinus(on: boolean): void {\n useEffect(() => {\n if (!on || typeof document === \"undefined\") return;\n let uninstall: (() => void) | undefined;\n let gone = false;\n import(\"../lib/clipboard-minus\").then(\n ({ installClipboardMinus }) => {\n if (!gone) uninstall = installClipboardMinus(document);\n },\n // Not loaded: copying works as the browser does it.\n () => undefined,\n );\n return () => {\n gone = true;\n uninstall?.();\n };\n }, [on]);\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/** A record of labels to merge into — not a React element, which is an object too but\n * is a label given whole. */\nfunction isLabelRecord(v: unknown): v is Record<string, unknown> {\n return isRecord(v) && !(\"$$typeof\" in v);\n}\n\n/** Merged key by key at EVERY depth — a namespace, a record inside it\n * (`accountSettings.passkeys`, `dataTable.presets`), and so on down — to match\n * {@link LabelOverride}. An `undefined` is skipped at every depth, so it never blanks\n * out what is under it. */\nfunction mergeNamespace<T extends object>(base: T, over: LabelOverride<T> | Partial<T> | undefined): T {\n if (!over) return base;\n const out = { ...base } as Record<string, unknown>;\n for (const [k, v] of Object.entries(over)) {\n if (v === undefined) continue;\n const prev = out[k];\n out[k] = isLabelRecord(prev) && isLabelRecord(v) ? mergeNamespace(prev, v) : v;\n }\n return out as T;\n}\n\nfunction mergeOverrides(\n a: UiKitLabelOverrides | undefined,\n b: UiKitLabelOverrides | undefined,\n): UiKitLabelOverrides | undefined {\n if (!a) return b;\n if (!b) return a;\n const out: Record<string, unknown> = { ...a };\n for (const [ns, v] of Object.entries(b)) {\n out[ns] = mergeNamespace((out[ns] as object | undefined) ?? {}, v as object);\n }\n return out as UiKitLabelOverrides;\n}\n\n/**\n * What the nearest provider says about one namespace — `undefined` outside one. Nested\n * providers' words come merged, at every depth; no English default is filled in.\n *\n * A {@link LabelOverride}, partial at every depth, like the components' `labels` props\n * that take it: a provider that names one key of a section (`accountSettings.passkeys`)\n * or one preset (`dataTable.presets`) hands over just that (round 0.35 R3 — until then\n * it was typed partial at the top only, so a nested section read as complete).\n *\n * For a component whose own resolver does more than a merge (the data table derives\n * `columnsCount` from `columns`): merge the component's prop over it — a record key by\n * key — and feed the result to that resolver.\n */\nexport function useKitLabelOverrides<K extends keyof UiKitLabels>(ns: K): LabelOverride<UiKitLabels[K]> | undefined {\n return useContext(KitI18nContext).labels?.[ns];\n}\n\n/**\n * One namespace, resolved: `defaults`, then the provider, then the component's own\n * `prop`. Record-valued keys are merged key by key at each step — so `prop` is a\n * {@link LabelOverride}, partial at every depth as the provider's labels are, and a\n * component's `labels` prop, typed the same, is handed over without a cast (refactor\n * audit 2026-10, API-9).\n */\nexport function useKitLabels<K extends keyof UiKitLabels>(\n ns: K,\n defaults: UiKitLabels[K],\n prop?: LabelOverride<UiKitLabels[K]>,\n): UiKitLabels[K] {\n const fromProvider = useKitLabelOverrides(ns);\n return useMemo(() => mergeNamespace(mergeNamespace(defaults, fromProvider), prop), [defaults, fromProvider, prop]);\n}\n\n/** The component's own `locale` prop, else the provider's, else `undefined` (which\n * every `Intl` API reads as \"the runtime's default\"). */\nexport function useKitLocale(prop?: string): string | undefined {\n const fromProvider = useContext(KitI18nContext).locale;\n return prop ?? fromProvider;\n}\n\n/** The week start the nearest `<UiKitProvider weekStartsOn>` pins, else `undefined`\n * (the caller then asks the locale). A component's own prop goes first:\n * `prop ?? useKitWeekStart()`. */\n/** The provider's router link, or `undefined` — a component's own `renderLink` should\n * win over it: `const Link = renderLink ?? useKitLink()`. */\nexport function useKitLink(): KitLinkComponent | undefined {\n return useContext(KitI18nContext).linkComponent;\n}\n\nexport function useKitWeekStart(): WeekDay | undefined {\n return useContext(KitI18nContext).weekStartsOn;\n}\n\n/** The provider's `chartTooltipPlacement`, or `undefined` — a chart's own prop wins. */\nexport function useKitChartTooltipPlacement(): ChartTooltipPlacement | undefined {\n return useContext(KitI18nContext).chartTooltipPlacement;\n}\n\n/** The nearest provider's `formatDate`, or `undefined` — a component's own\n * `formatValue` / `formatOptions` wins over it. See {@link KitDateFormatter}. */\nexport function useKitDateFormatter(): KitDateFormatter | undefined {\n return useContext(KitI18nContext).formatDate;\n}\n\n/** The nearest provider's `tableStorageKeyPrefix`, or `undefined` — a table's own\n * `storageKeyPrefix` wins over it, and the kit's `\"hbui-table:\"` comes after both. */\nexport function useKitTableStorageKeyPrefix(): string | undefined {\n return useContext(KitI18nContext).tableStorageKeyPrefix;\n}\n\n/** The nearest provider's `timeZone` (0.46), or `undefined` — the device's. A call's own\n * `timeZone` wins over it. */\nexport function useKitTimeZone(): string | undefined {\n return useContext(KitI18nContext).timeZone;\n}\n\n/** The nearest provider's `documentTitleFormat` and `appName`, or `undefined` each —\n * what `useDocumentTitle` writes with (the format's default is\n * `DEFAULT_DOCUMENT_TITLE_FORMAT`, applied there: this module reaches nothing outside\n * i18n/). */\nexport function useKitDocumentTitle(): { format: string | undefined; appName: string | undefined } {\n const { documentTitleFormat, appName } = useContext(KitI18nContext);\n return { format: documentTitleFormat, appName };\n}\n\n/** {@link DEFAULT_FILE_LABELS}, but formatting in the provider's locale. */\nexport function useKitFileLabels(prop?: Partial<FileLabels>): FileLabels {\n const locale = useKitLocale();\n const defaults = useMemo<FileLabels>(() => ({ size: (bytes) => formatFileSize(bytes, locale) }), [locale]);\n return useKitLabels(\"file\", defaults, prop);\n}\n\n/**\n * The dot paths of every key `labels` does NOT supply — the ones a translated app is\n * still showing in English. Assert on it in the app's own test:\n *\n * expect(missingKitLabels(labels, DEFAULT_UI_KIT_LABELS)).toEqual([]);\n *\n * `reference` is the complete tree to check against — pass\n * {@link DEFAULT_UI_KIT_LABELS} (src/i18n/defaults.ts). It is a parameter rather than an import\n * because the defaults live beside their components, and this module is imported BY\n * those components. Left out (a test file is not type-checked), it throws saying so\n * rather than \"Cannot convert undefined or null to object\" (keksdose, 0.18).\n */\nexport function missingKitLabels(labels: UiKitLabelOverrides | undefined, reference: UiKitLabels): string[] {\n if (!isRecord(reference)) {\n throw new TypeError(\n \"missingKitLabels(labels, reference): pass DEFAULT_UI_KIT_LABELS as the reference — \" +\n \"it is the tree the labels are checked against.\",\n );\n }\n const missing: string[] = [];\n for (const [ns, keys] of Object.entries(reference)) {\n const given = (labels as Record<string, Record<string, unknown> | undefined> | undefined)?.[ns];\n for (const [key, value] of Object.entries(keys as Record<string, unknown>)) {\n const got = given?.[key];\n if (got === undefined) {\n missing.push(`${ns}.${key}`);\n } else if (isRecord(value) && isRecord(got)) {\n for (const sub of Object.keys(value)) {\n if (got[sub] === undefined) missing.push(`${ns}.${key}.${sub}`);\n }\n }\n }\n }\n return missing;\n}\n"],"mappings":";AA2wBS;AA3wBT,SAAS,eAAe,YAAY,WAAW,eAAe;AAC9D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAomBP,MAAM,iBAAiB,cAAuB,CAAC,CAAC;AA6GzC,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AACF,GAAuB;AACrB,QAAM,QAAQ,WAAW,cAAc;AACvC,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL,QAAQ,UAAU,MAAM;AAAA,MACxB,cAAc,gBAAgB,MAAM;AAAA,MACpC,QAAQ,eAAe,MAAM,QAAQ,MAAM;AAAA,MAC3C,eAAe,iBAAiB,MAAM;AAAA,MACtC,uBAAuB,yBAAyB,MAAM;AAAA,MACtD,YAAY,cAAc,MAAM;AAAA,MAChC,uBAAuB,yBAAyB,MAAM;AAAA,MACtD,UAAU,YAAY,MAAM;AAAA,MAC5B,qBAAqB,uBAAuB,MAAM;AAAA,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ACpC;AAIO,SAAS,iBAAqC;AACnD,SAAO,WAAW,cAAc,EAAE;AACpC;AAMO,SAAS,sBAAmF;AACjG,QAAM,EAAE,qBAAqB,QAAQ,IAAI,WAAW,cAAc;AAClE,SAAO,EAAE,QAAQ,qBAAqB,QAAQ;AAChD;AAGO,SAAS,iBAAiB,MAAwC;AACvE,QAAM,SAAS,aAAa;AAC5B,QAAM,WAAW,QAAoB,OAAO,EAAE,MAAM,CAAC,UAAU,eAAe,OAAO,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;AACzG,SAAO,aAAa,QAAQ,UAAU,IAAI;AAC5C;AAcO,SAAS,iBAAiB,QAAyC,WAAkC;AAC1G,MAAI,CAAC,SAAS,SAAS,GAAG;AACxB,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,QAAM,UAAoB,CAAC;AAC3B,aAAW,CAAC,IAAI,IAAI,KAAK,OAAO,QAAQ,SAAS,GAAG;AAClD,UAAM,QAAS,SAA6E,EAAE;AAC9F,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAA+B,GAAG;AAC1E,YAAM,MAAM,QAAQ,GAAG;AACvB,UAAI,QAAQ,QAAW;AACrB,gBAAQ,KAAK,GAAG,EAAE,IAAI,GAAG,EAAE;AAAA,MAC7B,WAAW,SAAS,KAAK,KAAK,SAAS,GAAG,GAAG;AAC3C,mBAAW,OAAO,OAAO,KAAK,KAAK,GAAG;AACpC,cAAI,IAAI,GAAG,MAAM,OAAW,SAAQ,KAAK,GAAG,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;AAAA,QAChE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i18n/languages.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport type { UiKitLabels } from \"./kit-labels\";\nimport type { LanguageOption } from \"../shell/topbar-controls\";\n\n/**\n * \"Which language is this reader in, and what does the kit say in it?\" — the one\n * answer the three apps each wrote for themselves (docs/i18n-harmonization.md, H2).\n *\n * kastlan, keksdose and Kurvenschmiede all ship a subset of the same seven languages,\n * and every one of them hand-rolled the same three things: a list of languages with\n * their names and flags, a rule for turning what a browser asks for (`de-AT`, `zh-TW`,\n * `en-AU`) into a code the app ships, and a bridge from that code to the kit's label\n * catalogue. The three disagreed where nobody was looking: a reader asking for `zh-TW`\n * got German in kastlan and Chinese in Kurvenschmiede; keksdose's English got the raw\n * defaults, so its counts read \"12345\" where the other two wrote \"12,345\"; kastlan\n * formatted French as `fr-CH` and Kurvenschmiede as `fr-FR`. None of it was a decision.\n * This module makes it one, in one place, tested once.\n *\n * WHAT IT IS NOT: an i18n library. It resolves no app strings, carries no detector and\n * depends on nothing — the app keeps i18next (or whatever it uses) for its own words and\n * asks this module only the questions the kit can answer for all three apps alike:\n * - {@link KIT_LANGUAGES}: the seven codes, each with its own name, its English name,\n * the flag it flies and the locale it formats in;\n * - {@link resolveLanguage}: which of the codes an app offers answers a reader;\n * - {@link formatLocaleOf}: the `Intl` tag for a code (the provider's `locale`,\n * `<html lang>`, every `toLocaleString` in the app);\n * - {@link loadUiKitLabels}: the kit's catalogue for a code, fetched on demand;\n * - {@link languageOptions}: the rows `LanguageMenu` and `LanguageSetting` take.\n *\n * THE CODE AND THE FORMATTING LOCALE ARE TWO THINGS (Kurvenschmiede's insight, made\n * the rule). The code names a catalogue — what the account stores, what i18next\n * resolves, what a mail is chosen by — and a bare `en` says nothing about how a date is\n * written. Each language formats like its home (Marcel, 2026-10-02, H6): `de-CH`,\n * `en-GB` (British, like the spelling), `es-ES`, `fr-FR`, `it-IT`, `hu-HU`, `zh-CN`. An\n * app that must format otherwise — kastlan's QR bill follows the SIX spec, not the\n * reader — passes its own locale where it needs it; the registry is the default.\n *\n * THERE IS ONE GERMAN, `de-CH`: Swiss Standard German, formal (0.18). Every other\n * German a browser or an old localStorage can hand over — `de`, `de-DE`, `de-AT`,\n * `de-LI`, the briefly offered `de-informal` / `de-CH-informal` — is read as it.\n * Its name is plain \"Deutsch\": it is the only German, so there is nothing to tell it\n * apart from, and the Swiss flag beside it is what says where the spelling comes from.\n *\n * AND ONE CHINESE, `zh`, WHICH IS SIMPLIFIED. `zh-TW`, `zh-HK` and `zh-Hant` resolve to\n * it: there is no Traditional catalogue, and a reader of Traditional characters reads\n * Simplified far more readily than whichever second language a fallback would guess\n * at (Kurvenschmiede's reasoning, now everyone's). Its name says \"简体中文\" so that\n * reader sees what they are getting before they pick it.\n */\n\n/** The seven languages the kit ships a catalogue for. An app offers a subset. */\nexport type KitLanguageCode = \"de-CH\" | \"en\" | \"es\" | \"fr\" | \"it\" | \"hu\" | \"zh\";\n\n/** One language the kit ships: what it is called, which flag it flies and which\n * BCP 47 tag it formats in. */\nexport interface KitLanguage {\n /** The catalogue code — what an app stores, sends and hands i18next. */\n readonly code: KitLanguageCode;\n /** The language's name in itself, for a switcher: the reader looking for theirs may\n * not read the language the page is currently in. */\n readonly nativeName: string;\n /** The name in English, for places that list languages to a team rather than to a\n * reader (a translation review's locale column, an admin's reviewer grant). */\n readonly englishName: string;\n /** The BCP 47 tag the language formats numbers and dates in, and declares itself in\n * on `<html lang>`. See {@link formatLocaleOf}. */\n readonly formatLocale: string;\n /** ISO 3166-1 alpha-2 country (lowercase) for flag-icons' `fi fi-<flag>` class —\n * NOT the language code: English flies the UK flag, German the Swiss one, Chinese\n * the PRC's (the catalogue is Simplified). The kit renders the class name only; the\n * app supplies the flag stylesheet (README, \"What you install alongside it\"). */\n readonly flag: string;\n}\n\n/**\n * Every language the kit ships, in the order a switcher lists them: alphabetical by\n * native name (Deutsch, English, Español … 简体中文), which is what a reader scanning for\n * their own language's name expects.\n *\n * An app offering four of them passes those four codes to {@link resolveLanguage} and\n * {@link languageOptions}; it does not copy this list. A language added here is one the\n * kit has a catalogue for (the loader map below is typed by {@link KitLanguageCode}, so\n * a code without one does not compile).\n */\nexport const KIT_LANGUAGES: readonly KitLanguage[] = [\n { code: \"de-CH\", nativeName: \"Deutsch\", englishName: \"German\", formatLocale: \"de-CH\", flag: \"ch\" },\n { code: \"en\", nativeName: \"English\", englishName: \"English\", formatLocale: \"en-GB\", flag: \"gb\" },\n { code: \"es\", nativeName: \"Español\", englishName: \"Spanish\", formatLocale: \"es-ES\", flag: \"es\" },\n { code: \"fr\", nativeName: \"Français\", englishName: \"French\", formatLocale: \"fr-FR\", flag: \"fr\" },\n { code: \"it\", nativeName: \"Italiano\", englishName: \"Italian\", formatLocale: \"it-IT\", flag: \"it\" },\n { code: \"hu\", nativeName: \"Magyar\", englishName: \"Hungarian\", formatLocale: \"hu-HU\", flag: \"hu\" },\n { code: \"zh\", nativeName: \"简体中文\", englishName: \"Chinese (Simplified)\", formatLocale: \"zh-CN\", flag: \"cn\" },\n];\n\nconst ALL_CODES: readonly KitLanguageCode[] = KIT_LANGUAGES.map((language) => language.code);\n\n/** The kit's home language: what a reader nothing else matches gets, when it is offered. */\nconst HOME: KitLanguageCode = \"de-CH\";\n\n/** The language part of a tag, lower-cased: `de-CH-informal` → `de`, `zh_Hant` → `zh`. */\nconst languagePart = (tag: string) => tag.split(\"-\")[0].toLowerCase();\n\n/**\n * The offered code that answers ONE requested tag, or `undefined`.\n *\n * Exact first, ignoring case (`DE-ch` → `de-CH`), then by language part: since the kit\n * has exactly one code per language, \"the offered code whose language is the tag's\n * language\" is the whole of the rule, and it is what takes every German to `de-CH`\n * (`de-AT`, `de-informal`), every Chinese to `zh` (`zh-TW`, `zh-Hant-HK`) and every\n * regional form to its base (`fr-CA` → `fr`, `en-AU` → `en`). A language the app does\n * not offer answers nothing, so the caller moves on to the reader's next preference\n * rather than landing on a guess. Underscores are read as hyphens (`de_CH`), the way a\n * Java or Python backend may have stored the account's locale.\n */\nfunction answer(\n candidate: unknown,\n offered: readonly KitLanguageCode[],\n): KitLanguageCode | undefined {\n if (typeof candidate !== \"string\") return undefined;\n const tag = candidate.trim().replace(/_/g, \"-\");\n if (!tag) return undefined;\n const lower = tag.toLowerCase();\n const exact = offered.find((code) => code.toLowerCase() === lower);\n if (exact) return exact;\n const language = languagePart(tag);\n return offered.find((code) => languagePart(code) === language);\n}\n\n/**\n * Which of the codes an app offers answers this reader.\n *\n * `candidates` are the reader's preferences **in precedence order**, and the first\n * one that matches wins — so the order is the policy. The one the harmonisation plan\n * gives every app (H5):\n *\n * resolveLanguage(\n * [localStorage.getItem(\"<app>-lang\"), user?.locale, ...navigator.languages],\n * OFFERED,\n * );\n *\n * the choice stored on this device (the reader picked it, here) → the account's\n * language (read back on sign-in, so a new device starts in it) → the browser's list,\n * in its own order → the fallback. Missing sources are simply `null` / `undefined`;\n * they are skipped, as is an empty string.\n *\n * Each candidate is matched exactly (case-insensitively), then by language — every\n * German variant to `de-CH`, every Chinese to `zh` (Simplified), any other regional\n * form to its base language (`fr-CA` → `fr`, `en-AU` → `en`) — and only within\n * `offered`: a reader whose browser says `es-MX` first and `en` second, in an app that\n * offers no Spanish, gets English rather than the fallback. That is the difference\n * from a single-tag lookup, and why the browser's whole list is passed, not its first\n * entry.\n *\n * `fallback` is what a reader nothing matches gets: by default `de-CH` when the app\n * offers it — the kit's and the three apps' home language — else the app's first\n * offered code. It is returned as given, offered or not; the app chose it.\n *\n * Why not i18next's own matcher (`getBestMatchFromCodes`, which Kurvenschmiede calls):\n * it needs an i18next instance, it reduces `de-AT` to a `de` none of the apps ships\n * unless every caller remembers a converter first, and its answer to a list depends on\n * `supportedLngs` and `nonExplicitSupportedLngs` being set exactly so. This is a pure\n * function of its arguments, so the switcher, the account form, a server-rendered\n * guess and a test all get the same answer without one.\n */\nexport function resolveLanguage(\n candidates: readonly (string | null | undefined)[],\n offered: readonly KitLanguageCode[],\n fallback?: KitLanguageCode,\n): KitLanguageCode {\n for (const candidate of candidates) {\n const found = answer(candidate, offered);\n if (found) return found;\n }\n return fallback ?? (offered.includes(HOME) ? HOME : (offered[0] ?? HOME));\n}\n\n/**\n * The BCP 47 tag a language formats in — `formatLocaleOf(\"en\")` is `\"en-GB\"`.\n *\n * For `<UiKitProvider locale>`, for `<html lang>` (a screen reader pronounces by it,\n * and `en` alone does not say which English) and for the app's own `Intl` calls, so\n * the kit's counts and the app's amounts group their digits the same way.\n *\n * Takes any tag, not only a {@link KitLanguageCode}. A tag of one of the seven\n * languages formats in that language's home, by decision — not the reader's region:\n * `de-AT` as `de-CH`, `en-AU` and `en-US` as `en-GB`, `zh-TW` as `zh-CN`. So an app can\n * hand it i18next's `resolvedLanguage` as it comes.\n *\n * A tag of a language the kit does NOT ship formats as itself (canonicalised): `sv-SE`\n * stays `sv-SE`. That is a formatting preference, not a language — keksdose's date\n * setting offers ISO order as `sv-SE`, and 0.19.0 turned it into a German weekday by\n * resolving it to the home language (keksdose's 0.19 adoption). Words are another\n * matter: {@link resolveLanguage} and {@link loadUiKitLabels} still fall back to\n * `de-CH` for such a tag. A tag `Intl` cannot read formats as `de-CH`.\n */\nexport function formatLocaleOf(code: string): string {\n const shipped = answer(code, ALL_CODES);\n if (shipped) return homeFormat(shipped);\n try {\n return Intl.getCanonicalLocales(code)[0] ?? homeFormat(HOME);\n } catch {\n return homeFormat(HOME);\n }\n}\n\nfunction homeFormat(code: KitLanguageCode): string {\n return KIT_LANGUAGES.find((language) => language.code === code)!.formatLocale;\n}\n\n/** The format tag of the catalogue a code loads — always one of the seven languages'\n * own, so the words and the digits of a catalogue agree. */\nconst catalogueFormat = (code: string) => homeFormat(resolveLanguage([code], ALL_CODES));\n\n/**\n * One loader per catalogue, each a LITERAL relative `import()`.\n *\n * The literal is load-bearing twice. The library is built one file per module\n * (`bundle: false`, tsup.config.ts), so `./locales/fr` stays a module of its own in\n * dist/ and `scripts/fix-esm-extensions.mjs` gives the specifier its `.js`. And an\n * app's bundler can only split what it can read: a path assembled from a code is a\n * chunk rollup cannot make, and the failure is at runtime. With literals, each\n * language is a chunk of its own and a reader downloads exactly theirs — about 25 kB of\n * JavaScript a catalogue, so an entry chunk holding all of them would carry six that\n * the reader never uses.\n *\n * Relative, not `@eifi1/ui-kit/i18n/fr`: a package importing itself by name resolves\n * through the consumer's node_modules, which a linked checkout or a test of this repo\n * does not have.\n */\nconst LOADERS: Record<KitLanguageCode, (formatLocale: string) => Promise<UiKitLabels>> = {\n \"de-CH\": async (locale) => (await import(\"./locales/de-CH\")).uiKitLabelsDeCh(locale),\n en: async (locale) => (await import(\"./locales/en\")).uiKitLabelsEn(locale),\n es: async (locale) => (await import(\"./locales/es\")).uiKitLabelsEs(locale),\n fr: async (locale) => (await import(\"./locales/fr\")).uiKitLabelsFr(locale),\n it: async (locale) => (await import(\"./locales/it\")).uiKitLabelsIt(locale),\n hu: async (locale) => (await import(\"./locales/hu\")).uiKitLabelsHu(locale),\n zh: async (locale) => (await import(\"./locales/zh\")).uiKitLabelsZh(locale),\n};\n\n/** One promise per (language, format locale), so asking twice is one fetch and one\n * object: the provider's context value keeps its identity, and every kit component\n * reading it is spared a re-render on a switch back. */\nconst loaded = new Map<string, Promise<UiKitLabels>>();\n/** The same catalogues once they have arrived — what {@link peekUiKitLabels} reads. */\nconst ready = new Map<string, UiKitLabels>();\n\nfunction cacheKey(code: string, formatLocale: string): [KitLanguageCode, string] {\n const language = resolveLanguage([code], ALL_CODES);\n return [language, `${language}\\u0000${formatLocale}`];\n}\n\n/**\n * The kit's catalogue for a language, fetched on demand and formatted in\n * `formatLocale` — for `<UiKitProvider labels={…}>`.\n *\n * Every language goes through its catalogue's factory, English included:\n * `uiKitLabelsEn(\"en-GB\")` writes \"12,345 rows\" where the bare\n * `DEFAULT_UI_KIT_LABELS` print \"12345\" (and keksdose's English did, by passing no\n * labels at all). `formatLocale` defaults to the language's own\n * ({@link formatLocaleOf}); pass another only for a reason, as the factories' own\n * docs describe (`\"de-DE\"` keeps the Swiss words and writes German digits).\n *\n * `code` may be any tag and is resolved like {@link formatLocaleOf}'s, so `de` loads\n * the one German and a language the kit does not ship loads `de-CH` — the same answer\n * the app's own fallback gives, rather than English beside the app's German.\n *\n * Asynchronous on purpose, and there is no synchronous twin: one would have to import\n * all seven catalogues statically, which puts every language in every app's entry\n * chunk — exactly what one subpath per language exists to prevent. Await it before the\n * first render, beside the app's own catalogue (the apps already await i18next's init\n * for the same reason: no frame in the wrong language), and keep the result in state.\n * To change a few words, spread over what it returns rather than copying a catalogue:\n * a copy misses every key a later release adds.\n *\n * A rejected fetch (a deploy replaced the chunk, the device went offline) is not\n * remembered, so the next call tries again.\n */\nexport function loadUiKitLabels(\n code: string,\n formatLocale: string = catalogueFormat(code),\n): Promise<UiKitLabels> {\n const [language, key] = cacheKey(code, formatLocale);\n let labels = loaded.get(key);\n if (!labels) {\n labels = LOADERS[language](formatLocale);\n loaded.set(key, labels);\n labels.then(\n (done) => ready.set(key, done),\n () => loaded.delete(key),\n );\n }\n return labels;\n}\n\n/**\n * The catalogue {@link loadUiKitLabels} already fetched for this language and format\n * locale — synchronously — or `undefined` while it has not arrived. For the provider's\n * render, which cannot await: kastlan wrapped the loader in a cache of its own\n * (`hasKitLabels` / `kitLabelsFor`) to get exactly this, and the other apps would have\n * written the same lines. Same object as the promise resolved to.\n */\nexport function peekUiKitLabels(code: string, formatLocale: string = catalogueFormat(code)): UiKitLabels | undefined {\n return ready.get(cacheKey(code, formatLocale)[1]);\n}\n\n/**\n * The kit's catalogue for `code`, loading it on first use: `<UiKitProvider\n * labels={useUiKitLabels(language)} locale={formatLocaleOf(language)}>`.\n *\n * On a switch it keeps returning the PREVIOUS language's catalogue until the next one\n * has arrived, so the kit's words never blank out mid-switch; `undefined` only before\n * the very first catalogue (render nothing, or the English defaults, until then — or\n * await {@link loadUiKitLabels} before the first render, as the apps do for their own\n * catalogue). A failed fetch keeps the previous catalogue; the next switch tries again.\n */\nexport function useUiKitLabels(code: string, formatLocale: string = catalogueFormat(code)): UiKitLabels | undefined {\n const current = peekUiKitLabels(code, formatLocale);\n const [previous, setPrevious] = useState<UiKitLabels | undefined>(current);\n useEffect(() => {\n if (peekUiKitLabels(code, formatLocale)) return;\n let live = true;\n loadUiKitLabels(code, formatLocale).then(\n (labels) => {\n if (live) setPrevious(labels);\n },\n () => {},\n );\n return () => {\n live = false;\n };\n }, [code, formatLocale]);\n if (current && current !== previous) setPrevious(current);\n return current ?? previous;\n}\n\n/**\n * The rows `LanguageMenu` and `LanguageSetting` take, for the codes an app offers, in\n * the order given: `{ code, label: nativeName, country: flag }`.\n *\n * `LanguageMenu` draws `country` as a flag-icons class (`fi fi-ch`) and nothing more —\n * the kit ships no flag artwork and no flag CSS, the app loads the stylesheet (or just\n * the rules for its flags, as Kurvenschmiede and keksdose do). `LanguageSetting` is a\n * native `<select>`, whose options can hold text only, so it shows the names and\n * ignores `country`; the same array serves both.\n *\n * A label of the app's own (keksdose's \"Deutsch (Schweiz)\") is a `.map` over the\n * result.\n */\nexport function languageOptions(codes: readonly KitLanguageCode[] = ALL_CODES): LanguageOption[] {\n return codes.flatMap((code) => {\n const language = KIT_LANGUAGES.find((entry) => entry.code === code);\n if (!language) return [];\n return [{ code: language.code, label: language.nativeName, country: language.flag }];\n });\n}\n"],"mappings":";AAAA,SAAS,WAAW,gBAAgB;AAoF7B,MAAM,gBAAwC;AAAA,EACnD,EAAE,MAAM,SAAS,YAAY,WAAW,aAAa,UAAU,cAAc,SAAS,MAAM,KAAK;AAAA,EACjG,EAAE,MAAM,MAAM,YAAY,WAAW,aAAa,WAAW,cAAc,SAAS,MAAM,KAAK;AAAA,EAC/F,EAAE,MAAM,MAAM,YAAY,cAAW,aAAa,WAAW,cAAc,SAAS,MAAM,KAAK;AAAA,EAC/F,EAAE,MAAM,MAAM,YAAY,eAAY,aAAa,UAAU,cAAc,SAAS,MAAM,KAAK;AAAA,EAC/F,EAAE,MAAM,MAAM,YAAY,YAAY,aAAa,WAAW,cAAc,SAAS,MAAM,KAAK;AAAA,EAChG,EAAE,MAAM,MAAM,YAAY,UAAU,aAAa,aAAa,cAAc,SAAS,MAAM,KAAK;AAAA,EAChG,EAAE,MAAM,MAAM,YAAY,4BAAQ,aAAa,wBAAw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AAClD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkC,OAAO;AACzE,YAAU,MAAM;AACd,QAAI,gBAAgB,MAAM,YAAY,EAAG;AACzC,QAAI,OAAO;AACX,oBAAgB,MAAM,YAAY,EAAE;AAAA,MAClC,CAAC,WAAW;AACV,YAAI,KAAM,aAAY,MAAM;AAAA,MAC9B;AAAA,MACA,MAAM;AAAA,MAAC;AAAA,IACT;AACA,WAAO,MAAM;AACX,aAAO;AAAA,IACT;AAAA,EACF,GAAG,CAAC,MAAM,YAAY,CAAC;AACvB,MAAI,WAAW,YAAY,SAAU,aAAY,OAAO;AACxD,SAAO,WAAW;AACpB;AAeO,SAAS,gBAAgB,QAAoC,WAA6B;AAC/F,SAAO,MAAM,QAAQ,CAAC,SAAS;AAC7B,UAAM,WAAW,cAAc,KAAK,CAAC,UAAU,MAAM,SAAS,IAAI;AAClE,QAAI,CAAC,SAAU,QAAO,CAAC;AACvB,WAAO,CAAC,EAAE,MAAM,SAAS,MAAM,OAAO,SAAS,YAAY,SAAS,SAAS,KAAK,CAAC;AAAA,EACrF,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/i18n/languages.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport type { UiKitLabels } from \"./kit-labels\";\nimport type { LanguageOption } from \"../shell/topbar-controls\";\n\n/**\n * \"Which language is this reader in, and what does the kit say in it?\" — the one\n * answer the three apps each wrote for themselves (docs/i18n-harmonization.md, H2).\n *\n * kastlan, keksdose and Kurvenschmiede all ship a subset of the same seven languages,\n * and every one of them hand-rolled the same three things: a list of languages with\n * their names and flags, a rule for turning what a browser asks for (`de-AT`, `zh-TW`,\n * `en-AU`) into a code the app ships, and a bridge from that code to the kit's label\n * catalogue. The three disagreed where nobody was looking: a reader asking for `zh-TW`\n * got German in kastlan and Chinese in Kurvenschmiede; keksdose's English got the raw\n * defaults, so its counts read \"12345\" where the other two wrote \"12,345\"; kastlan\n * formatted French as `fr-CH` and Kurvenschmiede as `fr-FR`. None of it was a decision.\n * This module makes it one, in one place, tested once.\n *\n * WHAT IT IS NOT: an i18n library. It resolves no app strings, carries no detector and\n * depends on nothing — the app keeps i18next (or whatever it uses) for its own words and\n * asks this module only the questions the kit can answer for all three apps alike:\n * - {@link KIT_LANGUAGES}: the seven codes, each with its own name, its English name,\n * the flag it flies and the locale it formats in;\n * - {@link resolveLanguage}: which of the codes an app offers answers a reader;\n * - {@link formatLocaleOf}: the `Intl` tag for a code (the provider's `locale`,\n * `<html lang>`, every `toLocaleString` in the app);\n * - {@link loadUiKitLabels}: the kit's catalogue for a code, fetched on demand;\n * - {@link languageOptions}: the rows `LanguageMenu` and `LanguageSetting` take.\n *\n * THE CODE AND THE FORMATTING LOCALE ARE TWO THINGS (Kurvenschmiede's insight, made\n * the rule). The code names a catalogue — what the account stores, what i18next\n * resolves, what a mail is chosen by — and a bare `en` says nothing about how a date is\n * written. Each language formats like its home (Marcel, 2026-10-02, H6): `de-CH`,\n * `en-GB` (British, like the spelling), `es-ES`, `fr-FR`, `it-IT`, `hu-HU`, `zh-CN`. An\n * app that must format otherwise — kastlan's QR bill follows the SIX spec, not the\n * reader — passes its own locale where it needs it; the registry is the default.\n *\n * THERE IS ONE GERMAN, `de-CH`: Swiss Standard German, formal (0.18). Every other\n * German a browser or an old localStorage can hand over — `de`, `de-DE`, `de-AT`,\n * `de-LI`, the briefly offered `de-informal` / `de-CH-informal` — is read as it.\n * Its name is plain \"Deutsch\": it is the only German, so there is nothing to tell it\n * apart from, and the Swiss flag beside it is what says where the spelling comes from.\n *\n * AND ONE CHINESE, `zh`, WHICH IS SIMPLIFIED. `zh-TW`, `zh-HK` and `zh-Hant` resolve to\n * it: there is no Traditional catalogue, and a reader of Traditional characters reads\n * Simplified far more readily than whichever second language a fallback would guess\n * at (Kurvenschmiede's reasoning, now everyone's). Its name says \"简体中文\" so that\n * reader sees what they are getting before they pick it.\n */\n\n/** The seven languages the kit ships a catalogue for. An app offers a subset. */\nexport type KitLanguageCode = \"de-CH\" | \"en\" | \"es\" | \"fr\" | \"it\" | \"hu\" | \"zh\";\n\n/** One language the kit ships: what it is called, which flag it flies and which\n * BCP 47 tag it formats in. */\nexport interface KitLanguage {\n /** The catalogue code — what an app stores, sends and hands i18next. */\n readonly code: KitLanguageCode;\n /** The language's name in itself, for a switcher: the reader looking for theirs may\n * not read the language the page is currently in. */\n readonly nativeName: string;\n /** The name in English, for places that list languages to a team rather than to a\n * reader (a translation review's locale column, an admin's reviewer grant). */\n readonly englishName: string;\n /** The BCP 47 tag the language formats numbers and dates in, and declares itself in\n * on `<html lang>`. See {@link formatLocaleOf}. */\n readonly formatLocale: string;\n /** ISO 3166-1 alpha-2 country (lowercase) for flag-icons' `fi fi-<flag>` class —\n * NOT the language code: English flies the UK flag, German the Swiss one, Chinese\n * the PRC's (the catalogue is Simplified). The kit renders the class name only; the\n * app supplies the flag stylesheet (README, \"What you install alongside it\"). */\n readonly flag: string;\n}\n\n/**\n * Every language the kit ships, in the order a switcher lists them: alphabetical by\n * native name (Deutsch, English, Español … 简体中文), which is what a reader scanning for\n * their own language's name expects.\n *\n * An app offering four of them passes those four codes to {@link resolveLanguage} and\n * {@link languageOptions}; it does not copy this list. A language added here is one the\n * kit has a catalogue for (the loader map below is typed by {@link KitLanguageCode}, so\n * a code without one does not compile).\n */\nexport const KIT_LANGUAGES: readonly KitLanguage[] = [\n { code: \"de-CH\", nativeName: \"Deutsch\", englishName: \"German\", formatLocale: \"de-CH\", flag: \"ch\" },\n { code: \"en\", nativeName: \"English\", englishName: \"English\", formatLocale: \"en-GB\", flag: \"gb\" },\n { code: \"es\", nativeName: \"Español\", englishName: \"Spanish\", formatLocale: \"es-ES\", flag: \"es\" },\n { code: \"fr\", nativeName: \"Français\", englishName: \"French\", formatLocale: \"fr-FR\", flag: \"fr\" },\n { code: \"it\", nativeName: \"Italiano\", englishName: \"Italian\", formatLocale: \"it-IT\", flag: \"it\" },\n { code: \"hu\", nativeName: \"Magyar\", englishName: \"Hungarian\", formatLocale: \"hu-HU\", flag: \"hu\" },\n { code: \"zh\", nativeName: \"简体中文\", englishName: \"Chinese (Simplified)\", formatLocale: \"zh-CN\", flag: \"cn\" },\n];\n\nconst ALL_CODES: readonly KitLanguageCode[] = KIT_LANGUAGES.map((language) => language.code);\n\n/** The kit's home language: what a reader nothing else matches gets, when it is offered. */\nconst HOME: KitLanguageCode = \"de-CH\";\n\n/** The language part of a tag, lower-cased: `de-CH-informal` → `de`, `zh_Hant` → `zh`. */\nconst languagePart = (tag: string) => tag.split(\"-\")[0].toLowerCase();\n\n/**\n * The offered code that answers ONE requested tag, or `undefined`.\n *\n * Exact first, ignoring case (`DE-ch` → `de-CH`), then by language part: since the kit\n * has exactly one code per language, \"the offered code whose language is the tag's\n * language\" is the whole of the rule, and it is what takes every German to `de-CH`\n * (`de-AT`, `de-informal`), every Chinese to `zh` (`zh-TW`, `zh-Hant-HK`) and every\n * regional form to its base (`fr-CA` → `fr`, `en-AU` → `en`). A language the app does\n * not offer answers nothing, so the caller moves on to the reader's next preference\n * rather than landing on a guess. Underscores are read as hyphens (`de_CH`), the way a\n * Java or Python backend may have stored the account's locale.\n */\nfunction answer(candidate: unknown, offered: readonly KitLanguageCode[]): KitLanguageCode | undefined {\n if (typeof candidate !== \"string\") return undefined;\n const tag = candidate.trim().replace(/_/g, \"-\");\n if (!tag) return undefined;\n const lower = tag.toLowerCase();\n const exact = offered.find((code) => code.toLowerCase() === lower);\n if (exact) return exact;\n const language = languagePart(tag);\n return offered.find((code) => languagePart(code) === language);\n}\n\n/**\n * Which of the codes an app offers answers this reader.\n *\n * `candidates` are the reader's preferences **in precedence order**, and the first\n * one that matches wins — so the order is the policy. The one the harmonisation plan\n * gives every app (H5):\n *\n * resolveLanguage(\n * [localStorage.getItem(\"<app>-lang\"), user?.locale, ...navigator.languages],\n * OFFERED,\n * );\n *\n * the choice stored on this device (the reader picked it, here) → the account's\n * language (read back on sign-in, so a new device starts in it) → the browser's list,\n * in its own order → the fallback. Missing sources are simply `null` / `undefined`;\n * they are skipped, as is an empty string.\n *\n * Each candidate is matched exactly (case-insensitively), then by language — every\n * German variant to `de-CH`, every Chinese to `zh` (Simplified), any other regional\n * form to its base language (`fr-CA` → `fr`, `en-AU` → `en`) — and only within\n * `offered`: a reader whose browser says `es-MX` first and `en` second, in an app that\n * offers no Spanish, gets English rather than the fallback. That is the difference\n * from a single-tag lookup, and why the browser's whole list is passed, not its first\n * entry.\n *\n * `fallback` is what a reader nothing matches gets: by default `de-CH` when the app\n * offers it — the kit's and the three apps' home language — else the app's first\n * offered code. It is returned as given, offered or not; the app chose it.\n *\n * Why not i18next's own matcher (`getBestMatchFromCodes`, which Kurvenschmiede calls):\n * it needs an i18next instance, it reduces `de-AT` to a `de` none of the apps ships\n * unless every caller remembers a converter first, and its answer to a list depends on\n * `supportedLngs` and `nonExplicitSupportedLngs` being set exactly so. This is a pure\n * function of its arguments, so the switcher, the account form, a server-rendered\n * guess and a test all get the same answer without one.\n */\nexport function resolveLanguage(\n candidates: readonly (string | null | undefined)[],\n offered: readonly KitLanguageCode[],\n fallback?: KitLanguageCode,\n): KitLanguageCode {\n for (const candidate of candidates) {\n const found = answer(candidate, offered);\n if (found) return found;\n }\n return fallback ?? (offered.includes(HOME) ? HOME : (offered[0] ?? HOME));\n}\n\n/**\n * The BCP 47 tag a language formats in — `formatLocaleOf(\"en\")` is `\"en-GB\"`.\n *\n * For `<UiKitProvider locale>`, for `<html lang>` (a screen reader pronounces by it,\n * and `en` alone does not say which English) and for the app's own `Intl` calls, so\n * the kit's counts and the app's amounts group their digits the same way.\n *\n * Takes any tag, not only a {@link KitLanguageCode}. A tag of one of the seven\n * languages formats in that language's home, by decision — not the reader's region:\n * `de-AT` as `de-CH`, `en-AU` and `en-US` as `en-GB`, `zh-TW` as `zh-CN`. So an app can\n * hand it i18next's `resolvedLanguage` as it comes.\n *\n * A tag of a language the kit does NOT ship formats as itself (canonicalised): `sv-SE`\n * stays `sv-SE`. That is a formatting preference, not a language — keksdose's date\n * setting offers ISO order as `sv-SE`, and 0.19.0 turned it into a German weekday by\n * resolving it to the home language (keksdose's 0.19 adoption). Words are another\n * matter: {@link resolveLanguage} and {@link loadUiKitLabels} still fall back to\n * `de-CH` for such a tag. A tag `Intl` cannot read formats as `de-CH`.\n */\nexport function formatLocaleOf(code: string): string {\n const shipped = answer(code, ALL_CODES);\n if (shipped) return homeFormat(shipped);\n try {\n return Intl.getCanonicalLocales(code)[0] ?? homeFormat(HOME);\n } catch {\n return homeFormat(HOME);\n }\n}\n\nfunction homeFormat(code: KitLanguageCode): string {\n return KIT_LANGUAGES.find((language) => language.code === code)!.formatLocale;\n}\n\n/** The format tag of the catalogue a code loads — always one of the seven languages'\n * own, so the words and the digits of a catalogue agree. */\nconst catalogueFormat = (code: string) => homeFormat(resolveLanguage([code], ALL_CODES));\n\n/**\n * One loader per catalogue, each a LITERAL relative `import()`.\n *\n * The literal is load-bearing twice. The library is built one file per module\n * (`bundle: false`, tsup.config.ts), so `./locales/fr` stays a module of its own in\n * dist/ and `scripts/fix-esm-extensions.mjs` gives the specifier its `.js`. And an\n * app's bundler can only split what it can read: a path assembled from a code is a\n * chunk rollup cannot make, and the failure is at runtime. With literals, each\n * language is a chunk of its own and a reader downloads exactly theirs — about 25 kB of\n * JavaScript a catalogue, so an entry chunk holding all of them would carry six that\n * the reader never uses.\n *\n * Relative, not `@eifi1/ui-kit/i18n/fr`: a package importing itself by name resolves\n * through the consumer's node_modules, which a linked checkout or a test of this repo\n * does not have.\n */\nconst LOADERS: Record<KitLanguageCode, (formatLocale: string) => Promise<UiKitLabels>> = {\n \"de-CH\": async (locale) => (await import(\"./locales/de-CH\")).uiKitLabelsDeCh(locale),\n en: async (locale) => (await import(\"./locales/en\")).uiKitLabelsEn(locale),\n es: async (locale) => (await import(\"./locales/es\")).uiKitLabelsEs(locale),\n fr: async (locale) => (await import(\"./locales/fr\")).uiKitLabelsFr(locale),\n it: async (locale) => (await import(\"./locales/it\")).uiKitLabelsIt(locale),\n hu: async (locale) => (await import(\"./locales/hu\")).uiKitLabelsHu(locale),\n zh: async (locale) => (await import(\"./locales/zh\")).uiKitLabelsZh(locale),\n};\n\n/** One promise per (language, format locale), so asking twice is one fetch and one\n * object: the provider's context value keeps its identity, and every kit component\n * reading it is spared a re-render on a switch back. */\nconst loaded = new Map<string, Promise<UiKitLabels>>();\n/** The same catalogues once they have arrived — what {@link peekUiKitLabels} reads. */\nconst ready = new Map<string, UiKitLabels>();\n\nfunction cacheKey(code: string, formatLocale: string): [KitLanguageCode, string] {\n const language = resolveLanguage([code], ALL_CODES);\n return [language, `${language}\\u0000${formatLocale}`];\n}\n\n/**\n * The kit's catalogue for a language, fetched on demand and formatted in\n * `formatLocale` — for `<UiKitProvider labels={…}>`.\n *\n * Every language goes through its catalogue's factory, English included:\n * `uiKitLabelsEn(\"en-GB\")` writes \"12,345 rows\" where the bare\n * `DEFAULT_UI_KIT_LABELS` print \"12345\" (and keksdose's English did, by passing no\n * labels at all). `formatLocale` defaults to the language's own\n * ({@link formatLocaleOf}); pass another only for a reason, as the factories' own\n * docs describe (`\"de-DE\"` keeps the Swiss words and writes German digits).\n *\n * `code` may be any tag and is resolved like {@link formatLocaleOf}'s, so `de` loads\n * the one German and a language the kit does not ship loads `de-CH` — the same answer\n * the app's own fallback gives, rather than English beside the app's German.\n *\n * Asynchronous on purpose, and there is no synchronous twin: one would have to import\n * all seven catalogues statically, which puts every language in every app's entry\n * chunk — exactly what one subpath per language exists to prevent. Await it before the\n * first render, beside the app's own catalogue (the apps already await i18next's init\n * for the same reason: no frame in the wrong language), and keep the result in state.\n * To change a few words, spread over what it returns rather than copying a catalogue:\n * a copy misses every key a later release adds.\n *\n * A rejected fetch (a deploy replaced the chunk, the device went offline) is not\n * remembered, so the next call tries again.\n */\nexport function loadUiKitLabels(code: string, formatLocale: string = catalogueFormat(code)): Promise<UiKitLabels> {\n const [language, key] = cacheKey(code, formatLocale);\n let labels = loaded.get(key);\n if (!labels) {\n labels = LOADERS[language](formatLocale);\n loaded.set(key, labels);\n labels.then(\n (done) => ready.set(key, done),\n () => loaded.delete(key),\n );\n }\n return labels;\n}\n\n/**\n * The catalogue {@link loadUiKitLabels} already fetched for this language and format\n * locale — synchronously — or `undefined` while it has not arrived. For the provider's\n * render, which cannot await: kastlan wrapped the loader in a cache of its own\n * (`hasKitLabels` / `kitLabelsFor`) to get exactly this, and the other apps would have\n * written the same lines. Same object as the promise resolved to.\n */\nexport function peekUiKitLabels(code: string, formatLocale: string = catalogueFormat(code)): UiKitLabels | undefined {\n return ready.get(cacheKey(code, formatLocale)[1]);\n}\n\n/**\n * The kit's catalogue for `code`, loading it on first use: `<UiKitProvider\n * labels={useUiKitLabels(language)} locale={formatLocaleOf(language)}>`.\n *\n * On a switch it keeps returning the PREVIOUS language's catalogue until the next one\n * has arrived, so the kit's words never blank out mid-switch; `undefined` only before\n * the very first catalogue (render nothing, or the English defaults, until then — or\n * await {@link loadUiKitLabels} before the first render, as the apps do for their own\n * catalogue). A failed fetch keeps the previous catalogue; the next switch tries again.\n */\nexport function useUiKitLabels(code: string, formatLocale: string = catalogueFormat(code)): UiKitLabels | undefined {\n const current = peekUiKitLabels(code, formatLocale);\n const [previous, setPrevious] = useState<UiKitLabels | undefined>(current);\n useEffect(() => {\n if (peekUiKitLabels(code, formatLocale)) return;\n let live = true;\n loadUiKitLabels(code, formatLocale).then(\n (labels) => {\n if (live) setPrevious(labels);\n },\n () => {},\n );\n return () => {\n live = false;\n };\n }, [code, formatLocale]);\n if (current && current !== previous) setPrevious(current);\n return current ?? previous;\n}\n\n/**\n * The rows `LanguageMenu` and `LanguageSetting` take, for the codes an app offers, in\n * the order given: `{ code, label: nativeName, country: flag }`.\n *\n * `LanguageMenu` draws `country` as a flag-icons class (`fi fi-ch`) and nothing more —\n * the kit ships no flag artwork and no flag CSS, the app loads the stylesheet (or just\n * the rules for its flags, as Kurvenschmiede and keksdose do). `LanguageSetting` is a\n * native `<select>`, whose options can hold text only, so it shows the names and\n * ignores `country`; the same array serves both.\n *\n * A label of the app's own (keksdose's \"Deutsch (Schweiz)\") is a `.map` over the\n * result.\n */\nexport function languageOptions(codes: readonly KitLanguageCode[] = ALL_CODES): LanguageOption[] {\n return codes.flatMap((code) => {\n const language = KIT_LANGUAGES.find((entry) => entry.code === code);\n if (!language) return [];\n return [{ code: language.code, label: language.nativeName, country: language.flag }];\n });\n}\n"],"mappings":";AAAA,SAAS,WAAW,gBAAgB;AAoF7B,MAAM,gBAAwC;AAAA,EACnD,EAAE,MAAM,SAAS,YAAY,WAAW,aAAa,UAAU,cAAc,SAAS,MAAM,KAAK;AAAA,EACjG,EAAE,MAAM,MAAM,YAAY,WAAW,aAAa,WAAW,cAAc,SAAS,MAAM,KAAK;AAAA,EAC/F,EAAE,MAAM,MAAM,YAAY,cAAW,aAAa,WAAW,cAAc,SAAS,MAAM,KAAK;AAAA,EAC/F,EAAE,MAAM,MAAM,YAAY,eAAY,aAAa,UAAU,cAAc,SAAS,MAAM,KAAK;AAAA,EAC/F,EAAE,MAAM,MAAM,YAAY,YAAY,aAAa,WAAW,cAAc,SAAS,MAAM,KAAK;AAAA,EAChG,EAAE,MAAM,MAAM,YAAY,UAAU,aAAa,aAAa,cAAc,SAAS,MAAM,KAAK;AAAA,EAChG,EAAE,MAAM,MAAM,YAAY,4BAAQ,aAAa,wBAAwB,cAAc,SAAS,MAAM,KAAK;AAC3G;AAEA,MAAM,YAAwC,cAAc,IAAI,CAAC,aAAa,SAAS,IAAI;AAG3F,MAAM,OAAwB;AAG9B,MAAM,eAAe,CAAC,QAAgB,IAAI,MAAM,GAAG,EAAE,CAAC,EAAE,YAAY;AAcpE,SAAS,OAAO,WAAoB,SAAkE;AACpG,MAAI,OAAO,cAAc,SAAU,QAAO;AAC1C,QAAM,MAAM,UAAU,KAAK,EAAE,QAAQ,MAAM,GAAG;AAC9C,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,QAAQ,IAAI,YAAY;AAC9B,QAAM,QAAQ,QAAQ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,WAAW;AACpB;AAeO,SAAS,gBAAgB,QAAoC,WAA6B;AAC/F,SAAO,MAAM,QAAQ,CAAC,SAAS;AAC7B,UAAM,WAAW,cAAc,KAAK,CAAC,UAAU,MAAM,SAAS,IAAI;AAClE,QAAI,CAAC,SAAU,QAAO,CAAC;AACvB,WAAO,CAAC,EAAE,MAAM,SAAS,MAAM,OAAO,SAAS,YAAY,SAAS,SAAS,KAAK,CAAC;AAAA,EACrF,CAAC;AACH;","names":[]}
|
package/dist/i18n/locales/en.js
CHANGED
|
@@ -1623,7 +1623,10 @@ var DEFAULT_ADMIN_AREA_LABELS = {
|
|
|
1623
1623
|
sections: {
|
|
1624
1624
|
overview: { title: "Overview", help: "What is waiting, at a glance." },
|
|
1625
1625
|
users: { title: "Users", help: "Who has an account, and what each may do." },
|
|
1626
|
-
invitations: {
|
|
1626
|
+
invitations: {
|
|
1627
|
+
title: "Invitations",
|
|
1628
|
+
help: "Invite people by e-mail in their language; resend or revoke what\u2019s still open."
|
|
1629
|
+
},
|
|
1627
1630
|
billing: { title: "Billing", help: "The plan, the payment and the invoices." },
|
|
1628
1631
|
activity: { title: "Activity", help: "What the admins did, newest first." }
|
|
1629
1632
|
},
|