@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
|
@@ -12,25 +12,14 @@ import {
|
|
|
12
12
|
readTextFile,
|
|
13
13
|
roleOfColumn,
|
|
14
14
|
} from "../lib/column-mapping";
|
|
15
|
-
import type {
|
|
16
|
-
ColumnMapperResult,
|
|
17
|
-
ColumnMapping,
|
|
18
|
-
ColumnRole,
|
|
19
|
-
} from "../lib/column-mapping";
|
|
15
|
+
import type { ColumnMapperResult, ColumnMapping, ColumnRole } from "../lib/column-mapping";
|
|
20
16
|
import { parseTextTable } from "../lib/table-text";
|
|
21
17
|
import type { TableSeparator, TextTable } from "../lib/table-text";
|
|
22
18
|
import { AlertBanner } from "./alert-banner";
|
|
23
19
|
import { Checkbox } from "./checkbox";
|
|
24
20
|
import { Disclosure } from "./disclosure";
|
|
25
21
|
import { FileButton, useFilePicker } from "./file-button";
|
|
26
|
-
import {
|
|
27
|
-
Table,
|
|
28
|
-
TableBody,
|
|
29
|
-
TableCell,
|
|
30
|
-
TableHead,
|
|
31
|
-
TableHeaderCell,
|
|
32
|
-
TableRow,
|
|
33
|
-
} from "./table";
|
|
22
|
+
import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow } from "./table";
|
|
34
23
|
import type { FieldHelpProps } from "./field-parts";
|
|
35
24
|
import { Select } from "./select";
|
|
36
25
|
import { Textarea } from "./textarea";
|
|
@@ -142,11 +131,7 @@ const UNREAD_LISTED = 100;
|
|
|
142
131
|
* .tsv, … files" rather than a list of MIME types; the parse is the real check. */
|
|
143
132
|
const DEFAULT_ACCEPT = ".csv,.tsv,.txt,.dat,.asc";
|
|
144
133
|
|
|
145
|
-
function formatList(
|
|
146
|
-
items: string[],
|
|
147
|
-
type: "conjunction" | "disjunction",
|
|
148
|
-
locale: string | undefined,
|
|
149
|
-
): string {
|
|
134
|
+
function formatList(items: string[], type: "conjunction" | "disjunction", locale: string | undefined): string {
|
|
150
135
|
try {
|
|
151
136
|
return new Intl.ListFormat(locale, { type, style: "long" }).format(items);
|
|
152
137
|
} catch {
|
|
@@ -179,10 +164,7 @@ export type ColumnRoleTableRowProps = Omit<
|
|
|
179
164
|
> &
|
|
180
165
|
DataAttributes;
|
|
181
166
|
|
|
182
|
-
export interface ColumnRoleTableProps<
|
|
183
|
-
R extends string,
|
|
184
|
-
M extends ColumnMapping<R> = ColumnMapping<R>,
|
|
185
|
-
> {
|
|
167
|
+
export interface ColumnRoleTableProps<R extends string, M extends ColumnMapping<R> = ColumnMapping<R>> {
|
|
186
168
|
/** The columns' names — the file's header line — or `null` for a table without one
|
|
187
169
|
* (each column is then "Column 1", "Column 2", …). */
|
|
188
170
|
header: readonly string[] | null;
|
|
@@ -271,10 +253,7 @@ export interface ColumnRoleTableProps<
|
|
|
271
253
|
* focused behind the fade is scrolled clear of it, cell and all, and the Table's
|
|
272
254
|
* wrapper says which ends are cut in `data-overflow`.
|
|
273
255
|
*/
|
|
274
|
-
export function ColumnRoleTable<
|
|
275
|
-
R extends string,
|
|
276
|
-
M extends ColumnMapping<R> = ColumnMapping<R>,
|
|
277
|
-
>({
|
|
256
|
+
export function ColumnRoleTable<R extends string, M extends ColumnMapping<R> = ColumnMapping<R>>({
|
|
278
257
|
header,
|
|
279
258
|
rows,
|
|
280
259
|
width: widthProp,
|
|
@@ -289,38 +268,22 @@ export function ColumnRoleTable<
|
|
|
289
268
|
labels: labelsProp,
|
|
290
269
|
className,
|
|
291
270
|
}: ColumnRoleTableProps<R, M>) {
|
|
292
|
-
const labels: ColumnMapperLabels = useKitLabels(
|
|
293
|
-
"columnMapper",
|
|
294
|
-
DEFAULT_COLUMN_MAPPER_LABELS,
|
|
295
|
-
labelsProp,
|
|
296
|
-
);
|
|
271
|
+
const labels: ColumnMapperLabels = useKitLabels("columnMapper", DEFAULT_COLUMN_MAPPER_LABELS, labelsProp);
|
|
297
272
|
const locale = useKitLocale();
|
|
298
273
|
const shown = rows.slice(0, previewRows);
|
|
299
|
-
const width =
|
|
300
|
-
widthProp ??
|
|
301
|
-
shown.reduce(
|
|
302
|
-
(widest, row) => Math.max(widest, row.length),
|
|
303
|
-
header?.length ?? 0,
|
|
304
|
-
);
|
|
274
|
+
const width = widthProp ?? shown.reduce((widest, row) => Math.max(widest, row.length), header?.length ?? 0);
|
|
305
275
|
const columns = Array.from({ length: width }, (_, index) => index);
|
|
306
276
|
const total = totalRows ?? rows.length;
|
|
307
|
-
const nameOf = (column: number) =>
|
|
308
|
-
|
|
309
|
-
const labelOf = (value: R) =>
|
|
310
|
-
roles.find((role) => role.value === value)?.label ?? value;
|
|
277
|
+
const nameOf = (column: number) => header?.[column] || labels.columnN(column + 1);
|
|
278
|
+
const labelOf = (value: R) => roles.find((role) => role.value === value)?.label ?? value;
|
|
311
279
|
const gaps = missingRoles(roles, mapping, width).map((gap) =>
|
|
312
|
-
gap.length === 1
|
|
313
|
-
? labelOf(gap[0])
|
|
314
|
-
: labels.oneOf(formatList(gap.map(labelOf), "disjunction", locale)),
|
|
280
|
+
gap.length === 1 ? labelOf(gap[0]) : labels.oneOf(formatList(gap.map(labelOf), "disjunction", locale)),
|
|
315
281
|
);
|
|
316
282
|
// The required mark only where it tells one option from another.
|
|
317
283
|
const markRequired = roles.some((role) => role.required !== true);
|
|
318
284
|
|
|
319
285
|
return (
|
|
320
|
-
<div
|
|
321
|
-
className={cn("min-w-0 space-y-1.5", className)}
|
|
322
|
-
data-slot="column-role-table"
|
|
323
|
-
>
|
|
286
|
+
<div className={cn("min-w-0 space-y-1.5", className)} data-slot="column-role-table">
|
|
324
287
|
<Table density="compact" framed edgeFade aria-label={labels.table}>
|
|
325
288
|
<TableHead>
|
|
326
289
|
<TableRow>
|
|
@@ -328,14 +291,8 @@ export function ColumnRoleTable<
|
|
|
328
291
|
const role = roleOfColumn(roles, mapping, column);
|
|
329
292
|
const name = nameOf(column);
|
|
330
293
|
return (
|
|
331
|
-
<TableHeaderCell
|
|
332
|
-
|
|
333
|
-
scope="col"
|
|
334
|
-
className="min-w-36 py-2 align-top"
|
|
335
|
-
>
|
|
336
|
-
<span className="block max-w-56 truncate pb-1 text-caption font-normal text-muted">
|
|
337
|
-
{name}
|
|
338
|
-
</span>
|
|
294
|
+
<TableHeaderCell key={column} scope="col" className="min-w-36 py-2 align-top">
|
|
295
|
+
<span className="block max-w-56 truncate pb-1 text-caption font-normal text-muted">{name}</span>
|
|
339
296
|
<Select
|
|
340
297
|
size="sm"
|
|
341
298
|
className="w-full"
|
|
@@ -353,9 +310,7 @@ export function ColumnRoleTable<
|
|
|
353
310
|
roles,
|
|
354
311
|
mapping,
|
|
355
312
|
column,
|
|
356
|
-
event.target.value === ""
|
|
357
|
-
? null
|
|
358
|
-
: (event.target.value as R),
|
|
313
|
+
event.target.value === "" ? null : (event.target.value as R),
|
|
359
314
|
),
|
|
360
315
|
)
|
|
361
316
|
}
|
|
@@ -368,13 +323,9 @@ export function ColumnRoleTable<
|
|
|
368
323
|
key={option.value}
|
|
369
324
|
value={option.value}
|
|
370
325
|
// The short mark on screen, the word for a screen reader.
|
|
371
|
-
aria-label={
|
|
372
|
-
marked ? labels.requiredRole(option.label) : undefined
|
|
373
|
-
}
|
|
326
|
+
aria-label={marked ? labels.requiredRole(option.label) : undefined}
|
|
374
327
|
>
|
|
375
|
-
{marked
|
|
376
|
-
? (labels.requiredRoleShort ?? markedShort)(option.label)
|
|
377
|
-
: option.label}
|
|
328
|
+
{marked ? (labels.requiredRoleShort ?? markedShort)(option.label) : option.label}
|
|
378
329
|
</option>
|
|
379
330
|
);
|
|
380
331
|
})}
|
|
@@ -390,31 +341,22 @@ export function ColumnRoleTable<
|
|
|
390
341
|
{columns.map((column) => (
|
|
391
342
|
<TableCell
|
|
392
343
|
key={column}
|
|
393
|
-
data-ignored={
|
|
394
|
-
roleOfColumn(roles, mapping, column) === null || undefined
|
|
395
|
-
}
|
|
344
|
+
data-ignored={roleOfColumn(roles, mapping, column) === null || undefined}
|
|
396
345
|
className={cn(
|
|
397
346
|
"font-mono whitespace-nowrap",
|
|
398
347
|
// Dimmed, not hidden: its values are what tell you whether ignoring
|
|
399
348
|
// it was right.
|
|
400
|
-
roleOfColumn(roles, mapping, column) === null &&
|
|
401
|
-
"text-muted",
|
|
349
|
+
roleOfColumn(roles, mapping, column) === null && "text-muted",
|
|
402
350
|
)}
|
|
403
351
|
>
|
|
404
|
-
<span className="block max-w-56 truncate">
|
|
405
|
-
{row[column] ?? ""}
|
|
406
|
-
</span>
|
|
352
|
+
<span className="block max-w-56 truncate">{row[column] ?? ""}</span>
|
|
407
353
|
</TableCell>
|
|
408
354
|
))}
|
|
409
355
|
</TableRow>
|
|
410
356
|
))}
|
|
411
357
|
</TableBody>
|
|
412
358
|
</Table>
|
|
413
|
-
{total > shown.length && (
|
|
414
|
-
<p className="text-xs text-muted">
|
|
415
|
-
{labels.previewOf(shown.length, total)}
|
|
416
|
-
</p>
|
|
417
|
-
)}
|
|
359
|
+
{total > shown.length && <p className="text-xs text-muted">{labels.previewOf(shown.length, total)}</p>}
|
|
418
360
|
{gaps.length > 0 && (
|
|
419
361
|
<AlertBanner tone="warning" variant="inline" size="sm" block>
|
|
420
362
|
{labels.missing(formatList(gaps, "conjunction", locale))}
|
|
@@ -477,8 +419,7 @@ interface MapperState<R extends string> {
|
|
|
477
419
|
mapping: ColumnMapping<R>;
|
|
478
420
|
}
|
|
479
421
|
|
|
480
|
-
const hasFiles = (event: DragEvent) =>
|
|
481
|
-
Array.from(event.dataTransfer?.types ?? []).includes("Files");
|
|
422
|
+
const hasFiles = (event: DragEvent) => Array.from(event.dataTransfer?.types ?? []).includes("Files");
|
|
482
423
|
|
|
483
424
|
/**
|
|
484
425
|
* Paste, drop or choose a table, see what it was read as, and say which column is
|
|
@@ -517,13 +458,8 @@ export function ColumnMapper<R extends string>({
|
|
|
517
458
|
labels: labelsProp,
|
|
518
459
|
className,
|
|
519
460
|
}: ColumnMapperProps<R>) {
|
|
520
|
-
const labels: ColumnMapperLabels = useKitLabels(
|
|
521
|
-
|
|
522
|
-
DEFAULT_COLUMN_MAPPER_LABELS,
|
|
523
|
-
labelsProp,
|
|
524
|
-
);
|
|
525
|
-
const firstMapping = (table: TextTable) =>
|
|
526
|
-
guess ? guess(table) : guessMapping(roles, table.header, table.width);
|
|
461
|
+
const labels: ColumnMapperLabels = useKitLabels("columnMapper", DEFAULT_COLUMN_MAPPER_LABELS, labelsProp);
|
|
462
|
+
const firstMapping = (table: TextTable) => (guess ? guess(table) : guessMapping(roles, table.header, table.width));
|
|
527
463
|
const [state, setState] = useState<MapperState<R>>(() => {
|
|
528
464
|
const table = parseTextTable(defaultText);
|
|
529
465
|
return {
|
|
@@ -544,19 +480,14 @@ export function ColumnMapper<R extends string>({
|
|
|
544
480
|
|
|
545
481
|
const commit = (next: MapperState<R>) => {
|
|
546
482
|
setState(next);
|
|
547
|
-
onChange(
|
|
548
|
-
next.table.width === 0
|
|
549
|
-
? null
|
|
550
|
-
: readMappedTable(next.table, roles, next.mapping),
|
|
551
|
-
);
|
|
483
|
+
onChange(next.table.width === 0 ? null : readMappedTable(next.table, roles, next.mapping));
|
|
552
484
|
};
|
|
553
485
|
|
|
554
486
|
/** New text. `fresh` (a file): the reader's header answer and the mapping start over. */
|
|
555
487
|
const take = (text: string, fresh: boolean) => {
|
|
556
488
|
const header = fresh ? null : state.header;
|
|
557
489
|
const table = parseTextTable(text, header === null ? {} : { header });
|
|
558
|
-
const keep =
|
|
559
|
-
!fresh && table.width === state.table.width && state.table.width > 0;
|
|
490
|
+
const keep = !fresh && table.width === state.table.width && state.table.width > 0;
|
|
560
491
|
commit({
|
|
561
492
|
text,
|
|
562
493
|
header,
|
|
@@ -577,8 +508,7 @@ export function ColumnMapper<R extends string>({
|
|
|
577
508
|
.finally(() => setReading(false));
|
|
578
509
|
};
|
|
579
510
|
|
|
580
|
-
const refuse = (rejections: { message: string }[]) =>
|
|
581
|
-
setRefusal(rejections[0]?.message ?? null);
|
|
511
|
+
const refuse = (rejections: { message: string }[]) => setRefusal(rejections[0]?.message ?? null);
|
|
582
512
|
|
|
583
513
|
// A file dropped on the paste box. The same screening as the button's.
|
|
584
514
|
const drop = useFilePicker({
|
|
@@ -601,10 +531,7 @@ export function ColumnMapper<R extends string>({
|
|
|
601
531
|
const unread = result.unread;
|
|
602
532
|
|
|
603
533
|
return (
|
|
604
|
-
<div
|
|
605
|
-
className={cn("min-w-0 space-y-3", className)}
|
|
606
|
-
data-slot="column-mapper"
|
|
607
|
-
>
|
|
534
|
+
<div className={cn("min-w-0 space-y-3", className)} data-slot="column-mapper">
|
|
608
535
|
<Textarea
|
|
609
536
|
label={label ?? labels.paste}
|
|
610
537
|
hint={hint ?? labels.pasteHint}
|
|
@@ -616,10 +543,7 @@ export function ColumnMapper<R extends string>({
|
|
|
616
543
|
autoCorrect="off"
|
|
617
544
|
value={state.text}
|
|
618
545
|
disabled={disabled}
|
|
619
|
-
className={cn(
|
|
620
|
-
"font-mono text-xs",
|
|
621
|
-
dragOver && "rounded-md ring-2 ring-brand",
|
|
622
|
-
)}
|
|
546
|
+
className={cn("font-mono text-xs", dragOver && "rounded-md ring-2 ring-brand")}
|
|
623
547
|
data-drag-over={dragOver || undefined}
|
|
624
548
|
onChange={(event: ChangeEvent<HTMLTextAreaElement>) => {
|
|
625
549
|
setRefusal(null);
|
|
@@ -684,10 +608,7 @@ export function ColumnMapper<R extends string>({
|
|
|
684
608
|
|
|
685
609
|
{table.width > 0 && (
|
|
686
610
|
<>
|
|
687
|
-
<p
|
|
688
|
-
className="text-xs text-secondary"
|
|
689
|
-
data-slot="column-mapper-summary"
|
|
690
|
-
>
|
|
611
|
+
<p className="text-xs text-secondary" data-slot="column-mapper-summary">
|
|
691
612
|
{[
|
|
692
613
|
labels.summary(table.width, result.rows.length),
|
|
693
614
|
separator,
|
|
@@ -713,26 +634,16 @@ export function ColumnMapper<R extends string>({
|
|
|
713
634
|
labels={labelsProp}
|
|
714
635
|
/>
|
|
715
636
|
{unread.length > 0 && (
|
|
716
|
-
<Disclosure
|
|
717
|
-
variant="bare"
|
|
718
|
-
title={labels.unreadCount(unread.length)}
|
|
719
|
-
data-slot="column-mapper-unread"
|
|
720
|
-
>
|
|
637
|
+
<Disclosure variant="bare" title={labels.unreadCount(unread.length)} data-slot="column-mapper-unread">
|
|
721
638
|
<ul className="space-y-1 text-xs">
|
|
722
639
|
{unread.slice(0, UNREAD_LISTED).map((line) => (
|
|
723
640
|
<li key={line.line} className="min-w-0">
|
|
724
|
-
<span className="block text-secondary">
|
|
725
|
-
|
|
726
|
-
</span>
|
|
727
|
-
<code className="block truncate font-mono text-muted">
|
|
728
|
-
{line.text}
|
|
729
|
-
</code>
|
|
641
|
+
<span className="block text-secondary">{labels.unreadLine(line.line)}</span>
|
|
642
|
+
<code className="block truncate font-mono text-muted">{line.text}</code>
|
|
730
643
|
</li>
|
|
731
644
|
))}
|
|
732
645
|
{unread.length > UNREAD_LISTED && (
|
|
733
|
-
<li className="text-muted">
|
|
734
|
-
{labels.unreadMore(unread.length - UNREAD_LISTED)}
|
|
735
|
-
</li>
|
|
646
|
+
<li className="text-muted">{labels.unreadMore(unread.length - UNREAD_LISTED)}</li>
|
|
736
647
|
)}
|
|
737
648
|
</ul>
|
|
738
649
|
</Disclosure>
|
|
@@ -73,8 +73,7 @@ export interface ComboOption<V extends string | number> {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/** A row the user may take — present and not {@link ComboOption.disabled}. */
|
|
76
|
-
export const isOptionEnabled = (o: { disabled?: boolean } | undefined): boolean =>
|
|
77
|
-
o !== undefined && !o.disabled;
|
|
76
|
+
export const isOptionEnabled = (o: { disabled?: boolean } | undefined): boolean => o !== undefined && !o.disabled;
|
|
78
77
|
|
|
79
78
|
/**
|
|
80
79
|
* The next takeable row from `from`, stepping `dir` — what the arrow keys use so a
|
|
@@ -82,11 +81,7 @@ export const isOptionEnabled = (o: { disabled?: boolean } | undefined): boolean
|
|
|
82
81
|
* list (the family's arrows clamp rather than wrap) and answers `-1` when `from` is
|
|
83
82
|
* not a row and there is nothing to step to.
|
|
84
83
|
*/
|
|
85
|
-
export function stepEnabled(
|
|
86
|
-
rows: readonly { disabled?: boolean }[],
|
|
87
|
-
from: number,
|
|
88
|
-
dir: 1 | -1,
|
|
89
|
-
): number {
|
|
84
|
+
export function stepEnabled(rows: readonly { disabled?: boolean }[], from: number, dir: 1 | -1): number {
|
|
90
85
|
for (let i = from + dir; i >= 0 && i < rows.length; i += dir) {
|
|
91
86
|
if (!rows[i].disabled) return i;
|
|
92
87
|
}
|
|
@@ -535,8 +530,7 @@ export interface ComboboxPanelWidth {
|
|
|
535
530
|
maxRem?: number;
|
|
536
531
|
}
|
|
537
532
|
|
|
538
|
-
export interface ComboboxPanelProps<V extends string | number>
|
|
539
|
-
extends ComponentPropsWithoutRef<"div"> {
|
|
533
|
+
export interface ComboboxPanelProps<V extends string | number> extends ComponentPropsWithoutRef<"div"> {
|
|
540
534
|
core: ComboboxCore<V>;
|
|
541
535
|
/** What the trigger's `aria-controls` names. Owned by the component that renders
|
|
542
536
|
* the trigger, not by the core: one id has to reach both, and only one of them
|
|
@@ -663,9 +657,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
663
657
|
const isPhone = usePhoneLayout();
|
|
664
658
|
// Every row the keyboard can land on, the create row included — passed over, like a
|
|
665
659
|
// disabled option, while a write lock holds it.
|
|
666
|
-
const rows: readonly { disabled?: boolean }[] = showCreate
|
|
667
|
-
? [...results, { disabled: createLocked }]
|
|
668
|
-
: results;
|
|
660
|
+
const rows: readonly { disabled?: boolean }[] = showCreate ? [...results, { disabled: createLocked }] : results;
|
|
669
661
|
const rowCount = rows.length;
|
|
670
662
|
const optionId = (index: number) => `${listboxId}-option-${index}`;
|
|
671
663
|
// The core opens on row 0 and knows nothing of `disabled`; the highlight is settled
|
|
@@ -788,10 +780,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
788
780
|
failed ? "text-danger" : "text-muted",
|
|
789
781
|
)}
|
|
790
782
|
>
|
|
791
|
-
{message ??
|
|
792
|
-
(results.length > 0 && (
|
|
793
|
-
<span className="sr-only">{labels.resultCount(results.length)}</span>
|
|
794
|
-
))}
|
|
783
|
+
{message ?? (results.length > 0 && <span className="sr-only">{labels.resultCount(results.length)}</span>)}
|
|
795
784
|
</div>
|
|
796
785
|
);
|
|
797
786
|
|
|
@@ -825,11 +814,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
825
814
|
: "flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm",
|
|
826
815
|
// The row the arrows are on shows it on a phone too: the sheet takes
|
|
827
816
|
// the keyboard (BUG-5), and a tablet or a desktop at Large has one.
|
|
828
|
-
o.disabled
|
|
829
|
-
? DISABLED_ROW_CLASS
|
|
830
|
-
: i === current
|
|
831
|
-
? "bg-active"
|
|
832
|
-
: !isPhone && "hover:bg-hover",
|
|
817
|
+
o.disabled ? DISABLED_ROW_CLASS : i === current ? "bg-active" : !isPhone && "hover:bg-hover",
|
|
833
818
|
// After SHEET_ROW_CLASS, so its hover is the one cancelled.
|
|
834
819
|
o.disabled && isPhone && DISABLED_ROW_CLASS,
|
|
835
820
|
)}
|
|
@@ -841,9 +826,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
841
826
|
aria-hidden
|
|
842
827
|
className={cn(
|
|
843
828
|
"flex size-4 shrink-0 items-center justify-center rounded border",
|
|
844
|
-
selected
|
|
845
|
-
? "border-[var(--bg-inverse)] bg-inverse text-inverse"
|
|
846
|
-
: "border-strong bg-surface",
|
|
829
|
+
selected ? "border-[var(--bg-inverse)] bg-inverse text-inverse" : "border-strong bg-surface",
|
|
847
830
|
)}
|
|
848
831
|
>
|
|
849
832
|
{selected && <Check className="size-3" />}
|
|
@@ -858,9 +841,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
858
841
|
<span className={cn("block truncate-until-large text-primary", columns && selected && "font-medium")}>
|
|
859
842
|
{o.label}
|
|
860
843
|
</span>
|
|
861
|
-
{o.sublabel &&
|
|
862
|
-
<span className="block truncate-until-large text-xs text-placeholder">{o.sublabel}</span>
|
|
863
|
-
)}
|
|
844
|
+
{o.sublabel && <span className="block truncate-until-large text-xs text-placeholder">{o.sublabel}</span>}
|
|
864
845
|
</span>
|
|
865
846
|
)}
|
|
866
847
|
{!multi && selected && <Check className="size-4 shrink-0 text-brand" />}
|
|
@@ -889,15 +870,9 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
889
870
|
if (!createLocked) setActive(results.length);
|
|
890
871
|
}}
|
|
891
872
|
className={cn(
|
|
892
|
-
isPhone
|
|
893
|
-
? SHEET_ROW_CLASS
|
|
894
|
-
: "flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm",
|
|
873
|
+
isPhone ? SHEET_ROW_CLASS : "flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm",
|
|
895
874
|
"text-secondary",
|
|
896
|
-
createLocked
|
|
897
|
-
? DISABLED_ROW_CLASS
|
|
898
|
-
: current === results.length
|
|
899
|
-
? "bg-active"
|
|
900
|
-
: !isPhone && "hover:bg-hover",
|
|
875
|
+
createLocked ? DISABLED_ROW_CLASS : current === results.length ? "bg-active" : !isPhone && "hover:bg-hover",
|
|
901
876
|
// After SHEET_ROW_CLASS, so its hover is the one cancelled.
|
|
902
877
|
createLocked && isPhone && DISABLED_ROW_CLASS,
|
|
903
878
|
)}
|
|
@@ -906,9 +881,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
906
881
|
<span className="min-w-0 flex-1">
|
|
907
882
|
<span className="block truncate-until-large">{createContent}</span>
|
|
908
883
|
{createLocked && (
|
|
909
|
-
<span className="block truncate-until-large text-xs text-placeholder">
|
|
910
|
-
{createDisabledReason}
|
|
911
|
-
</span>
|
|
884
|
+
<span className="block truncate-until-large text-xs text-placeholder">{createDisabledReason}</span>
|
|
912
885
|
)}
|
|
913
886
|
</span>
|
|
914
887
|
</button>
|
|
@@ -1090,10 +1063,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
1090
1063
|
...(fit ? { width: "max-content", minWidth: least, maxWidth: most } : { width: panelWidth }),
|
|
1091
1064
|
maxHeight: placement.maxHeight,
|
|
1092
1065
|
}}
|
|
1093
|
-
className={cn(
|
|
1094
|
-
"z-50 flex flex-col rounded-md border border-subtle bg-surface shadow-lg",
|
|
1095
|
-
className,
|
|
1096
|
-
)}
|
|
1066
|
+
className={cn("z-50 flex flex-col rounded-md border border-subtle bg-surface shadow-lg", className)}
|
|
1097
1067
|
>
|
|
1098
1068
|
<DropdownSearchHeader
|
|
1099
1069
|
query={query}
|
|
@@ -40,8 +40,7 @@ export type { InlineEntityComboboxProps } from "./inline-entity-combobox";
|
|
|
40
40
|
* the DOM events of the wrapper. Everything else a wrapper needs reaches the root.
|
|
41
41
|
*/
|
|
42
42
|
export interface ComboboxProps
|
|
43
|
-
extends Omit<ComponentPropsWithoutRef<"div">, "id" | "onChange" | "onBlur" | "onSubmit">,
|
|
44
|
-
FieldHelpProps {
|
|
43
|
+
extends Omit<ComponentPropsWithoutRef<"div">, "id" | "onChange" | "onBlur" | "onSubmit">, FieldHelpProps {
|
|
45
44
|
value: string;
|
|
46
45
|
onChange: (v: string) => void;
|
|
47
46
|
/** Suggestion pool (e.g. existing payee names). */
|
|
@@ -592,10 +591,7 @@ export function Combobox(props: ComboboxProps) {
|
|
|
592
591
|
role="option"
|
|
593
592
|
aria-selected={o === value}
|
|
594
593
|
onClick={() => take(o)}
|
|
595
|
-
className={cn(
|
|
596
|
-
SHEET_ROW_CLASS,
|
|
597
|
-
optionAdornment && "flex items-center justify-between gap-2",
|
|
598
|
-
)}
|
|
594
|
+
className={cn(SHEET_ROW_CLASS, optionAdornment && "flex items-center justify-between gap-2")}
|
|
599
595
|
>
|
|
600
596
|
{optionAdornment ? <span className="truncate-until-large">{o}</span> : o}
|
|
601
597
|
{optionAdornment?.(o)}
|
|
@@ -90,7 +90,6 @@ export interface ConfirmOptions {
|
|
|
90
90
|
|
|
91
91
|
export type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
92
92
|
|
|
93
|
-
|
|
94
93
|
/**
|
|
95
94
|
* `const confirm = useConfirm()` → `if (!(await confirm({ title }))) return`.
|
|
96
95
|
*
|
|
@@ -279,8 +278,7 @@ function ConfirmDialogView({
|
|
|
279
278
|
const typedLabel =
|
|
280
279
|
target === undefined
|
|
281
280
|
? ""
|
|
282
|
-
: (request.typedLabel ??
|
|
283
|
-
(typeof labels.typed === "string" ? labels.typed : labels.typed(target)));
|
|
281
|
+
: (request.typedLabel ?? (typeof labels.typed === "string" ? labels.typed : labels.typed(target)));
|
|
284
282
|
|
|
285
283
|
return (
|
|
286
284
|
<DialogFrame
|
|
@@ -27,8 +27,7 @@ export interface CopyButtonLabels {
|
|
|
27
27
|
// Defined in ./copy-button-labels, which holds no component code (0.34, KS U8).
|
|
28
28
|
export { DEFAULT_COPY_BUTTON_LABELS };
|
|
29
29
|
|
|
30
|
-
export interface CopyButtonProps
|
|
31
|
-
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onClick"> {
|
|
30
|
+
export interface CopyButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onClick"> {
|
|
32
31
|
/** What to copy. A function is read at click time — for a value that is expensive
|
|
33
32
|
* to build (a CSV of the table) or that changes under the button. */
|
|
34
33
|
text: string | (() => string);
|
|
@@ -112,8 +111,7 @@ export function CopyButton({
|
|
|
112
111
|
const idleText = label ?? words.copy;
|
|
113
112
|
const stateText = state === "copied" ? words.copied : state === "failed" ? words.failed : idleText;
|
|
114
113
|
const Icon = ICONS[state];
|
|
115
|
-
const iconTone =
|
|
116
|
-
state === "copied" ? "text-success" : state === "failed" ? "text-danger" : undefined;
|
|
114
|
+
const iconTone = state === "copied" ? "text-success" : state === "failed" ? "text-danger" : undefined;
|
|
117
115
|
|
|
118
116
|
const onClick = async () => {
|
|
119
117
|
const ok = await copy(typeof text === "function" ? text() : text);
|
|
@@ -4,13 +4,7 @@ import { X } from "lucide-react";
|
|
|
4
4
|
import { cn } from "../lib/cn";
|
|
5
5
|
import { COUNTRY_CODES, countryName, normalizeCountryCode } from "../lib/countries";
|
|
6
6
|
import { rankMatch } from "../lib/text-match";
|
|
7
|
-
import {
|
|
8
|
-
FieldChevron,
|
|
9
|
-
FIELD_FLOATING_PAD,
|
|
10
|
-
FIELD_INVALID,
|
|
11
|
-
FIELD_TRIGGER,
|
|
12
|
-
FloatingField,
|
|
13
|
-
} from "./field-base";
|
|
7
|
+
import { FieldChevron, FIELD_FLOATING_PAD, FIELD_INVALID, FIELD_TRIGGER, FloatingField } from "./field-base";
|
|
14
8
|
import {
|
|
15
9
|
assignRef,
|
|
16
10
|
EndHintRow,
|
|
@@ -67,8 +61,7 @@ export { DEFAULT_COUNTRY_SELECT_LABELS };
|
|
|
67
61
|
* `null` of a clear cannot reach a handler that was never told about it.
|
|
68
62
|
*/
|
|
69
63
|
export interface CountrySelectProps<Clearable extends boolean = false>
|
|
70
|
-
extends Omit<ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue">,
|
|
71
|
-
FieldHelpProps {
|
|
64
|
+
extends Omit<ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue">, FieldHelpProps {
|
|
72
65
|
/** The chosen country as an ISO 3166-1 alpha-2 code ("CH"), in either case;
|
|
73
66
|
* `null`, `undefined` or `""` when none is. A code outside the list still shows
|
|
74
67
|
* its name — the list restricts what can be PICKED, not what can be shown. */
|
|
@@ -106,9 +99,10 @@ export interface CountrySelectProps<Clearable extends boolean = false>
|
|
|
106
99
|
* way — the order given is not kept, because the reader looks a country up by its
|
|
107
100
|
* name in their own language, and any other order is one they cannot predict.
|
|
108
101
|
*
|
|
109
|
-
* keksdose's bank picker
|
|
110
|
-
*
|
|
111
|
-
* is
|
|
102
|
+
* keksdose's bank picker passes the countries its configured bank-connection provider
|
|
103
|
+
* serves, read at runtime: its connections are provider-neutral since 2026-10-29, so
|
|
104
|
+
* the list is no longer a fixed fifteen. A code that is not in ISO's list is allowed
|
|
105
|
+
* here on purpose: `XK` (Kosovo) is the app's decision, not the kit's.
|
|
112
106
|
*/
|
|
113
107
|
countries?: readonly string[];
|
|
114
108
|
/**
|
|
@@ -218,7 +212,7 @@ function collator(locale: string): Intl.Collator {
|
|
|
218
212
|
* A country picker: the value is the ISO 3166-1 alpha-2 code ("CH"), the names are the
|
|
219
213
|
* runtime's own (`Intl.DisplayNames`) in the provider's locale, sorted by that
|
|
220
214
|
* locale's collation. Requested by kastlan (customer and handover addresses, with its
|
|
221
|
-
* six neighbours on top) and keksdose (
|
|
215
|
+
* six neighbours on top) and keksdose (its bank picker's countries) — both
|
|
222
216
|
* apps carried a hand-written list of names in two languages.
|
|
223
217
|
*
|
|
224
218
|
* ## Built on the kit's searchable combobox
|
|
@@ -318,10 +312,7 @@ export function CountrySelect<Clearable extends boolean = false>({
|
|
|
318
312
|
// `filter: false` — the panel is handed the rows `search` ranks below instead of
|
|
319
313
|
// the core's substring filter; the core still owns open, query, the highlighted row,
|
|
320
314
|
// anchoring and dismissal.
|
|
321
|
-
const allOptions = useMemo(
|
|
322
|
-
() => [...top, ...others].map((e) => toOption(e, flags)),
|
|
323
|
-
[top, others, flags],
|
|
324
|
-
);
|
|
315
|
+
const allOptions = useMemo(() => [...top, ...others].map((e) => toOption(e, flags)), [top, others, flags]);
|
|
325
316
|
const core = useComboboxCore<string>({ options: allOptions, filter: false });
|
|
326
317
|
const { open, setOpen, query, triggerRef, closeToTrigger } = core;
|
|
327
318
|
// The core anchors the panel to the trigger and hands focus back to it; the caller's
|
|
@@ -467,10 +458,7 @@ export function CountrySelect<Clearable extends boolean = false>({
|
|
|
467
458
|
{/* A long name ("Saint Vincent and the Grenadines") truncates rather than
|
|
468
459
|
widening the field: the kit is checked at 390px. From Large up it wraps and
|
|
469
460
|
the trigger grows instead (text size §10.17, round 0.34 T1). */}
|
|
470
|
-
<span
|
|
471
|
-
id={valueId}
|
|
472
|
-
className={cn("truncate-until-large", selectedName === undefined && "text-placeholder")}
|
|
473
|
-
>
|
|
461
|
+
<span id={valueId} className={cn("truncate-until-large", selectedName === undefined && "text-placeholder")}>
|
|
474
462
|
{selectedName ?? emptyText}
|
|
475
463
|
</span>
|
|
476
464
|
</span>
|
|
@@ -26,7 +26,11 @@ export function CurrencyFlag({ country, className, ...rest }: CurrencyFlagProps)
|
|
|
26
26
|
// code printed next to it, and a reader that met both would hear the currency
|
|
27
27
|
// twice.
|
|
28
28
|
aria-hidden
|
|
29
|
-
className={cn(
|
|
29
|
+
className={cn(
|
|
30
|
+
"fi inline-block w-5 h-[0.9375rem] rounded-sm shadow-[0_0_0_1px_rgba(0,0,0,0.08)] shrink-0",
|
|
31
|
+
`fi-${country}`,
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
30
34
|
/>
|
|
31
35
|
);
|
|
32
36
|
}
|
|
@@ -45,11 +49,7 @@ export function getCurrency(code: string | null | undefined): CurrencyOption | u
|
|
|
45
49
|
* `Intl` only when a locale was actually GIVEN (by prop or `<UiKitProvider>`): an
|
|
46
50
|
* app that never set one keeps the shipped English names it has always shown,
|
|
47
51
|
* rather than whatever language the test runner or the browser happens to be in. */
|
|
48
|
-
export function currencyName(
|
|
49
|
-
c: CurrencyOption,
|
|
50
|
-
names?: Record<string, string>,
|
|
51
|
-
locale?: string,
|
|
52
|
-
): string {
|
|
52
|
+
export function currencyName(c: CurrencyOption, names?: Record<string, string>, locale?: string): string {
|
|
53
53
|
const own = names?.[c.code];
|
|
54
54
|
if (own !== undefined) return own;
|
|
55
55
|
if (locale) {
|
|
@@ -138,14 +138,13 @@ export function CurrencyOptionList({
|
|
|
138
138
|
const results = useMemo(() => {
|
|
139
139
|
// Every word of the query, in the code, the name or the symbol (0.51.4).
|
|
140
140
|
const words = searchWords(query, locale);
|
|
141
|
-
const hits =
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
);
|
|
141
|
+
const hits =
|
|
142
|
+
words.length > 0 ? named.filter(({ c, name }) => matchesSearch(words, [c.code, name, c.symbol], locale)) : named;
|
|
143
|
+
return hits.map(({ c, name }): ComboOption<string> => ({
|
|
144
|
+
value: c.code,
|
|
145
|
+
label: name,
|
|
146
|
+
icon: <CurrencyFlag country={c.country} />,
|
|
147
|
+
}));
|
|
149
148
|
}, [named, query, locale]);
|
|
150
149
|
|
|
151
150
|
const chosen = getCurrency(value)?.code;
|
|
@@ -23,12 +23,7 @@ import {
|
|
|
23
23
|
type CurrencyFlagProps,
|
|
24
24
|
type CurrencyOption,
|
|
25
25
|
} from "./currency-option-list";
|
|
26
|
-
import {
|
|
27
|
-
DEFAULT_COMMON_LABELS,
|
|
28
|
-
DEFAULT_CURRENCY_LABELS,
|
|
29
|
-
useKitLabels,
|
|
30
|
-
useKitLocale,
|
|
31
|
-
} from "../i18n/kit-labels";
|
|
26
|
+
import { DEFAULT_COMMON_LABELS, DEFAULT_CURRENCY_LABELS, useKitLabels, useKitLocale } from "../i18n/kit-labels";
|
|
32
27
|
|
|
33
28
|
// The data and the flag are declared beside the one list both currency pickers render
|
|
34
29
|
// (./currency-option-list, round 0.34 Wave 2, DUP-4) and are this module's exports, as
|
|
@@ -278,7 +273,7 @@ export function CurrencySelect({
|
|
|
278
273
|
<span className="font-medium">{selected.code}</span>
|
|
279
274
|
</>
|
|
280
275
|
) : (
|
|
281
|
-
placeholder ?? text.currency
|
|
276
|
+
(placeholder ?? text.currency)
|
|
282
277
|
)}
|
|
283
278
|
</span>
|
|
284
279
|
{/* No menu to drop while disabled or locked, so no chevron — the arrow is the one
|