@eifi1/ui-kit 0.51.6 → 0.52.0
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 +146 -26
- package/dist/account/account-parts.d.ts +10 -8
- package/dist/account/account-parts.js +1 -18
- package/dist/account/account-parts.js.map +1 -1
- package/dist/account/data-export-setting-labels.js +1 -1
- package/dist/account/data-export-setting-labels.js.map +1 -1
- package/dist/account/delete-account-setting-labels.js +1 -1
- package/dist/account/delete-account-setting-labels.js.map +1 -1
- package/dist/account/email-change-setting-labels.js +1 -1
- package/dist/account/email-change-setting-labels.js.map +1 -1
- package/dist/account/passkeys-setting.d.ts +9 -2
- package/dist/account/passkeys-setting.js +41 -29
- package/dist/account/passkeys-setting.js.map +1 -1
- package/dist/account/sessions-setting.d.ts +3 -2
- package/dist/account/sessions-setting.js +10 -8
- package/dist/account/sessions-setting.js.map +1 -1
- package/dist/admin/admin-action-confirm.js +3 -7
- package/dist/admin/admin-action-confirm.js.map +1 -1
- package/dist/admin/admin-parts.d.ts +6 -3
- package/dist/admin/admin-parts.js +6 -21
- package/dist/admin/admin-parts.js.map +1 -1
- package/dist/admin/mail-test-card-labels.js +1 -1
- package/dist/admin/mail-test-card-labels.js.map +1 -1
- package/dist/admin/plan-change-labels.d.ts +2 -2
- package/dist/admin/plan-change-labels.js +1 -17
- package/dist/admin/plan-change-labels.js.map +1 -1
- package/dist/admin/plan-change.d.ts +3 -42
- package/dist/admin/plan-change.js +1 -1
- package/dist/admin/plan-change.js.map +1 -1
- package/dist/admin/reviewer-scope-editor.js +3 -3
- package/dist/admin/reviewer-scope-editor.js.map +1 -1
- package/dist/auth/auth-errors-labels.d.ts +11 -0
- package/dist/auth/auth-errors-labels.js +13 -0
- package/dist/auth/auth-errors-labels.js.map +1 -0
- package/dist/auth/auth-errors.d.ts +7 -23
- package/dist/auth/auth-errors.js +2 -15
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/auth/complete-name-dialog.d.ts +3 -2
- package/dist/auth/complete-name-dialog.js +3 -5
- package/dist/auth/complete-name-dialog.js.map +1 -1
- package/dist/auth/forgot-password-form-labels.js +1 -1
- package/dist/auth/forgot-password-form-labels.js.map +1 -1
- package/dist/auth/forgot-password-form.js +7 -2
- package/dist/auth/forgot-password-form.js.map +1 -1
- package/dist/auth/register-form-labels.js +1 -1
- package/dist/auth/register-form-labels.js.map +1 -1
- package/dist/auth/reset-password-form-labels.js +1 -1
- package/dist/auth/reset-password-form-labels.js.map +1 -1
- package/dist/auth/reset-password-form.js +5 -1
- package/dist/auth/reset-password-form.js.map +1 -1
- package/dist/auth/sign-in-form-labels.js +1 -1
- package/dist/auth/sign-in-form-labels.js.map +1 -1
- package/dist/auth/status-parts.d.ts +0 -3
- package/dist/auth/status-parts.js +0 -4
- package/dist/auth/status-parts.js.map +1 -1
- package/dist/auth/verify-email-labels.js +1 -1
- package/dist/auth/verify-email-labels.js.map +1 -1
- package/dist/auth/verify-email.js +7 -2
- package/dist/auth/verify-email.js.map +1 -1
- package/dist/billing/cancel-request.d.ts +11 -2
- package/dist/billing/cancel-request.js +15 -3
- package/dist/billing/cancel-request.js.map +1 -1
- package/dist/billing/cancel-subscription.d.ts +22 -10
- package/dist/billing/cancel-subscription.js +8 -11
- package/dist/billing/cancel-subscription.js.map +1 -1
- package/dist/billing/dialog-close.d.ts +29 -0
- package/dist/billing/dialog-close.js +8 -0
- package/dist/billing/dialog-close.js.map +1 -0
- package/dist/billing/plan-card.d.ts +14 -4
- package/dist/billing/plan-card.js +15 -8
- package/dist/billing/plan-card.js.map +1 -1
- package/dist/billing/plan-change-labels.d.ts +42 -0
- package/dist/billing/plan-change-labels.js +22 -0
- package/dist/billing/plan-change-labels.js.map +1 -0
- package/dist/billing/plan-switch.d.ts +21 -9
- package/dist/billing/plan-switch.js +10 -8
- package/dist/billing/plan-switch.js.map +1 -1
- package/dist/chart.d.ts +12 -0
- package/dist/chart.js +16 -1
- package/dist/chart.js.map +1 -1
- package/dist/components/account-chips.d.ts +5 -5
- package/dist/components/account-chips.js +11 -13
- package/dist/components/account-chips.js.map +1 -1
- package/dist/components/alert-banner.d.ts +16 -5
- package/dist/components/alert-banner.js +46 -1
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +22 -4
- package/dist/components/amount-input.js +3 -3
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/autocomplete.js +57 -65
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/bulk-action-bar.d.ts +12 -2
- package/dist/components/bulk-action-bar.js +65 -21
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-look.d.ts +5 -5
- package/dist/components/button-look.js.map +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js.map +1 -1
- package/dist/components/calculator.d.ts +21 -2
- package/dist/components/calculator.js +53 -14
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/chart-edge.d.ts +16 -0
- package/dist/components/chart-edge.js +14 -1
- package/dist/components/chart-edge.js.map +1 -1
- package/dist/components/chart-figure.d.ts +13 -0
- package/dist/components/chart-figure.js +15 -0
- package/dist/components/chart-figure.js.map +1 -0
- package/dist/components/chart-zoom-core.js +1 -4
- package/dist/components/chart-zoom-core.js.map +1 -1
- package/dist/components/chart.d.ts +8 -1
- package/dist/components/chart.js +19 -10
- package/dist/components/chart.js.map +1 -1
- package/dist/components/combobox-core.d.ts +119 -7
- package/dist/components/combobox-core.js +151 -46
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js +142 -131
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/copy-button.d.ts +6 -5
- package/dist/components/copy-button.js +5 -3
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/country-select.js +2 -2
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/data-table-column-settings.d.ts +1 -1
- package/dist/components/data-table-column-settings.js +33 -7
- package/dist/components/data-table-column-settings.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +4 -2
- package/dist/components/data-table-filters.js +2 -2
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-fit.d.ts +6 -4
- package/dist/components/data-table-fit.js +4 -1
- package/dist/components/data-table-fit.js.map +1 -1
- package/dist/components/data-table-groups.d.ts +1 -1
- package/dist/components/data-table-groups.js.map +1 -1
- package/dist/components/data-table-head.d.ts +1 -1
- package/dist/components/data-table-head.js +15 -12
- package/dist/components/data-table-head.js.map +1 -1
- package/dist/components/data-table-mobile.d.ts +36 -7
- package/dist/components/data-table-mobile.js +63 -31
- package/dist/components/data-table-mobile.js.map +1 -1
- package/dist/components/data-table-pagination.js +11 -6
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table-resize.d.ts +1 -1
- package/dist/components/data-table-resize.js.map +1 -1
- package/dist/components/data-table-row-actions.d.ts +2 -2
- package/dist/components/data-table-row-actions.js.map +1 -1
- package/dist/components/data-table-row.d.ts +6 -2
- package/dist/components/data-table-row.js +17 -10
- package/dist/components/data-table-row.js.map +1 -1
- package/dist/components/data-table-selection.d.ts +1 -1
- package/dist/components/data-table-selection.js.map +1 -1
- package/dist/components/data-table-shared.d.ts +10 -2
- package/dist/components/data-table-shared.js +18 -0
- package/dist/components/data-table-shared.js.map +1 -1
- package/dist/components/data-table-sort.d.ts +21 -2
- package/dist/components/data-table-sort.js +24 -0
- package/dist/components/data-table-sort.js.map +1 -1
- package/dist/components/data-table-virtual.d.ts +1 -1
- package/dist/components/data-table-virtual.js +18 -6
- package/dist/components/data-table-virtual.js.map +1 -1
- package/dist/components/data-table.d.ts +25 -8
- package/dist/components/data-table.js +154 -25
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-field.d.ts +24 -2
- package/dist/components/date-field.js +33 -8
- package/dist/components/date-field.js.map +1 -1
- package/dist/components/date-picker.d.ts +15 -2
- package/dist/components/date-picker.js +55 -26
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +47 -20
- package/dist/components/date-range-picker.js +23 -7
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +2 -1
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/entity-combobox.js +4 -2
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/error-boundary.js +37 -30
- package/dist/components/error-boundary.js.map +1 -1
- package/dist/components/{ui-labels.d.ts → field-base-labels.d.ts} +0 -2
- package/dist/components/{ui-labels.js → field-base-labels.js} +2 -9
- package/dist/components/field-base-labels.js.map +1 -0
- package/dist/components/field-base.d.ts +4 -3
- package/dist/components/field-base.js +3 -3
- package/dist/components/field-base.js.map +1 -1
- package/dist/components/field-sync-labels.d.ts +1 -0
- package/dist/components/field-sync-labels.js.map +1 -1
- package/dist/components/field-sync.d.ts +23 -1
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/form-actions.js +11 -5
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/hover-menu.d.ts +3 -0
- package/dist/components/hover-menu.js +5 -3
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/icon-button.js +14 -9
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/inline-confirm.d.ts +43 -0
- package/dist/components/inline-confirm.js +67 -0
- package/dist/components/inline-confirm.js.map +1 -0
- package/dist/components/inline-entity-combobox.d.ts +4 -3
- package/dist/components/inline-entity-combobox.js +150 -141
- package/dist/components/inline-entity-combobox.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/jump-calendar.js +28 -112
- package/dist/components/jump-calendar.js.map +1 -1
- package/dist/components/legal-page.d.ts +3 -1
- package/dist/components/legal-page.js +3 -2
- package/dist/components/legal-page.js.map +1 -1
- package/dist/components/legal.d.ts +4 -2
- package/dist/components/legal.js.map +1 -1
- package/dist/components/lightbox.d.ts +2 -2
- package/dist/components/lightbox.js +17 -6
- package/dist/components/lightbox.js.map +1 -1
- package/dist/components/list.d.ts +6 -2
- package/dist/components/list.js +4 -3
- package/dist/components/list.js.map +1 -1
- package/dist/components/measured-grid.d.ts +1 -1
- package/dist/components/measured-grid.js +2 -1
- package/dist/components/measured-grid.js.map +1 -1
- package/dist/components/mini-calendar.js +3 -5
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +24 -0
- package/dist/components/modal.js +12 -4
- package/dist/components/modal.js.map +1 -1
- package/dist/components/money-draft.js +7 -5
- package/dist/components/money-draft.js.map +1 -1
- package/dist/components/money-field.d.ts +2 -2
- package/dist/components/money-field.js.map +1 -1
- package/dist/components/month-grid.d.ts +55 -0
- package/dist/components/month-grid.js +148 -0
- package/dist/components/month-grid.js.map +1 -0
- package/dist/components/month-picker.d.ts +36 -4
- package/dist/components/month-picker.js +123 -146
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.js +2 -1
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.d.ts +2 -2
- package/dist/components/multi-select.js +11 -6
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/number-field.d.ts +6 -4
- package/dist/components/number-field.js +3 -2
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/number-input.d.ts +4 -1
- package/dist/components/number-input.js +3 -2
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/picker-sheet.js +2 -1
- package/dist/components/picker-sheet.js.map +1 -1
- package/dist/components/pie-chart-labels.d.ts +7 -0
- package/dist/components/pie-chart-labels.js +1 -0
- package/dist/components/pie-chart-labels.js.map +1 -1
- package/dist/components/pie-chart.d.ts +5 -3
- package/dist/components/pie-chart.js +7 -22
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover.d.ts +3 -0
- package/dist/components/popover.js +7 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/reauth-dialog.d.ts +4 -5
- package/dist/components/reauth-dialog.js +1 -4
- package/dist/components/reauth-dialog.js.map +1 -1
- package/dist/components/row-actions.js +2 -1
- package/dist/components/row-actions.js.map +1 -1
- package/dist/components/section-nav.d.ts +7 -0
- package/dist/components/section-nav.js.map +1 -1
- package/dist/components/series-chart-axes.d.ts +10 -3
- package/dist/components/series-chart-axes.js +1 -0
- package/dist/components/series-chart-axes.js.map +1 -1
- package/dist/components/series-chart-labels.d.ts +7 -4
- package/dist/components/series-chart-labels.js.map +1 -1
- package/dist/components/series-chart.d.ts +31 -7
- package/dist/components/series-chart.js +72 -29
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/share-card.js +3 -3
- package/dist/components/share-card.js.map +1 -1
- package/dist/components/sign-chip-labels.d.ts +1 -0
- package/dist/components/sign-chip-labels.js.map +1 -1
- package/dist/components/sign-chip.d.ts +10 -1
- package/dist/components/sign-chip.js.map +1 -1
- package/dist/components/tabs-labels.d.ts +2 -0
- package/dist/components/tabs-labels.js +11 -0
- package/dist/components/tabs-labels.js.map +1 -0
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +13 -11
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/toggle-legend.d.ts +2 -2
- package/dist/components/toggle-legend.js +6 -6
- package/dist/components/toggle-legend.js.map +1 -1
- package/dist/components/translation-review-editor.d.ts +4 -2
- package/dist/components/translation-review-editor.js +2 -3
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review.d.ts +2 -1
- package/dist/components/translation-review.js +2 -2
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/treemap-labels.d.ts +26 -0
- package/dist/components/treemap-labels.js +10 -0
- package/dist/components/treemap-labels.js.map +1 -0
- package/dist/components/treemap-layout.d.ts +62 -0
- package/dist/components/treemap-layout.js +126 -0
- package/dist/components/treemap-layout.js.map +1 -0
- package/dist/components/treemap.d.ts +140 -17
- package/dist/components/treemap.js +324 -97
- package/dist/components/treemap.js.map +1 -1
- package/dist/components/use-table-state.d.ts +5 -5
- package/dist/components/use-table-state.js +4 -1
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/data-table.d.ts +6 -2
- package/dist/data-table.js +7 -2
- package/dist/data-table.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/eslint/role-utilities.d.ts +36 -7
- package/dist/eslint/role-utilities.js +42 -9
- package/dist/eslint/role-utilities.js.map +1 -1
- package/dist/feedback/feedback-dialog.d.ts +25 -16
- package/dist/feedback/feedback-dialog.js +6 -2
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-mutation.d.ts +30 -0
- package/dist/feedback/feedback-mutation.js +16 -0
- package/dist/feedback/feedback-mutation.js.map +1 -0
- package/dist/feedback/feedback-page-link.d.ts +53 -0
- package/dist/feedback/feedback-page-link.js +37 -0
- package/dist/feedback/feedback-page-link.js.map +1 -0
- package/dist/feedback/feedback-public-list.d.ts +12 -3
- package/dist/feedback/feedback-public-list.js +2 -1
- package/dist/feedback/feedback-public-list.js.map +1 -1
- package/dist/feedback/feedback-replies.d.ts +3 -1
- package/dist/feedback/feedback-replies.js +5 -4
- package/dist/feedback/feedback-replies.js.map +1 -1
- package/dist/feedback/feedback-row-detail-labels.js +5 -0
- package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
- package/dist/feedback/feedback-row-detail.d.ts +64 -28
- package/dist/feedback/feedback-row-detail.js +30 -28
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-status-undo.d.ts +30 -11
- package/dist/feedback/feedback-status-undo.js +10 -15
- package/dist/feedback/feedback-status-undo.js.map +1 -1
- package/dist/feedback/feedback-submit-dialog.d.ts +1 -1
- package/dist/feedback/feedback-submit-dialog.js +1 -1
- package/dist/feedback/feedback-submit-dialog.js.map +1 -1
- package/dist/feedback/feedback-submit.js +9 -3
- package/dist/feedback/feedback-submit.js.map +1 -1
- package/dist/feedback/feedback-swipe.d.ts +1 -1
- package/dist/feedback/feedback-swipe.js.map +1 -1
- package/dist/feedback/feedback-table.d.ts +21 -9
- package/dist/feedback/feedback-table.js +45 -25
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/feedback/feedback-thread-labels.d.ts +2 -2
- package/dist/feedback/feedback-thread-labels.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +24 -23
- package/dist/feedback/feedback-thread.js +2 -1
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/feedback.d.ts +34 -0
- package/dist/feedback.js +42 -0
- package/dist/feedback.js.map +1 -1
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/hooks/use-focus-trap.d.ts +35 -0
- package/dist/hooks/use-focus-trap.js +6 -4
- package/dist/hooks/use-focus-trap.js.map +1 -1
- package/dist/hooks/use-hotkey.d.ts +5 -2
- package/dist/hooks/use-hotkey.js +5 -4
- package/dist/hooks/use-hotkey.js.map +1 -1
- package/dist/hooks/use-long-press.d.ts +7 -4
- package/dist/hooks/use-long-press.js +3 -0
- package/dist/hooks/use-long-press.js.map +1 -1
- package/dist/hooks/use-media-query.js +12 -4
- package/dist/hooks/use-media-query.js.map +1 -1
- package/dist/hooks/use-mounted.d.ts +22 -0
- package/dist/hooks/use-mounted.js +24 -0
- package/dist/hooks/use-mounted.js.map +1 -0
- package/dist/hooks/use-overlay-history.d.ts +7 -1
- package/dist/hooks/use-overlay-history.js +35 -5
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/i18n/defaults.js +4 -5
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +7 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +9 -2
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +20 -41
- package/dist/i18n/locales/en.js.map +3 -3
- package/dist/i18n/locales/es.js +7 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +20 -10
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +9 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +7 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +8 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +5 -0
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +64 -17
- package/dist/index.js +77 -12
- package/dist/index.js.map +1 -1
- package/dist/landing/routing.d.ts +3 -1
- package/dist/landing/routing.js +4 -7
- package/dist/landing/routing.js.map +1 -1
- package/dist/lib/broadcast.d.ts +17 -0
- package/dist/lib/broadcast.js +30 -0
- package/dist/lib/broadcast.js.map +1 -0
- package/dist/lib/calc.d.ts +7 -1
- package/dist/lib/calc.js +3 -1
- package/dist/lib/calc.js.map +1 -1
- package/dist/lib/clipboard-minus.d.ts +2 -2
- package/dist/lib/clipboard-minus.js +1 -1
- package/dist/lib/clipboard-minus.js.map +1 -1
- package/dist/lib/date-format.d.ts +37 -2
- package/dist/lib/date-format.js +34 -8
- package/dist/lib/date-format.js.map +1 -1
- package/dist/lib/day-format.d.ts +46 -0
- package/dist/lib/day-format.js +46 -0
- package/dist/lib/day-format.js.map +1 -0
- package/dist/lib/decimal-marks.d.ts +7 -1
- package/dist/lib/decimal-marks.js +5 -2
- package/dist/lib/decimal-marks.js.map +1 -1
- package/dist/lib/describe-failure.d.ts +14 -0
- package/dist/lib/describe-failure.js +9 -0
- package/dist/lib/describe-failure.js.map +1 -0
- package/dist/lib/direction.d.ts +16 -0
- package/dist/lib/direction.js +9 -1
- package/dist/lib/direction.js.map +1 -1
- package/dist/lib/focus-left.d.ts +63 -0
- package/dist/lib/focus-left.js +67 -0
- package/dist/lib/focus-left.js.map +1 -0
- package/dist/lib/format.d.ts +5 -3
- package/dist/lib/format.js +16 -13
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/http-status.d.ts +24 -0
- package/dist/lib/http-status.js +14 -0
- package/dist/lib/http-status.js.map +1 -0
- package/dist/lib/intl-cache.d.ts +14 -0
- package/dist/lib/intl-cache.js +15 -0
- package/dist/lib/intl-cache.js.map +1 -0
- package/dist/lib/isin.d.ts +10 -0
- package/dist/lib/isin.js.map +1 -1
- package/dist/lib/iso-day.d.ts +11 -0
- package/dist/lib/iso-day.js +8 -0
- package/dist/lib/iso-day.js.map +1 -0
- package/dist/lib/lazy-with-fallback.d.ts +31 -0
- package/dist/lib/lazy-with-fallback.js +40 -0
- package/dist/lib/lazy-with-fallback.js.map +1 -0
- package/dist/lib/path-pattern.d.ts +34 -0
- package/dist/lib/path-pattern.js +24 -0
- package/dist/lib/path-pattern.js.map +1 -0
- package/dist/lib/reduced-motion.d.ts +2 -1
- package/dist/lib/reduced-motion.js.map +1 -1
- package/dist/lib/round.d.ts +2 -1
- package/dist/lib/round.js +2 -1
- package/dist/lib/round.js.map +1 -1
- package/dist/lib/safe-storage.d.ts +24 -5
- package/dist/lib/safe-storage.js +27 -2
- package/dist/lib/safe-storage.js.map +1 -1
- package/dist/lib/session-refresh.js +1 -1
- package/dist/lib/session-refresh.js.map +1 -1
- package/dist/lib/share-format.d.ts +13 -0
- package/dist/lib/share-format.js +10 -0
- package/dist/lib/share-format.js.map +1 -0
- package/dist/lib/text-case.d.ts +17 -0
- package/dist/lib/text-case.js +8 -0
- package/dist/lib/text-case.js.map +1 -0
- package/dist/lib/text-match.d.ts +38 -0
- package/dist/lib/text-match.js +24 -2
- package/dist/lib/text-match.js.map +1 -1
- package/dist/lib/thenable.d.ts +13 -0
- package/dist/lib/thenable.js +8 -0
- package/dist/lib/thenable.js.map +1 -0
- package/dist/lib/translation-review.d.ts +7 -2
- package/dist/lib/translation-review.js +4 -4
- package/dist/lib/translation-review.js.map +1 -1
- package/dist/notifications/device-zone-report.js +1 -1
- package/dist/notifications/device-zone-report.js.map +1 -1
- package/dist/notifications/notification-bell.d.ts +2 -1
- package/dist/notifications/notification-bell.js +3 -3
- package/dist/notifications/notification-bell.js.map +1 -1
- package/dist/notifications/notification-inbox.d.ts +10 -6
- package/dist/notifications/notification-inbox.js +26 -48
- package/dist/notifications/notification-inbox.js.map +1 -1
- package/dist/notifications/notification-parts.d.ts +3 -2
- package/dist/notifications/notification-parts.js +1 -3
- package/dist/notifications/notification-parts.js.map +1 -1
- package/dist/notifications/notification-types-setting.js +1 -1
- package/dist/notifications/notification-types-setting.js.map +1 -1
- package/dist/notifications/notifications-labels.d.ts +6 -0
- package/dist/notifications/notifications-labels.js +1 -0
- package/dist/notifications/notifications-labels.js.map +1 -1
- package/dist/notifications/push-device-setting.js +1 -1
- package/dist/notifications/push-device-setting.js.map +1 -1
- package/dist/notifications/push-devices-setting.d.ts +2 -1
- package/dist/notifications/push-devices-setting.js +27 -49
- package/dist/notifications/push-devices-setting.js.map +1 -1
- package/dist/notifications/quiet-hours-setting.d.ts +10 -3
- package/dist/notifications/quiet-hours-setting.js +65 -26
- package/dist/notifications/quiet-hours-setting.js.map +1 -1
- package/dist/notifications/unsubscribe-panel.js +4 -7
- package/dist/notifications/unsubscribe-panel.js.map +1 -1
- package/dist/notifications/use-push-device.d.ts +39 -1
- package/dist/notifications/use-push-device.js +28 -7
- package/dist/notifications/use-push-device.js.map +1 -1
- package/dist/offline/query-persistence.d.ts +3 -1
- package/dist/offline/query-persistence.js +19 -2
- package/dist/offline/query-persistence.js.map +1 -1
- package/dist/rhf/fields.d.ts +11 -4
- package/dist/rhf/fields.js.map +1 -1
- package/dist/search/command-palette.js +1 -1
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search.js +19 -9
- package/dist/search/global-search.js.map +1 -1
- package/dist/search/use-command-key.d.ts +12 -1
- package/dist/search/use-command-key.js +3 -12
- package/dist/search/use-command-key.js.map +1 -1
- package/dist/search.d.ts +7 -0
- package/dist/search.js +10 -0
- package/dist/search.js.map +1 -1
- package/dist/settings/use-settings-focus.js +1 -0
- package/dist/settings/use-settings-focus.js.map +1 -1
- package/dist/shell/account-menu-language.d.ts +21 -5
- package/dist/shell/account-menu-language.js +3 -1
- package/dist/shell/account-menu-language.js.map +1 -1
- package/dist/shell/account-menu-text-size.d.ts +26 -9
- package/dist/shell/account-menu-text-size.js +3 -2
- package/dist/shell/account-menu-text-size.js.map +1 -1
- package/dist/shell/dev-menu.js +5 -18
- package/dist/shell/dev-menu.js.map +1 -1
- package/dist/shell/role-switcher.d.ts +7 -0
- package/dist/shell/role-switcher.js.map +1 -1
- package/dist/shell/top-bar-actions.d.ts +1 -1
- package/dist/shell/top-bar-actions.js.map +1 -1
- package/dist/shell/top-bar-parts-labels.d.ts +0 -2
- package/dist/shell/top-bar-parts-labels.js +0 -1
- package/dist/shell/top-bar-parts-labels.js.map +1 -1
- package/dist/shell.d.ts +27 -8
- package/dist/shell.js +28 -7
- package/dist/shell.js.map +1 -1
- package/dist/sync/engine.d.ts +30 -4
- package/dist/sync/engine.js +172 -52
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync.d.ts +6 -2
- package/dist/sync.js +6 -1
- package/dist/sync.js.map +1 -1
- package/dist/testing/css-variables.js +3 -8
- package/dist/testing/css-variables.js.map +1 -1
- package/dist/theme/contrast.d.ts +2 -1
- package/dist/theme/contrast.js +3 -8
- package/dist/theme/contrast.js.map +1 -1
- package/dist/theme/palette-store.js +6 -6
- package/dist/theme/palette-store.js.map +1 -1
- package/dist/theme/text-size.js +3 -8
- package/dist/theme/text-size.js.map +1 -1
- package/dist/theme/theme-store.js +3 -6
- package/dist/theme/theme-store.js.map +1 -1
- package/dist/tour/tour-catalogue.d.ts +7 -4
- package/dist/tour/tour-catalogue.js +12 -10
- package/dist/tour/tour-catalogue.js.map +1 -1
- package/dist/tour/tour-dock.d.ts +0 -2
- package/dist/tour/tour-dock.js +0 -2
- package/dist/tour/tour-dock.js.map +1 -1
- package/dist/tour/tour-gates.d.ts +4 -0
- package/dist/tour/tour-gates.js +14 -0
- package/dist/tour/tour-gates.js.map +1 -1
- package/dist/tour/tour-overlay.d.ts +27 -0
- package/dist/tour/tour-overlay.js +741 -0
- package/dist/tour/tour-overlay.js.map +1 -0
- package/dist/tour/tour.d.ts +16 -4
- package/dist/tour/tour.js +62 -778
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour/use-tour-progress.js +1 -1
- package/dist/tour/use-tour-progress.js.map +1 -1
- package/dist/tour/use-tour-url-sync.js +2 -2
- package/dist/tour/use-tour-url-sync.js.map +1 -1
- package/dist/wizard/stepper-nav.d.ts +5 -1
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.d.ts +6 -2
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.d.ts +3 -1
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/validation.d.ts +3 -1
- package/dist/wizard/validation.js.map +1 -1
- package/package.json +12 -8
- package/src/account/account-parts.ts +5 -25
- package/src/account/data-export-setting-labels.ts +1 -1
- package/src/account/delete-account-setting-labels.ts +1 -1
- package/src/account/email-change-setting-labels.ts +1 -1
- package/src/account/passkeys-setting.tsx +60 -38
- package/src/account/sessions-setting.tsx +18 -12
- package/src/admin/admin-action-confirm.tsx +5 -10
- package/src/admin/admin-parts.ts +11 -25
- package/src/admin/mail-test-card-labels.ts +1 -1
- package/src/admin/plan-change-labels.ts +5 -23
- package/src/admin/plan-change.tsx +7 -44
- package/src/admin/reviewer-scope-editor.tsx +3 -3
- package/src/auth/auth-errors-labels.ts +23 -0
- package/src/auth/auth-errors.ts +11 -38
- package/src/auth/complete-name-dialog.tsx +9 -8
- package/src/auth/forgot-password-form-labels.ts +1 -1
- package/src/auth/forgot-password-form.tsx +11 -6
- package/src/auth/register-form-labels.ts +1 -1
- package/src/auth/reset-password-form-labels.ts +1 -1
- package/src/auth/reset-password-form.tsx +8 -4
- package/src/auth/sign-in-form-labels.ts +1 -1
- package/src/auth/status-parts.tsx +0 -6
- package/src/auth/verify-email-labels.ts +1 -1
- package/src/auth/verify-email.tsx +11 -6
- package/src/billing/cancel-request.ts +28 -6
- package/src/billing/cancel-subscription.tsx +29 -22
- package/src/billing/dialog-close.ts +34 -0
- package/src/billing/plan-card.tsx +36 -11
- package/src/billing/plan-change-labels.ts +66 -0
- package/src/billing/plan-switch.tsx +31 -20
- package/src/chart.ts +21 -3
- package/src/components/account-chips.tsx +20 -23
- package/src/components/alert-banner.tsx +82 -5
- package/src/components/amount-input.tsx +32 -14
- package/src/components/autocomplete.tsx +64 -70
- package/src/components/bulk-action-bar.tsx +70 -2
- package/src/components/button-look.ts +5 -5
- package/src/components/button.tsx +2 -2
- package/src/components/calculator.tsx +98 -17
- package/src/components/chart-edge.ts +34 -1
- package/src/components/chart-figure.tsx +35 -0
- package/src/components/chart-zoom-core.tsx +6 -5
- package/src/components/chart.tsx +26 -5
- package/src/components/combobox-core.tsx +303 -69
- package/src/components/combobox.tsx +184 -155
- package/src/components/copy-button.tsx +34 -23
- package/src/components/country-select.tsx +16 -11
- package/src/components/data-table-column-settings.tsx +52 -10
- package/src/components/data-table-filters.ts +6 -4
- package/src/components/data-table-fit.ts +19 -5
- package/src/components/data-table-groups.tsx +1 -1
- package/src/components/data-table-head.tsx +32 -22
- package/src/components/data-table-mobile.tsx +110 -27
- package/src/components/data-table-pagination.tsx +21 -6
- package/src/components/data-table-resize.ts +1 -1
- package/src/components/data-table-row-actions.tsx +3 -3
- package/src/components/data-table-row.tsx +25 -14
- package/src/components/data-table-selection.ts +1 -1
- package/src/components/data-table-shared.tsx +33 -1
- package/src/components/data-table-sort.ts +57 -2
- package/src/components/data-table-virtual.ts +32 -8
- package/src/components/data-table.tsx +267 -41
- package/src/components/date-field.tsx +65 -8
- package/src/components/date-picker.tsx +125 -48
- package/src/components/date-range-picker.tsx +82 -31
- package/src/components/dialog-frame.tsx +2 -1
- package/src/components/entity-combobox.tsx +4 -1
- package/src/components/error-boundary.tsx +53 -39
- package/src/components/field-base-labels.ts +20 -0
- package/src/components/field-base.tsx +13 -7
- package/src/components/field-sync-labels.ts +1 -0
- package/src/components/field-sync.tsx +23 -1
- package/src/components/form-actions.tsx +20 -5
- package/src/components/hover-menu.tsx +18 -8
- package/src/components/icon-button.tsx +14 -9
- package/src/components/inline-confirm.tsx +116 -0
- package/src/components/inline-entity-combobox.tsx +198 -152
- package/src/components/input.tsx +1 -1
- package/src/components/jump-calendar.tsx +30 -146
- package/src/components/legal-page.tsx +10 -7
- package/src/components/legal.tsx +4 -2
- package/src/components/lightbox.tsx +21 -8
- package/src/components/list.tsx +14 -5
- package/src/components/measured-grid.tsx +8 -4
- package/src/components/mini-calendar.tsx +6 -5
- package/src/components/modal.tsx +45 -4
- package/src/components/money-draft.ts +16 -5
- package/src/components/money-field.tsx +2 -2
- package/src/components/month-grid.tsx +229 -0
- package/src/components/month-picker.tsx +192 -200
- package/src/components/multi-entity-combobox.tsx +1 -0
- package/src/components/multi-select.tsx +21 -9
- package/src/components/number-field.tsx +14 -7
- package/src/components/number-input.tsx +9 -3
- package/src/components/numpad-sheet.tsx +4 -3
- package/src/components/picker-sheet.tsx +12 -9
- package/src/components/pie-chart-labels.ts +8 -0
- package/src/components/pie-chart.tsx +22 -28
- package/src/components/popover.tsx +18 -1
- package/src/components/reauth-dialog.tsx +6 -10
- package/src/components/row-actions.tsx +2 -1
- package/src/components/section-nav.tsx +7 -0
- package/src/components/series-chart-axes.ts +11 -3
- package/src/components/series-chart-labels.ts +7 -4
- package/src/components/series-chart.tsx +178 -69
- package/src/components/share-card.tsx +6 -6
- package/src/components/sign-chip-labels.ts +1 -0
- package/src/components/sign-chip.tsx +10 -1
- package/src/components/tabs-labels.ts +13 -0
- package/src/components/tabs.tsx +35 -19
- package/src/components/toggle-legend.tsx +16 -11
- package/src/components/translation-review-editor.tsx +6 -5
- package/src/components/translation-review.tsx +4 -3
- package/src/components/treemap-labels.ts +39 -0
- package/src/components/treemap-layout.ts +210 -0
- package/src/components/treemap.tsx +722 -133
- package/src/components/use-table-state.ts +12 -9
- package/src/data-table.ts +9 -2
- package/src/eslint/role-utilities.ts +97 -19
- package/src/feedback/feedback-dialog.tsx +30 -19
- package/src/feedback/feedback-mutation.ts +41 -0
- package/src/feedback/feedback-page-link.ts +90 -0
- package/src/feedback/feedback-public-list.tsx +17 -5
- package/src/feedback/feedback-replies.tsx +13 -6
- package/src/feedback/feedback-row-detail-labels.ts +5 -0
- package/src/feedback/feedback-row-detail.tsx +103 -67
- package/src/feedback/feedback-status-undo.ts +41 -27
- package/src/feedback/feedback-submit-dialog.tsx +2 -2
- package/src/feedback/feedback-submit.tsx +21 -7
- package/src/feedback/feedback-swipe.tsx +1 -1
- package/src/feedback/feedback-table.tsx +86 -38
- package/src/feedback/feedback-thread-labels.ts +2 -2
- package/src/feedback/feedback-thread.tsx +27 -25
- package/src/feedback.ts +42 -0
- package/src/hooks/use-dismiss.ts +3 -2
- package/src/hooks/use-focus-trap.ts +8 -24
- package/src/hooks/use-hotkey.ts +24 -7
- package/src/hooks/use-long-press.ts +16 -2
- package/src/hooks/use-media-query.ts +20 -4
- package/src/hooks/use-mounted.ts +39 -0
- package/src/hooks/use-overlay-history.ts +70 -5
- package/src/i18n/defaults.ts +4 -5
- package/src/i18n/german.ts +8 -2
- package/src/i18n/kit-labels.tsx +9 -2
- package/src/i18n/locales/es.ts +8 -2
- package/src/i18n/locales/fr.ts +21 -13
- package/src/i18n/locales/hu.ts +10 -2
- package/src/i18n/locales/it.ts +8 -2
- package/src/i18n/locales/zh.ts +9 -2
- package/src/i18n/review.ts +5 -0
- package/src/index.ts +103 -13
- package/src/landing/routing.tsx +14 -10
- package/src/lib/broadcast.ts +52 -0
- package/src/lib/calc.ts +13 -2
- package/src/lib/clipboard-minus.ts +14 -4
- package/src/lib/date-format.ts +89 -13
- package/src/lib/day-format.ts +96 -0
- package/src/lib/decimal-marks.ts +12 -3
- package/src/lib/describe-failure.ts +18 -0
- package/src/lib/direction.ts +39 -0
- package/src/lib/focus-left.ts +156 -0
- package/src/lib/format.ts +34 -19
- package/src/lib/http-status.ts +38 -0
- package/src/lib/intl-cache.ts +25 -0
- package/src/lib/isin.ts +10 -0
- package/src/lib/iso-day.ts +13 -0
- package/src/lib/lazy-with-fallback.ts +82 -0
- package/src/lib/path-pattern.ts +55 -0
- package/src/lib/reduced-motion.ts +2 -1
- package/src/lib/round.ts +7 -2
- package/src/lib/safe-storage.ts +48 -6
- package/src/lib/session-refresh.ts +1 -1
- package/src/lib/share-format.ts +18 -0
- package/src/lib/text-case.ts +19 -0
- package/src/lib/text-match.ts +69 -2
- package/src/lib/thenable.ts +19 -0
- package/src/lib/translation-review.ts +13 -5
- package/src/notifications/device-zone-report.ts +1 -1
- package/src/notifications/notification-bell.tsx +7 -4
- package/src/notifications/notification-inbox.tsx +40 -58
- package/src/notifications/notification-parts.tsx +3 -4
- package/src/notifications/notification-types-setting.tsx +1 -1
- package/src/notifications/notifications-labels.ts +7 -0
- package/src/notifications/push-device-setting.tsx +1 -1
- package/src/notifications/push-devices-setting.tsx +30 -55
- package/src/notifications/quiet-hours-setting.tsx +93 -31
- package/src/notifications/unsubscribe-panel.tsx +4 -7
- package/src/notifications/use-push-device.ts +76 -10
- package/src/offline/query-persistence.ts +35 -3
- package/src/rhf/fields.tsx +11 -4
- package/src/search/command-palette.tsx +2 -4
- package/src/search/global-search.tsx +36 -15
- package/src/search/use-command-key.ts +13 -12
- package/src/search.ts +9 -0
- package/src/settings/use-settings-focus.ts +3 -0
- package/src/shell/account-menu-language.tsx +27 -5
- package/src/shell/account-menu-text-size.tsx +32 -10
- package/src/shell/dev-menu.tsx +7 -21
- package/src/shell/role-switcher.tsx +7 -0
- package/src/shell/top-bar-actions.tsx +1 -1
- package/src/shell/top-bar-parts-labels.ts +0 -3
- package/src/shell.ts +40 -9
- package/src/sync/engine.ts +339 -61
- package/src/sync.ts +8 -1
- package/src/testing/css-variables.ts +8 -9
- package/src/theme/contrast.ts +8 -9
- package/src/theme/palette-store.ts +9 -9
- package/src/theme/text-size.ts +6 -8
- package/src/theme/theme-store.ts +7 -9
- package/src/tour/tour-catalogue.tsx +26 -15
- package/src/tour/tour-dock.ts +0 -2
- package/src/tour/tour-gates.ts +23 -0
- package/src/tour/tour-overlay.tsx +1170 -0
- package/src/tour/tour.tsx +116 -1193
- package/src/tour/use-tour-progress.ts +1 -1
- package/src/tour/use-tour-url-sync.ts +7 -3
- package/src/wizard/stepper-nav.tsx +3 -1
- package/src/wizard/types.ts +11 -2
- package/src/wizard/use-wizard.ts +2 -1
- package/src/wizard/validation.ts +8 -2
- package/tokens.css +2 -1
- package/dist/components/ui-labels.js.map +0 -1
- package/dist/shell/dev-switchers.d.ts +0 -6
- package/dist/shell/dev-switchers.js +0 -12
- package/dist/shell/dev-switchers.js.map +0 -1
- package/src/components/ui-labels.ts +0 -24
- package/src/shell/dev-switchers.tsx +0 -18
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
useSyncExternalStore
|
|
12
|
+
} from "react";
|
|
13
|
+
import { Treemap as RechartsTreemap, useChartHeight, useChartWidth } from "recharts";
|
|
5
14
|
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
6
|
-
import { PALETTE_HEX, PALETTE_SIZE, textOn } from "../theme/chart-palette.js";
|
|
7
|
-
import { resolveChartColor, useChartEdge } from "./chart-edge.js";
|
|
15
|
+
import { CHART_ROLES, PALETTE_HEX, PALETTE_SIZE, lerpHex, textOn } from "../theme/chart-palette.js";
|
|
16
|
+
import { resolveChartColor, useChartEdge, useEdgesInForce } from "./chart-edge.js";
|
|
8
17
|
import { parseHex } from "../theme/color.js";
|
|
9
|
-
import { dirOf } from "../lib/direction.js";
|
|
18
|
+
import { dirOf, rovingTarget } from "../lib/direction.js";
|
|
19
|
+
import { shareFormat } from "../lib/share-format.js";
|
|
10
20
|
import { cn } from "../lib/cn.js";
|
|
11
21
|
import { useTextSize } from "../theme/text-size.js";
|
|
12
22
|
import { chartHeightProps } from "./chart-height.js";
|
|
13
23
|
import { formatWithMinus } from "../lib/minus.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const observer = new MutationObserver(onChange);
|
|
18
|
-
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-contrast"] });
|
|
19
|
-
return () => observer.disconnect();
|
|
20
|
-
}
|
|
21
|
-
const readMoreContrast = () => typeof document !== "undefined" && document.documentElement.getAttribute("data-contrast") === "more";
|
|
22
|
-
function useTileEdges(edges) {
|
|
23
|
-
const more = useSyncExternalStore(subscribeContrast, readMoreContrast, () => false);
|
|
24
|
-
return edges === "auto" ? more ? "contrast" : "uniform" : edges;
|
|
25
|
-
}
|
|
24
|
+
import { useKitLabels, useKitLocale } from "../i18n/kit-labels.js";
|
|
25
|
+
import { DEFAULT_TREEMAP_LABELS } from "./treemap-labels.js";
|
|
26
|
+
import { groupBody, layoutTreemap } from "./treemap-layout.js";
|
|
26
27
|
const CHART_TOKENS = PALETTE_SIZE;
|
|
27
28
|
function readChartTokens() {
|
|
28
29
|
const root = document.documentElement;
|
|
29
30
|
const fallback = root.classList.contains("dark") ? PALETTE_HEX.dark : PALETTE_HEX.light;
|
|
30
31
|
const style = getComputedStyle(root);
|
|
31
|
-
|
|
32
|
+
const ramp = Array.from({ length: CHART_TOKENS }, (_, i) => {
|
|
32
33
|
const v = style.getPropertyValue(`--chart-${i + 1}`).trim();
|
|
33
34
|
return parseHex(v) ? v : fallback[i];
|
|
34
35
|
}).join(",");
|
|
36
|
+
const card = style.getPropertyValue("--bg-surface").trim();
|
|
37
|
+
return `${ramp}|${parseHex(card) ? card : ""}`;
|
|
35
38
|
}
|
|
36
39
|
function subscribeChartTokens(onChange) {
|
|
37
40
|
const observer = new MutationObserver(onChange);
|
|
@@ -41,10 +44,13 @@ function subscribeChartTokens(onChange) {
|
|
|
41
44
|
});
|
|
42
45
|
return () => observer.disconnect();
|
|
43
46
|
}
|
|
44
|
-
const SERVER_TOKENS = PALETTE_HEX.light.join(",")
|
|
47
|
+
const SERVER_TOKENS = `${PALETTE_HEX.light.join(",")}|`;
|
|
45
48
|
function useChartTokenHex() {
|
|
46
49
|
const joined = useSyncExternalStore(subscribeChartTokens, readChartTokens, () => SERVER_TOKENS);
|
|
47
|
-
return
|
|
50
|
+
return useMemo(() => {
|
|
51
|
+
const [ramp = "", card = ""] = joined.split("|");
|
|
52
|
+
return { ramp: ramp.split(","), card: card || null };
|
|
53
|
+
}, [joined]);
|
|
48
54
|
}
|
|
49
55
|
const CHART_TOKEN_REF = /^var\(\s*--chart-(\d+)\s*\)$/;
|
|
50
56
|
function measurableFill(fill, tokens) {
|
|
@@ -55,6 +61,7 @@ function measurableFill(fill, tokens) {
|
|
|
55
61
|
if (typeof document === "undefined") return null;
|
|
56
62
|
return resolveChartColor(fill, getComputedStyle(document.documentElement));
|
|
57
63
|
}
|
|
64
|
+
const TreemapTiles = createContext(null);
|
|
58
65
|
const LABEL_FONT_SIZE = 12;
|
|
59
66
|
const NOTE_FONT_SIZE = 11;
|
|
60
67
|
function fitLabel(name, boxWidth, fontSize) {
|
|
@@ -62,7 +69,32 @@ function fitLabel(name, boxWidth, fontSize) {
|
|
|
62
69
|
if (max < 3) return null;
|
|
63
70
|
return name.length <= max ? name : `${name.slice(0, max - 1).trimEnd()}\u2026`;
|
|
64
71
|
}
|
|
65
|
-
|
|
72
|
+
const haloOf = (halo) => ({
|
|
73
|
+
stroke: halo,
|
|
74
|
+
strokeWidth: 2.5,
|
|
75
|
+
strokeLinejoin: "round",
|
|
76
|
+
paintOrder: "stroke"
|
|
77
|
+
});
|
|
78
|
+
const BAND_INK = { fill: "var(--text-primary)", stroke: "none" };
|
|
79
|
+
function TreemapCell(props) {
|
|
80
|
+
const map = useContext(TreemapTiles);
|
|
81
|
+
return map ? /* @__PURE__ */ jsx(MapTile, { ...props, map }) : /* @__PURE__ */ jsx(StandaloneTile, { ...props });
|
|
82
|
+
}
|
|
83
|
+
function MapTile(props) {
|
|
84
|
+
const width = useChartWidth();
|
|
85
|
+
const height = useChartHeight();
|
|
86
|
+
const { scale } = useTextSize();
|
|
87
|
+
const place = props.path !== void 0 && width && height ? props.map.layout?.(width, height, scale).get(props.path) : void 0;
|
|
88
|
+
return /* @__PURE__ */ jsx(Tile, { ...props, place });
|
|
89
|
+
}
|
|
90
|
+
function StandaloneTile(props) {
|
|
91
|
+
const tokens = useChartTokenHex().ramp;
|
|
92
|
+
const edgeFor = useChartEdge();
|
|
93
|
+
const edges = useEdgesInForce(props.edges ?? "auto");
|
|
94
|
+
const map = useMemo(() => ({ tokens, edgeFor, edges }), [tokens, edgeFor, edges]);
|
|
95
|
+
return /* @__PURE__ */ jsx(Tile, { ...props, map });
|
|
96
|
+
}
|
|
97
|
+
function Tile({
|
|
66
98
|
depth,
|
|
67
99
|
x = 0,
|
|
68
100
|
y = 0,
|
|
@@ -73,48 +105,66 @@ function TreemapCell({
|
|
|
73
105
|
labelColor,
|
|
74
106
|
id,
|
|
75
107
|
onNodeClick,
|
|
108
|
+
onGroupClick,
|
|
109
|
+
groups,
|
|
110
|
+
path,
|
|
111
|
+
children,
|
|
76
112
|
redactNames,
|
|
77
113
|
nodeNote,
|
|
78
114
|
dir = "ltr",
|
|
79
|
-
|
|
115
|
+
map,
|
|
116
|
+
place
|
|
80
117
|
}) {
|
|
81
|
-
const tokenHex = useChartTokenHex();
|
|
82
118
|
const { scale } = useTextSize();
|
|
83
|
-
const edgeFor =
|
|
84
|
-
const edges = useTileEdges(edgesProp);
|
|
119
|
+
const { tokens: tokenHex, edgeFor, edges, keys } = map;
|
|
85
120
|
if (!depth) return null;
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const
|
|
121
|
+
const box = place?.box ?? { x, y, width, height };
|
|
122
|
+
const px = Math.round(box.x);
|
|
123
|
+
const py = Math.round(box.y);
|
|
124
|
+
const pw = Math.round(box.width);
|
|
125
|
+
const ph = Math.round(box.height);
|
|
126
|
+
const isGroup = children != null && children.length > 0;
|
|
127
|
+
const group = !isGroup ? void 0 : place?.body ? { banded: place.banded ?? false, body: place.body } : groupBody({ x: px, y: py, width: pw, height: ph }, scale);
|
|
90
128
|
const tileFill = fill ?? "var(--chart-1)";
|
|
91
129
|
const measured = measurableFill(tileFill, tokenHex);
|
|
92
130
|
const ink = labelColor ?? (measured ? textOn(measured) : "currentColor");
|
|
93
|
-
const edge = edges
|
|
131
|
+
const edge = edges !== "contrast" ? void 0 : group ? CHART_ROLES.outline : measured ? edgeFor(measured) : void 0;
|
|
94
132
|
const halo = measured ? tileFill : "none";
|
|
95
133
|
const labelSize = LABEL_FONT_SIZE * scale;
|
|
96
134
|
const noteSize = NOTE_FONT_SIZE * scale;
|
|
97
|
-
const
|
|
98
|
-
const
|
|
135
|
+
const roomForName = group ? group.banded : pw >= 44 * scale && ph >= 20 * scale;
|
|
136
|
+
const label = roomForName ? fitLabel(name ?? "", pw, labelSize) : null;
|
|
137
|
+
const rawNote = !group && id != null && nodeNote ? nodeNote(id) : void 0;
|
|
99
138
|
const note = label != null && rawNote != null && ph >= 36 * scale ? fitLabel(rawNote, pw, noteSize) : null;
|
|
100
139
|
const textX = dir === "rtl" ? px + pw - 6 : px + 6;
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
|
|
140
|
+
const click = group ? onGroupClick : onNodeClick;
|
|
141
|
+
const activate = id != null && click ? () => groups && groups.length > 0 ? click(id, name ?? "", groups) : click(id, name ?? "") : void 0;
|
|
142
|
+
const roving = path != null && keys ? keys : void 0;
|
|
143
|
+
const focusable = roving !== void 0 || activate !== void 0;
|
|
144
|
+
const onKeyDown = focusable ? (e) => {
|
|
145
|
+
if (roving?.move(path, e)) {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (!activate || e.key !== "Enter" && e.key !== " ") return;
|
|
104
150
|
e.preventDefault();
|
|
105
151
|
activate();
|
|
106
152
|
} : void 0;
|
|
107
153
|
return /* @__PURE__ */ jsxs(
|
|
108
154
|
"g",
|
|
109
155
|
{
|
|
156
|
+
ref: roving ? refFor(roving.register, path) : void 0,
|
|
110
157
|
onClick: activate,
|
|
111
158
|
onKeyDown,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
|
|
159
|
+
onFocus: roving ? () => roving.onFocus(path) : void 0,
|
|
160
|
+
onMouseEnter: map.hover ? () => map.hover({ x: px, y: py, width: pw, height: ph }) : void 0,
|
|
161
|
+
role: activate ? "button" : roving ? "img" : void 0,
|
|
162
|
+
tabIndex: roving ? -1 : activate ? 0 : void 0,
|
|
163
|
+
"aria-label": focusable ? roving?.name(path) ?? name : void 0,
|
|
164
|
+
"data-private": focusable && redactNames ? "" : void 0,
|
|
165
|
+
"data-group": group ? "" : void 0,
|
|
116
166
|
cursor: activate ? "pointer" : void 0,
|
|
117
|
-
className:
|
|
167
|
+
className: focusable ? "outline-none [&:focus-visible>rect]:stroke-[var(--brand)]" : void 0,
|
|
118
168
|
children: [
|
|
119
169
|
/* @__PURE__ */ jsx(
|
|
120
170
|
"rect",
|
|
@@ -123,7 +173,7 @@ function TreemapCell({
|
|
|
123
173
|
y: py,
|
|
124
174
|
width: pw,
|
|
125
175
|
height: ph,
|
|
126
|
-
fill: tileFill,
|
|
176
|
+
fill: group ? "var(--bg-surface-2)" : tileFill,
|
|
127
177
|
stroke: edges === "contrast" ? "var(--bg-surface)" : "var(--bg-page)",
|
|
128
178
|
strokeWidth: 2,
|
|
129
179
|
rx: 3
|
|
@@ -149,13 +199,9 @@ function TreemapCell({
|
|
|
149
199
|
{
|
|
150
200
|
"data-private": redactNames ? "" : void 0,
|
|
151
201
|
x: textX,
|
|
152
|
-
y: py + 15 * scale,
|
|
202
|
+
y: py + (group ? 14 : 15) * scale,
|
|
153
203
|
direction: dir,
|
|
154
|
-
fill: ink,
|
|
155
|
-
stroke: halo,
|
|
156
|
-
strokeWidth: 2.5,
|
|
157
|
-
strokeLinejoin: "round",
|
|
158
|
-
paintOrder: "stroke",
|
|
204
|
+
...group ? BAND_INK : { fill: ink, ...haloOf(halo) },
|
|
159
205
|
fontSize: labelSize,
|
|
160
206
|
fontWeight: 600,
|
|
161
207
|
style: { pointerEvents: "none" },
|
|
@@ -170,10 +216,7 @@ function TreemapCell({
|
|
|
170
216
|
direction: dir,
|
|
171
217
|
fill: ink,
|
|
172
218
|
fillOpacity: 0.85,
|
|
173
|
-
|
|
174
|
-
strokeWidth: 2.5,
|
|
175
|
-
strokeLinejoin: "round",
|
|
176
|
-
paintOrder: "stroke",
|
|
219
|
+
...haloOf(halo),
|
|
177
220
|
fontSize: noteSize,
|
|
178
221
|
fontWeight: 500,
|
|
179
222
|
style: { pointerEvents: "none" },
|
|
@@ -188,73 +231,257 @@ const TREEMAP_CONFIG = {};
|
|
|
188
231
|
function RedactedTooltipContent(props) {
|
|
189
232
|
return /* @__PURE__ */ jsx("div", { "data-private": true, children: /* @__PURE__ */ jsx(ChartTooltipContent, { ...props }) });
|
|
190
233
|
}
|
|
191
|
-
|
|
234
|
+
function createAnchor() {
|
|
235
|
+
let at = null;
|
|
236
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
237
|
+
return {
|
|
238
|
+
read: () => at,
|
|
239
|
+
subscribe: (onChange) => {
|
|
240
|
+
listeners.add(onChange);
|
|
241
|
+
return () => listeners.delete(onChange);
|
|
242
|
+
},
|
|
243
|
+
set: (box) => {
|
|
244
|
+
if (at && at.x === box.x && at.y === box.y && at.width === box.width && at.height === box.height) return;
|
|
245
|
+
at = box;
|
|
246
|
+
listeners.forEach((onChange) => onChange());
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
function TreemapTooltip({ content, anchor }) {
|
|
251
|
+
const at = useSyncExternalStore(anchor.subscribe, anchor.read, anchor.read);
|
|
252
|
+
const width = useChartWidth() ?? 0;
|
|
253
|
+
const height = useChartHeight() ?? 0;
|
|
254
|
+
if (!at) return /* @__PURE__ */ jsx(ChartTooltip, { content });
|
|
255
|
+
const cx = at.x + at.width / 2;
|
|
256
|
+
const cy = at.y + at.height / 2;
|
|
257
|
+
const left = cx > width / 2;
|
|
258
|
+
const up = cy > height / 2;
|
|
259
|
+
return /* @__PURE__ */ jsx(
|
|
260
|
+
ChartTooltip,
|
|
261
|
+
{
|
|
262
|
+
content,
|
|
263
|
+
position: { x: cx + (left ? -10 : 10), y: cy + (up ? -10 : 10) },
|
|
264
|
+
wrapperStyle: { translate: `${left ? "-100%" : "0"} ${up ? "-100%" : "0"}` }
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
function mapNodes(data, ramp, maxTiles, shaded) {
|
|
269
|
+
let left = maxTiles == null ? Infinity : Number.isNaN(maxTiles) ? 0 : Math.floor(maxTiles);
|
|
270
|
+
const walk = (list, groups, paint) => list.flatMap((d, idx) => {
|
|
271
|
+
const fill = d.fill ?? paint?.fill ?? ramp[idx % ramp.length];
|
|
272
|
+
const labelColor = d.labelColor ?? (d.fill === void 0 ? paint?.labelColor : void 0);
|
|
273
|
+
const shade = d.shade ?? paint?.shade;
|
|
274
|
+
if (d.children && d.children.length > 0) {
|
|
275
|
+
const children = walk(d.children, [...groups, d.id], { fill, labelColor, shade });
|
|
276
|
+
if (children.length === 0) return [];
|
|
277
|
+
const size = children.reduce((acc, c) => acc + c.size, 0);
|
|
278
|
+
return [{ id: d.id, name: d.name, size, fill, groups, path: pathOf(groups, d.id), children }];
|
|
279
|
+
}
|
|
280
|
+
if (!(Number.isFinite(d.value) && d.value > 0) || left <= 0) return [];
|
|
281
|
+
left -= 1;
|
|
282
|
+
const drawn = shaded(fill, shade);
|
|
283
|
+
const ink = d.labelColor ?? (drawn === fill ? labelColor : void 0);
|
|
284
|
+
return [
|
|
285
|
+
{ id: d.id, name: d.name, size: d.value, fill: drawn, labelColor: ink, groups, path: pathOf(groups, d.id) }
|
|
286
|
+
];
|
|
287
|
+
});
|
|
288
|
+
return walk(data, [], void 0);
|
|
289
|
+
}
|
|
290
|
+
const LAYOUTS = /* @__PURE__ */ new WeakMap();
|
|
291
|
+
function layoutFor(nodes, width, height, scale) {
|
|
292
|
+
const key = `${width}x${height}@${scale}`;
|
|
293
|
+
const last = LAYOUTS.get(nodes);
|
|
294
|
+
if (last?.key === key) return last.placed;
|
|
295
|
+
const placed = layoutTreemap(nodes, width, height, scale);
|
|
296
|
+
LAYOUTS.set(nodes, { key, placed });
|
|
297
|
+
return placed;
|
|
298
|
+
}
|
|
299
|
+
const REFS = /* @__PURE__ */ new WeakMap();
|
|
300
|
+
function refFor(register, path) {
|
|
301
|
+
let byPath = REFS.get(register);
|
|
302
|
+
if (!byPath) {
|
|
303
|
+
byPath = /* @__PURE__ */ new Map();
|
|
304
|
+
REFS.set(register, byPath);
|
|
305
|
+
}
|
|
306
|
+
let ref = byPath.get(path);
|
|
307
|
+
if (!ref) {
|
|
308
|
+
ref = (element) => register(path, element);
|
|
309
|
+
byPath.set(path, ref);
|
|
310
|
+
}
|
|
311
|
+
return ref;
|
|
312
|
+
}
|
|
313
|
+
const pathOf = (groups, id) => JSON.stringify([...groups, id]);
|
|
314
|
+
function depthFirst(nodes) {
|
|
315
|
+
return nodes.flatMap((n) => [n, ...n.children ? depthFirst(n.children) : []]);
|
|
316
|
+
}
|
|
192
317
|
function Treemap({
|
|
193
318
|
data,
|
|
194
319
|
valueFormatter,
|
|
195
320
|
height = "20rem",
|
|
196
321
|
onNodeClick,
|
|
322
|
+
onGroupClick,
|
|
197
323
|
redactNames = false,
|
|
198
324
|
nodeNote,
|
|
199
325
|
maxTiles,
|
|
200
326
|
colors,
|
|
201
327
|
edges = "auto",
|
|
328
|
+
description,
|
|
329
|
+
labels: labelsProp,
|
|
202
330
|
style,
|
|
203
331
|
...rest
|
|
204
332
|
}) {
|
|
205
|
-
const tokenHex = useChartTokenHex();
|
|
333
|
+
const { ramp: tokenHex, card } = useChartTokenHex();
|
|
334
|
+
const edgeFor = useChartEdge();
|
|
335
|
+
const edgesInForce = useEdgesInForce(edges);
|
|
336
|
+
const labels = useKitLabels("treemap", DEFAULT_TREEMAP_LABELS, labelsProp);
|
|
337
|
+
const locale = useKitLocale();
|
|
338
|
+
const numberFormat = useMemo(() => new Intl.NumberFormat(locale), [locale]);
|
|
339
|
+
const shareText = useMemo(() => shareFormat(locale), [locale]);
|
|
206
340
|
const rootRef = useRef(null);
|
|
207
341
|
const [dir, setDir] = useState("ltr");
|
|
208
342
|
useLayoutEffect(() => {
|
|
209
343
|
setDir(dirOf(rootRef.current));
|
|
210
344
|
}, [data]);
|
|
211
345
|
const ramp = colors && colors.length > 0 ? colors : tokenHex;
|
|
212
|
-
const nodes =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
onNodeClick,
|
|
248
|
-
redactNames,
|
|
249
|
-
nodeNote,
|
|
250
|
-
dir,
|
|
251
|
-
edges
|
|
252
|
-
}
|
|
253
|
-
),
|
|
254
|
-
children: /* @__PURE__ */ jsx(ChartTooltip, { content: /* @__PURE__ */ jsx(Content, { hideLabel: true, valueFormatter: format }) })
|
|
346
|
+
const nodes = useMemo(
|
|
347
|
+
() => mapNodes(data, ramp, maxTiles, (fill, shade) => {
|
|
348
|
+
if (shade === void 0 || !Number.isFinite(shade) || shade >= 1 || !card) return fill;
|
|
349
|
+
const hex = measurableFill(fill, tokenHex);
|
|
350
|
+
return hex ? lerpHex(card, hex, shade) : fill;
|
|
351
|
+
}),
|
|
352
|
+
[data, ramp, maxTiles, tokenHex, card]
|
|
353
|
+
);
|
|
354
|
+
const order = useMemo(() => depthFirst(nodes), [nodes]);
|
|
355
|
+
const layout = useMemo(
|
|
356
|
+
() => (width, height2, scale) => layoutFor(nodes, width, height2, scale),
|
|
357
|
+
[nodes]
|
|
358
|
+
);
|
|
359
|
+
const [anchor] = useState(createAnchor);
|
|
360
|
+
const tiles = useRef(/* @__PURE__ */ new Map());
|
|
361
|
+
const orderRef = useRef(order);
|
|
362
|
+
const stopRef = useRef(void 0);
|
|
363
|
+
const restoreRef = useRef(null);
|
|
364
|
+
const stopOf = useCallback(() => {
|
|
365
|
+
const drawn = orderRef.current;
|
|
366
|
+
return drawn.some((n) => n.path === stopRef.current) ? stopRef.current : drawn[0]?.path;
|
|
367
|
+
}, []);
|
|
368
|
+
const applyStop = useCallback(() => {
|
|
369
|
+
const at = stopOf();
|
|
370
|
+
tiles.current.forEach((el, path) => el.setAttribute("tabindex", path === at ? "0" : "-1"));
|
|
371
|
+
return at;
|
|
372
|
+
}, [stopOf]);
|
|
373
|
+
const register = useCallback(
|
|
374
|
+
(path, element) => {
|
|
375
|
+
if (element) {
|
|
376
|
+
tiles.current.set(path, element);
|
|
377
|
+
element.setAttribute("tabindex", path === stopOf() ? "0" : "-1");
|
|
378
|
+
if (restoreRef.current === path) {
|
|
379
|
+
restoreRef.current = null;
|
|
380
|
+
element.focus();
|
|
255
381
|
}
|
|
256
|
-
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (tiles.current.get(path) === document.activeElement) {
|
|
385
|
+
restoreRef.current = path;
|
|
386
|
+
queueMicrotask(() => {
|
|
387
|
+
if (restoreRef.current === path) restoreRef.current = null;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
tiles.current.delete(path);
|
|
391
|
+
},
|
|
392
|
+
[stopOf]
|
|
393
|
+
);
|
|
394
|
+
const onFocus = useCallback(
|
|
395
|
+
(path) => {
|
|
396
|
+
stopRef.current = path;
|
|
397
|
+
applyStop();
|
|
398
|
+
},
|
|
399
|
+
[applyStop]
|
|
400
|
+
);
|
|
401
|
+
useLayoutEffect(() => {
|
|
402
|
+
orderRef.current = order;
|
|
403
|
+
const refs = REFS.get(register);
|
|
404
|
+
if (refs) {
|
|
405
|
+
const drawn = new Set(order.map((n) => n.path));
|
|
406
|
+
for (const path of refs.keys()) if (!drawn.has(path)) refs.delete(path);
|
|
257
407
|
}
|
|
408
|
+
const at = applyStop();
|
|
409
|
+
if (restoreRef.current === null) return;
|
|
410
|
+
restoreRef.current = null;
|
|
411
|
+
if (at) tiles.current.get(at)?.focus();
|
|
412
|
+
}, [order, applyStop, register]);
|
|
413
|
+
const move = useCallback((path, event) => {
|
|
414
|
+
const drawn = orderRef.current;
|
|
415
|
+
const at = drawn.findIndex((n) => n.path === path);
|
|
416
|
+
const to = at < 0 ? void 0 : rovingTarget(event.key, "ltr", at, drawn.length, false);
|
|
417
|
+
if (to === void 0) return false;
|
|
418
|
+
const target = drawn[to];
|
|
419
|
+
if (target) tiles.current.get(target.path)?.focus();
|
|
420
|
+
return true;
|
|
421
|
+
}, []);
|
|
422
|
+
const total = useMemo(() => nodes.reduce((acc, n) => acc + n.size, 0), [nodes]);
|
|
423
|
+
const format = useCallback(
|
|
424
|
+
(v) => valueFormatter ? valueFormatter(v, total > 0 ? v / total : void 0) : formatWithMinus(numberFormat, v),
|
|
425
|
+
[valueFormatter, total, numberFormat]
|
|
426
|
+
);
|
|
427
|
+
const names = useMemo(() => {
|
|
428
|
+
const valueText = (v) => {
|
|
429
|
+
const out = format(v);
|
|
430
|
+
return typeof out === "string" || typeof out === "number" ? String(out) : formatWithMinus(numberFormat, v);
|
|
431
|
+
};
|
|
432
|
+
const groupName = new Map(order.filter((n) => n.children).map((n) => [n.path, n.name]));
|
|
433
|
+
return new Map(
|
|
434
|
+
order.map((n) => {
|
|
435
|
+
const say = n.children ? labels.group : labels.tile;
|
|
436
|
+
const own = say(n.name, valueText(n.size), shareText(total > 0 ? n.size / total : 0));
|
|
437
|
+
const named = n.groups.map((g, i) => groupName.get(pathOf(n.groups.slice(0, i), g)) ?? g).reduceRight((acc, group) => labels.inGroup(acc, group), own);
|
|
438
|
+
return [n.path, named];
|
|
439
|
+
})
|
|
440
|
+
);
|
|
441
|
+
}, [order, labels, format, numberFormat, shareText, total]);
|
|
442
|
+
const keys = useMemo(
|
|
443
|
+
() => ({ name: (path) => names.get(path), onFocus, register, move }),
|
|
444
|
+
[names, onFocus, register, move]
|
|
445
|
+
);
|
|
446
|
+
const context = useMemo(
|
|
447
|
+
() => ({ tokens: tokenHex, edgeFor, edges: edgesInForce, keys, layout, hover: anchor.set }),
|
|
448
|
+
[tokenHex, edgeFor, edgesInForce, keys, layout, anchor]
|
|
449
|
+
);
|
|
450
|
+
const Content = redactNames ? RedactedTooltipContent : ChartTooltipContent;
|
|
451
|
+
const cell = useMemo(
|
|
452
|
+
() => /* @__PURE__ */ jsx(
|
|
453
|
+
TreemapCell,
|
|
454
|
+
{
|
|
455
|
+
onNodeClick,
|
|
456
|
+
onGroupClick,
|
|
457
|
+
redactNames,
|
|
458
|
+
nodeNote,
|
|
459
|
+
dir
|
|
460
|
+
}
|
|
461
|
+
),
|
|
462
|
+
[onNodeClick, onGroupClick, redactNames, nodeNote, dir]
|
|
463
|
+
);
|
|
464
|
+
const tooltip = useMemo(
|
|
465
|
+
() => /* @__PURE__ */ jsx(TreemapTooltip, { content: /* @__PURE__ */ jsx(Content, { hideLabel: true, valueFormatter: format }), anchor }),
|
|
466
|
+
[Content, format, anchor]
|
|
467
|
+
);
|
|
468
|
+
if (nodes.length === 0) return null;
|
|
469
|
+
const box = chartHeightProps(height);
|
|
470
|
+
return (
|
|
471
|
+
// Round the container, not inside it: ResponsiveContainer sizes its ONE child, the chart.
|
|
472
|
+
/* @__PURE__ */ jsx(TreemapTiles.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
473
|
+
ChartContainer,
|
|
474
|
+
{
|
|
475
|
+
role: "figure",
|
|
476
|
+
...rest,
|
|
477
|
+
description,
|
|
478
|
+
ref: rootRef,
|
|
479
|
+
config: TREEMAP_CONFIG,
|
|
480
|
+
className: cn(box.className, rest.className),
|
|
481
|
+
style: { ...style, ...box.style },
|
|
482
|
+
children: /* @__PURE__ */ jsx(RechartsTreemap, { data: nodes, dataKey: "size", fill: "var(--chart-1)", isAnimationActive: false, content: cell, children: tooltip })
|
|
483
|
+
}
|
|
484
|
+
) })
|
|
258
485
|
);
|
|
259
486
|
}
|
|
260
487
|
export {
|