@eifi1/ui-kit 0.31.1 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -28
- package/dist/account/delete-account-setting.d.ts +8 -3
- package/dist/admin/admin-action-confirm.d.ts +8 -3
- package/dist/admin/admin-action-log.d.ts +1 -1
- package/dist/admin/admin-action-log.js +4 -2
- package/dist/admin/admin-action-log.js.map +1 -1
- package/dist/admin/invitations-panel.d.ts +8 -3
- package/dist/admin/invitations-panel.js +29 -26
- package/dist/admin/invitations-panel.js.map +1 -1
- package/dist/admin/reviewer-scope-editor.d.ts +8 -3
- package/dist/admin/role-select.d.ts +10 -5
- package/dist/admin/transfer-ownership-dialog.d.ts +8 -3
- package/dist/admin/user-roster.d.ts +10 -5
- package/dist/admin/user-roster.js +8 -47
- package/dist/admin/user-roster.js.map +1 -1
- package/dist/auth/auth-errors.d.ts +43 -8
- package/dist/auth/auth-errors.js +24 -1
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/auth/register-form.d.ts +8 -3
- package/dist/billing/billing-banner.d.ts +184 -0
- package/dist/billing/billing-banner.js +98 -0
- package/dist/billing/billing-banner.js.map +1 -0
- package/dist/billing/billing-labels.d.ts +100 -0
- package/dist/billing/billing-labels.js +76 -0
- package/dist/billing/billing-labels.js.map +1 -0
- package/dist/billing/billing-lock.d.ts +158 -0
- package/dist/billing/billing-lock.js +17 -0
- package/dist/billing/billing-lock.js.map +1 -0
- package/dist/billing/billing-standing.d.ts +149 -0
- package/dist/billing/billing-standing.js +28 -0
- package/dist/billing/billing-standing.js.map +1 -0
- package/dist/billing/plan-card.d.ts +248 -0
- package/dist/billing/plan-card.js +248 -0
- package/dist/billing/plan-card.js.map +1 -0
- package/dist/billing/plan-limit-notice.d.ts +156 -0
- package/dist/billing/plan-limit-notice.js +76 -0
- package/dist/billing/plan-limit-notice.js.map +1 -0
- package/dist/billing/plan-limit.d.ts +34 -0
- package/dist/billing/plan-limit.js +20 -0
- package/dist/billing/plan-limit.js.map +1 -0
- package/dist/billing/plan-price.d.ts +61 -0
- package/dist/billing/plan-price.js +45 -0
- package/dist/billing/plan-price.js.map +1 -0
- package/dist/billing/subscription-actions.d.ts +133 -0
- package/dist/billing/subscription-actions.js +28 -0
- package/dist/billing/subscription-actions.js.map +1 -0
- package/dist/billing/subscription-status-chip.d.ts +149 -0
- package/dist/billing/subscription-status-chip.js +48 -0
- package/dist/billing/subscription-status-chip.js.map +1 -0
- package/dist/chart.d.ts +9 -3
- package/dist/chart.js.map +1 -1
- package/dist/components/account-chips.d.ts +16 -4
- package/dist/components/account-chips.js +21 -3
- package/dist/components/account-chips.js.map +1 -1
- package/dist/components/alert-banner.d.ts +6 -1
- package/dist/components/alert-banner.js +5 -4
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +8 -3
- package/dist/components/amount-input.js +5 -5
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/appearance-labels.d.ts +38 -0
- package/dist/components/appearance-labels.js +19 -0
- package/dist/components/appearance-labels.js.map +1 -0
- package/dist/components/autocomplete.js +2 -2
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/breadcrumbs.js +3 -2
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/bulk-action-bar.d.ts +2 -2
- package/dist/components/bulk-action-bar.js +7 -12
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-group.d.ts +8 -3
- package/dist/components/button-group.js +7 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/calculator.d.ts +8 -3
- package/dist/components/calculator.js +4 -3
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/calendar-heatmap.js +5 -5
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/chart-height.d.ts +23 -0
- package/dist/components/chart-height.js +15 -0
- package/dist/components/chart-height.js.map +1 -0
- package/dist/components/chart-zoom.js +6 -1
- package/dist/components/chart-zoom.js.map +1 -1
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/checkbox.d.ts +10 -0
- package/dist/components/checkbox.js +25 -10
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/chip.d.ts +19 -3
- package/dist/components/chip.js +54 -23
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.d.ts +1 -1
- package/dist/components/choice-card.js +9 -8
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/column-mapper.js +1 -1
- package/dist/components/column-mapper.js.map +1 -1
- package/dist/components/combobox-core.js +8 -7
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.js +8 -8
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -3
- package/dist/components/copy-button.d.ts +10 -5
- package/dist/components/country-select.js +1 -1
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/currency-select.js +3 -3
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +8 -3
- package/dist/components/data-table-cells.d.ts +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filter-popover.js +4 -1
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table-labels.d.ts +1 -1
- package/dist/components/data-table-pagination.d.ts +3 -2
- package/dist/components/data-table-pagination.js +15 -6
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +123 -52
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +18 -6
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/description-list.js +2 -2
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.js +2 -1
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.js +3 -2
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/dropdown.d.ts +1 -1
- package/dist/components/dropdown.js +7 -1
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/facing-pair.d.ts +19 -6
- package/dist/components/facing-pair.js +3 -2
- package/dist/components/facing-pair.js.map +1 -1
- package/dist/components/field-parts.d.ts +102 -6
- package/dist/components/field-parts.js +81 -6
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-sync.d.ts +4 -1
- package/dist/components/field-sync.js +12 -2
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/field.js +2 -2
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-button.d.ts +8 -3
- package/dist/components/file-dropzone.d.ts +8 -3
- package/dist/components/floating-panel.js +7 -4
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/focus-ring.d.ts +12 -0
- package/dist/components/focus-ring.js +8 -0
- package/dist/components/focus-ring.js.map +1 -0
- package/dist/components/form-actions.d.ts +8 -3
- package/dist/components/form-actions.js +33 -19
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/full-bleed-dialog.d.ts +11 -1
- package/dist/components/full-bleed-dialog.js +3 -1
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/iban-input.d.ts +8 -3
- package/dist/components/image-grid.js +1 -1
- package/dist/components/image-grid.js.map +1 -1
- package/dist/components/inline-edit-field.js +10 -4
- package/dist/components/inline-edit-field.js.map +1 -1
- package/dist/components/language-select.d.ts +8 -3
- package/dist/components/legal-page.d.ts +26 -5
- package/dist/components/legal-page.js +3 -1
- package/dist/components/legal-page.js.map +1 -1
- package/dist/components/legal.d.ts +8 -3
- package/dist/components/legal.js +2 -1
- package/dist/components/legal.js.map +1 -1
- package/dist/components/lightbox.js +24 -2
- package/dist/components/lightbox.js.map +1 -1
- package/dist/components/line-items.js +2 -1
- package/dist/components/line-items.js.map +1 -1
- package/dist/components/list.d.ts +5 -0
- package/dist/components/list.js +13 -9
- package/dist/components/list.js.map +1 -1
- package/dist/components/measured-grid.d.ts +3 -1
- package/dist/components/measured-grid.js +38 -20
- package/dist/components/measured-grid.js.map +1 -1
- package/dist/components/menu-item.js +2 -1
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/mini-calendar.js +8 -4
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/money-field.d.ts +8 -3
- package/dist/components/month-picker.js +50 -39
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/nav-pills.js +1 -1
- package/dist/components/nav-pills.js.map +1 -1
- package/dist/components/number-field.d.ts +8 -3
- package/dist/components/number-input.d.ts +11 -4
- package/dist/components/number-input.js +8 -6
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.d.ts +8 -3
- package/dist/components/numpad-sheet.js +2 -1
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/one-time-code-input.js +2 -2
- package/dist/components/one-time-code-input.js.map +1 -1
- package/dist/components/page-contents.js +2 -2
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/phone-input.d.ts +8 -3
- package/dist/components/phone-input.js +4 -4
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/pie-chart.d.ts +8 -2
- package/dist/components/pie-chart.js +11 -7
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover.d.ts +9 -1
- package/dist/components/popover.js +8 -4
- package/dist/components/popover.js.map +1 -1
- package/dist/components/row-actions.d.ts +100 -0
- package/dist/components/row-actions.js +231 -0
- package/dist/components/row-actions.js.map +1 -0
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/search-field.js +3 -2
- package/dist/components/search-field.js.map +1 -1
- package/dist/components/series-chart-budget.d.ts +30 -7
- package/dist/components/series-chart-budget.js +12 -4
- package/dist/components/series-chart-budget.js.map +1 -1
- package/dist/components/series-chart-ticks.d.ts +7 -1
- package/dist/components/series-chart-ticks.js +6 -0
- package/dist/components/series-chart-ticks.js.map +1 -1
- package/dist/components/series-chart.d.ts +58 -28
- package/dist/components/series-chart.js +42 -32
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/settings-fields.d.ts +57 -8
- package/dist/components/settings-fields.js +39 -1
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/share-card.d.ts +11 -6
- package/dist/components/share-card.js +8 -2
- package/dist/components/share-card.js.map +1 -1
- package/dist/components/sign-chip.d.ts +4 -0
- package/dist/components/sign-chip.js +17 -4
- package/dist/components/sign-chip.js.map +1 -1
- package/dist/components/signature-pad.d.ts +3 -1
- package/dist/components/signature-pad.js +8 -5
- package/dist/components/signature-pad.js.map +1 -1
- package/dist/components/slider.js +7 -6
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sparkline.d.ts +5 -1
- package/dist/components/sparkline.js +4 -2
- package/dist/components/sparkline.js.map +1 -1
- package/dist/components/stat-tile.d.ts +17 -1
- package/dist/components/stat-tile.js +48 -20
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/status-dot.d.ts +4 -0
- package/dist/components/status-dot.js +9 -2
- package/dist/components/status-dot.js.map +1 -1
- package/dist/components/swipeable-row.js +10 -2
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/switch.d.ts +21 -7
- package/dist/components/switch.js +24 -11
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +2 -2
- package/dist/components/table.js.map +1 -1
- package/dist/components/text-link.d.ts +8 -3
- package/dist/components/text-link.js +1 -1
- package/dist/components/text-link.js.map +1 -1
- package/dist/components/text.d.ts +7 -2
- package/dist/components/text.js +5 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/tile-radio.js +2 -1
- package/dist/components/tile-radio.js.map +1 -1
- package/dist/components/time-input.d.ts +8 -3
- package/dist/components/toast.d.ts +18 -2
- package/dist/components/toast.js +8 -5
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.d.ts +25 -3
- package/dist/components/toggle-group.js +40 -11
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle-legend.d.ts +10 -1
- package/dist/components/toggle-legend.js +21 -7
- package/dist/components/toggle-legend.js.map +1 -1
- package/dist/components/translation-review-editor.js +1 -1
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-parts.d.ts +4 -0
- package/dist/components/translation-review.d.ts +4 -0
- package/dist/components/translation-review.js +3 -3
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/tree-view.js +3 -2
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/treemap.d.ts +5 -2
- package/dist/components/treemap.js +33 -16
- package/dist/components/treemap.js.map +1 -1
- package/dist/components/ui.d.ts +8 -3
- package/dist/components/ui.js +207 -119
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/components/user-avatar.d.ts +5 -1
- package/dist/components/user-avatar.js +1 -1
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/wizard-stepper.js +20 -14
- package/dist/components/wizard-stepper.js.map +1 -1
- package/dist/{data-table-labels-DUELeXpa.d.ts → data-table-labels-kpAAVi6g.d.ts} +26 -2
- package/dist/data-table.d.ts +1 -1
- package/dist/{delete-account-setting-CpIhzxxZ.d.ts → delete-account-setting-FLyJf-kZ.d.ts} +642 -60
- package/dist/demo/demo-banner.js +1 -0
- package/dist/demo/demo-banner.js.map +1 -1
- package/dist/feedback/feedback-attachment.d.ts +8 -3
- package/dist/feedback/feedback-context.d.ts +8 -3
- package/dist/feedback/feedback-crash.d.ts +8 -3
- package/dist/feedback/feedback-dialog.d.ts +8 -3
- package/dist/feedback/feedback-dialog.js +3 -3
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.d.ts +8 -3
- package/dist/feedback/feedback-inbox.js +2 -2
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-labels.d.ts +8 -3
- package/dist/feedback/feedback-menu.d.ts +9 -4
- package/dist/feedback/feedback-record.d.ts +8 -3
- package/dist/feedback/feedback-row-detail.d.ts +8 -3
- package/dist/feedback/feedback-status-undo.d.ts +8 -3
- package/dist/feedback/feedback-submit.d.ts +8 -3
- package/dist/feedback/feedback-swipe.d.ts +8 -3
- package/dist/feedback/feedback-table.d.ts +8 -3
- package/dist/feedback/feedback-thread.d.ts +8 -3
- package/dist/feedback/feedback-thread.js +3 -3
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/feedback.d.ts +8 -3
- package/dist/hooks/use-anchored-panel.d.ts +32 -3
- package/dist/hooks/use-anchored-panel.js +21 -3
- package/dist/hooks/use-anchored-panel.js.map +1 -1
- package/dist/hooks/use-breakpoint.d.ts +88 -0
- package/dist/hooks/use-breakpoint.js +50 -0
- package/dist/hooks/use-breakpoint.js.map +1 -0
- package/dist/hooks/use-file-drop.d.ts +8 -3
- package/dist/hooks/use-large-text.d.ts +29 -0
- package/dist/hooks/use-large-text.js +20 -0
- package/dist/hooks/use-large-text.js.map +1 -0
- package/dist/hooks/use-windowed-rows.d.ts +52 -8
- package/dist/hooks/use-windowed-rows.js +94 -5
- package/dist/hooks/use-windowed-rows.js.map +1 -1
- package/dist/i18n/defaults.d.ts +8 -3
- package/dist/i18n/defaults.js +8 -0
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.d.ts +8 -3
- package/dist/i18n/german.js +94 -3
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +8 -3
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.d.ts +10 -5
- package/dist/i18n/locales/de-CH.d.ts +8 -3
- package/dist/i18n/locales/en.d.ts +8 -3
- package/dist/i18n/locales/es.d.ts +8 -3
- package/dist/i18n/locales/es.js +89 -3
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +8 -3
- package/dist/i18n/locales/fr.js +91 -3
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +8 -3
- package/dist/i18n/locales/hu.js +91 -3
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +8 -3
- package/dist/i18n/locales/it.js +92 -3
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +8 -3
- package/dist/i18n/locales/zh.js +89 -3
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.d.ts +8 -3
- package/dist/i18n/review.js +15 -1
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +27 -11
- package/dist/index.js +77 -4
- package/dist/index.js.map +1 -1
- package/dist/landing/landing-actions.d.ts +8 -3
- package/dist/landing/landing-sections.d.ts +8 -3
- package/dist/landing/landing-sections.js +7 -3
- package/dist/landing/landing-sections.js.map +1 -1
- package/dist/landing/public-header.d.ts +9 -4
- package/dist/landing/public-header.js +3 -3
- package/dist/landing/public-header.js.map +1 -1
- package/dist/landing/routing.d.ts +8 -3
- package/dist/lib/cn.js +3 -2
- package/dist/lib/cn.js.map +1 -1
- package/dist/rhf/fields.d.ts +8 -3
- package/dist/rhf/fields.js +1 -1
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form.d.ts +8 -3
- package/dist/rhf/form.js +2 -2
- package/dist/rhf/form.js.map +1 -1
- package/dist/rhf.d.ts +8 -3
- package/dist/search/command-palette.d.ts +1 -1
- package/dist/search/command-palette.js +9 -8
- package/dist/search/command-palette.js.map +1 -1
- package/dist/settings/settings-layout.js +2 -1
- package/dist/settings/settings-layout.js.map +1 -1
- package/dist/settings/settings-section.d.ts +8 -3
- package/dist/settings/use-account-appearance.d.ts +92 -0
- package/dist/settings/use-account-appearance.js +63 -0
- package/dist/settings/use-account-appearance.js.map +1 -0
- package/dist/settings/use-settings-route.d.ts +1 -1
- package/dist/settings/use-settings-route.js +2 -3
- package/dist/settings/use-settings-route.js.map +1 -1
- package/dist/shell/app-shell.d.ts +12 -171
- package/dist/shell/app-shell.js +144 -28
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/auth-layout.js +1 -1
- package/dist/shell/auth-layout.js.map +1 -1
- package/dist/shell/option-switcher-menu.js +1 -1
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/top-bar-brand.d.ts +8 -3
- package/dist/shell/top-bar-brand.js +3 -1
- package/dist/shell/top-bar-brand.js.map +1 -1
- package/dist/shell/topbar-action-menu.d.ts +4 -0
- package/dist/shell/topbar-action-menu.js +3 -3
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.js +4 -4
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/shell.d.ts +9 -5
- package/dist/theme/contrast-tokens.d.ts +41 -0
- package/dist/theme/contrast-tokens.js +59 -0
- package/dist/theme/contrast-tokens.js.map +1 -0
- package/dist/theme/contrast.d.ts +110 -0
- package/dist/theme/contrast.js +128 -0
- package/dist/theme/contrast.js.map +1 -0
- package/dist/theme/palette-presets.d.ts +12 -1
- package/dist/theme/palette-presets.js +9 -4
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/theme/palette-store.js.map +1 -1
- package/dist/theme/text-size.d.ts +173 -0
- package/dist/theme/text-size.js +121 -0
- package/dist/theme/text-size.js.map +1 -0
- package/dist/wizard/stepper-nav.d.ts +8 -3
- package/dist/wizard/wizard-summary.js +1 -1
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/dist/wizard.d.ts +8 -3
- package/package.json +1 -1
- package/src/admin/admin-action-log.tsx +6 -1
- package/src/admin/invitations-panel.tsx +36 -29
- package/src/admin/user-roster.tsx +17 -72
- package/src/auth/auth-errors.ts +68 -7
- package/src/billing/billing-banner.tsx +205 -0
- package/src/billing/billing-labels.ts +240 -0
- package/src/billing/billing-lock.ts +75 -0
- package/src/billing/billing-standing.ts +72 -0
- package/src/billing/plan-card.tsx +458 -0
- package/src/billing/plan-limit-notice.tsx +145 -0
- package/src/billing/plan-limit.ts +53 -0
- package/src/billing/plan-price.ts +101 -0
- package/src/billing/subscription-actions.tsx +76 -0
- package/src/billing/subscription-status-chip.tsx +95 -0
- package/src/chart.ts +2 -0
- package/src/components/account-chips.tsx +36 -10
- package/src/components/alert-banner.tsx +16 -7
- package/src/components/amount-input.tsx +5 -5
- package/src/components/appearance-labels.ts +47 -0
- package/src/components/autocomplete.tsx +2 -2
- package/src/components/breadcrumbs.tsx +3 -3
- package/src/components/bulk-action-bar.tsx +11 -14
- package/src/components/button-group.tsx +21 -0
- package/src/components/calculator.tsx +4 -3
- package/src/components/calendar-heatmap.tsx +5 -5
- package/src/components/chart-height.ts +30 -0
- package/src/components/chart-zoom.tsx +6 -1
- package/src/components/checkbox-group.tsx +2 -2
- package/src/components/checkbox.tsx +62 -20
- package/src/components/chip.tsx +139 -30
- package/src/components/choice-card.tsx +16 -11
- package/src/components/column-mapper.tsx +1 -1
- package/src/components/combobox-core.tsx +8 -7
- package/src/components/combobox.tsx +8 -8
- package/src/components/country-select.tsx +1 -1
- package/src/components/currency-select.tsx +3 -3
- package/src/components/data-table-filter-popover.tsx +7 -1
- package/src/components/data-table-pagination.tsx +60 -31
- package/src/components/data-table.tsx +164 -43
- package/src/components/date-picker.tsx +44 -10
- package/src/components/description-list.tsx +2 -2
- package/src/components/dialog-frame.tsx +2 -1
- package/src/components/disclosure.tsx +3 -2
- package/src/components/dropdown.tsx +10 -2
- package/src/components/facing-pair.ts +12 -5
- package/src/components/field-parts.tsx +190 -7
- package/src/components/field-sync.tsx +17 -3
- package/src/components/field.tsx +2 -2
- package/src/components/floating-panel.tsx +7 -4
- package/src/components/focus-ring.ts +12 -0
- package/src/components/form-actions.tsx +55 -18
- package/src/components/full-bleed-dialog.tsx +18 -4
- package/src/components/image-grid.tsx +1 -1
- package/src/components/inline-edit-field.tsx +26 -4
- package/src/components/legal-page.tsx +28 -2
- package/src/components/legal.tsx +19 -1
- package/src/components/lightbox.tsx +24 -2
- package/src/components/line-items.tsx +7 -1
- package/src/components/list.tsx +36 -10
- package/src/components/measured-grid.tsx +49 -24
- package/src/components/menu-item.tsx +2 -2
- package/src/components/mini-calendar.tsx +8 -4
- package/src/components/month-picker.tsx +15 -6
- package/src/components/nav-pills.tsx +1 -1
- package/src/components/number-input.tsx +14 -7
- package/src/components/numpad-sheet.tsx +2 -2
- package/src/components/one-time-code-input.tsx +2 -2
- package/src/components/page-contents.tsx +2 -2
- package/src/components/phone-input.tsx +9 -4
- package/src/components/pie-chart.tsx +19 -9
- package/src/components/popover.tsx +22 -5
- package/src/components/row-actions.tsx +450 -0
- package/src/components/scroll-area.tsx +1 -1
- package/src/components/search-field.tsx +4 -2
- package/src/components/series-chart-budget.ts +40 -8
- package/src/components/series-chart-ticks.ts +10 -0
- package/src/components/series-chart.tsx +123 -72
- package/src/components/settings-fields.tsx +89 -5
- package/src/components/share-card.tsx +31 -2
- package/src/components/sign-chip.tsx +28 -4
- package/src/components/signature-pad.tsx +13 -7
- package/src/components/slider.tsx +22 -9
- package/src/components/sparkline.tsx +11 -3
- package/src/components/stat-tile.tsx +70 -14
- package/src/components/status-dot.tsx +25 -2
- package/src/components/swipeable-row.tsx +10 -2
- package/src/components/switch.tsx +57 -23
- package/src/components/table.tsx +2 -2
- package/src/components/text-link.tsx +1 -1
- package/src/components/text.tsx +11 -6
- package/src/components/tile-radio.tsx +4 -1
- package/src/components/toast.tsx +27 -7
- package/src/components/toggle-group.tsx +115 -14
- package/src/components/toggle-legend.tsx +53 -8
- package/src/components/translation-review-editor.tsx +1 -1
- package/src/components/translation-review.tsx +11 -5
- package/src/components/tree-view.tsx +3 -2
- package/src/components/treemap.tsx +27 -10
- package/src/components/ui.tsx +353 -153
- package/src/components/user-avatar.tsx +1 -1
- package/src/components/wizard-stepper.tsx +5 -1
- package/src/demo/demo-banner.tsx +5 -0
- package/src/feedback/feedback-dialog.tsx +3 -3
- package/src/feedback/feedback-inbox.tsx +2 -2
- package/src/feedback/feedback-thread.tsx +3 -3
- package/src/hooks/use-anchored-panel.ts +67 -5
- package/src/hooks/use-breakpoint.ts +132 -0
- package/src/hooks/use-large-text.ts +41 -0
- package/src/hooks/use-windowed-rows.ts +168 -12
- package/src/i18n/defaults.ts +8 -0
- package/src/i18n/german.ts +107 -0
- package/src/i18n/kit-labels.tsx +12 -0
- package/src/i18n/locales/es.ts +98 -0
- package/src/i18n/locales/fr.ts +102 -0
- package/src/i18n/locales/hu.ts +100 -0
- package/src/i18n/locales/it.ts +103 -0
- package/src/i18n/locales/zh.ts +94 -0
- package/src/i18n/review.ts +14 -0
- package/src/index.ts +76 -6
- package/src/landing/landing-sections.tsx +7 -3
- package/src/landing/public-header.tsx +4 -4
- package/src/lib/cn.ts +13 -2
- package/src/rhf/fields.tsx +1 -1
- package/src/rhf/form.tsx +2 -2
- package/src/search/command-palette.tsx +10 -9
- package/src/settings/settings-layout.tsx +2 -1
- package/src/settings/use-account-appearance.ts +148 -0
- package/src/settings/use-settings-route.ts +3 -4
- package/src/shell/app-shell.tsx +278 -54
- package/src/shell/auth-layout.tsx +1 -1
- package/src/shell/option-switcher-menu.tsx +1 -1
- package/src/shell/top-bar-brand.tsx +3 -1
- package/src/shell/topbar-action-menu.tsx +3 -3
- package/src/shell/topbar-controls.tsx +4 -4
- package/src/theme/contrast-tokens.ts +112 -0
- package/src/theme/contrast.ts +225 -0
- package/src/theme/palette-presets.ts +24 -4
- package/src/theme/palette-store.ts +6 -1
- package/src/theme/text-size.ts +283 -0
- package/src/wizard/wizard-summary.tsx +4 -2
- package/tokens.css +158 -8
|
@@ -93,8 +93,10 @@ const CARD =
|
|
|
93
93
|
// The focus mark is the CARD's, not the 16px box's: the card is what was clicked and
|
|
94
94
|
// what the eye is on. An OUTLINE rather than a ring, because the checked state already
|
|
95
95
|
// spends the ring — two `ring-*` widths on one element are decided by stylesheet
|
|
96
|
-
// order, and the loser would be the focus mark. Offset, so the two never merge.
|
|
97
|
-
|
|
96
|
+
// order, and the loser would be the focus mark. Offset, so the two never merge. Its
|
|
97
|
+
// width is the kit's focus frame (0.32, §5: `--focus-ring-width`, 3 px under More
|
|
98
|
+
// contrast) — `FOCUS_RING` itself is a ring, which this mark cannot be.
|
|
99
|
+
"has-[:focus-visible]:outline-[length:var(--focus-ring-width)] has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-[var(--brand)] " +
|
|
98
100
|
// Read from the input too, so a card disabled by its `<fieldset>` fades as well.
|
|
99
101
|
"has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60";
|
|
100
102
|
|
|
@@ -107,10 +109,12 @@ const CARD_INVALID =
|
|
|
107
109
|
const BOX =
|
|
108
110
|
"peer size-4 shrink-0 appearance-none border border-[var(--border-strong)] bg-[var(--bg-surface)] transition-colors " +
|
|
109
111
|
"checked:border-[var(--brand)] focus:outline-none disabled:cursor-not-allowed";
|
|
110
|
-
const CHECKBOX = "rounded
|
|
111
|
-
// A radio's dot is its BORDER: a
|
|
112
|
-
// centre. No glyph to lay over it, and
|
|
113
|
-
|
|
112
|
+
const CHECKBOX = "rounded checked:bg-[var(--brand)]";
|
|
113
|
+
// A radio's dot is its BORDER: a 0.3125rem brand border (5px at Normal) round a
|
|
114
|
+
// surface-coloured 0.375rem centre. No glyph to lay over it, and in rem since 0.32
|
|
115
|
+
// (§3.2) it scales with the box — a 5px border on a 24px box at 150 % was a ring, not a
|
|
116
|
+
// dot.
|
|
117
|
+
const RADIO = "rounded-full checked:border-[0.3125rem]";
|
|
114
118
|
|
|
115
119
|
export const ChoiceCard = forwardRef<HTMLInputElement, ChoiceCardProps>(function ChoiceCard(
|
|
116
120
|
{
|
|
@@ -219,7 +223,7 @@ export const ChoiceCard = forwardRef<HTMLInputElement, ChoiceCardProps>(function
|
|
|
219
223
|
</span>
|
|
220
224
|
)}
|
|
221
225
|
{showError && (
|
|
222
|
-
<span id={errorId} className="mt-1 block text-
|
|
226
|
+
<span id={errorId} className="mt-1 block text-caption leading-tight text-[var(--danger)]">
|
|
223
227
|
{error}
|
|
224
228
|
</span>
|
|
225
229
|
)}
|
|
@@ -341,8 +345,9 @@ export const ActionCard = forwardRef<HTMLButtonElement, ActionCardProps>(functio
|
|
|
341
345
|
const look = cn(
|
|
342
346
|
"flex w-full items-start gap-3 rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] p-3 text-start shadow-sm transition-colors",
|
|
343
347
|
"hover:border-[var(--brand)] hover:bg-[var(--bg-hover)]",
|
|
344
|
-
// The outline, as on ChoiceCard: the card is what the eye is on
|
|
345
|
-
|
|
348
|
+
// The outline, as on ChoiceCard: the card is what the eye is on — the focus frame's
|
|
349
|
+
// width (§5).
|
|
350
|
+
"focus:outline-none focus-visible:outline-[length:var(--focus-ring-width)] focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)]",
|
|
346
351
|
"disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-[var(--border)] disabled:hover:bg-[var(--bg-surface)]",
|
|
347
352
|
className,
|
|
348
353
|
);
|
|
@@ -523,7 +528,7 @@ export function ChoiceCardGroup<T extends string>(props: ChoiceCardGroupProps<T>
|
|
|
523
528
|
{required && <RequiredMark />}
|
|
524
529
|
</legend>
|
|
525
530
|
)}
|
|
526
|
-
<div className={cn("grid gap-2 sm:grid-cols-2", className)}>
|
|
531
|
+
<div className={cn("grid grid-cols-1 gap-2 sm:grid-cols-2", className)}>
|
|
527
532
|
{options.map((o) => (
|
|
528
533
|
<ChoiceCard
|
|
529
534
|
key={o.value}
|
|
@@ -543,7 +548,7 @@ export function ChoiceCardGroup<T extends string>(props: ChoiceCardGroupProps<T>
|
|
|
543
548
|
))}
|
|
544
549
|
</div>
|
|
545
550
|
{showError && (
|
|
546
|
-
<p id={errorId} className="mt-1 text-
|
|
551
|
+
<p id={errorId} className="mt-1 text-caption leading-tight text-[var(--danger)]">
|
|
547
552
|
{error}
|
|
548
553
|
</p>
|
|
549
554
|
)}
|
|
@@ -367,7 +367,7 @@ export function ColumnRoleTable<
|
|
|
367
367
|
scope="col"
|
|
368
368
|
className="min-w-36 py-2 align-top"
|
|
369
369
|
>
|
|
370
|
-
<span className="block max-w-56 truncate pb-1 text-
|
|
370
|
+
<span className="block max-w-56 truncate pb-1 text-caption font-normal text-[var(--text-muted)]">
|
|
371
371
|
{name}
|
|
372
372
|
</span>
|
|
373
373
|
<Select
|
|
@@ -13,8 +13,8 @@ import { cn } from "../lib/cn";
|
|
|
13
13
|
import { CLIPS_ATTRIBUTE } from "../lib/clipping";
|
|
14
14
|
import { DropdownSearchHeader } from "./dropdown";
|
|
15
15
|
import { PickerSheet, SHEET_ROW_CLASS } from "./picker-sheet";
|
|
16
|
-
import {
|
|
17
|
-
import { FLOATING_LABEL_STATIC,
|
|
16
|
+
import { usePhoneLayout } from "../hooks/use-breakpoint";
|
|
17
|
+
import { FLOATING_LABEL_STATIC, Spinner } from "./ui";
|
|
18
18
|
import { useAnchorDir } from "./use-anchor-dir";
|
|
19
19
|
import { type AnchorRect } from "../hooks/use-anchored-rect";
|
|
20
20
|
import { useAnchoredPanel, type AnchoredPanel } from "../hooks/use-anchored-panel";
|
|
@@ -364,7 +364,7 @@ export function useComboboxCore<V extends string | number>({
|
|
|
364
364
|
// old value, and tapping the search box or the X was equally fatal. `PickerSheet`
|
|
365
365
|
// stops `mousedown` for exactly this reason, but that guard was written for
|
|
366
366
|
// `useDropdown`'s listener and never covered this hook.
|
|
367
|
-
const isPhone =
|
|
367
|
+
const isPhone = usePhoneLayout();
|
|
368
368
|
useOutsideClick([triggerRef, panelRef], close, open && !isPhone);
|
|
369
369
|
useEscapeKey(closeToTrigger, open);
|
|
370
370
|
|
|
@@ -437,7 +437,7 @@ export function useComboboxCore<V extends string | number>({
|
|
|
437
437
|
|
|
438
438
|
/** The error line under a field — the same type as `ui.tsx`'s (module-private) one,
|
|
439
439
|
* so a combobox's message is indistinguishable from an Input's. */
|
|
440
|
-
const FIELD_ERROR_CLASS = "mt-1 text-
|
|
440
|
+
const FIELD_ERROR_CLASS = "mt-1 text-caption leading-tight text-[var(--danger)]";
|
|
441
441
|
|
|
442
442
|
/**
|
|
443
443
|
* {@link Input}'s `error` for the combobox family: the message under the field, its
|
|
@@ -589,7 +589,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
589
589
|
// The phone gets a full-screen sheet instead of an anchored panel (live #200).
|
|
590
590
|
// Same core, same results, same handlers — only the container differs, so the
|
|
591
591
|
// two presentations cannot drift in what they offer.
|
|
592
|
-
const isPhone =
|
|
592
|
+
const isPhone = usePhoneLayout();
|
|
593
593
|
// Every row the keyboard can land on, the create row included — passed over, like a
|
|
594
594
|
// disabled option, while a write lock holds it.
|
|
595
595
|
const rows: readonly { disabled?: boolean }[] = showCreate
|
|
@@ -732,7 +732,7 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
732
732
|
role="presentation"
|
|
733
733
|
className={cn(
|
|
734
734
|
"font-semibold uppercase tracking-wide text-[var(--text-muted)]",
|
|
735
|
-
isPhone ? "px-4 pb-1 pt-3 text-xs" : "px-3 pb-0.5 pt-2 text-
|
|
735
|
+
isPhone ? "px-4 pb-1 pt-3 text-xs" : "px-3 pb-0.5 pt-2 text-caption first:pt-1",
|
|
736
736
|
)}
|
|
737
737
|
>
|
|
738
738
|
{o.group}
|
|
@@ -906,7 +906,8 @@ export function ComboboxPanel<V extends string | number>({
|
|
|
906
906
|
top: placement.top,
|
|
907
907
|
...inline,
|
|
908
908
|
width: rect.width,
|
|
909
|
-
|
|
909
|
+
// 220 px at Normal, in rem so the panel's text keeps its room at Large (§3.2).
|
|
910
|
+
minWidth: "13.75rem",
|
|
910
911
|
maxHeight: placement.maxHeight,
|
|
911
912
|
}}
|
|
912
913
|
className={cn(
|
|
@@ -2,12 +2,12 @@ import { Fragment, useId, useMemo, useRef, useState } from "react";
|
|
|
2
2
|
import type { ComponentPropsWithoutRef, ReactNode, Ref, RefObject } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { ChevronDown, Plus, X } from "lucide-react";
|
|
5
|
-
import { FIELD_BASE, FIELD_FLOATING_PAD, FIELD_INVALID
|
|
5
|
+
import { FIELD_BASE, FIELD_FLOATING_PAD, FIELD_INVALID } from "./ui";
|
|
6
6
|
import { cn } from "../lib/cn";
|
|
7
7
|
import { useDropdown } from "./dropdown";
|
|
8
8
|
import { useAnchoredPanel } from "../hooks/use-anchored-panel";
|
|
9
9
|
import { useAnchorDir } from "./use-anchor-dir";
|
|
10
|
-
import {
|
|
10
|
+
import { usePhoneLayout } from "../hooks/use-breakpoint";
|
|
11
11
|
import { PickerSheet, SHEET_ROW_CLASS } from "./picker-sheet";
|
|
12
12
|
import {
|
|
13
13
|
ComboboxFieldLabel,
|
|
@@ -339,7 +339,7 @@ export function Combobox(props: ComboboxProps) {
|
|
|
339
339
|
// `backCloses` is the desktop half of live #309: the phone's list IS a
|
|
340
340
|
// {@link PickerSheet}, which registers its own history entry, so registering a
|
|
341
341
|
// second one here would cost two Back presses to dismiss one sheet.
|
|
342
|
-
const isPhone =
|
|
342
|
+
const isPhone = usePhoneLayout();
|
|
343
343
|
const { open, setOpen, wrapperRef, panelRef } = useDropdown({ backCloses: !isPhone });
|
|
344
344
|
const primaryOnly = usePrimaryPressOnly();
|
|
345
345
|
const [active, setActive] = useState(-1);
|
|
@@ -673,7 +673,7 @@ export function Combobox(props: ComboboxProps) {
|
|
|
673
673
|
{group !== undefined && (
|
|
674
674
|
<li
|
|
675
675
|
role="presentation"
|
|
676
|
-
className="px-4 pb-0.5 pt-3 text-
|
|
676
|
+
className="px-4 pb-0.5 pt-3 text-caption font-semibold uppercase tracking-wide text-[var(--text-muted)]"
|
|
677
677
|
>
|
|
678
678
|
{group}
|
|
679
679
|
</li>
|
|
@@ -730,7 +730,7 @@ export function Combobox(props: ComboboxProps) {
|
|
|
730
730
|
{group !== undefined && (
|
|
731
731
|
<li
|
|
732
732
|
role="presentation"
|
|
733
|
-
className="px-3 pb-0.5 pt-2 text-
|
|
733
|
+
className="px-3 pb-0.5 pt-2 text-caption font-semibold uppercase tracking-wide text-[var(--text-muted)] first:pt-1"
|
|
734
734
|
>
|
|
735
735
|
{group}
|
|
736
736
|
</li>
|
|
@@ -978,7 +978,7 @@ export function InlineEntityCombobox<V extends string | number, C extends ComboC
|
|
|
978
978
|
// See the twin above on why these hang off the generated id.
|
|
979
979
|
const listboxId = `${generated}-listbox`;
|
|
980
980
|
const optionId = (index: number) => `${generated}-option-${index}`;
|
|
981
|
-
const isPhone =
|
|
981
|
+
const isPhone = usePhoneLayout();
|
|
982
982
|
// See the twin above: the phone sheet owns its own Back entry (live #309).
|
|
983
983
|
const { open, setOpen, wrapperRef, panelRef } = useDropdown({ backCloses: !isPhone });
|
|
984
984
|
const primaryOnly = usePrimaryPressOnly();
|
|
@@ -1357,7 +1357,7 @@ export function InlineEntityCombobox<V extends string | number, C extends ComboC
|
|
|
1357
1357
|
{o.group && o.group !== matches[i - 1]?.group && (
|
|
1358
1358
|
<li
|
|
1359
1359
|
role="presentation"
|
|
1360
|
-
className="px-4 pb-0.5 pt-3 text-
|
|
1360
|
+
className="px-4 pb-0.5 pt-3 text-caption font-semibold uppercase tracking-wide text-[var(--text-muted)]"
|
|
1361
1361
|
>
|
|
1362
1362
|
{o.group}
|
|
1363
1363
|
</li>
|
|
@@ -1420,7 +1420,7 @@ export function InlineEntityCombobox<V extends string | number, C extends ComboC
|
|
|
1420
1420
|
{o.group && o.group !== matches[i - 1]?.group && (
|
|
1421
1421
|
<li
|
|
1422
1422
|
role="presentation"
|
|
1423
|
-
className="px-3 pb-0.5 pt-2 text-
|
|
1423
|
+
className="px-3 pb-0.5 pt-2 text-caption font-semibold uppercase tracking-wide text-[var(--text-muted)] first:pt-1"
|
|
1424
1424
|
>
|
|
1425
1425
|
{o.group}
|
|
1426
1426
|
</li>
|
|
@@ -532,7 +532,7 @@ export function CountrySelect<Clearable extends boolean = false>({
|
|
|
532
532
|
<div {...rest} className={className}>
|
|
533
533
|
{box}
|
|
534
534
|
{textHint && (
|
|
535
|
-
<p id={hintId} className="mt-1 text-
|
|
535
|
+
<p id={hintId} className="mt-1 text-caption leading-tight text-[var(--text-muted)]">
|
|
536
536
|
{hint}
|
|
537
537
|
</p>
|
|
538
538
|
)}
|
|
@@ -63,7 +63,7 @@ export function CurrencyFlag({ country, className, ...rest }: CurrencyFlagProps)
|
|
|
63
63
|
// code printed next to it, and a reader that met both would hear the currency
|
|
64
64
|
// twice.
|
|
65
65
|
aria-hidden
|
|
66
|
-
className={cn("fi inline-block w-5 h-[
|
|
66
|
+
className={cn("fi inline-block w-5 h-[0.9375rem] rounded-sm shadow-[0_0_0_1px_rgba(0,0,0,0.08)] shrink-0", `fi-${country}`, className)}
|
|
67
67
|
/>
|
|
68
68
|
);
|
|
69
69
|
}
|
|
@@ -341,7 +341,7 @@ export function CurrencySelect({
|
|
|
341
341
|
is `absolute` with no `top`, so it opens at its place in the flow — under the
|
|
342
342
|
caption, had the caption come first. */}
|
|
343
343
|
{textHint && (
|
|
344
|
-
<p id={hintId} className="mt-1 text-
|
|
344
|
+
<p id={hintId} className="mt-1 text-caption leading-tight text-[var(--text-muted)]">
|
|
345
345
|
{hint}
|
|
346
346
|
</p>
|
|
347
347
|
)}
|
|
@@ -356,4 +356,4 @@ export function CurrencySelect({
|
|
|
356
356
|
|
|
357
357
|
// The error line under a field — the type of `ui.tsx`'s (module-private) one, so a
|
|
358
358
|
// CurrencySelect's message is indistinguishable from an Input's.
|
|
359
|
-
const FIELD_ERROR_CLASS = "mt-1 text-
|
|
359
|
+
const FIELD_ERROR_CLASS = "mt-1 text-caption leading-tight text-[var(--danger)]";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
2
|
import { X } from "lucide-react";
|
|
3
3
|
import { cn } from "../lib/cn";
|
|
4
|
+
import { FIELD_TOUCH_TEXT } from "./ui";
|
|
5
|
+
import { FOCUS_RING } from "./focus-ring";
|
|
4
6
|
import { MiniCalendar } from "./mini-calendar";
|
|
5
7
|
import { dateRangePresets } from "../lib/dates";
|
|
6
8
|
import { resolveFilter } from "./data-table-filters";
|
|
@@ -71,7 +73,11 @@ export function FilterPopover<T>({
|
|
|
71
73
|
// border going from --border to --border-strong is not a location. The ring is, and it
|
|
72
74
|
// is the package's brand focus colour, as on every field in ui.tsx.
|
|
73
75
|
const inputBase =
|
|
74
|
-
"block w-full rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1.5 text-sm text-[var(--text-secondary)] placeholder:text-[var(--text-placeholder)] focus:border-[var(--border-strong)] focus:outline-none
|
|
76
|
+
"block w-full rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1.5 text-sm text-[var(--text-secondary)] placeholder:text-[var(--text-placeholder)] focus:border-[var(--border-strong)] focus:outline-none " +
|
|
77
|
+
FOCUS_RING +
|
|
78
|
+
" " +
|
|
79
|
+
// §10.1: a filter field is a field — 16 px on touch, or iOS zooms on focus.
|
|
80
|
+
FIELD_TOUCH_TEXT;
|
|
75
81
|
const buttonBase =
|
|
76
82
|
"rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1 text-xs text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]";
|
|
77
83
|
|
|
@@ -3,6 +3,8 @@ import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
|
3
3
|
import { cn } from "../lib/cn";
|
|
4
4
|
import { DEFAULT_DATA_TABLE_LABELS, type DataTableLabels } from "./data-table-labels";
|
|
5
5
|
import { useKitLabels, useKitLocale } from "../i18n/kit-labels";
|
|
6
|
+
import { usePhoneLayout } from "../hooks/use-breakpoint";
|
|
7
|
+
import { useLargeText } from "../hooks/use-large-text";
|
|
6
8
|
|
|
7
9
|
export const PAGE_SIZE_OPTIONS = [10, 25, 50, 100, 200] as const;
|
|
8
10
|
|
|
@@ -32,8 +34,28 @@ interface PaginationProps {
|
|
|
32
34
|
density?: "comfortable" | "compact";
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
/**
|
|
38
|
+
* How many page numbers flank the current one on the strip: ±2, and ±1 on a phone at
|
|
39
|
+
* Large and Extra large (0.32.1, the 360 px Extra-large sweep; docs/text-size-
|
|
40
|
+
* harmonization.md §4). At 150 % a number button is 42 px, and "‹ 1 2 3 … 494 ›" was
|
|
41
|
+
* 312 px on a 360 px phone's 262; one neighbour fewer on each side saves two buttons.
|
|
42
|
+
*/
|
|
43
|
+
const PAGE_WINDOW = 2;
|
|
44
|
+
const PAGE_WINDOW_LARGE_PHONE = 1;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The strip's two parts (0.32.1, same sweep, §4 "nothing overflows"). The arrows keep
|
|
48
|
+
* the ends; the numbers between them wrap, centred, when even the narrower window does
|
|
49
|
+
* not fit — a middle page of a long list ("1 … 249 250 251 … 494") at Extra large, or at
|
|
50
|
+
* Normal on a narrow phone, where the one-row strip ran past the screen. Where the
|
|
51
|
+
* strip fits it is one row, as before.
|
|
52
|
+
*/
|
|
53
|
+
const PAGE_STRIP = "flex min-w-0 max-w-full items-center gap-1";
|
|
54
|
+
const PAGE_NUMBERS = "flex min-w-0 flex-wrap items-center justify-center gap-1";
|
|
55
|
+
|
|
35
56
|
/** Footer for {@link DataTable}: range summary, page-size select, and a
|
|
36
|
-
* windowed page-number strip (first/last + ±2 around the current page
|
|
57
|
+
* windowed page-number strip (first/last + ±2 around the current page, ±1 on a phone
|
|
58
|
+
* at Large — see {@link PAGE_WINDOW}). */
|
|
37
59
|
export function Pagination({
|
|
38
60
|
page,
|
|
39
61
|
totalPages,
|
|
@@ -57,15 +79,20 @@ export function Pagination({
|
|
|
57
79
|
// summary is not formatted here — `pageRange` / `rowCount` take NUMBERS so the
|
|
58
80
|
// translation can format them itself, alongside the words around them.
|
|
59
81
|
const num = useMemo(() => new Intl.NumberFormat(locale), [locale]);
|
|
82
|
+
const large = useLargeText();
|
|
83
|
+
const phone = usePhoneLayout();
|
|
84
|
+
const radius = large && phone ? PAGE_WINDOW_LARGE_PHONE : PAGE_WINDOW;
|
|
60
85
|
const visible = useMemo(() => {
|
|
61
|
-
|
|
86
|
+
// Every page when that is no longer than the window would be (first, last, the
|
|
87
|
+
// current one, its neighbours and two ellipses).
|
|
88
|
+
if (totalPages <= 2 * radius + 3) return Array.from({ length: totalPages }, (_, i) => i);
|
|
62
89
|
const set = new Set<number>([0, totalPages - 1, page]);
|
|
63
|
-
for (let d = 1; d <=
|
|
90
|
+
for (let d = 1; d <= radius; d++) {
|
|
64
91
|
if (page - d >= 0) set.add(page - d);
|
|
65
92
|
if (page + d <= totalPages - 1) set.add(page + d);
|
|
66
93
|
}
|
|
67
94
|
return Array.from(set).sort((a, b) => a - b);
|
|
68
|
-
}, [page, totalPages]);
|
|
95
|
+
}, [page, totalPages, radius]);
|
|
69
96
|
|
|
70
97
|
const items: (number | "ellipsis")[] = [];
|
|
71
98
|
visible.forEach((p, idx) => {
|
|
@@ -108,7 +135,7 @@ export function Pagination({
|
|
|
108
135
|
)}
|
|
109
136
|
</div>
|
|
110
137
|
{pageSize !== Infinity && totalPages > 1 && (
|
|
111
|
-
<div
|
|
138
|
+
<div data-slot="page-strip" className={PAGE_STRIP}>
|
|
112
139
|
<button
|
|
113
140
|
type="button"
|
|
114
141
|
onClick={() => onPage(Math.max(0, page - 1))}
|
|
@@ -119,32 +146,34 @@ export function Pagination({
|
|
|
119
146
|
{/* "Previous" points back along the line — left in LTR, right in RTL. */}
|
|
120
147
|
<ChevronLeft className={cn("rtl:-scale-x-100", compact ? "size-3.5" : "size-4")} />
|
|
121
148
|
</button>
|
|
122
|
-
|
|
123
|
-
it
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
149
|
+
<div data-slot="page-numbers" className={PAGE_NUMBERS}>
|
|
150
|
+
{items.map((it, i) =>
|
|
151
|
+
it === "ellipsis" ? (
|
|
152
|
+
<span key={`e${i}`} className="px-1 text-[var(--text-placeholder)]">
|
|
153
|
+
…
|
|
154
|
+
</span>
|
|
155
|
+
) : (
|
|
156
|
+
<button
|
|
157
|
+
key={it}
|
|
158
|
+
type="button"
|
|
159
|
+
onClick={() => onPage(it)}
|
|
160
|
+
// Which page you are on is carried only by a background colour
|
|
161
|
+
// otherwise, and the strip is a row of bare numbers with nothing
|
|
162
|
+
// else to tell them apart.
|
|
163
|
+
aria-current={it === page ? "page" : undefined}
|
|
164
|
+
className={cn(
|
|
165
|
+
"rounded",
|
|
166
|
+
compact ? "min-w-6 px-1.5 py-0" : "min-w-7 px-2 py-0.5",
|
|
167
|
+
it === page
|
|
168
|
+
? "bg-[var(--bg-inverse)] text-[var(--text-inverse)]"
|
|
169
|
+
: "hover:bg-[var(--bg-hover)]",
|
|
170
|
+
)}
|
|
171
|
+
>
|
|
172
|
+
{num.format(it + 1)}
|
|
173
|
+
</button>
|
|
174
|
+
),
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
148
177
|
<button
|
|
149
178
|
type="button"
|
|
150
179
|
onClick={() => onPage(Math.min(totalPages - 1, page + 1))}
|