@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
|
@@ -5,6 +5,7 @@ import { cn } from "../lib/cn";
|
|
|
5
5
|
import { dirOf, horizontalStep, type Direction } from "../lib/direction";
|
|
6
6
|
import { monthKey, pad } from "../lib/dates";
|
|
7
7
|
import { Button, FIELD_FLOATING_PAD, FIELD_INVALID, FIELD_TRIGGER, IconButton } from "./ui";
|
|
8
|
+
import { FOCUS_RING, FOCUS_RING_WIDTH } from "./focus-ring";
|
|
8
9
|
import { Popover } from "./popover";
|
|
9
10
|
import { splitTriggerAria } from "./trigger-aria";
|
|
10
11
|
import type { TriggerAria } from "./trigger-aria";
|
|
@@ -283,7 +284,8 @@ function MonthHeadingTrigger({
|
|
|
283
284
|
aria-describedby={aria["aria-describedby"]}
|
|
284
285
|
className={cn(
|
|
285
286
|
"-ms-1.5 inline-flex h-9 min-w-0 items-center gap-1 rounded-md px-1.5 text-lg font-semibold text-[var(--text-primary)] transition-colors",
|
|
286
|
-
"hover:bg-[var(--bg-hover)]
|
|
287
|
+
"hover:bg-[var(--bg-hover)]",
|
|
288
|
+
FOCUS_RING,
|
|
287
289
|
disabled && "cursor-not-allowed opacity-50",
|
|
288
290
|
)}
|
|
289
291
|
>
|
|
@@ -570,7 +572,8 @@ function MonthGrid({
|
|
|
570
572
|
onKeyDown={onCellKeyDown}
|
|
571
573
|
className={cn(
|
|
572
574
|
"rounded px-2 py-1.5 text-sm capitalize transition-colors",
|
|
573
|
-
|
|
575
|
+
FOCUS_RING_WIDTH,
|
|
576
|
+
"focus-visible:outline-none focus-visible:ring-inset",
|
|
574
577
|
// A --brand ring on a --brand fill exists only in the DOM.
|
|
575
578
|
selected && !disabled
|
|
576
579
|
? "focus-visible:ring-[var(--brand-contrast)]"
|
|
@@ -761,7 +764,8 @@ function YearGrid({
|
|
|
761
764
|
onKeyDown={onCellKeyDown}
|
|
762
765
|
className={cn(
|
|
763
766
|
"rounded px-2 py-1.5 text-sm tabular-nums transition-colors",
|
|
764
|
-
|
|
767
|
+
FOCUS_RING_WIDTH,
|
|
768
|
+
"focus-visible:outline-none focus-visible:ring-inset",
|
|
765
769
|
selected && !disabled
|
|
766
770
|
? "focus-visible:ring-[var(--brand-contrast)]"
|
|
767
771
|
: "focus-visible:ring-[var(--brand)]",
|
|
@@ -935,7 +939,7 @@ export function MonthPicker(props: MonthPickerProps) {
|
|
|
935
939
|
const Heading = headingLevel ? (`h${headingLevel}` as const) : null;
|
|
936
940
|
const trigger = (
|
|
937
941
|
<Popover
|
|
938
|
-
width=
|
|
942
|
+
width="16rem"
|
|
939
943
|
panelId={panelId}
|
|
940
944
|
labels={{ panel: panelLabel }}
|
|
941
945
|
dir={dir}
|
|
@@ -958,7 +962,12 @@ export function MonthPicker(props: MonthPickerProps) {
|
|
|
958
962
|
</Popover>
|
|
959
963
|
);
|
|
960
964
|
return (
|
|
961
|
-
|
|
965
|
+
// `flex-wrap`: where the heading and the buttons do not fit one row, the buttons
|
|
966
|
+
// take the next line, at the end (0.32.1, the 360 px Extra-large sweep;
|
|
967
|
+
// docs/text-size-harmonization.md §4). In one row at 150 % "Today ‹ ›" left the
|
|
968
|
+
// heading 30 px on a 360 px phone, and "October 2026" was drawn under "Today".
|
|
969
|
+
// Where they fit, nothing changes.
|
|
970
|
+
<div {...wrapperRest} ref={rootRef} className={cn("flex min-w-0 flex-wrap items-center gap-2", className)}>
|
|
962
971
|
{Heading ? <Heading className="m-0 min-w-0 text-lg font-semibold">{trigger}</Heading> : trigger}
|
|
963
972
|
<div className="ms-auto flex shrink-0 items-center gap-1">
|
|
964
973
|
{showToday && (
|
|
@@ -1006,7 +1015,7 @@ export function MonthPicker(props: MonthPickerProps) {
|
|
|
1006
1015
|
</span>
|
|
1007
1016
|
)}
|
|
1008
1017
|
<Popover
|
|
1009
|
-
width=
|
|
1018
|
+
width="16rem"
|
|
1010
1019
|
panelId={panelId}
|
|
1011
1020
|
labels={{ panel: panelLabel }}
|
|
1012
1021
|
dir={dir}
|
|
@@ -55,7 +55,7 @@ export interface NavPillsProps<T extends string> extends Omit<ComponentPropsWith
|
|
|
55
55
|
// the current one), so a strip of these beside a segmented control reads as the same
|
|
56
56
|
// family. Unlike the segments, a pill never truncates: the strip WRAPS instead.
|
|
57
57
|
const PILL =
|
|
58
|
-
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-
|
|
58
|
+
"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-[length:var(--focus-ring-width)] focus-visible:ring-[var(--border-strong)] [&_svg]:size-4 [&_svg]:shrink-0";
|
|
59
59
|
const PILL_SM = "gap-1 px-2 py-1 text-xs [&_svg]:size-3.5";
|
|
60
60
|
const PILL_CURRENT = "bg-[var(--bg-inverse)] text-[var(--text-inverse)]";
|
|
61
61
|
const PILL_IDLE = "text-[var(--text-secondary)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-primary)]";
|
|
@@ -2,13 +2,14 @@ import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
|
2
2
|
import type { KeyboardEvent, ReactNode } from "react";
|
|
3
3
|
import { CalculatorButton, type CalculatorButtonLabels } from "./calculator";
|
|
4
4
|
import { NumberPadSheet, type NumberPadSheetLabels } from "./numpad-sheet";
|
|
5
|
-
import { FIELD_BASE, FIELD_DISPLAY, FIELD_INVALID, FLOATING_INPUT_CLASS, FloatingField
|
|
5
|
+
import { FIELD_BASE, FIELD_DISPLAY, FIELD_INVALID, FLOATING_INPUT_CLASS, FloatingField } from "./ui";
|
|
6
6
|
import { CURRENCIES } from "./currency-select";
|
|
7
7
|
import { hasMessage, mergeDescribedBy } from "./choice-parts";
|
|
8
|
+
import { useInlineHint } from "./field-parts";
|
|
8
9
|
import { cn } from "../lib/cn";
|
|
9
10
|
import { commitExpression, formatResult } from "../lib/calc";
|
|
10
11
|
import { decimalMark, localizeMark, readTyped, showsTyped } from "../lib/decimal-marks";
|
|
11
|
-
import {
|
|
12
|
+
import { usePhoneLayout } from "../hooks/use-breakpoint";
|
|
12
13
|
import { useKitLocale } from "../i18n/kit-labels";
|
|
13
14
|
|
|
14
15
|
interface NumberInputProps {
|
|
@@ -65,7 +66,9 @@ interface NumberInputProps {
|
|
|
65
66
|
* feedback #48). Plain TEXT (a string or a number) is a caption instead, UNDER
|
|
66
67
|
* the field and attached through `aria-describedby` after the caller's own —
|
|
67
68
|
* the same rule as {@link Select}'s `hint`: the label line has no room for a
|
|
68
|
-
* sentence, and one placed there ran over the label and into the value.
|
|
69
|
+
* sentence, and one placed there ran over the label and into the value.
|
|
70
|
+
* Since 0.32 a FieldHint is that caption too at Large and on a touch screen,
|
|
71
|
+
* where a "?" cannot be hovered open (`useInlineHint`). */
|
|
69
72
|
hint?: ReactNode;
|
|
70
73
|
/** Required and unanswered — {@link FIELD_INVALID}. See {@link Input}'s `invalid`. */
|
|
71
74
|
invalid?: boolean;
|
|
@@ -179,7 +182,7 @@ export function stepNumber(
|
|
|
179
182
|
|
|
180
183
|
// The error line under a field — the type of `ui.tsx`'s (module-private) one, so a
|
|
181
184
|
// NumberInput's message is indistinguishable from an Input's.
|
|
182
|
-
const FIELD_ERROR_CLASS = "mt-1 text-
|
|
185
|
+
const FIELD_ERROR_CLASS = "mt-1 text-caption leading-tight text-[var(--danger)]";
|
|
183
186
|
|
|
184
187
|
// ── The money guard (kastlan 5, Kurvenschmiede) ─────────────────────────────────
|
|
185
188
|
|
|
@@ -275,7 +278,7 @@ export function NumberInput(props: NumberInputProps) {
|
|
|
275
278
|
id,
|
|
276
279
|
calculator = true,
|
|
277
280
|
variant = "field",
|
|
278
|
-
hint,
|
|
281
|
+
hint: hintProp,
|
|
279
282
|
invalid: invalidProp,
|
|
280
283
|
error,
|
|
281
284
|
locale: localeProp,
|
|
@@ -291,6 +294,10 @@ export function NumberInput(props: NumberInputProps) {
|
|
|
291
294
|
const fieldId = id ?? generatedId;
|
|
292
295
|
const hintId = useId();
|
|
293
296
|
const errorId = useId();
|
|
297
|
+
// §4 "No fact only in a tooltip" (docs/text-size-harmonization.md): at Large and on a
|
|
298
|
+
// touch screen a FieldHint is its words, so it takes the caption's path below — the
|
|
299
|
+
// other kit fields do the same through `useFieldHint`.
|
|
300
|
+
const hint = useInlineHint(hintProp);
|
|
294
301
|
// Text is a caption under the field; a FieldHint rides the label line. See `hint`.
|
|
295
302
|
const textHint = (typeof hint === "string" && hint !== "") || typeof hint === "number";
|
|
296
303
|
const hasError = hasMessage(error);
|
|
@@ -302,7 +309,7 @@ export function NumberInput(props: NumberInputProps) {
|
|
|
302
309
|
const labelled = label !== undefined;
|
|
303
310
|
// On phones we suppress the OS keyboard (inputMode="none" below) for our own
|
|
304
311
|
// calculator numpad, so the desktop popover trigger is hidden (feedback #334).
|
|
305
|
-
const isMobile =
|
|
312
|
+
const isMobile = usePhoneLayout();
|
|
306
313
|
const asDisplay = isMobile && variant === "display";
|
|
307
314
|
const showCalc = calculator && !disabled && !isMobile;
|
|
308
315
|
const [focused, setFocused] = useState(false);
|
|
@@ -512,7 +519,7 @@ export function NumberInput(props: NumberInputProps) {
|
|
|
512
519
|
<div>
|
|
513
520
|
{field}
|
|
514
521
|
{textHint && (
|
|
515
|
-
<p id={hintId} className="mt-1 text-
|
|
522
|
+
<p id={hintId} className="mt-1 text-caption leading-tight text-[var(--text-muted)]">
|
|
516
523
|
{hint}
|
|
517
524
|
</p>
|
|
518
525
|
)}
|
|
@@ -3,6 +3,7 @@ import { Delete } from "lucide-react";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
5
|
import { cn } from "../lib/cn";
|
|
6
|
+
import { FOCUS_RING } from "./focus-ring";
|
|
6
7
|
import { useEscapeKey } from "../hooks/use-dismiss";
|
|
7
8
|
import { evaluateExpression, formatResult, sanitizeLive } from "../lib/calc";
|
|
8
9
|
import {
|
|
@@ -88,8 +89,7 @@ const PAD_KEYS: PadKey[] = [
|
|
|
88
89
|
*
|
|
89
90
|
* --brand rather than --border-strong: the operator keys are filled with --border, and
|
|
90
91
|
* a ring in the colour of the thing it surrounds is not an indicator. */
|
|
91
|
-
const PAD_BTN =
|
|
92
|
-
"flex h-14 items-center justify-center rounded-lg text-lg font-medium transition-transform select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--brand)] active:scale-[0.97]";
|
|
92
|
+
const PAD_BTN = `flex h-14 items-center justify-center rounded-lg text-lg font-medium transition-transform select-none focus:outline-none ${FOCUS_RING} focus-visible:ring-inset active:scale-[0.97]`;
|
|
93
93
|
const PAD_DIGIT = "bg-[var(--bg-surface-2)] text-[var(--text-primary)] active:bg-[var(--border)]";
|
|
94
94
|
const PAD_ACCENT = "bg-[var(--border)] text-[var(--text-primary)] active:bg-[var(--bg-surface-2)]";
|
|
95
95
|
|
|
@@ -105,8 +105,8 @@ export interface OneTimeCodeInputProps
|
|
|
105
105
|
|
|
106
106
|
// The error line under a field — the type of `ui.tsx`'s (module-private) one, so this
|
|
107
107
|
// field's message is indistinguishable from an Input's.
|
|
108
|
-
const FIELD_ERROR_CLASS = "mt-1 text-
|
|
109
|
-
const FIELD_CAPTION_CLASS = "mt-1 text-
|
|
108
|
+
const FIELD_ERROR_CLASS = "mt-1 text-caption leading-tight text-[var(--danger)]";
|
|
109
|
+
const FIELD_CAPTION_CLASS = "mt-1 text-caption leading-tight text-[var(--text-muted)]";
|
|
110
110
|
|
|
111
111
|
// Equal-width digits, spaced a little apart, so a code reads — and compares against the
|
|
112
112
|
// authenticator's screen — digit by digit.
|
|
@@ -182,7 +182,7 @@ export function PageContents({
|
|
|
182
182
|
aria-current={current ? "location" : undefined}
|
|
183
183
|
onClick={() => setClicked(item.id)}
|
|
184
184
|
className={cn(
|
|
185
|
-
"-ms-px block border-s-2 py-1 pe-1 text-[
|
|
185
|
+
"-ms-px block border-s-2 py-1 pe-1 text-[0.8125rem] leading-snug transition-colors duration-150",
|
|
186
186
|
variant === "rail" && "[overflow-wrap:anywhere]",
|
|
187
187
|
item.level === 2 ? "ps-6" : "ps-3",
|
|
188
188
|
current
|
|
@@ -222,7 +222,7 @@ export function PageContents({
|
|
|
222
222
|
|
|
223
223
|
return (
|
|
224
224
|
<nav {...rest} aria-label={l.title} className={className}>
|
|
225
|
-
<p className="mb-2 text-
|
|
225
|
+
<p className="mb-2 text-caption font-semibold uppercase tracking-wide text-[var(--text-muted)]">
|
|
226
226
|
{l.title}
|
|
227
227
|
</p>
|
|
228
228
|
{list}
|
|
@@ -42,8 +42,8 @@ function usePhoneInputLabels(prop: Partial<PhoneInputLabels> | undefined): Phone
|
|
|
42
42
|
|
|
43
43
|
/** The caption and the error under the row — the type every kit field uses for them
|
|
44
44
|
* (Select's caption, Input's `error`). */
|
|
45
|
-
const CAPTION_CLASS = "mt-1 text-
|
|
46
|
-
const ERROR_CLASS = "mt-1 text-
|
|
45
|
+
const CAPTION_CLASS = "mt-1 text-caption leading-tight text-[var(--text-muted)]";
|
|
46
|
+
const ERROR_CLASS = "mt-1 text-caption leading-tight text-[var(--danger)]";
|
|
47
47
|
|
|
48
48
|
const isTextHint = (hint: unknown): hint is string | number =>
|
|
49
49
|
(typeof hint === "string" && hint !== "") || typeof hint === "number";
|
|
@@ -242,7 +242,12 @@ export const PhoneInput = forwardRef<HTMLInputElement, PhoneInputProps>(function
|
|
|
242
242
|
role={named ? "group" : undefined}
|
|
243
243
|
aria-label={named ? label : undefined}
|
|
244
244
|
>
|
|
245
|
-
|
|
245
|
+
{/* On a phone at Large the number takes a line of its own under the country (0.32.1,
|
|
246
|
+
the 360 px Extra-large sweep; docs/text-size-harmonization.md §4 "nothing
|
|
247
|
+
truncates"): the 7rem select is 168 px at 150 %, and on a 360 px phone it left
|
|
248
|
+
the number 82 px — "Ph…" over "021 (". `large:max-sm:`, the scaled phone width,
|
|
249
|
+
so a wider screen at Large and Normal keep the one row. */}
|
|
250
|
+
<div className="flex items-stretch gap-2 large:max-sm:flex-wrap">
|
|
246
251
|
<Select
|
|
247
252
|
aria-label={text.countryCode}
|
|
248
253
|
value={country}
|
|
@@ -261,7 +266,7 @@ export const PhoneInput = forwardRef<HTMLInputElement, PhoneInputProps>(function
|
|
|
261
266
|
<option value="other">{text.other}</option>
|
|
262
267
|
</Select>
|
|
263
268
|
{/* Its own flex item, so nothing Input wraps itself in can take the sizing. */}
|
|
264
|
-
<div className="min-w-0 flex-1">
|
|
269
|
+
<div className="min-w-0 flex-1 large:max-sm:basis-full">
|
|
265
270
|
<Input
|
|
266
271
|
ref={ref}
|
|
267
272
|
{...rest}
|
|
@@ -18,6 +18,8 @@ import { paletteFor } from "../theme/chart-palette";
|
|
|
18
18
|
import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig } from "./chart";
|
|
19
19
|
import { DEFAULT_PIE_CHART_LABELS, type PieChartLabels } from "./pie-chart-labels";
|
|
20
20
|
import { StaticLegend, ToggleLegend, toggleHidden, type LegendEntry } from "./toggle-legend";
|
|
21
|
+
import { useTextSize } from "../theme/text-size";
|
|
22
|
+
import { chartHeightProps, type ChartHeight } from "./chart-height";
|
|
21
23
|
|
|
22
24
|
/** One slice. */
|
|
23
25
|
export interface PieChartSlice {
|
|
@@ -46,8 +48,13 @@ export interface PieChartProps extends Omit<ComponentPropsWithoutRef<"div">, "ch
|
|
|
46
48
|
data: readonly PieChartSlice[];
|
|
47
49
|
/** `"donut"` (default) leaves a hole with the total in it; `"pie"` is the full disc. */
|
|
48
50
|
variant?: "donut" | "pie";
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Height of the plot (the legend is under it): a CSS length (`"20rem"`,
|
|
53
|
+
* `"min(20rem, 50dvh)"`), a Tailwind class, or px. Default `"18.75rem"` — 300 px at
|
|
54
|
+
* Normal, growing with the text size so the slice labels keep their room (0.32,
|
|
55
|
+
* docs/text-size-harmonization.md §10.10). A number does not follow the text size.
|
|
56
|
+
*/
|
|
57
|
+
height?: ChartHeight;
|
|
51
58
|
/** How a value is written in the tooltip, the slice's name, a `"value"` slice label
|
|
52
59
|
* and the donut's total. Default: `Intl.NumberFormat` in `locale`. */
|
|
53
60
|
formatValue?: (value: number) => string;
|
|
@@ -144,7 +151,7 @@ function RedactedTooltipContent(props: ComponentProps<typeof ChartTooltipContent
|
|
|
144
151
|
export function PieChart({
|
|
145
152
|
data,
|
|
146
153
|
variant = "donut",
|
|
147
|
-
height =
|
|
154
|
+
height = "18.75rem",
|
|
148
155
|
formatValue: formatValueProp,
|
|
149
156
|
sliceLabels = "percent",
|
|
150
157
|
minLabelShare = 0.04,
|
|
@@ -165,6 +172,9 @@ export function PieChart({
|
|
|
165
172
|
}: PieChartProps) {
|
|
166
173
|
const labels = useKitLabels("pieChart", DEFAULT_PIE_CHART_LABELS, labelsProp);
|
|
167
174
|
const locale = useKitLocale(localeProp);
|
|
175
|
+
// The slice labels are SVG text in px: they follow the text size by this (§10.10).
|
|
176
|
+
const { scale } = useTextSize();
|
|
177
|
+
const box = chartHeightProps(height);
|
|
168
178
|
const numberFormat = useMemo(() => new Intl.NumberFormat(locale), [locale]);
|
|
169
179
|
const percentFormats = useMemo(
|
|
170
180
|
() => ({
|
|
@@ -312,7 +322,7 @@ export function PieChart({
|
|
|
312
322
|
const radius = Number(props.outerRadius);
|
|
313
323
|
const mid = Number(props.midAngle);
|
|
314
324
|
if (!d || d.share < minLabelShare || ![cx, cy, radius, mid].every(Number.isFinite)) return null;
|
|
315
|
-
const r = radius + 10;
|
|
325
|
+
const r = radius + 10 * scale;
|
|
316
326
|
const x = cx + r * Math.cos(-mid * RADIAN);
|
|
317
327
|
const y = cy + r * Math.sin(-mid * RADIAN);
|
|
318
328
|
const isValue = sliceLabels === "value";
|
|
@@ -322,7 +332,7 @@ export function PieChart({
|
|
|
322
332
|
y={y}
|
|
323
333
|
textAnchor={x >= cx ? "start" : "end"}
|
|
324
334
|
dominantBaseline="central"
|
|
325
|
-
fontSize={11}
|
|
335
|
+
fontSize={11 * scale}
|
|
326
336
|
fill="var(--text-secondary)"
|
|
327
337
|
data-private={redact && isValue ? "" : undefined}
|
|
328
338
|
style={{ pointerEvents: "none" }}
|
|
@@ -331,7 +341,7 @@ export function PieChart({
|
|
|
331
341
|
</text>
|
|
332
342
|
);
|
|
333
343
|
},
|
|
334
|
-
[drawn, minLabelShare, sliceLabels, redact, formatValue, formatShare],
|
|
344
|
+
[drawn, minLabelShare, sliceLabels, redact, formatValue, formatShare, scale],
|
|
335
345
|
);
|
|
336
346
|
|
|
337
347
|
const withLabels = sliceLabels !== "none";
|
|
@@ -394,8 +404,8 @@ export function PieChart({
|
|
|
394
404
|
|
|
395
405
|
const emptyBox = (
|
|
396
406
|
<div
|
|
397
|
-
className="flex items-center justify-center text-sm text-[var(--text-muted)]"
|
|
398
|
-
style={
|
|
407
|
+
className={cn("flex items-center justify-center text-sm text-[var(--text-muted)]", box.className)}
|
|
408
|
+
style={box.style}
|
|
399
409
|
>
|
|
400
410
|
{empty ?? labels.empty}
|
|
401
411
|
</div>
|
|
@@ -418,7 +428,7 @@ export function PieChart({
|
|
|
418
428
|
// Every slice switched off: the legend below is how they come back.
|
|
419
429
|
emptyBox
|
|
420
430
|
) : (
|
|
421
|
-
<div role="group" aria-label={labels.slices} className="relative" style={
|
|
431
|
+
<div role="group" aria-label={labels.slices} className={cn("relative", box.className)} style={box.style}>
|
|
422
432
|
<ChartContainer
|
|
423
433
|
config={PIE_CONFIG}
|
|
424
434
|
className={cn("h-full", clickable && "[&_.recharts-pie-sector]:cursor-pointer")}
|
|
@@ -4,6 +4,7 @@ import { createPortal } from "react-dom";
|
|
|
4
4
|
import { useAnchoredPanel } from "../hooks/use-anchored-panel";
|
|
5
5
|
import { useEscapeKey, useOutsideClick } from "../hooks/use-dismiss";
|
|
6
6
|
import { useFocusTrap } from "../hooks/use-focus-trap";
|
|
7
|
+
import { lengthPx, useRemPx, type RemLength } from "../hooks/use-breakpoint";
|
|
7
8
|
import { cn } from "../lib/cn";
|
|
8
9
|
import { dirOf } from "../lib/direction";
|
|
9
10
|
import type { Direction } from "../lib/direction";
|
|
@@ -39,7 +40,14 @@ export const DEFAULT_POPOVER_LABELS: PopoverLabels = {
|
|
|
39
40
|
export interface PopoverProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
40
41
|
trigger: (state: { open: boolean; toggle: () => void; ref: RefObject<HTMLButtonElement | null> }) => ReactNode;
|
|
41
42
|
children: (close: () => void) => ReactNode;
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The panel's width: `"18rem"` (the default) grows with the text size — the panel
|
|
45
|
+
* holds text, and a 288 px calendar at 150 % cut its own month off (0.32,
|
|
46
|
+
* docs/text-size-harmonization.md §3.2). A plain number is px, fixed, as before.
|
|
47
|
+
* Either way the panel is never wider than the viewport less 8 px a side: 18rem is
|
|
48
|
+
* 432 px at Extra large, more than a 360 px phone has.
|
|
49
|
+
*/
|
|
50
|
+
width?: number | RemLength;
|
|
43
51
|
labels?: Partial<PopoverLabels>;
|
|
44
52
|
/** Id for the panel, so a trigger wearing `role="combobox"` can `aria-controls` it.
|
|
45
53
|
* Required by ARIA on that role, and the panel is rendered here rather than by the
|
|
@@ -49,7 +57,11 @@ export interface PopoverProps extends Omit<ComponentPropsWithoutRef<"div">, "chi
|
|
|
49
57
|
className?: string;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
|
-
|
|
60
|
+
/** 288 px at Normal, in rem so it follows the text size (§3.2). */
|
|
61
|
+
const POPOVER_WIDTH: RemLength = "18rem";
|
|
62
|
+
|
|
63
|
+
/** The gap the panel keeps from either edge of the viewport, in px. */
|
|
64
|
+
const EDGE = 8;
|
|
53
65
|
|
|
54
66
|
/**
|
|
55
67
|
* Portal-rendered popover anchored under its trigger button. The panel is fixed
|
|
@@ -124,12 +136,17 @@ export function Popover({
|
|
|
124
136
|
// of the screen (feedback #135). It re-measures on scroll/resize.
|
|
125
137
|
const placement = useAnchoredPanel(triggerRef, open);
|
|
126
138
|
const rect = placement.rect;
|
|
139
|
+
// In px for the arithmetic below, at the text size in force; capped at the viewport.
|
|
140
|
+
const remPx = useRemPx();
|
|
141
|
+
const panelWidth = rect
|
|
142
|
+
? Math.min(lengthPx(width, remPx), Math.max(0, window.innerWidth - 2 * EDGE))
|
|
143
|
+
: 0;
|
|
127
144
|
const pos = rect
|
|
128
145
|
? {
|
|
129
146
|
top: placement.top,
|
|
130
147
|
left: Math.min(
|
|
131
|
-
Math.max(
|
|
132
|
-
window.innerWidth -
|
|
148
|
+
Math.max(EDGE, dir === "rtl" ? rect.left : rect.right - panelWidth),
|
|
149
|
+
window.innerWidth - panelWidth - EDGE,
|
|
133
150
|
),
|
|
134
151
|
}
|
|
135
152
|
: null;
|
|
@@ -199,7 +216,7 @@ export function Popover({
|
|
|
199
216
|
position: "fixed",
|
|
200
217
|
top: pos.top,
|
|
201
218
|
left: pos.left,
|
|
202
|
-
width,
|
|
219
|
+
width: panelWidth,
|
|
203
220
|
maxHeight: placement.maxHeight,
|
|
204
221
|
}}
|
|
205
222
|
className={cn(
|