@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/series-chart-ticks.ts"],"sourcesContent":["// Round tick values for `SeriesChart` — internal, not re-exported by `@eifi1/ui-kit/chart`.\n//\n// Handed an explicit numeric domain, recharts divides it into equal parts and prints\n// wherever those land: a fitted band of [-11, 811] comes out as -11, 189, 389 … and a\n// padded [89, 1011] as 89, 289, 489 — numbers nobody can put a ruler against. These\n// are the ticks a person would draw instead: every multiple of a 1, 2 or 5 × 10^n step\n// that lies INSIDE the domain. The domain itself is left alone, so the 4 % of air the\n// fit leaves and a zoom window's exact edges both survive; the frame simply does not\n// get a number of its own.\n\n/** Roughly how many ticks to aim for. The 1/2/5 ladder lands anywhere from about half\n * to about twice this, which is the price of every tick being a round number. */\nconst TARGET_TICKS = 5;\n\n/** The round step closest to `span / target`: 1, 2 or 5 times a power of ten. */\nexport function niceStep(span: number, target: number = TARGET_TICKS): number {\n const rough = span / Math.max(1, target);\n const magnitude = 10 ** Math.floor(Math.log10(rough));\n const norm = rough / magnitude;\n const factor = norm < 1.5 ? 1 : norm < 3 ? 2 : norm < 7 ? 5 : 10;\n return factor * magnitude;\n}\n\n/**\n * The round ticks inside `[low, high]`, ascending — or `undefined` when there is no\n * span to divide (no domain, a zero-height one, anything non-finite), which leaves the\n * choice to recharts.\n *\n * Each tick is computed as `k × step` and then rounded to the step's own decimals:\n * accumulating `+= 0.1` would print 0.30000000000000004 on the third tick.\n */\nexport function niceTicks(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): number[] | undefined {\n if (!domain) return undefined;\n const [low, high] = domain;\n if (!Number.isFinite(low) || !Number.isFinite(high) || !(high > low)) return undefined;\n const step = niceStep(high - low, target);\n if (!(step > 0) || !Number.isFinite(step)) return undefined;\n const decimals = Math.max(0, -Math.floor(Math.log10(step)));\n const ticks: number[] = [];\n // Half a step's tolerance per end would admit ticks outside the frame; a millionth\n // of one only forgives the float error in `low / step`.\n const first = Math.ceil(low / step - 1e-6);\n const last = Math.floor(high / step + 1e-6);\n for (let k = first; k <= last; k++) {\n // `+ 0` turns the -0 that `Number(\"-0.00\")` gives back into a plain 0.\n ticks.push(Number((k * step).toFixed(decimals)) + 0);\n }\n return ticks.length ? ticks : undefined;\n}\n\n/**\n * {@link niceTicks} on whole numbers only: the step never drops below 1, so a short\n * index series (a domain of [-0.2, 4.2]) is ticked 0 1 2 3 4 instead of every half.\n * `undefined` when the window holds no whole number at all, so the caller can fall\n * back to the fractional ticks of a deep zoom rather than show none.\n */\nexport function integerTicks(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): number[] | undefined {\n if (!domain) return undefined;\n const [low, high] = domain;\n if (!Number.isFinite(low) || !Number.isFinite(high) || !(high >= low)) return undefined;\n const step = high > low ? Math.max(1, niceStep(high - low, target)) : 1;\n const ticks: number[] = [];\n const first = Math.ceil(low / step - 1e-6);\n const last = Math.floor(high / step + 1e-6);\n for (let k = first; k <= last; k++) ticks.push(k * step + 0);\n return ticks.length ? ticks : undefined;\n}\n\n/**\n * The slots of a CATEGORY axis that lie inside a window over their positions.\n *\n * `SeriesChart` draws a category axis on the slot INDEX (see `x.type: \"category\"`), so a\n * zoom window is a range of fractional positions — [2.6, 8.3] after a drag across the\n * third to ninth month. A tick belongs on every whole slot inside it, and on nothing in\n * between: there is no month 2.5. Recharts' `minTickGap` thins them where they crowd.\n */\nexport function categoryTicks(\n domain: readonly [number, number] | undefined,\n count: number,\n): number[] | undefined {\n if (!domain || !(count > 0)) return undefined;\n const first = Math.max(0, Math.ceil(domain[0] - 1e-6));\n const last = Math.min(count - 1, Math.floor(domain[1] + 1e-6));\n const ticks: number[] = [];\n for (let slot = first; slot <= last; slot++) ticks.push(slot);\n return ticks.length ? ticks : undefined;\n}\n\n/** What one tick of a time axis stands for, which is also how its label is written. */\nexport type TimeTickUnit = \"hour\" | \"day\" | \"month\" | \"year\";\n\nconst HOUR = 3_600_000;\nconst DAY = 24 * HOUR;\n\n/**\n * The calendar steps a time axis may tick in, with their rough length for choosing.\n * Months and years are stepped with `Date` setters, not by adding their \"length\":\n * thirty days from the 1st of February is the 3rd of March, and a tick that promises a\n * month start and prints the 3rd is the ruler lying.\n */\nconst TIME_STEPS: readonly { unit: TimeTickUnit; n: number; ms: number }[] = [\n { unit: \"hour\", n: 1, ms: HOUR },\n { unit: \"hour\", n: 3, ms: 3 * HOUR },\n { unit: \"hour\", n: 6, ms: 6 * HOUR },\n { unit: \"hour\", n: 12, ms: 12 * HOUR },\n { unit: \"day\", n: 1, ms: DAY },\n { unit: \"day\", n: 2, ms: 2 * DAY },\n { unit: \"day\", n: 7, ms: 7 * DAY },\n { unit: \"month\", n: 1, ms: 30.44 * DAY },\n { unit: \"month\", n: 2, ms: 60.88 * DAY },\n { unit: \"month\", n: 3, ms: 91.31 * DAY },\n { unit: \"month\", n: 6, ms: 182.62 * DAY },\n];\n\n/**\n * Calendar ticks inside a window of epoch milliseconds — midnights, Mondays, month and\n * quarter starts, new years, in LOCAL time — and the unit they are in, so the label can\n * say as much as the tick means (\"Mar 26\" for a month start, \"14 Mar\" for a day).\n *\n * The time counterpart of {@link niceTicks}: a 1/2/5 ladder over raw milliseconds lands\n * on 5 × 10⁹ ms, every 58 days, at whatever hour that happens to be. keksdose's price\n * history and cash buffer each thinned their own ticks by hand for exactly this reason.\n */\nexport function timeTicksWithUnit(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): { ticks: number[]; unit: TimeTickUnit } | undefined {\n if (!domain) return undefined;\n const [low, high] = domain;\n if (!Number.isFinite(low) || !Number.isFinite(high) || !(high > low)) return undefined;\n const rough = (high - low) / Math.max(1, target);\n let unit: TimeTickUnit = \"year\";\n let n = 1;\n let best = Infinity;\n for (const step of TIME_STEPS) {\n const miss = Math.abs(Math.log(step.ms / rough));\n if (miss < best) {\n best = miss;\n unit = step.unit;\n n = step.n;\n }\n }\n // The year ladder competes on the same terms as the table: one year is 365.25 days.\n const yearN = Math.max(1, Math.round(niceStep((high - low) / (365.25 * DAY), target)));\n if (Math.abs(Math.log((yearN * 365.25 * DAY) / rough)) < best) {\n unit = \"year\";\n n = yearN;\n }\n\n const start = new Date(low);\n start.setMinutes(0, 0, 0);\n if (unit !== \"hour\") start.setHours(0);\n if (unit === \"month\" || unit === \"year\") start.setDate(1);\n if (unit === \"year\") start.setMonth(0);\n // Onto the step's own grid: hours of the day, Mondays, month indices, years — so a\n // zoom window starting on a Wednesday still ticks on Mondays.\n if (unit === \"hour\") start.setHours(start.getHours() - (start.getHours() % n));\n if (unit === \"day\" && n === 7) start.setDate(start.getDate() - ((start.getDay() + 6) % 7));\n if (unit === \"month\") start.setMonth(start.getMonth() - (start.getMonth() % n));\n if (unit === \"year\") start.setFullYear(start.getFullYear() - (start.getFullYear() % n));\n\n const ticks: number[] = [];\n const at = new Date(start);\n // Bounded, so a window of a million years cannot hang the render.\n for (let guard = 0; guard < 1000 && at.getTime() <= high; guard++) {\n if (at.getTime() >= low) ticks.push(at.getTime());\n if (unit === \"hour\") at.setHours(at.getHours() + n);\n else if (unit === \"day\") at.setDate(at.getDate() + n);\n else if (unit === \"month\") at.setMonth(at.getMonth() + n);\n else at.setFullYear(at.getFullYear() + n);\n }\n return ticks.length ? { ticks, unit } : undefined;\n}\n\n/** {@link timeTicksWithUnit}, ticks only. */\nexport function timeTicks(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): number[] | undefined {\n return timeTicksWithUnit(domain, target)?.ticks;\n}\n"],"mappings":";AAYA,MAAM,eAAe;AAGd,SAAS,SAAS,MAAc,SAAiB,cAAsB;AAC5E,QAAM,QAAQ,OAAO,KAAK,IAAI,GAAG,MAAM;AACvC,QAAM,YAAY,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,CAAC;AACpD,QAAM,OAAO,QAAQ;AACrB,QAAM,SAAS,OAAO,MAAM,IAAI,OAAO,IAAI,IAAI,OAAO,IAAI,IAAI;AAC9D,SAAO,SAAS;AAClB;AAUO,SAAS,UACd,QACA,SAAiB,cACK;AACtB,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,CAAC,KAAK,IAAI,IAAI;AACpB,MAAI,CAAC,OAAO,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,IAAI,KAAK,EAAE,OAAO,KAAM,QAAO;AAC7E,QAAM,OAAO,SAAS,OAAO,KAAK,MAAM;AACxC,MAAI,EAAE,OAAO,MAAM,CAAC,OAAO,SAAS,IAAI,EAAG,QAAO;AAClD,QAAM,WAAW,KAAK,IAAI,GAAG,CAAC,KAAK,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC;AAC1D,QAAM,QAAkB,CAAC;AAGzB,QAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,IAAI;AACzC,QAAM,OAAO,KAA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series-chart-ticks.ts"],"sourcesContent":["// Round tick values for `SeriesChart` — internal, not re-exported by `@eifi1/ui-kit/chart`.\n//\n// Handed an explicit numeric domain, recharts divides it into equal parts and prints\n// wherever those land: a fitted band of [-11, 811] comes out as -11, 189, 389 … and a\n// padded [89, 1011] as 89, 289, 489 — numbers nobody can put a ruler against. These\n// are the ticks a person would draw instead: every multiple of a 1, 2 or 5 × 10^n step\n// that lies INSIDE the domain. The domain itself is left alone, so the 4 % of air the\n// fit leaves and a zoom window's exact edges both survive; the frame simply does not\n// get a number of its own.\n\n/** Roughly how many ticks to aim for. The 1/2/5 ladder lands anywhere from about half\n * to about twice this, which is the price of every tick being a round number. */\nconst TARGET_TICKS = 5;\n\n/** The aim at Large and Extra large (docs/text-size-harmonization.md §4): the labels are\n * 25–50 % wider and taller, so five of them crowd an axis that holds them at Normal. */\nexport const LARGE_TEXT_TARGET_TICKS = 3;\n\n/** How many ticks to aim for at a text `scale` (`useTextSize().scale`): five at Normal,\n * three from Large up. */\nexport function tickTarget(scale = 1): number {\n return scale > 1 ? LARGE_TEXT_TARGET_TICKS : TARGET_TICKS;\n}\n\n/** The round step closest to `span / target`: 1, 2 or 5 times a power of ten. */\nexport function niceStep(span: number, target: number = TARGET_TICKS): number {\n const rough = span / Math.max(1, target);\n const magnitude = 10 ** Math.floor(Math.log10(rough));\n const norm = rough / magnitude;\n const factor = norm < 1.5 ? 1 : norm < 3 ? 2 : norm < 7 ? 5 : 10;\n return factor * magnitude;\n}\n\n/**\n * The round ticks inside `[low, high]`, ascending — or `undefined` when there is no\n * span to divide (no domain, a zero-height one, anything non-finite), which leaves the\n * choice to recharts.\n *\n * Each tick is computed as `k × step` and then rounded to the step's own decimals:\n * accumulating `+= 0.1` would print 0.30000000000000004 on the third tick.\n */\nexport function niceTicks(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): number[] | undefined {\n if (!domain) return undefined;\n const [low, high] = domain;\n if (!Number.isFinite(low) || !Number.isFinite(high) || !(high > low)) return undefined;\n const step = niceStep(high - low, target);\n if (!(step > 0) || !Number.isFinite(step)) return undefined;\n const decimals = Math.max(0, -Math.floor(Math.log10(step)));\n const ticks: number[] = [];\n // Half a step's tolerance per end would admit ticks outside the frame; a millionth\n // of one only forgives the float error in `low / step`.\n const first = Math.ceil(low / step - 1e-6);\n const last = Math.floor(high / step + 1e-6);\n for (let k = first; k <= last; k++) {\n // `+ 0` turns the -0 that `Number(\"-0.00\")` gives back into a plain 0.\n ticks.push(Number((k * step).toFixed(decimals)) + 0);\n }\n return ticks.length ? ticks : undefined;\n}\n\n/**\n * {@link niceTicks} on whole numbers only: the step never drops below 1, so a short\n * index series (a domain of [-0.2, 4.2]) is ticked 0 1 2 3 4 instead of every half.\n * `undefined` when the window holds no whole number at all, so the caller can fall\n * back to the fractional ticks of a deep zoom rather than show none.\n */\nexport function integerTicks(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): number[] | undefined {\n if (!domain) return undefined;\n const [low, high] = domain;\n if (!Number.isFinite(low) || !Number.isFinite(high) || !(high >= low)) return undefined;\n const step = high > low ? Math.max(1, niceStep(high - low, target)) : 1;\n const ticks: number[] = [];\n const first = Math.ceil(low / step - 1e-6);\n const last = Math.floor(high / step + 1e-6);\n for (let k = first; k <= last; k++) ticks.push(k * step + 0);\n return ticks.length ? ticks : undefined;\n}\n\n/**\n * The slots of a CATEGORY axis that lie inside a window over their positions.\n *\n * `SeriesChart` draws a category axis on the slot INDEX (see `x.type: \"category\"`), so a\n * zoom window is a range of fractional positions — [2.6, 8.3] after a drag across the\n * third to ninth month. A tick belongs on every whole slot inside it, and on nothing in\n * between: there is no month 2.5. Recharts' `minTickGap` thins them where they crowd.\n */\nexport function categoryTicks(\n domain: readonly [number, number] | undefined,\n count: number,\n): number[] | undefined {\n if (!domain || !(count > 0)) return undefined;\n const first = Math.max(0, Math.ceil(domain[0] - 1e-6));\n const last = Math.min(count - 1, Math.floor(domain[1] + 1e-6));\n const ticks: number[] = [];\n for (let slot = first; slot <= last; slot++) ticks.push(slot);\n return ticks.length ? ticks : undefined;\n}\n\n/** What one tick of a time axis stands for, which is also how its label is written. */\nexport type TimeTickUnit = \"hour\" | \"day\" | \"month\" | \"year\";\n\nconst HOUR = 3_600_000;\nconst DAY = 24 * HOUR;\n\n/**\n * The calendar steps a time axis may tick in, with their rough length for choosing.\n * Months and years are stepped with `Date` setters, not by adding their \"length\":\n * thirty days from the 1st of February is the 3rd of March, and a tick that promises a\n * month start and prints the 3rd is the ruler lying.\n */\nconst TIME_STEPS: readonly { unit: TimeTickUnit; n: number; ms: number }[] = [\n { unit: \"hour\", n: 1, ms: HOUR },\n { unit: \"hour\", n: 3, ms: 3 * HOUR },\n { unit: \"hour\", n: 6, ms: 6 * HOUR },\n { unit: \"hour\", n: 12, ms: 12 * HOUR },\n { unit: \"day\", n: 1, ms: DAY },\n { unit: \"day\", n: 2, ms: 2 * DAY },\n { unit: \"day\", n: 7, ms: 7 * DAY },\n { unit: \"month\", n: 1, ms: 30.44 * DAY },\n { unit: \"month\", n: 2, ms: 60.88 * DAY },\n { unit: \"month\", n: 3, ms: 91.31 * DAY },\n { unit: \"month\", n: 6, ms: 182.62 * DAY },\n];\n\n/**\n * Calendar ticks inside a window of epoch milliseconds — midnights, Mondays, month and\n * quarter starts, new years, in LOCAL time — and the unit they are in, so the label can\n * say as much as the tick means (\"Mar 26\" for a month start, \"14 Mar\" for a day).\n *\n * The time counterpart of {@link niceTicks}: a 1/2/5 ladder over raw milliseconds lands\n * on 5 × 10⁹ ms, every 58 days, at whatever hour that happens to be. keksdose's price\n * history and cash buffer each thinned their own ticks by hand for exactly this reason.\n */\nexport function timeTicksWithUnit(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): { ticks: number[]; unit: TimeTickUnit } | undefined {\n if (!domain) return undefined;\n const [low, high] = domain;\n if (!Number.isFinite(low) || !Number.isFinite(high) || !(high > low)) return undefined;\n const rough = (high - low) / Math.max(1, target);\n let unit: TimeTickUnit = \"year\";\n let n = 1;\n let best = Infinity;\n for (const step of TIME_STEPS) {\n const miss = Math.abs(Math.log(step.ms / rough));\n if (miss < best) {\n best = miss;\n unit = step.unit;\n n = step.n;\n }\n }\n // The year ladder competes on the same terms as the table: one year is 365.25 days.\n const yearN = Math.max(1, Math.round(niceStep((high - low) / (365.25 * DAY), target)));\n if (Math.abs(Math.log((yearN * 365.25 * DAY) / rough)) < best) {\n unit = \"year\";\n n = yearN;\n }\n\n const start = new Date(low);\n start.setMinutes(0, 0, 0);\n if (unit !== \"hour\") start.setHours(0);\n if (unit === \"month\" || unit === \"year\") start.setDate(1);\n if (unit === \"year\") start.setMonth(0);\n // Onto the step's own grid: hours of the day, Mondays, month indices, years — so a\n // zoom window starting on a Wednesday still ticks on Mondays.\n if (unit === \"hour\") start.setHours(start.getHours() - (start.getHours() % n));\n if (unit === \"day\" && n === 7) start.setDate(start.getDate() - ((start.getDay() + 6) % 7));\n if (unit === \"month\") start.setMonth(start.getMonth() - (start.getMonth() % n));\n if (unit === \"year\") start.setFullYear(start.getFullYear() - (start.getFullYear() % n));\n\n const ticks: number[] = [];\n const at = new Date(start);\n // Bounded, so a window of a million years cannot hang the render.\n for (let guard = 0; guard < 1000 && at.getTime() <= high; guard++) {\n if (at.getTime() >= low) ticks.push(at.getTime());\n if (unit === \"hour\") at.setHours(at.getHours() + n);\n else if (unit === \"day\") at.setDate(at.getDate() + n);\n else if (unit === \"month\") at.setMonth(at.getMonth() + n);\n else at.setFullYear(at.getFullYear() + n);\n }\n return ticks.length ? { ticks, unit } : undefined;\n}\n\n/** {@link timeTicksWithUnit}, ticks only. */\nexport function timeTicks(\n domain: readonly [number, number] | undefined,\n target: number = TARGET_TICKS,\n): number[] | undefined {\n return timeTicksWithUnit(domain, target)?.ticks;\n}\n"],"mappings":";AAYA,MAAM,eAAe;AAId,MAAM,0BAA0B;AAIhC,SAAS,WAAW,QAAQ,GAAW;AAC5C,SAAO,QAAQ,IAAI,0BAA0B;AAC/C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S,OAAM,SAAS,MAAM,SAAS,IAAK,MAAM,SAAS,IAAI,CAAE;AAC9E,MAAI,SAAS,OAAQ,OAAM,YAAY,MAAM,YAAY,IAAK,MAAM,YAAY,IAAI,CAAE;AAEtF,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,IAAI,KAAK,KAAK;AAEzB,WAAS,QAAQ,GAAG,QAAQ,OAAQ,GAAG,QAAQ,KAAK,MAAM,SAAS;AACjE,QAAI,GAAG,QAAQ,KAAK,IAAK,OAAM,KAAK,GAAG,QAAQ,CAAC;AAChD,QAAI,SAAS,OAAQ,IAAG,SAAS,GAAG,SAAS,IAAI,CAAC;AAAA,aACzC,SAAS,MAAO,IAAG,QAAQ,GAAG,QAAQ,IAAI,CAAC;AAAA,aAC3C,SAAS,QAAS,IAAG,SAAS,GAAG,SAAS,IAAI,CAAC;AAAA,QACnD,IAAG,YAAY,GAAG,YAAY,IAAI,CAAC;AAAA,EAC1C;AACA,SAAO,MAAM,SAAS,EAAE,OAAO,KAAK,IAAI;AAC1C;AAGO,SAAS,UACd,QACA,SAAiB,cACK;AACtB,SAAO,kBAAkB,QAAQ,MAAM,GAAG;AAC5C;","names":[]}
|
|
@@ -5,19 +5,22 @@ import { LegendEntry } from './toggle-legend.js';
|
|
|
5
5
|
import { SeriesChartLabels } from './series-chart-labels.js';
|
|
6
6
|
import { TimeTickUnit } from './series-chart-ticks.js';
|
|
7
7
|
import { SeriesChartAxisBudget } from './series-chart-budget.js';
|
|
8
|
-
import {
|
|
8
|
+
import { c6 as ChartTooltipPlacement } from '../delete-account-setting-FLyJf-kZ.js';
|
|
9
|
+
import { ChartHeight } from './chart-height.js';
|
|
9
10
|
import 'recharts';
|
|
10
11
|
import './tooltip.js';
|
|
11
12
|
import '../hooks/use-anchored-rect.js';
|
|
12
13
|
import '../lib/clipping.js';
|
|
13
|
-
import '../data-table-labels-
|
|
14
|
+
import '../data-table-labels-kpAAVi6g.js';
|
|
14
15
|
import './data-table-sort.js';
|
|
15
16
|
import './swipeable-row.js';
|
|
16
17
|
import './mini-calendar.js';
|
|
17
18
|
import './calendar-heatmap.js';
|
|
18
19
|
import './popover.js';
|
|
20
|
+
import '../hooks/use-breakpoint.js';
|
|
19
21
|
import './chip.js';
|
|
20
22
|
import 'lucide-react';
|
|
23
|
+
import './field-parts.js';
|
|
21
24
|
import './field-sync.js';
|
|
22
25
|
import '../wizard/types.js';
|
|
23
26
|
import '../tour/tour.js';
|
|
@@ -85,6 +88,9 @@ import '../admin/admin-parts.js';
|
|
|
85
88
|
import '../admin/admin-action-log.js';
|
|
86
89
|
import '../settings/settings-labels.js';
|
|
87
90
|
import '../demo/demo-labels.js';
|
|
91
|
+
import './appearance-labels.js';
|
|
92
|
+
import '../theme/contrast.js';
|
|
93
|
+
import '../theme/text-size.js';
|
|
88
94
|
import './reauth-dialog.js';
|
|
89
95
|
import './server-wake.js';
|
|
90
96
|
import '../lib/server-wake.js';
|
|
@@ -98,7 +104,7 @@ import './sign-chip.js';
|
|
|
98
104
|
import './column-mapper.js';
|
|
99
105
|
import '../lib/column-mapping.js';
|
|
100
106
|
import '../lib/table-text.js';
|
|
101
|
-
import './
|
|
107
|
+
import './focus-ring.js';
|
|
102
108
|
|
|
103
109
|
interface SeriesChartSeries {
|
|
104
110
|
/** The row key this line reads — and the `--color-<key>` it is painted with, so it
|
|
@@ -362,7 +368,7 @@ interface SeriesChartX {
|
|
|
362
368
|
* instead of being centred across it; the anchor is physical, like the plot (see
|
|
363
369
|
* `ChartContainer`), so it is the same in RTL. The band under the axis grows to the
|
|
364
370
|
* rotated height of the longest label on show, estimated from its length (at most
|
|
365
|
-
* 120 px, past which a label is clipped). Default 0.
|
|
371
|
+
* 120 px × the text size's scale, past which a label is clipped). Default 0.
|
|
366
372
|
*/
|
|
367
373
|
tickAngle?: number;
|
|
368
374
|
/**
|
|
@@ -517,13 +523,22 @@ interface SeriesChartProps {
|
|
|
517
523
|
/** A value in the tooltip, where a number stands on its own and needs its unit.
|
|
518
524
|
* Default: `Intl.NumberFormat` in the kit's locale. */
|
|
519
525
|
valueFormat?: (value: number) => string;
|
|
520
|
-
/**
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
|
|
526
|
+
/**
|
|
527
|
+
* The chart's height: a CSS length, a Tailwind height class, or px. Default `h-72`
|
|
528
|
+
* (18rem). The empty state takes it too, so a chart losing its last line does not
|
|
529
|
+
* relayout the page under it.
|
|
530
|
+
*
|
|
531
|
+
* - **A CSS length** (0.32) — `"20rem"`, `"min(20rem, 60dvh)"` — set inline. The form
|
|
532
|
+
* for a height that should grow with the text size and still stop at the screen
|
|
533
|
+
* (docs/text-size-harmonization.md §10.10): `min(30rem, 60dvh)` is 480 px at Normal
|
|
534
|
+
* on a desktop and never more than 60 % of a phone at Extra large, where a scaled
|
|
535
|
+
* 480 px would be 720.
|
|
536
|
+
* - **A Tailwind class** — `"h-72"`, `"h-64 md:h-80"` — as before.
|
|
537
|
+
* - **A number** is px, set inline, and does NOT follow the text size: kept for a
|
|
538
|
+
* height the caller holds as a number (keksdose's report charts take
|
|
539
|
+
* `height = 260` as a prop). Prefer `"16.25rem"`, or a `min()` with a viewport cap.
|
|
540
|
+
*/
|
|
541
|
+
height?: ChartHeight;
|
|
527
542
|
/** Bridge holes left by sources sampled on different grids. See {@link mergeSeries}. */
|
|
528
543
|
connectNulls?: boolean;
|
|
529
544
|
/** Shown, centred at the chart's height, instead of an empty chart. Default: the
|
|
@@ -567,17 +582,23 @@ interface SeriesChartProps {
|
|
|
567
582
|
maxVisibleAxes?: SeriesChartAxisBudget;
|
|
568
583
|
/**
|
|
569
584
|
* `"auto"` (the default): a chart so narrow that its axes' bands would leave the plot
|
|
570
|
-
* under 160 px (`MIN_PLOT_WIDTH
|
|
571
|
-
* plot on a phone, whose plot was 10 px wide.
|
|
572
|
-
*
|
|
585
|
+
* under 160 px (`MIN_PLOT_WIDTH`, × the text size's scale) draws ONE axis a side —
|
|
586
|
+
* lenkbank's four-axis curve plot on a phone, whose plot was 10 px wide. And a chart
|
|
587
|
+
* with an axis on EACH side that one a side still leaves too narrow (0.32: at 150 % a
|
|
588
|
+
* 390 px phone's plot kept about 80 px between its two bands) drops the right-hand,
|
|
589
|
+
* secondary axis too. Measured on the chart's own box (`ResizeObserver`), and applied
|
|
590
|
+
* on top of `maxVisibleAxes`. Either way the series on an axis it hid say the axis'
|
|
591
|
+
* unit in the tooltip and the readout ("Rack load (N)"), and in a legend built by
|
|
592
|
+
* {@link seriesLegendEntries} with `onAxisBudget`'s ids.
|
|
573
593
|
*
|
|
574
|
-
* On by default because it cannot touch a layout that works: it needs a
|
|
575
|
-
*
|
|
576
|
-
* below about
|
|
577
|
-
* axis
|
|
578
|
-
* width. `"off"` keeps every
|
|
579
|
-
*
|
|
580
|
-
* Without layout (jsdom, SSR) nothing is
|
|
594
|
+
* On by default because it cannot touch a layout that works: it needs a plot that
|
|
595
|
+
* would otherwise be under 160 px — a four-axis chart below about 440 px at Normal, a
|
|
596
|
+
* two-left-axis one below about 300, a one-a-side one below about 290 — and the
|
|
597
|
+
* left-hand axis always stays. A chart with one axis (each chart of a facing pair,
|
|
598
|
+
* every single-axis chart) is never budgeted, at any width. `"off"` keeps every
|
|
599
|
+
* declared axis whatever the width: for a stack of multi-axis charts that must keep
|
|
600
|
+
* identical bands, or a caller budgeting itself. Without layout (jsdom, SSR) nothing is
|
|
601
|
+
* measured and nothing is hidden.
|
|
581
602
|
*/
|
|
582
603
|
axisBudget?: "auto" | "off";
|
|
583
604
|
/**
|
|
@@ -600,11 +621,12 @@ interface SeriesChartProps {
|
|
|
600
621
|
* keep the real value. Default: none — a zero draws nothing. */
|
|
601
622
|
minBarLength?: number;
|
|
602
623
|
}
|
|
603
|
-
/** How much of an axis band the rotated title takes, in px
|
|
604
|
-
*
|
|
605
|
-
*
|
|
624
|
+
/** How much of an axis band the rotated title takes, in px at Normal — × the text size's
|
|
625
|
+
* scale on the chart (§3.2), since the title is text. Reserved rather than shared with
|
|
626
|
+
* the ticks: a title merely offset inside the band prints on top of a five-figure tick,
|
|
627
|
+
* and which gives way depends on the data. */
|
|
606
628
|
declare const AXIS_TITLE_STRIP = 16;
|
|
607
|
-
/** The width the ticks of a y axis get when a caller does not say. */
|
|
629
|
+
/** The width the ticks of a y axis get when a caller does not say, in px at Normal. */
|
|
608
630
|
declare const AXIS_TICK_WIDTH = 48;
|
|
609
631
|
/** The band a fitted axis draws, padded — and a real band for constant data, which is
|
|
610
632
|
* a zero-height domain recharts cannot scale into. `undefined` when nothing finite. */
|
|
@@ -615,9 +637,17 @@ declare function paddedDomain(values: Iterable<number>): [number, number] | unde
|
|
|
615
637
|
* without a second padding rule. `low > high` means "nothing was seen": `undefined`.
|
|
616
638
|
*/
|
|
617
639
|
declare function padBand(low: number, high: number): [number, number] | undefined;
|
|
618
|
-
/**
|
|
619
|
-
*
|
|
620
|
-
|
|
640
|
+
/**
|
|
641
|
+
* The whole band a y axis occupies: its ticks, and its title when it draws one. For
|
|
642
|
+
* lining a heading up over a PLOT rather than over its column.
|
|
643
|
+
*
|
|
644
|
+
* `scale` is the text size's (`useTextSize().scale`, §3.2, §10.10): the chart draws every
|
|
645
|
+
* band — the default 48 px and a caller's own `width` alike (keksdose's
|
|
646
|
+
* `MONEY_AXIS_WIDTH`) — this many times wider, because the ticks in it are `text-xs`
|
|
647
|
+
* and grow with the text. A heading lined up over the plot has to pass the same scale.
|
|
648
|
+
* One factor for both sides of a facing pair, so the mirrored bands stay equal.
|
|
649
|
+
*/
|
|
650
|
+
declare function axisBandWidth(tickWidth: number | undefined, titled: boolean, scale?: number): number;
|
|
621
651
|
/**
|
|
622
652
|
* The colour an axis TITLE takes, or `undefined` for the neutral one.
|
|
623
653
|
*
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chart-zoom.js";
|
|
25
25
|
import { STEP_DASH, strokeDash } from "./toggle-legend.js";
|
|
26
26
|
import { DEFAULT_SERIES_CHART_LABELS } from "./series-chart-labels.js";
|
|
27
|
-
import { categoryTicks, integerTicks, niceTicks, timeTicksWithUnit } from "./series-chart-ticks.js";
|
|
27
|
+
import { categoryTicks, integerTicks, niceTicks, tickTarget, timeTicksWithUnit } from "./series-chart-ticks.js";
|
|
28
28
|
import { autoAxisBudget, axisUnit, budgetedAxes } from "./series-chart-budget.js";
|
|
29
29
|
import { paletteFor } from "../theme/chart-palette.js";
|
|
30
30
|
import {
|
|
@@ -32,9 +32,10 @@ import {
|
|
|
32
32
|
useKitLabels,
|
|
33
33
|
useKitLocale
|
|
34
34
|
} from "../i18n/kit-labels.js";
|
|
35
|
-
import {
|
|
35
|
+
import { useBreakpoint } from "../hooks/use-breakpoint.js";
|
|
36
|
+
import { useTextSize } from "../theme/text-size.js";
|
|
37
|
+
import { chartHeightProps } from "./chart-height.js";
|
|
36
38
|
import { cn } from "../lib/cn.js";
|
|
37
|
-
const TOOLTIP_READOUT_QUERY = "(max-width: 639px)";
|
|
38
39
|
function resolveTooltipPlacement(own, fromProvider, phone) {
|
|
39
40
|
const wanted = own ?? fromProvider ?? "cursor";
|
|
40
41
|
return wanted === "auto" ? phone ? "above" : "cursor" : wanted;
|
|
@@ -56,12 +57,14 @@ const MAX_TILTED_TICK_BAND = 120;
|
|
|
56
57
|
const TICK_CHAR_WIDTH = 7;
|
|
57
58
|
const TICK_LINE_HEIGHT = 12;
|
|
58
59
|
const TICK_GAP = 8;
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
const LEVEL_TICK_BAND = 30;
|
|
61
|
+
const MIN_TICK_GAP = 32;
|
|
62
|
+
function tiltedTickBand(labels, angle, scale = 1) {
|
|
63
|
+
if (!angle) return scale === 1 ? void 0 : Math.ceil(LEVEL_TICK_BAND * scale);
|
|
61
64
|
const rad = Math.abs(angle) * Math.PI / 180;
|
|
62
|
-
const longest = Math.max(0, ...labels.map((label) => label.length)) * TICK_CHAR_WIDTH;
|
|
63
|
-
const band = Math.sin(rad) * longest + Math.cos(rad) * TICK_LINE_HEIGHT + TICK_GAP;
|
|
64
|
-
return Math.min(MAX_TILTED_TICK_BAND, Math.max(
|
|
65
|
+
const longest = Math.max(0, ...labels.map((label) => label.length)) * TICK_CHAR_WIDTH * scale;
|
|
66
|
+
const band = Math.sin(rad) * longest + Math.cos(rad) * TICK_LINE_HEIGHT * scale + TICK_GAP;
|
|
67
|
+
return Math.min(Math.round(MAX_TILTED_TICK_BAND * scale), Math.max(Math.ceil(LEVEL_TICK_BAND * scale), Math.ceil(band)));
|
|
65
68
|
}
|
|
66
69
|
const AXIS_TICK_WIDTH = 48;
|
|
67
70
|
const AUTO_PAD = 0.04;
|
|
@@ -80,8 +83,9 @@ function padBand(low, high) {
|
|
|
80
83
|
const pad = (high - low) * AUTO_PAD || Math.abs(high) * AUTO_PAD || 1;
|
|
81
84
|
return [low - pad, high + pad];
|
|
82
85
|
}
|
|
83
|
-
function axisBandWidth(tickWidth, titled) {
|
|
84
|
-
|
|
86
|
+
function axisBandWidth(tickWidth, titled, scale = 1) {
|
|
87
|
+
const band = (tickWidth ?? AXIS_TICK_WIDTH) + (titled ? AXIS_TITLE_STRIP : 0);
|
|
88
|
+
return scale === 1 ? band : Math.round(band * scale);
|
|
85
89
|
}
|
|
86
90
|
function soleSeriesColor(axis, series) {
|
|
87
91
|
const mine = series.filter((entry) => (entry.axis ?? DEFAULT_Y_AXIS) === axis.id);
|
|
@@ -234,6 +238,7 @@ function focusedBarShape(index) {
|
|
|
234
238
|
};
|
|
235
239
|
}
|
|
236
240
|
const MARKER_LABEL_SIZE = 11;
|
|
241
|
+
const REFERENCE_LABEL_SIZE = 10;
|
|
237
242
|
function MarkerLabel({
|
|
238
243
|
viewBox,
|
|
239
244
|
value
|
|
@@ -241,16 +246,17 @@ function MarkerLabel({
|
|
|
241
246
|
const plot = usePlotArea();
|
|
242
247
|
const ref = useRef(null);
|
|
243
248
|
const [measured, setMeasured] = useState();
|
|
249
|
+
const fontSize = MARKER_LABEL_SIZE * useTextSize().scale;
|
|
244
250
|
const text = value == null ? "" : String(value);
|
|
245
251
|
useLayoutEffect(() => {
|
|
246
252
|
const el = ref.current;
|
|
247
253
|
if (!el || typeof el.getComputedTextLength !== "function") return;
|
|
248
254
|
const w = el.getComputedTextLength();
|
|
249
255
|
if (w > 0 && w !== measured) setMeasured(w);
|
|
250
|
-
}, [text, measured]);
|
|
256
|
+
}, [text, measured, fontSize]);
|
|
251
257
|
if (!viewBox || viewBox.x == null || viewBox.y == null || text === "") return null;
|
|
252
258
|
const cx = viewBox.x + (viewBox.width ?? 0) / 2;
|
|
253
|
-
const half = (measured ?? text.length *
|
|
259
|
+
const half = (measured ?? text.length * fontSize * 0.6) / 2;
|
|
254
260
|
const x = plot ? Math.max(plot.x + half, Math.min(cx, plot.x + plot.width - half)) : cx;
|
|
255
261
|
return /* @__PURE__ */ jsx(
|
|
256
262
|
"text",
|
|
@@ -259,7 +265,7 @@ function MarkerLabel({
|
|
|
259
265
|
x,
|
|
260
266
|
y: viewBox.y - 5,
|
|
261
267
|
textAnchor: "middle",
|
|
262
|
-
fontSize
|
|
268
|
+
fontSize,
|
|
263
269
|
fontWeight: 600,
|
|
264
270
|
fill: "var(--text-primary)",
|
|
265
271
|
className: "recharts-label",
|
|
@@ -359,9 +365,12 @@ function SeriesPlot({
|
|
|
359
365
|
const labels = useKitLabels("seriesChart", DEFAULT_SERIES_CHART_LABELS, labelsProp);
|
|
360
366
|
const locale = useKitLocale(localeProp);
|
|
361
367
|
const number = useDefaultFormat(localeProp);
|
|
368
|
+
const { scale } = useTextSize();
|
|
369
|
+
const ticksAim = tickTarget(scale);
|
|
370
|
+
const grow = (px) => scale === 1 ? px : Math.round(px * scale);
|
|
362
371
|
const [keyStop, setKeyStop] = useState(0);
|
|
363
372
|
const [keyFocus, setKeyFocus] = useState(void 0);
|
|
364
|
-
const phone =
|
|
373
|
+
const phone = useBreakpoint("max-sm", false);
|
|
365
374
|
const placement = resolveTooltipPlacement(tooltip?.placement, useKitChartTooltipPlacement(), phone);
|
|
366
375
|
const [readout, setReadout] = useState(null);
|
|
367
376
|
const [box, setBox] = useState(null);
|
|
@@ -381,7 +390,8 @@ function SeriesPlot({
|
|
|
381
390
|
autoAxisBudget(
|
|
382
391
|
afterCap,
|
|
383
392
|
width,
|
|
384
|
-
(axis) => axisBandWidth(axis.width, Boolean(axis.title))
|
|
393
|
+
(axis) => axisBandWidth(axis.width, Boolean(axis.title), scale),
|
|
394
|
+
scale
|
|
385
395
|
)
|
|
386
396
|
);
|
|
387
397
|
const budgeted = [...capped, ...auto];
|
|
@@ -392,8 +402,7 @@ function SeriesPlot({
|
|
|
392
402
|
reported.current = budgetKey;
|
|
393
403
|
onAxisBudget?.(budgetKey ? budgetKey.split("\n") : []);
|
|
394
404
|
}, [budgetKey, onAxisBudget]);
|
|
395
|
-
const
|
|
396
|
-
const heightStyle = typeof height === "number" ? { height } : void 0;
|
|
405
|
+
const { className: heightClass, style: heightStyle } = chartHeightProps(height);
|
|
397
406
|
if (!model.source.length || !series.length) {
|
|
398
407
|
return /* @__PURE__ */ jsx(
|
|
399
408
|
"div",
|
|
@@ -427,11 +436,12 @@ function SeriesPlot({
|
|
|
427
436
|
const onRight = visible.some((axis) => axis.orientation === "right");
|
|
428
437
|
const margin = {
|
|
429
438
|
// Room for a marker's label over a point at the top of the band.
|
|
430
|
-
top: markers?.some((marker) => marker.label) ? 22 : 8,
|
|
431
|
-
|
|
432
|
-
|
|
439
|
+
top: markers?.some((marker) => marker.label) ? grow(22) : 8,
|
|
440
|
+
// The first and last x tick's overhang: text, so it grows with it.
|
|
441
|
+
right: onRight ? 0 : grow(10),
|
|
442
|
+
left: onLeft ? 0 : grow(10),
|
|
433
443
|
// Under the ticks, not under the whole axis: whatever comes next owns the gap.
|
|
434
|
-
bottom: x.title ? 18 : 2
|
|
444
|
+
bottom: x.title ? grow(18) : 2
|
|
435
445
|
};
|
|
436
446
|
const refs = references ?? [];
|
|
437
447
|
const xRefs = refs.filter((ref) => ref.axis === "x");
|
|
@@ -447,12 +457,12 @@ function SeriesPlot({
|
|
|
447
457
|
]
|
|
448
458
|
) ?? [Infinity, -Infinity]
|
|
449
459
|
));
|
|
450
|
-
const timeUnit = model.kind === "time" ? timeTicksWithUnit(fittedX) : void 0;
|
|
460
|
+
const timeUnit = model.kind === "time" ? timeTicksWithUnit(fittedX, ticksAim) : void 0;
|
|
451
461
|
const integerX = model.kind === "number" && (x.integerTicks ?? plotted.every((row2) => {
|
|
452
462
|
const value = finite(row2[xKey]);
|
|
453
463
|
return value === void 0 || Number.isInteger(value);
|
|
454
464
|
}));
|
|
455
|
-
const xTicks = resolveTicks(x.tickValues, fittedX, xPos) ?? (model.kind === "category" ? categoryTicks(fittedX, rows.length) : model.kind === "time" ? timeUnit?.ticks : integerX ? integerTicks(fittedX) ?? niceTicks(fittedX) : niceTicks(fittedX));
|
|
465
|
+
const xTicks = resolveTicks(x.tickValues, fittedX, xPos) ?? (model.kind === "category" ? categoryTicks(fittedX, rows.length) : model.kind === "time" ? timeUnit?.ticks : integerX ? integerTicks(fittedX, ticksAim) ?? niceTicks(fittedX, ticksAim) : niceTicks(fittedX, ticksAim));
|
|
456
466
|
const timeFormat = new Intl.DateTimeFormat(locale, TIME_TICK_FORMAT[timeUnit?.unit ?? "day"]);
|
|
457
467
|
const dateFormat = new Intl.DateTimeFormat(locale, {
|
|
458
468
|
dateStyle: "medium",
|
|
@@ -470,7 +480,7 @@ function SeriesPlot({
|
|
|
470
480
|
const label = x.label ?? (model.kind === "time" ? (position) => dateFormat.format(position) : format);
|
|
471
481
|
const xLabel = (position) => label(position, tickAt(position));
|
|
472
482
|
const tickAngle = x.ticks === false ? 0 : x.tickAngle ?? 0;
|
|
473
|
-
const tickBand = tiltedTickBand((xTicks ?? []).map((tick) => xFormat(tick)), tickAngle);
|
|
483
|
+
const tickBand = tiltedTickBand((xTicks ?? []).map((tick) => xFormat(tick)), tickAngle, scale);
|
|
474
484
|
const source = {
|
|
475
485
|
rows: plotted,
|
|
476
486
|
series,
|
|
@@ -617,7 +627,7 @@ function SeriesPlot({
|
|
|
617
627
|
allowDataOverflow: zoom?.xDomain !== void 0 || model.kind === "category",
|
|
618
628
|
tickLine: false,
|
|
619
629
|
axisLine: false,
|
|
620
|
-
minTickGap:
|
|
630
|
+
minTickGap: grow(MIN_TICK_GAP),
|
|
621
631
|
interval: "equidistantPreserveEnd",
|
|
622
632
|
tick: x.ticks === false ? false : void 0,
|
|
623
633
|
...tickAngle ? { angle: tickAngle, textAnchor: tickAngle < 0 ? "end" : "start" } : {},
|
|
@@ -628,8 +638,8 @@ function SeriesPlot({
|
|
|
628
638
|
{
|
|
629
639
|
value: x.title,
|
|
630
640
|
position: "insideBottom",
|
|
631
|
-
offset: -12,
|
|
632
|
-
className: "fill-[var(--text-muted)] text-
|
|
641
|
+
offset: -grow(12),
|
|
642
|
+
className: "fill-[var(--text-muted)] text-caption"
|
|
633
643
|
}
|
|
634
644
|
)
|
|
635
645
|
}
|
|
@@ -643,10 +653,10 @@ function SeriesPlot({
|
|
|
643
653
|
yAxisId: axis.id,
|
|
644
654
|
hide: axis.hide,
|
|
645
655
|
domain,
|
|
646
|
-
ticks: resolveTicks(axis.tickValues, domain, finite) ?? (wholeOnly(axis) ? integerTicks(domain) ?? niceTicks(domain) : niceTicks(domain)),
|
|
656
|
+
ticks: resolveTicks(axis.tickValues, domain, finite) ?? (wholeOnly(axis) ? integerTicks(domain, ticksAim) ?? niceTicks(domain, ticksAim) : niceTicks(domain, ticksAim)),
|
|
647
657
|
allowDataOverflow: zoomed,
|
|
648
658
|
orientation: axis.orientation ?? "left",
|
|
649
|
-
width: axis.hide ? 0 : axisBandWidth(axis.width, Boolean(axis.title)),
|
|
659
|
+
width: axis.hide ? 0 : axisBandWidth(axis.width, Boolean(axis.title), scale),
|
|
650
660
|
tickLine: false,
|
|
651
661
|
axisLine: false,
|
|
652
662
|
tickFormatter: axis.format ?? number,
|
|
@@ -658,8 +668,8 @@ function SeriesPlot({
|
|
|
658
668
|
angle: axis.orientation === "right" ? 90 : -90,
|
|
659
669
|
position: axis.orientation === "right" ? "insideRight" : "insideLeft",
|
|
660
670
|
style: { textAnchor: "middle", fill: soleSeriesColor(axis, series) },
|
|
661
|
-
offset: AXIS_TITLE_OFFSET,
|
|
662
|
-
className: "fill-[var(--text-muted)] text-
|
|
671
|
+
offset: grow(AXIS_TITLE_OFFSET),
|
|
672
|
+
className: "fill-[var(--text-muted)] text-caption"
|
|
663
673
|
}
|
|
664
674
|
)
|
|
665
675
|
},
|
|
@@ -803,7 +813,7 @@ function SeriesPlot({
|
|
|
803
813
|
label: ref.label ? {
|
|
804
814
|
value: ref.label,
|
|
805
815
|
position: "insideTopLeft",
|
|
806
|
-
fontSize:
|
|
816
|
+
fontSize: REFERENCE_LABEL_SIZE * scale,
|
|
807
817
|
fill: color
|
|
808
818
|
} : void 0
|
|
809
819
|
},
|