@eifi1/ui-kit 0.33.1 → 0.34.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 +444 -282
- package/dist/account/account-parts.d.ts +6 -8
- package/dist/account/account-parts.js +1 -2
- package/dist/account/account-parts.js.map +1 -1
- package/dist/{components → account}/account-settings-labels.d.ts +16 -10
- package/dist/{components → account}/account-settings-labels.js +3 -1
- package/dist/account/account-settings-labels.js.map +1 -0
- package/dist/{components → account}/account-settings.d.ts +53 -23
- package/dist/{components → account}/account-settings.js +97 -26
- package/dist/account/account-settings.js.map +1 -0
- package/dist/account/data-export-setting-labels.d.ts +2 -0
- package/dist/account/data-export-setting-labels.js +15 -0
- package/dist/account/data-export-setting-labels.js.map +1 -0
- package/dist/account/data-export-setting.d.ts +9 -11
- package/dist/account/data-export-setting.js +11 -27
- package/dist/account/data-export-setting.js.map +1 -1
- package/dist/account/delete-account-setting-labels.d.ts +2 -0
- package/dist/account/delete-account-setting-labels.js +23 -0
- package/dist/account/delete-account-setting-labels.js.map +1 -0
- package/dist/account/delete-account-setting.d.ts +132 -101
- package/dist/account/delete-account-setting.js +7 -23
- package/dist/account/delete-account-setting.js.map +1 -1
- package/dist/account/email-change-setting-labels.d.ts +2 -0
- package/dist/account/email-change-setting-labels.js +28 -0
- package/dist/account/email-change-setting-labels.js.map +1 -0
- package/dist/account/email-change-setting.d.ts +10 -12
- package/dist/account/email-change-setting.js +11 -30
- package/dist/account/email-change-setting.js.map +1 -1
- package/dist/{components → account}/passkeys-setting.d.ts +9 -12
- package/dist/{components → account}/passkeys-setting.js +10 -7
- package/dist/account/passkeys-setting.js.map +1 -0
- package/dist/account/sessions-setting-labels.d.ts +2 -0
- package/dist/account/sessions-setting-labels.js +22 -0
- package/dist/account/sessions-setting-labels.js.map +1 -0
- package/dist/account/sessions-setting.d.ts +12 -14
- package/dist/account/sessions-setting.js +8 -23
- package/dist/account/sessions-setting.js.map +1 -1
- package/dist/admin/admin-action-confirm-labels.d.ts +2 -0
- package/dist/admin/admin-action-confirm-labels.js +16 -0
- package/dist/admin/admin-action-confirm-labels.js.map +1 -0
- package/dist/admin/admin-action-confirm.d.ts +156 -101
- package/dist/admin/admin-action-confirm.js +17 -22
- package/dist/admin/admin-action-confirm.js.map +1 -1
- package/dist/admin/admin-action-log-labels.d.ts +2 -0
- package/dist/admin/admin-action-log-labels.js +73 -0
- package/dist/admin/admin-action-log-labels.js.map +1 -0
- package/dist/admin/admin-action-log.d.ts +98 -22
- package/dist/admin/admin-action-log.js +48 -45
- package/dist/admin/admin-action-log.js.map +1 -1
- package/dist/admin/admin-parts.d.ts +7 -14
- package/dist/admin/admin-parts.js +0 -4
- package/dist/admin/admin-parts.js.map +1 -1
- package/dist/admin/invitations-panel-labels.d.ts +2 -0
- package/dist/admin/invitations-panel-labels.js +29 -0
- package/dist/admin/invitations-panel-labels.js.map +1 -0
- package/dist/admin/invitations-panel.d.ts +167 -101
- package/dist/admin/invitations-panel.js +12 -31
- package/dist/admin/invitations-panel.js.map +1 -1
- package/dist/admin/plan-change-labels.d.ts +2 -0
- package/dist/admin/plan-change-labels.js +22 -0
- package/dist/admin/plan-change-labels.js.map +1 -0
- package/dist/admin/plan-change.d.ts +244 -101
- package/dist/admin/plan-change.js +16 -24
- package/dist/admin/plan-change.js.map +1 -1
- package/dist/admin/reviewer-scope-editor-labels.d.ts +2 -0
- package/dist/admin/reviewer-scope-editor-labels.js +14 -0
- package/dist/admin/reviewer-scope-editor-labels.js.map +1 -0
- package/dist/admin/reviewer-scope-editor.d.ts +95 -101
- package/dist/admin/reviewer-scope-editor.js +5 -13
- package/dist/admin/reviewer-scope-editor.js.map +1 -1
- package/dist/admin/role-select-labels.d.ts +2 -0
- package/dist/admin/role-select-labels.js +15 -0
- package/dist/admin/role-select-labels.js.map +1 -0
- package/dist/admin/role-select.d.ts +136 -101
- package/dist/admin/role-select.js +7 -18
- package/dist/admin/role-select.js.map +1 -1
- package/dist/admin/transfer-ownership-dialog-labels.d.ts +2 -0
- package/dist/admin/transfer-ownership-dialog-labels.js +18 -0
- package/dist/admin/transfer-ownership-dialog-labels.js.map +1 -0
- package/dist/admin/transfer-ownership-dialog.d.ts +81 -101
- package/dist/admin/transfer-ownership-dialog.js +3 -15
- package/dist/admin/transfer-ownership-dialog.js.map +1 -1
- package/dist/admin/user-roster-labels.d.ts +2 -0
- package/dist/admin/user-roster-labels.js +16 -0
- package/dist/admin/user-roster-labels.js.map +1 -0
- package/dist/admin/user-roster.d.ts +225 -101
- package/dist/admin/user-roster.js +4 -14
- package/dist/admin/user-roster.js.map +1 -1
- package/dist/auth/accept-invitation-labels.d.ts +2 -0
- package/dist/auth/accept-invitation-labels.js +20 -0
- package/dist/auth/accept-invitation-labels.js.map +1 -0
- package/dist/auth/accept-invitation.d.ts +11 -13
- package/dist/auth/accept-invitation.js +3 -16
- package/dist/auth/accept-invitation.js.map +1 -1
- package/dist/auth/auth-errors.d.ts +34 -23
- package/dist/auth/auth-errors.js +8 -4
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/auth/complete-name-dialog-labels.d.ts +2 -0
- package/dist/auth/complete-name-dialog-labels.js +14 -0
- package/dist/auth/complete-name-dialog-labels.js.map +1 -0
- package/dist/auth/complete-name-dialog.d.ts +9 -11
- package/dist/auth/complete-name-dialog.js +4 -11
- package/dist/auth/complete-name-dialog.js.map +1 -1
- package/dist/auth/email-tag.d.ts +2 -4
- package/dist/auth/forgot-password-form-labels.d.ts +3 -0
- package/dist/auth/forgot-password-form-labels.js +17 -0
- package/dist/auth/forgot-password-form-labels.js.map +1 -0
- package/dist/auth/forgot-password-form.d.ts +9 -12
- package/dist/auth/forgot-password-form.js +6 -15
- package/dist/auth/forgot-password-form.js.map +1 -1
- package/dist/auth/form-rules.d.ts +5 -7
- package/dist/auth/new-password-fields.d.ts +4 -8
- package/dist/auth/new-password-fields.js +1 -1
- package/dist/auth/new-password-fields.js.map +1 -1
- package/dist/auth/not-found-page-labels.d.ts +2 -0
- package/dist/auth/not-found-page-labels.js +11 -0
- package/dist/auth/not-found-page-labels.js.map +1 -0
- package/dist/auth/not-found-page.d.ts +9 -11
- package/dist/auth/not-found-page.js +5 -10
- package/dist/auth/not-found-page.js.map +1 -1
- package/dist/auth/register-form-labels.d.ts +3 -0
- package/dist/auth/register-form-labels.js +28 -0
- package/dist/auth/register-form-labels.js.map +1 -0
- package/dist/auth/register-form.d.ts +174 -101
- package/dist/auth/register-form.js +11 -31
- package/dist/auth/register-form.js.map +1 -1
- package/dist/auth/reset-password-form-labels.d.ts +3 -0
- package/dist/auth/reset-password-form-labels.js +24 -0
- package/dist/auth/reset-password-form-labels.js.map +1 -0
- package/dist/auth/reset-password-form.d.ts +12 -15
- package/dist/auth/reset-password-form.js +6 -22
- package/dist/auth/reset-password-form.js.map +1 -1
- package/dist/auth/sign-in-form-labels.d.ts +3 -0
- package/dist/auth/sign-in-form-labels.js +42 -0
- package/dist/auth/sign-in-form-labels.js.map +1 -0
- package/dist/auth/sign-in-form.d.ts +15 -19
- package/dist/auth/sign-in-form.js +12 -46
- package/dist/auth/sign-in-form.js.map +1 -1
- package/dist/auth/status-parts.d.ts +13 -17
- package/dist/auth/status-parts.js +3 -3
- package/dist/auth/status-parts.js.map +1 -1
- package/dist/auth/verify-email-labels.d.ts +2 -0
- package/dist/auth/verify-email-labels.js +25 -0
- package/dist/auth/verify-email-labels.js.map +1 -0
- package/dist/auth/verify-email.d.ts +15 -17
- package/dist/auth/verify-email.js +4 -21
- package/dist/auth/verify-email.js.map +1 -1
- package/dist/billing/billing-banner.d.ts +8 -109
- package/dist/billing/billing-banner.js +2 -1
- package/dist/billing/billing-banner.js.map +1 -1
- package/dist/billing/billing-labels.d.ts +168 -101
- package/dist/billing/billing-labels.js.map +1 -1
- package/dist/billing/billing-lock.d.ts +10 -110
- package/dist/billing/billing-overview.d.ts +7 -109
- package/dist/billing/billing-standing.d.ts +6 -108
- package/dist/billing/checkout-processing.d.ts +8 -111
- package/dist/billing/checkout-processing.js +2 -9
- package/dist/billing/checkout-processing.js.map +1 -1
- package/dist/billing/checkout-return.d.ts +5 -7
- package/dist/billing/pay-page.d.ts +15 -117
- package/dist/billing/plan-card.d.ts +14 -115
- package/dist/billing/plan-card.js +15 -13
- package/dist/billing/plan-card.js.map +1 -1
- package/dist/billing/plan-limit-notice.d.ts +8 -109
- package/dist/billing/plan-limit-notice.js +1 -1
- package/dist/billing/plan-limit-notice.js.map +1 -1
- package/dist/billing/plan-limit-toast.d.ts +6 -107
- package/dist/billing/plan-limit.d.ts +2 -4
- package/dist/billing/plan-price.d.ts +10 -12
- package/dist/billing/subscription-actions.d.ts +6 -109
- package/dist/billing/subscription-actions.js +2 -2
- package/dist/billing/subscription-actions.js.map +1 -1
- package/dist/billing/subscription-status-chip.d.ts +7 -108
- package/dist/chart.d.ts +12 -113
- package/dist/chart.js +4 -0
- package/dist/chart.js.map +1 -1
- package/dist/components/account-chips-labels.d.ts +10 -0
- package/dist/components/account-chips-labels.js +15 -0
- package/dist/components/account-chips-labels.js.map +1 -0
- package/dist/components/account-chips.d.ts +22 -44
- package/dist/components/account-chips.js +9 -14
- package/dist/components/account-chips.js.map +1 -1
- package/dist/components/alert-banner.d.ts +15 -11
- package/dist/components/alert-banner.js +28 -18
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +66 -110
- package/dist/components/amount-input.js +259 -283
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/appearance-labels.d.ts +6 -10
- package/dist/components/appearance-labels.js.map +1 -1
- package/dist/components/authed-image-labels.d.ts +2 -0
- package/dist/components/authed-image-labels.js +10 -0
- package/dist/components/authed-image-labels.js.map +1 -0
- package/dist/components/authed-image.d.ts +11 -13
- package/dist/components/authed-image.js +2 -6
- package/dist/components/authed-image.js.map +1 -1
- package/dist/components/autocomplete.d.ts +13 -11
- package/dist/components/autocomplete.js +33 -28
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/breadcrumbs-labels.d.ts +2 -0
- package/dist/components/breadcrumbs-labels.js +9 -0
- package/dist/components/breadcrumbs-labels.js.map +1 -0
- package/dist/components/breadcrumbs.d.ts +10 -12
- package/dist/components/breadcrumbs.js +7 -10
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/bulk-action-bar-labels.d.ts +2 -0
- package/dist/components/bulk-action-bar-labels.js +10 -0
- package/dist/components/bulk-action-bar-labels.js.map +1 -0
- package/dist/components/bulk-action-bar.d.ts +10 -12
- package/dist/components/bulk-action-bar.js +9 -12
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-group.d.ts +7 -110
- package/dist/components/button-group.js +5 -5
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button-look.d.ts +88 -0
- package/dist/components/button-look.js +91 -0
- package/dist/components/button-look.js.map +1 -0
- package/dist/components/button.d.ts +153 -0
- package/dist/components/button.js +165 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calculator.d.ts +8 -107
- package/dist/components/calculator.js +10 -7
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/calendar-heatmap-labels.d.ts +3 -0
- package/dist/components/calendar-heatmap-labels.js +12 -0
- package/dist/components/calendar-heatmap-labels.js.map +1 -0
- package/dist/components/calendar-heatmap.d.ts +13 -16
- package/dist/components/calendar-heatmap.js +7 -13
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/card.d.ts +145 -0
- package/dist/components/card.js +186 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/chart-height.d.ts +4 -7
- package/dist/components/chart-zoom-core.d.ts +202 -0
- package/dist/components/chart-zoom-core.js +334 -0
- package/dist/components/chart-zoom-core.js.map +1 -0
- package/dist/components/chart-zoom.d.ts +39 -205
- package/dist/components/chart-zoom.js +15 -316
- package/dist/components/chart-zoom.js.map +1 -1
- package/dist/components/chart.d.ts +11 -15
- package/dist/components/chart.js +11 -11
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox-group.d.ts +6 -10
- package/dist/components/checkbox-group.js +10 -9
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/checkbox.d.ts +8 -12
- package/dist/components/checkbox.js +20 -18
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/chip-input.d.ts +73 -0
- package/dist/components/chip-input.js +224 -0
- package/dist/components/chip-input.js.map +1 -0
- package/dist/components/chip-labels.d.ts +2 -0
- package/dist/components/chip-labels.js +12 -0
- package/dist/components/chip-labels.js.map +1 -0
- package/dist/components/chip.d.ts +18 -93
- package/dist/components/chip.js +74 -426
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.d.ts +21 -18
- package/dist/components/choice-card.js +45 -45
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/column-mapper-labels.d.ts +5 -0
- package/dist/components/column-mapper-labels.js +34 -0
- package/dist/components/column-mapper-labels.js.map +1 -0
- package/dist/components/column-mapper.d.ts +15 -17
- package/dist/components/column-mapper.js +11 -37
- package/dist/components/column-mapper.js.map +1 -1
- package/dist/components/combobox-core.d.ts +79 -40
- package/dist/components/combobox-core.js +187 -121
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox-suggestions.d.ts +76 -0
- package/dist/components/combobox-suggestions.js +56 -0
- package/dist/components/combobox-suggestions.js.map +1 -0
- package/dist/components/combobox.d.ts +14 -159
- package/dist/components/combobox.js +40 -507
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog-labels.d.ts +7 -0
- package/dist/components/confirm-dialog-labels.js +10 -0
- package/dist/components/confirm-dialog-labels.js.map +1 -0
- package/dist/components/confirm-dialog.d.ts +165 -101
- package/dist/components/confirm-dialog.js +2 -6
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-button-labels.d.ts +2 -0
- package/dist/components/copy-button-labels.js +12 -0
- package/dist/components/copy-button-labels.js.map +1 -0
- package/dist/components/copy-button.d.ts +70 -101
- package/dist/components/copy-button.js +4 -9
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/country-select-labels.d.ts +2 -0
- package/dist/components/country-select-labels.js +10 -0
- package/dist/components/country-select-labels.js.map +1 -0
- package/dist/components/country-select.d.ts +18 -15
- package/dist/components/country-select.js +49 -64
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/currency-option-list.d.ts +63 -0
- package/dist/components/currency-option-list.js +135 -0
- package/dist/components/currency-option-list.js.map +1 -0
- package/dist/components/currency-select.d.ts +10 -30
- package/dist/components/currency-select.js +50 -133
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm-labels.d.ts +14 -0
- package/dist/components/danger-confirm-labels.js +17 -0
- package/dist/components/danger-confirm-labels.js.map +1 -0
- package/dist/components/danger-confirm.d.ts +448 -101
- package/dist/components/danger-confirm.js +40 -46
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-cells.d.ts +9 -24
- package/dist/components/data-table-cells.js +1 -1
- package/dist/components/data-table-cells.js.map +1 -1
- package/dist/components/data-table-column-settings.d.ts +16 -0
- package/dist/components/data-table-column-settings.js +119 -0
- package/dist/components/data-table-column-settings.js.map +1 -0
- package/dist/components/data-table-filter-popover.d.ts +5 -19
- package/dist/components/data-table-filter-popover.js +39 -22
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +93 -15
- package/dist/components/data-table-filters.js +22 -7
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-head.d.ts +36 -0
- package/dist/components/data-table-head.js +190 -0
- package/dist/components/data-table-head.js.map +1 -0
- package/dist/components/data-table-labels.d.ts +124 -15
- package/dist/components/data-table-labels.js +9 -5
- package/dist/components/data-table-labels.js.map +1 -1
- package/dist/components/data-table-mobile.d.ts +106 -0
- package/dist/components/data-table-mobile.js +412 -0
- package/dist/components/data-table-mobile.js.map +1 -0
- package/dist/components/data-table-pagination.d.ts +6 -21
- package/dist/components/data-table-pagination.js +7 -7
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table-resize.d.ts +37 -0
- package/dist/components/data-table-resize.js +103 -0
- package/dist/components/data-table-resize.js.map +1 -0
- package/dist/components/data-table-row-actions.d.ts +24 -0
- package/dist/components/data-table-row-actions.js +95 -0
- package/dist/components/data-table-row-actions.js.map +1 -0
- package/dist/components/data-table-selection.d.ts +21 -0
- package/dist/components/data-table-selection.js +30 -0
- package/dist/components/data-table-selection.js.map +1 -0
- package/dist/components/data-table-shared.d.ts +77 -0
- package/dist/components/data-table-shared.js +77 -0
- package/dist/components/data-table-shared.js.map +1 -0
- package/dist/components/data-table-sort.d.ts +8 -10
- package/dist/components/data-table.d.ts +603 -15
- package/dist/components/data-table.js +134 -927
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-field.d.ts +203 -0
- package/dist/components/date-field.js +270 -0
- package/dist/components/date-field.js.map +1 -0
- package/dist/components/date-picker.d.ts +6 -261
- package/dist/components/date-picker.js +24 -760
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +125 -0
- package/dist/components/date-range-picker.js +261 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/description-list-labels.d.ts +2 -0
- package/dist/components/description-list-labels.js +8 -0
- package/dist/components/description-list-labels.js.map +1 -0
- package/dist/components/description-list.d.ts +13 -15
- package/dist/components/description-list.js +17 -11
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame-labels.d.ts +2 -0
- package/dist/components/dialog-frame-labels.js +6 -0
- package/dist/components/dialog-frame-labels.js.map +1 -0
- package/dist/components/dialog-frame.d.ts +7 -11
- package/dist/components/dialog-frame.js +6 -6
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.d.ts +6 -10
- package/dist/components/disclosure.js +11 -11
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/dropdown.d.ts +55 -27
- package/dist/components/dropdown.js +53 -30
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/empty-state.d.ts +64 -0
- package/dist/components/empty-state.js +70 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/entity-combobox.d.ts +10 -11
- package/dist/components/entity-combobox.js +14 -13
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/error-boundary-labels.d.ts +2 -0
- package/dist/components/error-boundary-labels.js +19 -0
- package/dist/components/error-boundary-labels.js.map +1 -0
- package/dist/components/error-boundary.d.ts +17 -17
- package/dist/components/error-boundary.js +5 -17
- package/dist/components/error-boundary.js.map +1 -1
- package/dist/components/facing-pair.d.ts +7 -116
- package/dist/components/facing-pair.js +1 -1
- package/dist/components/facing-pair.js.map +1 -1
- package/dist/components/field-base.d.ts +260 -0
- package/dist/components/field-base.js +228 -0
- package/dist/components/field-base.js.map +1 -0
- package/dist/components/field-parts.d.ts +188 -87
- package/dist/components/field-parts.js +60 -33
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-strip.d.ts +19 -28
- package/dist/components/field-strip.js +2 -2
- package/dist/components/field-strip.js.map +1 -1
- package/dist/components/field-sync-labels.d.ts +2 -0
- package/dist/components/field-sync-labels.js +12 -0
- package/dist/components/field-sync-labels.js.map +1 -0
- package/dist/components/field-sync.d.ts +20 -19
- package/dist/components/field-sync.js +4 -10
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/field.d.ts +45 -10
- package/dist/components/field.js +10 -8
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-button.d.ts +85 -101
- package/dist/components/file-button.js +23 -169
- package/dist/components/file-button.js.map +1 -1
- package/dist/components/file-dropzone.d.ts +9 -110
- package/dist/components/file-dropzone.js +22 -22
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel-labels.d.ts +2 -0
- package/dist/components/floating-panel-labels.js +9 -0
- package/dist/components/floating-panel-labels.js.map +1 -0
- package/dist/components/floating-panel.d.ts +17 -21
- package/dist/components/floating-panel.js +19 -18
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/focus-ring.d.ts +9 -6
- package/dist/components/focus-ring.js +2 -2
- package/dist/components/focus-ring.js.map +1 -1
- package/dist/components/form-actions-labels.d.ts +2 -0
- package/dist/components/form-actions-labels.js +10 -0
- package/dist/components/form-actions-labels.js.map +1 -0
- package/dist/components/form-actions.d.ts +280 -101
- package/dist/components/form-actions.js +10 -20
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/full-bleed-dialog.d.ts +7 -8
- package/dist/components/full-bleed-dialog.js +14 -13
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/grouped-picker.d.ts +21 -16
- package/dist/components/grouped-picker.js +76 -62
- package/dist/components/grouped-picker.js.map +1 -1
- package/dist/components/help-popover.d.ts +60 -0
- package/dist/components/help-popover.js +48 -0
- package/dist/components/help-popover.js.map +1 -0
- package/dist/components/hover-menu.d.ts +17 -16
- package/dist/components/hover-menu.js +18 -17
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/iban-input-labels.d.ts +2 -0
- package/dist/components/iban-input-labels.js +13 -0
- package/dist/components/iban-input-labels.js.map +1 -0
- package/dist/components/iban-input.d.ts +73 -101
- package/dist/components/iban-input.js +22 -15
- package/dist/components/iban-input.js.map +1 -1
- package/dist/components/icon-button.d.ts +300 -0
- package/dist/components/icon-button.js +465 -0
- package/dist/components/icon-button.js.map +1 -0
- package/dist/components/icon-picker-labels.d.ts +2 -0
- package/dist/components/icon-picker-labels.js +12 -0
- package/dist/components/icon-picker-labels.js.map +1 -0
- package/dist/components/icon-picker.d.ts +13 -13
- package/dist/components/icon-picker.js +18 -17
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/image-grid-labels.d.ts +2 -0
- package/dist/components/image-grid-labels.js +10 -0
- package/dist/components/image-grid-labels.js.map +1 -0
- package/dist/components/image-grid.d.ts +12 -14
- package/dist/components/image-grid.js +6 -10
- package/dist/components/image-grid.js.map +1 -1
- package/dist/components/inline-edit-field-labels.d.ts +2 -0
- package/dist/components/inline-edit-field-labels.js +10 -0
- package/dist/components/inline-edit-field-labels.js.map +1 -0
- package/dist/components/inline-edit-field.d.ts +11 -13
- package/dist/components/inline-edit-field.js +11 -13
- package/dist/components/inline-edit-field.js.map +1 -1
- package/dist/components/inline-entity-combobox.d.ts +155 -0
- package/dist/components/inline-entity-combobox.js +467 -0
- package/dist/components/inline-entity-combobox.js.map +1 -0
- package/dist/components/input.d.ts +98 -0
- package/dist/components/input.js +219 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/jump-calendar.d.ts +8 -0
- package/dist/components/jump-calendar.js +274 -0
- package/dist/components/jump-calendar.js.map +1 -0
- package/dist/components/language-select.d.ts +20 -111
- package/dist/components/language-select.js +12 -7
- package/dist/components/language-select.js.map +1 -1
- package/dist/components/legal-labels.d.ts +2 -0
- package/dist/components/legal-labels.js +100 -0
- package/dist/components/legal-labels.js.map +1 -0
- package/dist/components/legal-page.d.ts +17 -118
- package/dist/components/legal-page.js +2 -2
- package/dist/components/legal-page.js.map +1 -1
- package/dist/components/legal.d.ts +353 -101
- package/dist/components/legal.js +7 -101
- package/dist/components/legal.js.map +1 -1
- package/dist/components/lightbox-labels.d.ts +2 -0
- package/dist/components/lightbox-labels.js +17 -0
- package/dist/components/lightbox-labels.js.map +1 -0
- package/dist/components/lightbox.d.ts +12 -14
- package/dist/components/lightbox.js +9 -19
- package/dist/components/lightbox.js.map +1 -1
- package/dist/components/line-items-labels.d.ts +2 -0
- package/dist/components/line-items-labels.js +13 -0
- package/dist/components/line-items-labels.js.map +1 -0
- package/dist/components/line-items.d.ts +16 -18
- package/dist/components/line-items.js +18 -26
- package/dist/components/line-items.js.map +1 -1
- package/dist/components/list-labels.d.ts +2 -0
- package/dist/components/list-labels.js +9 -0
- package/dist/components/list-labels.js.map +1 -0
- package/dist/components/list.d.ts +32 -21
- package/dist/components/list.js +41 -25
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-state.d.ts +5 -9
- package/dist/components/loading-state.js +2 -2
- package/dist/components/loading-state.js.map +1 -1
- package/dist/components/measured-grid-labels.d.ts +4 -0
- package/dist/components/measured-grid-labels.js +21 -0
- package/dist/components/measured-grid-labels.js.map +1 -0
- package/dist/components/measured-grid.d.ts +13 -17
- package/dist/components/measured-grid.js +31 -50
- package/dist/components/measured-grid.js.map +1 -1
- package/dist/components/menu-item.d.ts +10 -10
- package/dist/components/menu-item.js +9 -9
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/mini-calendar-labels.d.ts +4 -0
- package/dist/components/mini-calendar-labels.js +14 -0
- package/dist/components/mini-calendar-labels.js.map +1 -0
- package/dist/components/mini-calendar.d.ts +10 -14
- package/dist/components/mini-calendar.js +22 -29
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +26 -18
- package/dist/components/modal.js +8 -11
- package/dist/components/modal.js.map +1 -1
- package/dist/components/money-draft.d.ts +34 -0
- package/dist/components/money-draft.js +39 -0
- package/dist/components/money-draft.js.map +1 -0
- package/dist/components/money-field.d.ts +13 -111
- package/dist/components/money-field.js +6 -22
- package/dist/components/money-field.js.map +1 -1
- package/dist/components/month-picker-labels.d.ts +5 -0
- package/dist/components/month-picker-labels.js +18 -0
- package/dist/components/month-picker-labels.js.map +1 -0
- package/dist/components/month-picker.d.ts +15 -13
- package/dist/components/month-picker.js +34 -32
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.d.ts +9 -11
- package/dist/components/multi-entity-combobox.js +14 -13
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.d.ts +81 -21
- package/dist/components/multi-select.js +171 -197
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/nav-pills.d.ts +9 -10
- package/dist/components/nav-pills.js +53 -42
- package/dist/components/nav-pills.js.map +1 -1
- package/dist/components/number-field.d.ts +6 -111
- package/dist/components/number-field.js +2 -3
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/number-input.d.ts +30 -111
- package/dist/components/number-input.js +34 -66
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numeric-field.d.ts +85 -0
- package/dist/components/numeric-field.js +71 -0
- package/dist/components/numeric-field.js.map +1 -0
- package/dist/components/numpad-sheet.d.ts +5 -108
- package/dist/components/numpad-sheet.js +7 -7
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/one-time-code-input.d.ts +6 -7
- package/dist/components/one-time-code-input.js +119 -124
- package/dist/components/one-time-code-input.js.map +1 -1
- package/dist/components/page-contents-labels.d.ts +2 -0
- package/dist/components/page-contents-labels.js +8 -0
- package/dist/components/page-contents-labels.js.map +1 -0
- package/dist/components/page-contents.d.ts +13 -15
- package/dist/components/page-contents.js +7 -9
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/page-header.d.ts +10 -10
- package/dist/components/page-header.js +3 -3
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/password-strength-labels.d.ts +2 -0
- package/dist/components/password-strength-labels.js +21 -0
- package/dist/components/password-strength-labels.js.map +1 -0
- package/dist/components/password-strength.d.ts +15 -17
- package/dist/components/password-strength.js +7 -22
- package/dist/components/password-strength.js.map +1 -1
- package/dist/components/phone-input-labels.d.ts +2 -0
- package/dist/components/phone-input-labels.js +9 -0
- package/dist/components/phone-input-labels.js.map +1 -0
- package/dist/components/phone-input.d.ts +75 -101
- package/dist/components/phone-input.js +20 -23
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/picker-sheet.d.ts +20 -8
- package/dist/components/picker-sheet.js +22 -11
- package/dist/components/picker-sheet.js.map +1 -1
- package/dist/components/pie-chart-labels.d.ts +2 -4
- package/dist/components/pie-chart.d.ts +8 -11
- package/dist/components/pie-chart.js +5 -5
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover-labels.d.ts +2 -0
- package/dist/components/popover-labels.js +11 -0
- package/dist/components/popover-labels.js.map +1 -0
- package/dist/components/popover.d.ts +13 -11
- package/dist/components/popover.js +15 -21
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress-bar-labels.d.ts +2 -0
- package/dist/components/progress-bar-labels.js +9 -0
- package/dist/components/progress-bar-labels.js.map +1 -0
- package/dist/components/progress-bar.d.ts +16 -15
- package/dist/components/progress-bar.js +22 -20
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/qr-code.d.ts +4 -8
- package/dist/components/qr-code.js.map +1 -1
- package/dist/components/reauth-dialog-labels.d.ts +2 -0
- package/dist/components/reauth-dialog-labels.js +12 -0
- package/dist/components/reauth-dialog-labels.js.map +1 -0
- package/dist/components/reauth-dialog.d.ts +8 -10
- package/dist/components/reauth-dialog.js +3 -8
- package/dist/components/reauth-dialog.js.map +1 -1
- package/dist/components/row-actions-labels.d.ts +2 -0
- package/dist/components/row-actions-labels.js +9 -0
- package/dist/components/row-actions-labels.js.map +1 -0
- package/dist/components/row-actions.d.ts +224 -101
- package/dist/components/row-actions.js +4 -5
- package/dist/components/row-actions.js.map +1 -1
- package/dist/components/scroll-area.d.ts +6 -9
- package/dist/components/scroll-area.js +4 -10
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/search-field.d.ts +12 -27
- package/dist/components/search-field.js +13 -16
- package/dist/components/search-field.js.map +1 -1
- package/dist/components/select.d.ts +69 -0
- package/dist/components/select.js +164 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +3 -7
- package/dist/components/separator.js.map +1 -1
- package/dist/components/series-chart-axes.d.ts +120 -0
- package/dist/components/series-chart-axes.js +164 -0
- package/dist/components/series-chart-axes.js.map +1 -0
- package/dist/components/series-chart-budget.d.ts +8 -9
- package/dist/components/series-chart-labels.d.ts +2 -4
- package/dist/components/series-chart-thin.d.ts +34 -0
- package/dist/components/series-chart-thin.js +103 -0
- package/dist/components/series-chart-thin.js.map +1 -0
- package/dist/components/series-chart-ticks.d.ts +9 -11
- package/dist/components/series-chart.d.ts +64 -214
- package/dist/components/series-chart.js +69 -160
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/server-wake-labels.d.ts +2 -0
- package/dist/components/server-wake-labels.js +9 -0
- package/dist/components/server-wake-labels.js.map +1 -0
- package/dist/components/server-wake.d.ts +32 -23
- package/dist/components/server-wake.js +15 -35
- package/dist/components/server-wake.js.map +1 -1
- package/dist/components/settings-fields.d.ts +46 -118
- package/dist/components/settings-fields.js +13 -3
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/share-card-labels.d.ts +2 -0
- package/dist/components/share-card-labels.js +29 -0
- package/dist/components/share-card-labels.js.map +1 -0
- package/dist/components/share-card.d.ts +188 -101
- package/dist/components/share-card.js +16 -34
- package/dist/components/share-card.js.map +1 -1
- package/dist/components/sign-chip-labels.d.ts +2 -0
- package/dist/components/sign-chip-labels.js +11 -0
- package/dist/components/sign-chip-labels.js.map +1 -0
- package/dist/components/sign-chip.d.ts +7 -9
- package/dist/components/sign-chip.js +2 -7
- package/dist/components/sign-chip.js.map +1 -1
- package/dist/components/signature-pad-labels.d.ts +2 -0
- package/dist/components/signature-pad-labels.js +23 -0
- package/dist/components/signature-pad-labels.js.map +1 -0
- package/dist/components/signature-pad.d.ts +16 -15
- package/dist/components/signature-pad.js +22 -35
- package/dist/components/signature-pad.js.map +1 -1
- package/dist/components/signed-amount-labels.d.ts +2 -0
- package/dist/components/signed-amount-labels.js +9 -0
- package/dist/components/signed-amount-labels.js.map +1 -0
- package/dist/components/signed-amount.d.ts +19 -21
- package/dist/components/signed-amount.js +12 -15
- package/dist/components/signed-amount.js.map +1 -1
- package/dist/components/skeleton.d.ts +5 -9
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +16 -11
- package/dist/components/slider.js +23 -18
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sparkline-labels.d.ts +2 -0
- package/dist/components/sparkline-labels.js +13 -0
- package/dist/components/sparkline-labels.js.map +1 -0
- package/dist/components/sparkline.d.ts +10 -12
- package/dist/components/sparkline.js +10 -17
- package/dist/components/sparkline.js.map +1 -1
- package/dist/components/spinner.d.ts +45 -0
- package/dist/components/spinner.js +39 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat-tile-labels.d.ts +2 -0
- package/dist/components/stat-tile-labels.js +14 -0
- package/dist/components/stat-tile-labels.js.map +1 -0
- package/dist/components/stat-tile.d.ts +15 -17
- package/dist/components/stat-tile.js +25 -32
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/status-dot.d.ts +8 -20
- package/dist/components/status-dot.js +13 -12
- package/dist/components/status-dot.js.map +1 -1
- package/dist/components/swatch-picker-labels.d.ts +2 -0
- package/dist/components/swatch-picker-labels.js +9 -0
- package/dist/components/swatch-picker-labels.js.map +1 -0
- package/dist/components/swatch-picker.d.ts +14 -14
- package/dist/components/swatch-picker.js +14 -8
- package/dist/components/swatch-picker.js.map +1 -1
- package/dist/components/swipeable-row.d.ts +14 -27
- package/dist/components/swipeable-row.js +2 -2
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/switch.d.ts +10 -13
- package/dist/components/switch.js +13 -12
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +28 -31
- package/dist/components/table.js +15 -15
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +182 -0
- package/dist/components/tabs.js +312 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text-link.d.ts +17 -119
- package/dist/components/text-link.js +7 -7
- package/dist/components/text-link.js.map +1 -1
- package/dist/components/text.d.ts +14 -13
- package/dist/components/text.js +5 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/textarea.d.ts +20 -0
- package/dist/components/textarea.js +161 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/tile-radio.d.ts +6 -10
- package/dist/components/tile-radio.js +6 -6
- package/dist/components/tile-radio.js.map +1 -1
- package/dist/components/time-input.d.ts +5 -108
- package/dist/components/time-input.js +14 -5
- package/dist/components/time-input.js.map +1 -1
- package/dist/components/toast-labels.d.ts +2 -0
- package/dist/components/toast-labels.js +11 -0
- package/dist/components/toast-labels.js.map +1 -0
- package/dist/components/toast.d.ts +21 -23
- package/dist/components/toast.js +1 -6
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.d.ts +26 -26
- package/dist/components/toggle-group.js +43 -19
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle-legend.d.ts +18 -21
- package/dist/components/toggle-legend.js +3 -3
- package/dist/components/toggle-legend.js.map +1 -1
- package/dist/components/tooltip.d.ts +16 -15
- package/dist/components/tooltip.js +4 -9
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/translation-review-editor.d.ts +8 -10
- package/dist/components/translation-review-editor.js +6 -5
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-labels.d.ts +4 -7
- package/dist/components/translation-review-parts.d.ts +19 -28
- package/dist/components/translation-review-parts.js +4 -7
- package/dist/components/translation-review-parts.js.map +1 -1
- package/dist/components/translation-review.d.ts +26 -24
- package/dist/components/translation-review.js +13 -10
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/tree-view.d.ts +7 -11
- package/dist/components/tree-view.js +8 -8
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/treemap.d.ts +9 -13
- package/dist/components/trigger-aria.d.ts +2 -4
- package/dist/components/ui-labels.d.ts +5 -0
- package/dist/components/ui-labels.js +20 -0
- package/dist/components/ui-labels.js.map +1 -0
- package/dist/components/use-anchor-dir.d.ts +3 -6
- package/dist/components/use-mobile-reveal.d.ts +2 -6
- package/dist/components/use-table-state.d.ts +154 -15
- package/dist/components/user-avatar.d.ts +8 -21
- package/dist/components/user-avatar.js +1 -1
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/wizard-stepper.d.ts +6 -6
- package/dist/components/wizard-stepper.js +4 -3
- package/dist/components/wizard-stepper.js.map +1 -1
- package/dist/components/write-lock-labels.d.ts +2 -0
- package/dist/components/write-lock-labels.js +8 -0
- package/dist/components/write-lock-labels.js.map +1 -0
- package/dist/components/write-lock.d.ts +16 -18
- package/dist/components/write-lock.js +4 -8
- package/dist/components/write-lock.js.map +1 -1
- package/dist/data-table.d.ts +10 -18
- package/dist/data-table.js.map +1 -1
- package/dist/demo/demo-banner.d.ts +10 -13
- package/dist/demo/demo-banner.js +5 -19
- package/dist/demo/demo-banner.js.map +1 -1
- package/dist/demo/demo-countdown.d.ts +7 -9
- package/dist/demo/demo-ended.d.ts +10 -13
- package/dist/demo/demo-ended.js +4 -4
- package/dist/demo/demo-ended.js.map +1 -1
- package/dist/demo/demo-labels.d.ts +4 -5
- package/dist/demo/demo-labels.js.map +1 -1
- package/dist/demo/demo-session.d.ts +3 -5
- package/dist/demo/demo-start.d.ts +8 -11
- package/dist/demo/demo-start.js +3 -2
- package/dist/demo/demo-start.js.map +1 -1
- package/dist/feedback/feedback-attachment-labels.d.ts +16 -0
- package/dist/feedback/feedback-attachment-labels.js +17 -0
- package/dist/feedback/feedback-attachment-labels.js.map +1 -0
- package/dist/feedback/feedback-attachment.d.ts +312 -101
- package/dist/feedback/feedback-attachment.js +31 -42
- package/dist/feedback/feedback-attachment.js.map +1 -1
- package/dist/feedback/feedback-capture.d.ts +2 -4
- package/dist/feedback/feedback-context-labels.d.ts +2 -0
- package/dist/feedback/feedback-context-labels.js +9 -0
- package/dist/feedback/feedback-context-labels.js.map +1 -0
- package/dist/feedback/feedback-context.d.ts +110 -101
- package/dist/feedback/feedback-context.js +4 -7
- package/dist/feedback/feedback-context.js.map +1 -1
- package/dist/feedback/feedback-crash.d.ts +8 -110
- package/dist/feedback/feedback-dialog-labels.d.ts +12 -0
- package/dist/feedback/feedback-dialog-labels.js +17 -0
- package/dist/feedback/feedback-dialog-labels.js.map +1 -0
- package/dist/feedback/feedback-dialog.d.ts +186 -101
- package/dist/feedback/feedback-dialog.js +8 -18
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.d.ts +236 -101
- package/dist/feedback/feedback-inbox.js +31 -141
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-labels.d.ts +83 -101
- package/dist/feedback/feedback-labels.js.map +1 -1
- package/dist/feedback/feedback-menu-labels.d.ts +2 -0
- package/dist/feedback/feedback-menu-labels.js +10 -0
- package/dist/feedback/feedback-menu-labels.js.map +1 -0
- package/dist/feedback/feedback-menu.d.ts +83 -101
- package/dist/feedback/feedback-menu.js +3 -7
- package/dist/feedback/feedback-menu.js.map +1 -1
- package/dist/feedback/feedback-record.d.ts +239 -101
- package/dist/feedback/feedback-record.js +7 -2
- package/dist/feedback/feedback-record.js.map +1 -1
- package/dist/feedback/feedback-row-detail-labels.d.ts +2 -0
- package/dist/feedback/feedback-row-detail-labels.js +31 -0
- package/dist/feedback/feedback-row-detail-labels.js.map +1 -0
- package/dist/feedback/feedback-row-detail.d.ts +315 -101
- package/dist/feedback/feedback-row-detail.js +11 -37
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-status-undo.d.ts +66 -101
- package/dist/feedback/feedback-status-undo.js.map +1 -1
- package/dist/feedback/feedback-submit-dialog.d.ts +39 -0
- package/dist/feedback/feedback-submit-dialog.js +66 -0
- package/dist/feedback/feedback-submit-dialog.js.map +1 -0
- package/dist/feedback/feedback-submit.d.ts +13 -109
- package/dist/feedback/feedback-submit.js +19 -40
- package/dist/feedback/feedback-submit.js.map +1 -1
- package/dist/feedback/feedback-swipe.d.ts +9 -110
- package/dist/feedback/feedback-swipe.js +1 -1
- package/dist/feedback/feedback-swipe.js.map +1 -1
- package/dist/feedback/feedback-table-labels.d.ts +2 -0
- package/dist/feedback/feedback-table-labels.js +26 -0
- package/dist/feedback/feedback-table-labels.js.map +1 -0
- package/dist/feedback/feedback-table.d.ts +314 -101
- package/dist/feedback/feedback-table.js +11 -31
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/feedback/feedback-thread-labels.d.ts +3 -0
- package/dist/feedback/feedback-thread-labels.js +21 -0
- package/dist/feedback/feedback-thread-labels.js.map +1 -0
- package/dist/feedback/feedback-thread.d.ts +378 -101
- package/dist/feedback/feedback-thread.js +27 -34
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/feedback/feedback-vocabulary.d.ts +98 -0
- package/dist/feedback/feedback-vocabulary.js +143 -0
- package/dist/feedback/feedback-vocabulary.js.map +1 -0
- package/dist/feedback.d.ts +15 -105
- package/dist/hooks/use-anchored-panel.d.ts +77 -15
- package/dist/hooks/use-anchored-panel.js +34 -1
- package/dist/hooks/use-anchored-panel.js.map +1 -1
- package/dist/hooks/use-anchored-rect.d.ts +15 -6
- package/dist/hooks/use-anchored-rect.js +2 -1
- package/dist/hooks/use-anchored-rect.js.map +1 -1
- package/dist/hooks/use-announce.d.ts +4 -6
- package/dist/hooks/use-authed-src.d.ts +5 -7
- package/dist/hooks/use-authed-src.js +3 -7
- package/dist/hooks/use-authed-src.js.map +1 -1
- package/dist/hooks/use-body-scroll-lock.d.ts +1 -3
- package/dist/hooks/use-breakpoint.d.ts +16 -17
- package/dist/hooks/use-breakpoint.js.map +1 -1
- package/dist/hooks/use-close-transition.d.ts +8 -8
- package/dist/hooks/use-close-transition.js +5 -4
- package/dist/hooks/use-close-transition.js.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +5 -7
- package/dist/hooks/use-debounce.d.ts +13 -6
- package/dist/hooks/use-debounce.js.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +37 -11
- package/dist/hooks/use-dismiss.js +69 -10
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/hooks/use-file-drop.d.ts +8 -110
- package/dist/hooks/use-file-drop.js +1 -1
- package/dist/hooks/use-file-drop.js.map +1 -1
- package/dist/hooks/use-file-picker-labels.d.ts +2 -0
- package/dist/hooks/use-file-picker-labels.js +25 -0
- package/dist/hooks/use-file-picker-labels.js.map +1 -0
- package/dist/hooks/use-file-picker.d.ts +164 -0
- package/dist/hooks/use-file-picker.js +149 -0
- package/dist/hooks/use-file-picker.js.map +1 -0
- package/dist/hooks/use-focus-trap.d.ts +2 -4
- package/dist/hooks/use-focus-trap.js +2 -1
- package/dist/hooks/use-focus-trap.js.map +1 -1
- package/dist/hooks/use-hotkey.d.ts +7 -9
- package/dist/hooks/use-large-text.d.ts +3 -5
- package/dist/hooks/use-media-query.d.ts +1 -3
- package/dist/hooks/use-noindex.d.ts +1 -3
- package/dist/hooks/use-overlay-history.d.ts +1 -3
- package/dist/hooks/use-row-swipe.d.ts +5 -8
- package/dist/hooks/use-search-param-state.d.ts +10 -11
- package/dist/hooks/use-windowed-rows.d.ts +4 -7
- package/dist/i18n/defaults.d.ts +11 -105
- package/dist/i18n/defaults.js +82 -82
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.d.ts +2 -105
- package/dist/i18n/german.js +52 -8
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +609 -101
- package/dist/i18n/kit-labels.js +22 -97
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.d.ts +197 -101
- package/dist/i18n/locales/de-CH.d.ts +3 -106
- package/dist/i18n/locales/en.d.ts +4 -105
- package/dist/i18n/locales/en.js +1834 -4
- package/dist/i18n/locales/en.js.map +7 -1
- package/dist/i18n/locales/es.d.ts +3 -106
- package/dist/i18n/locales/es.js +52 -8
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +3 -106
- package/dist/i18n/locales/fr.js +53 -8
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +3 -106
- package/dist/i18n/locales/hu.js +52 -8
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +3 -106
- package/dist/i18n/locales/it.js +53 -8
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +3 -106
- package/dist/i18n/locales/zh.js +51 -8
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/plurals.d.ts +3 -5
- package/dist/i18n/review.d.ts +5 -107
- package/dist/i18n/review.js +4 -0
- package/dist/i18n/review.js.map +1 -1
- package/dist/i18n/shared-labels.d.ts +17 -0
- package/dist/i18n/shared-labels.js +111 -0
- package/dist/i18n/shared-labels.js.map +1 -0
- package/dist/i18n/swiss.d.ts +1 -3
- package/dist/index.d.ts +329 -249
- package/dist/index.js +188 -215
- package/dist/index.js.map +1 -1
- package/dist/landing/access.d.ts +7 -9
- package/dist/landing/access.js.map +1 -1
- package/dist/landing/landing-actions.d.ts +9 -109
- package/dist/landing/landing-actions.js +1 -1
- package/dist/landing/landing-actions.js.map +1 -1
- package/dist/landing/landing-labels.d.ts +4 -5
- package/dist/landing/landing-labels.js.map +1 -1
- package/dist/landing/landing-sections.d.ts +21 -121
- package/dist/landing/landing-sections.js +15 -15
- package/dist/landing/landing-sections.js.map +1 -1
- package/dist/landing/page-seo.d.ts +7 -9
- package/dist/landing/public-header.d.ts +10 -111
- package/dist/landing/public-header.js +1 -1
- package/dist/landing/public-header.js.map +1 -1
- package/dist/landing/routing.d.ts +16 -120
- package/dist/landing/routing.js +2 -6
- package/dist/landing/routing.js.map +1 -1
- package/dist/lib/calc.d.ts +7 -9
- package/dist/lib/chip-edge-snap.d.ts +10 -0
- package/dist/lib/chip-edge-snap.js +131 -0
- package/dist/lib/chip-edge-snap.js.map +1 -0
- package/dist/lib/clipping.d.ts +2 -4
- package/dist/lib/cn.d.ts +2 -5
- package/dist/lib/cn.js +6 -1
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/column-mapping.d.ts +10 -13
- package/dist/lib/countries.d.ts +3 -5
- package/dist/lib/dates.d.ts +25 -25
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/decimal-marks.d.ts +8 -8
- package/dist/lib/decimal-marks.js +1 -1
- package/dist/lib/decimal-marks.js.map +1 -1
- package/dist/lib/direction.d.ts +4 -6
- package/dist/lib/document-navigation.d.ts +1 -3
- package/dist/lib/download.d.ts +67 -0
- package/dist/lib/download.js +89 -0
- package/dist/lib/download.js.map +1 -0
- package/dist/lib/floating-stack.d.ts +8 -6
- package/dist/lib/floating-stack.js.map +1 -1
- package/dist/lib/format.d.ts +24 -23
- package/dist/lib/format.js +3 -3
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/iban.d.ts +9 -11
- package/dist/lib/ime.d.ts +17 -0
- package/dist/lib/ime.js +13 -0
- package/dist/lib/ime.js.map +1 -0
- package/dist/lib/isin.d.ts +3 -5
- package/dist/lib/logger.d.ts +4 -6
- package/dist/lib/person-name.d.ts +3 -5
- package/dist/lib/phone.d.ts +9 -11
- package/dist/lib/presence.d.ts +15 -0
- package/dist/lib/presence.js +8 -0
- package/dist/lib/presence.js.map +1 -0
- package/dist/lib/qr-encode.d.ts +4 -6
- package/dist/lib/reduced-motion.d.ts +18 -0
- package/dist/lib/reduced-motion.js +9 -0
- package/dist/lib/reduced-motion.js.map +1 -0
- package/dist/lib/round.d.ts +22 -0
- package/dist/lib/round.js +15 -0
- package/dist/lib/round.js.map +1 -0
- package/dist/lib/safe-storage.d.ts +14 -4
- package/dist/lib/safe-storage.js +24 -9
- package/dist/lib/safe-storage.js.map +1 -1
- package/dist/lib/server-wake.d.ts +13 -14
- package/dist/lib/session-refresh.d.ts +200 -0
- package/dist/lib/session-refresh.js +187 -0
- package/dist/lib/session-refresh.js.map +1 -0
- package/dist/lib/strip-fade.d.ts +10 -13
- package/dist/lib/table-text.d.ts +14 -16
- package/dist/lib/text-match.d.ts +41 -0
- package/dist/lib/text-match.js +23 -0
- package/dist/lib/text-match.js.map +1 -0
- package/dist/lib/translation-review.d.ts +44 -45
- package/dist/lib/translation-review.js +3 -2
- package/dist/lib/translation-review.js.map +1 -1
- package/dist/rhf/fields.d.ts +123 -189
- package/dist/rhf/fields.js +46 -54
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form-core.d.ts +153 -0
- package/dist/rhf/form-core.js +143 -0
- package/dist/rhf/form-core.js.map +1 -0
- package/dist/rhf/form.d.ts +38 -175
- package/dist/rhf/form.js +9 -131
- package/dist/rhf/form.js.map +1 -1
- package/dist/rhf/line-items.d.ts +40 -11
- package/dist/rhf/line-items.js.map +1 -1
- package/dist/rhf/use-rhf-wizard-step.d.ts +3 -6
- package/dist/rhf.d.ts +4 -118
- package/dist/rhf.js.map +1 -1
- package/dist/search/command-palette-labels.d.ts +2 -0
- package/dist/search/command-palette-labels.js +15 -0
- package/dist/search/command-palette-labels.js.map +1 -0
- package/dist/search/command-palette.d.ts +10 -13
- package/dist/search/command-palette.js +25 -44
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search-labels.d.ts +2 -0
- package/dist/search/global-search-labels.js +12 -0
- package/dist/search/global-search-labels.js.map +1 -0
- package/dist/search/global-search.d.ts +17 -16
- package/dist/search/global-search.js +12 -12
- package/dist/search/global-search.js.map +1 -1
- package/dist/search/search-index.d.ts +13 -14
- package/dist/search/search-index.js +2 -1
- package/dist/search/search-index.js.map +1 -1
- package/dist/search/use-command-key.d.ts +9 -0
- package/dist/search/use-command-key.js +18 -0
- package/dist/search/use-command-key.js.map +1 -0
- package/dist/search.d.ts +3 -4
- package/dist/settings/settings-card-classes.d.ts +11 -0
- package/dist/settings/settings-card-classes.js +8 -0
- package/dist/settings/settings-card-classes.js.map +1 -0
- package/dist/settings/settings-catalogue.d.ts +11 -14
- package/dist/settings/settings-context.d.ts +4 -8
- package/dist/settings/settings-heading.d.ts +8 -12
- package/dist/settings/settings-heading.js +1 -1
- package/dist/settings/settings-heading.js.map +1 -1
- package/dist/settings/settings-labels.d.ts +6 -7
- package/dist/settings/settings-labels.js.map +1 -1
- package/dist/settings/settings-layout.d.ts +36 -13
- package/dist/settings/settings-layout.js +25 -4
- package/dist/settings/settings-layout.js.map +1 -1
- package/dist/settings/settings-section.d.ts +4 -107
- package/dist/settings/settings-section.js +2 -2
- package/dist/settings/settings-section.js.map +1 -1
- package/dist/settings/use-account-appearance.d.ts +11 -16
- package/dist/settings/use-account-language.d.ts +8 -10
- package/dist/settings/use-settings-focus.d.ts +3 -5
- package/dist/settings/use-settings-focus.js +2 -4
- package/dist/settings/use-settings-focus.js.map +1 -1
- package/dist/settings/use-settings-route.d.ts +11 -16
- package/dist/shell/app-shell-labels.d.ts +2 -0
- package/dist/shell/app-shell-labels.js +9 -0
- package/dist/shell/app-shell-labels.js.map +1 -0
- package/dist/shell/app-shell.d.ts +216 -101
- package/dist/shell/app-shell.js +51 -35
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/auth-layout.d.ts +6 -9
- package/dist/shell/auth-layout.js +6 -6
- package/dist/shell/auth-layout.js.map +1 -1
- package/dist/shell/company-switcher-labels.d.ts +2 -0
- package/dist/shell/company-switcher-labels.js +12 -0
- package/dist/shell/company-switcher-labels.js.map +1 -0
- package/dist/shell/company-switcher.d.ts +9 -11
- package/dist/shell/company-switcher.js +3 -9
- package/dist/shell/company-switcher.js.map +1 -1
- package/dist/shell/option-switcher-menu.d.ts +19 -9
- package/dist/shell/option-switcher-menu.js +6 -4
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/role-switcher.d.ts +5 -6
- package/dist/shell/role-switcher.js +4 -3
- package/dist/shell/role-switcher.js.map +1 -1
- package/dist/shell/top-bar-brand.d.ts +4 -107
- package/dist/shell/top-bar-brand.js +1 -1
- package/dist/shell/top-bar-brand.js.map +1 -1
- package/dist/shell/top-bar.d.ts +6 -9
- package/dist/shell/top-bar.js +1 -1
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/shell/topbar-action-menu.d.ts +30 -31
- package/dist/shell/topbar-action-menu.js +12 -10
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.d.ts +20 -18
- package/dist/shell/topbar-controls.js +14 -11
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/shell.d.ts +25 -116
- package/dist/shell.js.map +1 -1
- package/dist/table-text.d.ts +1 -1
- package/dist/testing/css-variables.d.ts +4 -6
- package/dist/testing/css-variables.generated.d.ts +2 -4
- package/dist/testing/index.d.ts +2 -1
- package/dist/testing/index.js +9 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/viewport.d.ts +93 -0
- package/dist/testing/viewport.js +152 -0
- package/dist/testing/viewport.js.map +1 -0
- package/dist/theme/chart-palette.d.ts +7 -9
- package/dist/theme/color.d.ts +14 -16
- package/dist/theme/color.js +2 -1
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/contrast-tokens.d.ts +13 -17
- package/dist/theme/contrast.d.ts +22 -27
- package/dist/theme/palette-derive.d.ts +16 -22
- package/dist/theme/palette-derive.js +15 -7
- package/dist/theme/palette-derive.js.map +1 -1
- package/dist/theme/palette-presets.d.ts +25 -15
- package/dist/theme/palette-presets.js +66 -66
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/theme/palette-store.d.ts +10 -13
- package/dist/theme/text-size.d.ts +21 -26
- package/dist/theme/theme-store.d.ts +9 -14
- package/dist/tour/tour-labels.d.ts +2 -0
- package/dist/tour/tour-labels.js +13 -0
- package/dist/tour/tour-labels.js.map +1 -0
- package/dist/tour/tour.d.ts +12 -14
- package/dist/tour/tour.js +9 -20
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour.d.ts +1 -2
- package/dist/wizard/stepper-nav.d.ts +8 -108
- package/dist/wizard/stepper-nav.js +15 -14
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.d.ts +18 -18
- package/dist/wizard/types.js +1 -19
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.d.ts +2 -6
- package/dist/wizard/validation.d.ts +3 -7
- package/dist/wizard/wizard-context.d.ts +7 -11
- package/dist/wizard/wizard-labels.d.ts +4 -0
- package/dist/wizard/wizard-labels.js +24 -0
- package/dist/wizard/wizard-labels.js.map +1 -0
- package/dist/wizard/wizard-step.d.ts +3 -7
- package/dist/wizard/wizard-step.js +2 -2
- package/dist/wizard/wizard-step.js.map +1 -1
- package/dist/wizard/wizard-summary.d.ts +5 -8
- package/dist/wizard/wizard-summary.js +6 -5
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/dist/wizard.d.ts +7 -107
- package/package.json +9 -6
- package/src/account/account-parts.ts +3 -3
- package/src/{components → account}/account-settings-labels.ts +11 -1
- package/src/{components → account}/account-settings.tsx +145 -34
- package/src/account/data-export-setting-labels.ts +20 -0
- package/src/account/data-export-setting.tsx +19 -38
- package/src/account/delete-account-setting-labels.ts +33 -0
- package/src/account/delete-account-setting.tsx +13 -35
- package/src/account/email-change-setting-labels.ts +32 -0
- package/src/account/email-change-setting.tsx +17 -36
- package/src/{components → account}/passkeys-setting.tsx +14 -9
- package/src/account/sessions-setting-labels.ts +24 -0
- package/src/account/sessions-setting.tsx +14 -28
- package/src/admin/admin-action-confirm-labels.ts +19 -0
- package/src/admin/admin-action-confirm.tsx +59 -38
- package/src/admin/admin-action-log-labels.ts +74 -0
- package/src/admin/admin-action-log.tsx +180 -54
- package/src/admin/admin-parts.ts +0 -7
- package/src/admin/invitations-panel-labels.ts +31 -0
- package/src/admin/invitations-panel.tsx +16 -34
- package/src/admin/plan-change-labels.ts +23 -0
- package/src/admin/plan-change.tsx +58 -34
- package/src/admin/reviewer-scope-editor-labels.ts +16 -0
- package/src/admin/reviewer-scope-editor.tsx +9 -15
- package/src/admin/role-select-labels.ts +16 -0
- package/src/admin/role-select.tsx +13 -23
- package/src/admin/transfer-ownership-dialog-labels.ts +20 -0
- package/src/admin/transfer-ownership-dialog.tsx +7 -17
- package/src/admin/user-roster-labels.ts +17 -0
- package/src/admin/user-roster.tsx +9 -17
- package/src/auth/accept-invitation-labels.ts +21 -0
- package/src/auth/accept-invitation.tsx +9 -20
- package/src/auth/auth-errors.ts +29 -13
- package/src/auth/complete-name-dialog-labels.ts +16 -0
- package/src/auth/complete-name-dialog.tsx +8 -13
- package/src/auth/forgot-password-form-labels.ts +20 -0
- package/src/auth/forgot-password-form.tsx +12 -20
- package/src/auth/new-password-fields.tsx +1 -1
- package/src/auth/not-found-page-labels.ts +12 -0
- package/src/auth/not-found-page.tsx +11 -14
- package/src/auth/register-form-labels.ts +31 -0
- package/src/auth/register-form.tsx +18 -38
- package/src/auth/reset-password-form-labels.ts +27 -0
- package/src/auth/reset-password-form.tsx +12 -27
- package/src/auth/sign-in-form-labels.ts +44 -0
- package/src/auth/sign-in-form.tsx +18 -51
- package/src/auth/status-parts.tsx +3 -3
- package/src/auth/verify-email-labels.ts +26 -0
- package/src/auth/verify-email.tsx +15 -30
- package/src/billing/billing-banner.tsx +2 -1
- package/src/billing/billing-labels.ts +1 -1
- package/src/billing/checkout-processing.ts +2 -12
- package/src/billing/plan-card.tsx +26 -27
- package/src/billing/plan-limit-notice.tsx +1 -1
- package/src/billing/subscription-actions.tsx +4 -4
- package/src/chart.ts +7 -1
- package/src/components/account-chips-labels.ts +16 -0
- package/src/components/account-chips.tsx +13 -16
- package/src/components/alert-banner.tsx +39 -19
- package/src/components/amount-input.tsx +461 -405
- package/src/components/appearance-labels.ts +2 -2
- package/src/components/authed-image-labels.ts +11 -0
- package/src/components/authed-image.tsx +6 -8
- package/src/components/autocomplete.tsx +79 -78
- package/src/components/breadcrumbs-labels.ts +10 -0
- package/src/components/breadcrumbs.tsx +17 -14
- package/src/components/bulk-action-bar-labels.ts +11 -0
- package/src/components/bulk-action-bar.tsx +15 -16
- package/src/components/button-group.tsx +7 -7
- package/src/components/button-look.ts +230 -0
- package/src/components/button.tsx +339 -0
- package/src/components/calculator.tsx +18 -11
- package/src/components/calendar-heatmap-labels.ts +15 -0
- package/src/components/calendar-heatmap.tsx +13 -19
- package/src/components/card.tsx +381 -0
- package/src/components/chart-zoom-core.tsx +653 -0
- package/src/components/chart-zoom.tsx +64 -648
- package/src/components/chart.tsx +11 -11
- package/src/components/checkbox-group.tsx +13 -10
- package/src/components/checkbox.tsx +43 -42
- package/src/components/chip-input.tsx +377 -0
- package/src/components/chip-labels.ts +13 -0
- package/src/components/chip.tsx +115 -711
- package/src/components/choice-card.tsx +83 -85
- package/src/components/column-mapper-labels.ts +45 -0
- package/src/components/column-mapper.tsx +16 -51
- package/src/components/combobox-core.tsx +346 -194
- package/src/components/combobox-suggestions.tsx +129 -0
- package/src/components/combobox.tsx +69 -895
- package/src/components/confirm-dialog-labels.ts +13 -0
- package/src/components/confirm-dialog.tsx +4 -8
- package/src/components/copy-button-labels.ts +13 -0
- package/src/components/copy-button.tsx +10 -12
- package/src/components/country-select-labels.ts +11 -0
- package/src/components/country-select.tsx +74 -89
- package/src/components/currency-option-list.tsx +216 -0
- package/src/components/currency-select.tsx +85 -196
- package/src/components/danger-confirm-labels.ts +20 -0
- package/src/components/danger-confirm.tsx +69 -77
- package/src/components/data-table-cells.tsx +5 -5
- package/src/components/data-table-column-settings.tsx +137 -0
- package/src/components/data-table-filter-popover.tsx +49 -24
- package/src/components/data-table-filters.ts +48 -11
- package/src/components/data-table-head.tsx +258 -0
- package/src/components/data-table-labels.ts +43 -11
- package/src/components/data-table-mobile.tsx +594 -0
- package/src/components/data-table-pagination.tsx +11 -10
- package/src/components/data-table-resize.ts +187 -0
- package/src/components/data-table-row-actions.tsx +152 -0
- package/src/components/data-table-selection.ts +55 -0
- package/src/components/data-table-shared.tsx +172 -0
- package/src/components/data-table.tsx +178 -1300
- package/src/components/date-field.tsx +627 -0
- package/src/components/date-picker.tsx +58 -1446
- package/src/components/date-range-picker.tsx +490 -0
- package/src/components/description-list-labels.ts +9 -0
- package/src/components/description-list.tsx +31 -15
- package/src/components/dialog-frame-labels.ts +7 -0
- package/src/components/dialog-frame.tsx +8 -6
- package/src/components/disclosure.tsx +14 -14
- package/src/components/dropdown.tsx +102 -40
- package/src/components/empty-state.tsx +137 -0
- package/src/components/entity-combobox.tsx +17 -12
- package/src/components/error-boundary-labels.ts +20 -0
- package/src/components/error-boundary.tsx +10 -20
- package/src/components/facing-pair.ts +1 -1
- package/src/components/field-base.tsx +615 -0
- package/src/components/field-parts.tsx +206 -77
- package/src/components/field-strip.tsx +16 -21
- package/src/components/field-sync-labels.ts +13 -0
- package/src/components/field-sync.tsx +11 -12
- package/src/components/field.tsx +13 -11
- package/src/components/file-button.tsx +64 -412
- package/src/components/file-dropzone.tsx +36 -33
- package/src/components/floating-panel-labels.ts +10 -0
- package/src/components/floating-panel.tsx +32 -21
- package/src/components/focus-ring.ts +9 -4
- package/src/components/form-actions-labels.ts +11 -0
- package/src/components/form-actions.tsx +17 -21
- package/src/components/full-bleed-dialog.tsx +27 -25
- package/src/components/grouped-picker.tsx +118 -96
- package/src/components/help-popover.tsx +115 -0
- package/src/components/hover-menu.tsx +46 -35
- package/src/components/iban-input-labels.ts +15 -0
- package/src/components/iban-input.tsx +25 -20
- package/src/components/icon-button.tsx +945 -0
- package/src/components/icon-picker-labels.ts +13 -0
- package/src/components/icon-picker.tsx +27 -24
- package/src/components/image-grid-labels.ts +11 -0
- package/src/components/image-grid.tsx +13 -15
- package/src/components/inline-edit-field-labels.ts +11 -0
- package/src/components/inline-edit-field.tsx +20 -19
- package/src/components/inline-entity-combobox.tsx +789 -0
- package/src/components/input.tsx +380 -0
- package/src/components/jump-calendar.tsx +385 -0
- package/src/components/language-select.tsx +31 -16
- package/src/components/legal-labels.ts +99 -0
- package/src/components/legal-page.tsx +2 -2
- package/src/components/legal.tsx +11 -101
- package/src/components/lightbox-labels.ts +18 -0
- package/src/components/lightbox.tsx +13 -21
- package/src/components/line-items-labels.ts +14 -0
- package/src/components/line-items.tsx +24 -31
- package/src/components/list-labels.ts +10 -0
- package/src/components/list.tsx +98 -75
- package/src/components/loading-state.tsx +4 -4
- package/src/components/measured-grid-labels.ts +25 -0
- package/src/components/measured-grid.tsx +39 -62
- package/src/components/menu-item.tsx +29 -26
- package/src/components/mini-calendar-labels.ts +17 -0
- package/src/components/mini-calendar.tsx +38 -45
- package/src/components/modal.tsx +31 -18
- package/src/components/money-draft.ts +72 -0
- package/src/components/money-field.tsx +16 -30
- package/src/components/month-picker-labels.ts +22 -0
- package/src/components/month-picker.tsx +59 -45
- package/src/components/multi-entity-combobox.tsx +17 -12
- package/src/components/multi-select.tsx +313 -288
- package/src/components/nav-pills.tsx +19 -8
- package/src/components/number-field.tsx +7 -5
- package/src/components/number-input.tsx +72 -97
- package/src/components/numeric-field.ts +161 -0
- package/src/components/numpad-sheet.tsx +16 -16
- package/src/components/one-time-code-input.tsx +154 -169
- package/src/components/page-contents-labels.ts +9 -0
- package/src/components/page-contents.tsx +15 -15
- package/src/components/page-header.tsx +9 -5
- package/src/components/password-strength-labels.ts +23 -0
- package/src/components/password-strength.tsx +13 -27
- package/src/components/phone-input-labels.ts +10 -0
- package/src/components/phone-input.tsx +42 -57
- package/src/components/picker-sheet.tsx +47 -18
- package/src/components/pie-chart.tsx +11 -9
- package/src/components/popover-labels.ts +14 -0
- package/src/components/popover.tsx +34 -37
- package/src/components/progress-bar-labels.ts +10 -0
- package/src/components/progress-bar.tsx +32 -23
- package/src/components/qr-code.tsx +2 -2
- package/src/components/reauth-dialog-labels.ts +13 -0
- package/src/components/reauth-dialog.tsx +7 -10
- package/src/components/row-actions-labels.ts +10 -0
- package/src/components/row-actions.tsx +11 -10
- package/src/components/scroll-area.tsx +4 -10
- package/src/components/search-field.tsx +35 -49
- package/src/components/select.tsx +302 -0
- package/src/components/separator.tsx +2 -2
- package/src/components/series-chart-axes.ts +329 -0
- package/src/components/series-chart-thin.ts +180 -0
- package/src/components/series-chart.tsx +124 -325
- package/src/components/server-wake-labels.ts +11 -0
- package/src/components/server-wake.tsx +42 -63
- package/src/components/settings-fields.tsx +46 -17
- package/src/components/share-card-labels.ts +30 -0
- package/src/components/share-card.tsx +22 -37
- package/src/components/sign-chip-labels.ts +12 -0
- package/src/components/sign-chip.tsx +6 -9
- package/src/components/signature-pad-labels.ts +24 -0
- package/src/components/signature-pad.tsx +48 -57
- package/src/components/signed-amount-labels.ts +10 -0
- package/src/components/signed-amount.tsx +21 -22
- package/src/components/skeleton.tsx +1 -1
- package/src/components/slider.tsx +51 -39
- package/src/components/sparkline-labels.ts +14 -0
- package/src/components/sparkline.tsx +16 -21
- package/src/components/spinner.tsx +81 -0
- package/src/components/stat-tile-labels.ts +15 -0
- package/src/components/stat-tile.tsx +32 -37
- package/src/components/status-dot.tsx +17 -14
- package/src/components/swatch-picker-labels.ts +10 -0
- package/src/components/swatch-picker.tsx +23 -16
- package/src/components/swipeable-row.tsx +7 -7
- package/src/components/switch.tsx +33 -32
- package/src/components/table.tsx +15 -15
- package/src/components/tabs.tsx +660 -0
- package/src/components/text-link.tsx +7 -7
- package/src/components/text.tsx +10 -6
- package/src/components/textarea.tsx +323 -0
- package/src/components/tile-radio.tsx +6 -6
- package/src/components/time-input.tsx +15 -7
- package/src/components/toast-labels.ts +12 -0
- package/src/components/toast.tsx +5 -8
- package/src/components/toggle-group.tsx +105 -42
- package/src/components/toggle-legend.tsx +6 -6
- package/src/components/tooltip.tsx +10 -21
- package/src/components/translation-review-editor.tsx +8 -7
- package/src/components/translation-review-parts.tsx +9 -13
- package/src/components/translation-review.tsx +26 -14
- package/src/components/tree-view.tsx +14 -12
- package/src/components/ui-labels.ts +22 -0
- package/src/components/user-avatar.tsx +3 -3
- package/src/components/wizard-stepper.tsx +10 -5
- package/src/components/write-lock-labels.ts +9 -0
- package/src/components/write-lock.tsx +10 -12
- package/src/data-table.ts +4 -0
- package/src/demo/demo-banner.tsx +9 -25
- package/src/demo/demo-ended.tsx +8 -7
- package/src/demo/demo-labels.ts +2 -2
- package/src/demo/demo-start.tsx +7 -5
- package/src/feedback/feedback-attachment-labels.ts +36 -0
- package/src/feedback/feedback-attachment.tsx +42 -66
- package/src/feedback/feedback-context-labels.ts +10 -0
- package/src/feedback/feedback-context.tsx +8 -9
- package/src/feedback/feedback-dialog-labels.ts +28 -0
- package/src/feedback/feedback-dialog.tsx +14 -44
- package/src/feedback/feedback-inbox.tsx +49 -252
- package/src/feedback/feedback-labels.ts +5 -5
- package/src/feedback/feedback-menu-labels.ts +11 -0
- package/src/feedback/feedback-menu.tsx +13 -11
- package/src/feedback/feedback-record.ts +21 -7
- package/src/feedback/feedback-row-detail-labels.ts +33 -0
- package/src/feedback/feedback-row-detail.tsx +30 -43
- package/src/feedback/feedback-status-undo.ts +3 -2
- package/src/feedback/feedback-submit-dialog.tsx +109 -0
- package/src/feedback/feedback-submit.tsx +45 -55
- package/src/feedback/feedback-swipe.tsx +1 -1
- package/src/feedback/feedback-table-labels.ts +27 -0
- package/src/feedback/feedback-table.tsx +24 -40
- package/src/feedback/feedback-thread-labels.ts +22 -0
- package/src/feedback/feedback-thread.tsx +48 -47
- package/src/feedback/feedback-vocabulary.ts +252 -0
- package/src/hooks/use-anchored-panel.ts +102 -2
- package/src/hooks/use-anchored-rect.ts +11 -9
- package/src/hooks/use-authed-src.ts +13 -7
- package/src/hooks/use-breakpoint.ts +5 -4
- package/src/hooks/use-close-transition.ts +9 -10
- package/src/hooks/use-debounce.ts +9 -0
- package/src/hooks/use-dismiss.ts +176 -19
- package/src/hooks/use-file-drop.ts +2 -2
- package/src/hooks/use-file-picker-labels.ts +29 -0
- package/src/hooks/use-file-picker.tsx +363 -0
- package/src/hooks/use-focus-trap.ts +19 -6
- package/src/i18n/defaults.ts +91 -82
- package/src/i18n/german.ts +50 -6
- package/src/i18n/kit-labels.tsx +70 -119
- package/src/i18n/locales/en.ts +46 -0
- package/src/i18n/locales/es.ts +50 -6
- package/src/i18n/locales/fr.ts +52 -7
- package/src/i18n/locales/hu.ts +50 -6
- package/src/i18n/locales/it.ts +51 -6
- package/src/i18n/locales/zh.ts +49 -6
- package/src/i18n/review.ts +4 -0
- package/src/i18n/shared-labels.ts +135 -0
- package/src/index.ts +412 -404
- package/src/landing/access.ts +2 -1
- package/src/landing/landing-actions.tsx +6 -5
- package/src/landing/landing-labels.ts +2 -2
- package/src/landing/landing-sections.tsx +24 -23
- package/src/landing/public-header.tsx +3 -2
- package/src/landing/routing.tsx +2 -7
- package/src/lib/chip-edge-snap.ts +212 -0
- package/src/lib/cn.ts +13 -1
- package/src/lib/dates.ts +4 -2
- package/src/lib/decimal-marks.ts +4 -2
- package/src/lib/download.ts +172 -0
- package/src/lib/floating-stack.ts +5 -1
- package/src/lib/format.ts +5 -3
- package/src/lib/ime.ts +24 -0
- package/src/lib/presence.ts +18 -0
- package/src/lib/reduced-motion.ts +21 -0
- package/src/lib/round.ts +38 -0
- package/src/lib/safe-storage.ts +35 -11
- package/src/lib/session-refresh.ts +473 -0
- package/src/lib/text-match.ts +60 -0
- package/src/lib/translation-review.ts +7 -6
- package/src/rhf/fields.tsx +131 -179
- package/src/rhf/form-core.tsx +327 -0
- package/src/rhf/form.tsx +46 -321
- package/src/rhf/line-items.tsx +1 -1
- package/src/rhf.ts +3 -2
- package/src/search/command-palette-labels.ts +16 -0
- package/src/search/command-palette.tsx +37 -50
- package/src/search/global-search-labels.ts +13 -0
- package/src/search/global-search.tsx +50 -24
- package/src/search/search-index.ts +5 -6
- package/src/search/use-command-key.ts +22 -0
- package/src/settings/settings-card-classes.ts +11 -0
- package/src/settings/settings-heading.tsx +1 -1
- package/src/settings/settings-labels.ts +2 -2
- package/src/settings/settings-layout.tsx +65 -6
- package/src/settings/settings-section.tsx +5 -5
- package/src/settings/use-settings-focus.ts +2 -5
- package/src/shell/app-shell-labels.ts +10 -0
- package/src/shell/app-shell.tsx +79 -53
- package/src/shell/auth-layout.tsx +11 -10
- package/src/shell/company-switcher-labels.ts +13 -0
- package/src/shell/company-switcher.tsx +7 -11
- package/src/shell/option-switcher-menu.tsx +25 -6
- package/src/shell/role-switcher.tsx +7 -3
- package/src/shell/top-bar-brand.tsx +1 -1
- package/src/shell/top-bar.tsx +6 -5
- package/src/shell/topbar-action-menu.tsx +39 -20
- package/src/shell/topbar-controls.tsx +24 -12
- package/src/shell.ts +1 -1
- package/src/testing/index.ts +11 -0
- package/src/testing/viewport.ts +251 -0
- package/src/theme/color.ts +7 -1
- package/src/theme/palette-derive.ts +29 -7
- package/src/theme/palette-presets.ts +81 -68
- package/src/tour/tour-labels.ts +14 -0
- package/src/tour/tour.tsx +13 -23
- package/src/wizard/stepper-nav.tsx +19 -18
- package/src/wizard/types.ts +7 -22
- package/src/wizard/wizard-labels.ts +29 -0
- package/src/wizard/wizard-step.tsx +2 -2
- package/src/wizard/wizard-summary.tsx +8 -7
- package/tokens.css +45 -14
- package/dist/components/account-settings-labels.js.map +0 -1
- package/dist/components/account-settings.js.map +0 -1
- package/dist/components/choice-parts.d.ts +0 -24
- package/dist/components/choice-parts.js +0 -18
- package/dist/components/choice-parts.js.map +0 -1
- package/dist/components/passkeys-setting.js.map +0 -1
- package/dist/components/ui.d.ts +0 -101
- package/dist/components/ui.js +0 -1955
- package/dist/components/ui.js.map +0 -1
- package/dist/data-table-labels-BJ5JE_X2.d.ts +0 -923
- package/dist/delete-account-setting-DAgGBrbn.d.ts +0 -8167
- package/src/components/choice-parts.ts +0 -33
- package/src/components/ui.tsx +0 -4233
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/chart-zoom.tsx"],"sourcesContent":["// Drag-to-zoom for cartesian charts — the HOC, the shared x window, and the arithmetic.\n// Lifted out of lenkbank, where every plot in the app is one `SeriesChart` and zoom is\n// therefore wired in exactly once.\n//\n// **Which axes a drag zooms is read off the drag itself.** A selection that is roughly\n// square is a box: the reader framed a REGION and means both axes. A long thin one is a\n// band, and its own direction says which: a wide flat drag means \"this stretch of the\n// abscissa\", a tall narrow one \"this range of values\". Asking with a modifier key\n// instead would be asking people to remember a convention for something they have\n// already drawn.\n//\n// Squareness is measured **in fractions of the plot**, not pixels. These charts are\n// three times wider than they are tall, so a pixel-square selection is a very wide\n// slice of the data and would read as a band to anybody looking at it.\n//\n// The zoom is VIEW state and lives here, never in a query or a store: it is where\n// somebody is looking, and a chart whose data reloads should not lose it. It is cleared\n// by the reset button, by a double click, and by nothing else.\n//\n// Everything with a decision in it is a pure exported function below (`zoomAxesFor`,\n// `selectionFromDrag`, `zoomAfter`, `zoomDomains`, `fitYToX`, `fitXToY`); the\n// components are plumbing between a pointer and those.\nimport { createContext, useContext, useEffect, useRef, useState } from \"react\";\nimport type { ComponentType, Dispatch, ReactNode, SetStateAction } from \"react\";\nimport {\n usePlotArea,\n useXAxisInverseScale,\n useYAxisInverseScale,\n type InverseScaleFunction,\n} from \"recharts\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { FOCUS_RING } from \"./focus-ring\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { DEFAULT_SERIES_CHART_LABELS, type SeriesChartLabels } from \"./series-chart-labels\";\n\n/** The y axis a series lands on when it names none — the single shared scale most\n * charts have. `SeriesChart` and the fit below agree on it by importing this. */\nexport const DEFAULT_Y_AXIS = \"y\";\n\n/* ── The arithmetic ─────────────────────────────────────────────────────── */\n\n/**\n * How square a selection has to be before it counts as a box: the shorter side\n * against the longer, both as fractions of the plot. At 0.5 a selection twice as wide\n * as it is tall is still a box and one three times as wide is a band.\n */\nexport const ZOOM_SQUARE_ENOUGH = 0.5;\n\n/** Below this a drag is a click that moved, not a selection. In fractions of the plot,\n * so it is the same gesture on a phone and on a wall display. */\nexport const ZOOM_MIN_DRAG = 0.02;\n\nexport type ZoomAxes = \"both\" | \"x\" | \"y\";\n\n/** Which axes a drag zooms — or `null` for a drag too small to mean one, or a plot\n * that has not been laid out yet. Direction does not matter; proportion does. */\nexport function zoomAxesFor(\n dx: number,\n dy: number,\n width: number,\n height: number,\n threshold: number = ZOOM_SQUARE_ENOUGH,\n /** A chart that zooms ONE axis only (see {@link ZoomTarget.zoomAxes}): every drag is\n * a band along it, however it was drawn, and a drag with no extent along it is\n * nothing — a tall narrow drag over a bar chart names no stretch of the abscissa. */\n only?: \"x\" | \"y\",\n): ZoomAxes | null {\n if (!(width > 0) || !(height > 0)) return null;\n const across = Math.abs(dx) / width;\n const down = Math.abs(dy) / height;\n if (only === \"x\") return across < ZOOM_MIN_DRAG ? null : \"x\";\n if (only === \"y\") return down < ZOOM_MIN_DRAG ? null : \"y\";\n if (across < ZOOM_MIN_DRAG && down < ZOOM_MIN_DRAG) return null;\n const longer = Math.max(across, down);\n const shorter = Math.min(across, down);\n if (shorter / longer >= threshold) return \"both\";\n return across > down ? \"x\" : \"y\";\n}\n\n/** What a drag chose, in DATA coordinates, and which axes it actually named — the\n * caller needs the second to know which of the two it may derive from the other. */\nexport interface ZoomSelection {\n which: ZoomAxes;\n x?: [number, number];\n /** One window per y axis, keyed by axis id: they are in different units. */\n y: Record<string, [number, number]>;\n}\n\n/** A drag, in the chart's own pixel coordinates. */\nexport interface ZoomDrag {\n fromX: number;\n fromY: number;\n toX: number;\n toY: number;\n}\n\n/** A pair as a domain, smallest first. Recharts wants an ascending domain whichever\n * way the drag went, and a y axis counts downward in pixels while its values count\n * upward — so both ends are read and sorted rather than one assumed to be low. */\nfunction ordered(a: number, b: number): [number, number] {\n return a <= b ? [a, b] : [b, a];\n}\n\n/**\n * A finished drag as a selection, or `null` when it selects nothing.\n *\n * `xInverse` and `yInverse(axisId)` are recharts' pixel→value functions; an axis whose\n * function is missing, or whose ends come back non-finite, is left out rather than\n * handed a NaN window.\n */\nexport function selectionFromDrag(\n drag: ZoomDrag,\n plot: { width: number; height: number },\n xInverse: InverseScaleFunction | undefined,\n yInverse: (axisId: string) => InverseScaleFunction | undefined,\n axisIds: readonly string[],\n only?: \"x\" | \"y\",\n): ZoomSelection | null {\n const which = zoomAxesFor(\n drag.toX - drag.fromX,\n drag.toY - drag.fromY,\n plot.width,\n plot.height,\n ZOOM_SQUARE_ENOUGH,\n only,\n );\n if (!which) return null;\n const next: ZoomSelection = { which, y: {} };\n if (which !== \"y\" && xInverse) {\n const from = Number(xInverse(drag.fromX));\n const to = Number(xInverse(drag.toX));\n if (Number.isFinite(from) && Number.isFinite(to)) next.x = ordered(from, to);\n }\n if (which !== \"x\") {\n for (const id of axisIds) {\n const inverse = yInverse(id);\n if (!inverse) continue;\n const from = Number(inverse(drag.fromY));\n const to = Number(inverse(drag.toY));\n if (Number.isFinite(from) && Number.isFinite(to)) next.y[id] = ordered(from, to);\n }\n }\n return next.x || Object.keys(next.y).length ? next : null;\n}\n\n/** One row of a zoomable chart. Loose on purpose: a row also carries what the chart\n * does not plot — keksdose's `rawPeriod` for a drilldown, a label for a category axis —\n * and only the finite NUMBERS in it are ever read as samples. */\nexport type ZoomRow = Readonly<Record<string, unknown>>;\n\n/** A series as the fit sees it. `stack` groups bars/areas drawn on top of each other\n * (recharts' `stackId`), whose extent is their SUM, not any one of them. */\nexport interface ZoomFitSeries {\n key: string;\n axis?: string;\n stack?: string;\n /** Only `\"line\"` matters here: recharts cannot stack a line, so a line's `stack` is\n * ignored rather than summed into a height nothing on the chart reaches. */\n type?: string;\n}\n\n/** What a band refit needs to know about the chart — a subset of `SeriesChart`'s own\n * props, so a chart hands its data straight over. */\nexport interface ZoomFitSource {\n rows: readonly ZoomRow[];\n series: readonly ZoomFitSeries[];\n axes: readonly { id: string }[];\n xKey: string;\n}\n\n/** How much of a refitted span to leave as air, top and bottom. Without it the\n * highest sample sits exactly on the frame, where a line is half drawn and reads as\n * clipped rather than as the maximum. */\nconst FIT_AIR = 0.05;\n\n/** A span with air around it — and a real span for a flat channel, which would\n * otherwise be a zero-height window recharts cannot scale. */\nfunction airy(low: number, high: number): [number, number] {\n const span = high - low;\n const air = span > 0 ? span * FIT_AIR : Math.max(Math.abs(high), 1) * FIT_AIR;\n return [low - air, high + air];\n}\n\n/** A running low/high pair. A pair rather than an array to take `Math.min(...)` of:\n * the spread passes one argument per sample, and V8 faults past ~125,000 of them. */\ntype Span = [number, number] | undefined;\n\n/** A pair widened by one value. A non-finite one is not a value — one NaN would\n * otherwise take the whole window with it. */\nfunction widen(span: Span, value: unknown): Span {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return span;\n if (!span) return [value, value];\n if (value < span[0]) span[0] = value;\n else if (value > span[1]) span[1] = value;\n return span;\n}\n\n/** Which series are measured on an axis. */\nfunction keysOn(source: ZoomFitSource, axisId: string): string[] {\n return source.series\n .filter((entry) => (entry.axis ?? DEFAULT_Y_AXIS) === axisId)\n .map((entry) => entry.key);\n}\n\n/** A row's value as a sample, or 0 for a stack's missing layer — a stacked bar with no\n * value for one series draws the rest of the stack from where that one would end. */\nconst layer = (value: unknown) => (typeof value === \"number\" && Number.isFinite(value) ? value : 0);\n\n/**\n * The lowest and highest value an axis DRAWS over the rows whose abscissa is inside\n * `window` (every row when there is none) — `undefined` when it draws nothing finite.\n *\n * Stack-aware, and that is why it exists: a stack of three bars reaches the SUM of\n * them, and fitting the axis to the tallest single layer (what fitting on values did)\n * cuts the top two thirds of every stack off. Positive and negative layers are summed\n * apart, as recharts draws them under `stackOffset=\"sign\"` — a month with 900 income\n * and −300 expense stacks up to 900 and down to −300, not to 600. A stacked extent\n * therefore always contains the zero its layers stand on.\n *\n * `SeriesChart` fits its axes with this and the zoom refits them with it, so the two\n * cannot disagree about how tall a stack is.\n */\nexport function axisExtent(\n source: ZoomFitSource,\n axisId: string,\n window?: readonly [number, number],\n): [number, number] | undefined {\n const mine = source.series.filter((entry) => (entry.axis ?? DEFAULT_Y_AXIS) === axisId);\n const loose: string[] = [];\n const stacks = new Map<string, string[]>();\n for (const entry of mine) {\n if (entry.stack === undefined || entry.type === \"line\" || entry.type === undefined) {\n loose.push(entry.key);\n } else {\n stacks.set(entry.stack, [...(stacks.get(entry.stack) ?? []), entry.key]);\n }\n }\n let span: Span;\n for (const row of source.rows) {\n if (window) {\n const at = row[source.xKey];\n if (typeof at !== \"number\" || !(at >= window[0] && at <= window[1])) continue;\n }\n for (const key of loose) span = widen(span, row[key]);\n for (const keys of stacks.values()) {\n let up = 0;\n let down = 0;\n let any = false;\n for (const key of keys) {\n const value = layer(row[key]);\n any ||= typeof row[key] === \"number\" && Number.isFinite(row[key]);\n if (value >= 0) up += value;\n else down += value;\n }\n if (!any) continue;\n span = widen(widen(span, down), up);\n }\n }\n return span;\n}\n\n/**\n * Each y axis fitted to the samples inside an x window — what a band across x leaves\n * the axes nobody dragged showing. Zoom into a tenth of a sweep and a y axis still\n * scaled to the whole run draws that tenth as a flat line, which is the one thing the\n * zoom was for; so the unnamed axes are refitted, which is what \"zoom\" means everywhere\n * else.\n *\n * An axis with nothing inside the window is left OUT rather than collapsed: a window\n * between two samples is one where the chart should keep drawing the line across.\n */\nexport function fitYToX(\n source: ZoomFitSource,\n window: readonly [number, number],\n): Record<string, [number, number]> {\n const fitted: Record<string, [number, number]> = {};\n for (const axis of source.axes) {\n const span = axisExtent(source, axis.id, window);\n if (span) fitted[axis.id] = airy(span[0], span[1]);\n }\n return fitted;\n}\n\n/**\n * The x window that holds every sample inside a set of y windows — the other direction\n * of the same idea. A channel crossing its band once gives a tight window; one that\n * oscillates through it gives back most of the sweep, which is the truthful answer.\n * `undefined` when no sample qualifies, rather than a guess.\n */\nexport function fitXToY(\n source: ZoomFitSource,\n windows: Readonly<Record<string, readonly [number, number]>>,\n): [number, number] | undefined {\n let hits: Span;\n for (const [axisId, [low, high]] of Object.entries(windows)) {\n for (const key of keysOn(source, axisId)) {\n for (const row of source.rows) {\n const value = row[key];\n if (typeof value === \"number\" && Number.isFinite(value) && value >= low && value <= high) {\n hits = widen(hits, row[source.xKey]);\n }\n }\n }\n }\n return hits ? airy(hits[0], hits[1]) : undefined;\n}\n\n/**\n * What a chart remembers about its zoom: the x window, and the y windows the reader\n * DRAGGED. `y: null` means \"derive y from x\" — the split is the whole design: what was\n * dragged is kept, and what follows from it is recomputed on every render, so a band\n * across x refits y here and in every chart sharing the window.\n */\nexport interface ZoomState {\n x?: [number, number];\n y: Record<string, [number, number]> | null;\n}\n\nexport const NO_ZOOM: ZoomState = { x: undefined, y: null };\n\n/**\n * The state after a selection. Two band drags COMPOSE rather than the second undoing\n * the first: a band down y keeps the x window when the band holds no samples, and\n * otherwise pulls x in to where they are.\n */\nexport function zoomAfter(\n state: ZoomState,\n selection: ZoomSelection,\n source: ZoomFitSource,\n): ZoomState {\n if (selection.which === \"both\") return { x: selection.x, y: selection.y };\n // Leave y derived, so it fits itself to what is inside the new window.\n if (selection.which === \"x\") return { x: selection.x, y: null };\n return { x: fitXToY(source, selection.y) ?? state.x, y: selection.y };\n}\n\n/** The domains a chart draws for a state: the x window as is, and each y axis either\n * as dragged or fitted to the x window. `{}` means \"fit your own data\". */\nexport function zoomDomains(\n state: ZoomState,\n source: ZoomFitSource,\n): { xDomain?: [number, number]; yDomains: Record<string, [number, number]> } {\n return {\n xDomain: state.x,\n yDomains: state.y ?? (state.x ? fitYToX(source, state.x) : {}),\n };\n}\n\n/* ── The components ─────────────────────────────────────────────────────── */\n\n/** What the wrapped chart is handed. It applies the domains to its own axes and renders\n * `layer` INSIDE the recharts chart, where recharts' hooks answer. */\nexport interface ZoomBinding {\n xDomain?: [number, number];\n yDomains: Record<string, [number, number]>;\n layer: ReactNode;\n}\n\n/**\n * Which axes a chart lets a drag zoom. `\"none\"` draws no drag layer and no reset.\n * A drag on a one-axis chart is always a band along that axis (see {@link zoomAxesFor}).\n */\nexport type ZoomAxesSetting = ZoomAxes | \"none\";\n\n/**\n * The zoom a chart gets when it does not say, read off what its series ARE.\n *\n * - Only lines: `\"both\"` — lenkbank's measurement plots, unchanged.\n * - Any area: `\"x\"`. An area's height is a length from zero, and a y window that cuts\n * the baseline off draws a band of 40 as three times one of 20 — so its y axis refits\n * to the x window (still from zero), and a drag never names a y range.\n * - Any bar: `\"none\"`. A bar chart is a handful of periods read one bar at a time, and\n * in keksdose every one of them is CLICKED — to drill into a payee, a month, a budget\n * line — which a drag layer over the plot would swallow. A chart of many bars opts\n * back in with `zoomAxes: \"x\"`; a click then reports the period, not the bar.\n */\nexport function defaultZoomAxes(series: readonly { type?: string }[] | undefined): ZoomAxesSetting {\n if (series?.some((entry) => entry.type === \"bar\")) return \"none\";\n if (series?.some((entry) => entry.type === \"area\")) return \"x\";\n return \"both\";\n}\n\n/** The props `withChartZoom` reads off the chart it wraps. */\nexport interface ZoomTarget {\n /** Default: the single axis {@link DEFAULT_Y_AXIS}. */\n axes?: readonly { id: string; hide?: boolean }[];\n /** The chart's own data, so a band can refit the axis it did not name. Optional: a\n * chart with nothing plotted has nothing to fit to. */\n rows?: readonly ZoomRow[];\n series?: readonly ZoomFitSeries[];\n x?: { key?: string };\n zoom?: ZoomBinding;\n labels?: Partial<SeriesChartLabels>;\n /** Which axes a drag may zoom. Default: {@link defaultZoomAxes} of `series`. */\n zoomAxes?: ZoomAxesSetting;\n}\n\nconst SharedX = createContext<{\n window?: [number, number];\n set: Dispatch<SetStateAction<[number, number] | undefined>>;\n} | null>(null);\n\n/**\n * One x window for several charts.\n *\n * A column of charts over one abscissa is one picture, and zooming one of them and not\n * the rest turns it into several pictures of different things. Every zoomable chart\n * inside this shares the x window: any drag in any of them moves all of them.\n *\n * **Only x.** The y axes stay each chart's own — they are in different units — and\n * each refits its own y to what is inside the shared window.\n */\nexport function SharedXZoom({ children }: { children: ReactNode }) {\n const [window, set] = useState<[number, number] | undefined>(undefined);\n return <SharedX.Provider value={{ window, set }}>{children}</SharedX.Provider>;\n}\n\n/**\n * Wrap a chart in drag-to-zoom.\n *\n * The chart receives a `zoom` binding: it applies `xDomain`/`yDomains` to its axes\n * (with `allowDataOverflow`, so recharts clips to the window instead of widening it\n * back out) and renders `layer` as a child of its recharts chart. A reset button\n * appears over the chart's top end corner while it is zoomed — a real button, so the\n * keyboard can undo what the pointer did.\n */\nexport function withChartZoom<P extends ZoomTarget>(Chart: ComponentType<P>) {\n function Zoomable(props: P) {\n const labels = useKitLabels(\"seriesChart\", DEFAULT_SERIES_CHART_LABELS, props.labels);\n const group = useContext(SharedX);\n const [ownX, setOwnX] = useState<[number, number] | undefined>(undefined);\n const [ownY, setOwnY] = useState<Record<string, [number, number]> | null>(null);\n const xWindow = group ? group.window : ownX;\n const setXWindow = group ? group.set : setOwnX;\n const axes = props.axes ?? [{ id: DEFAULT_Y_AXIS }];\n const setting = props.zoomAxes ?? defaultZoomAxes(props.series);\n const only = setting === \"x\" || setting === \"y\" ? setting : undefined;\n\n // Every axis, hidden ones included: a hidden axis still scales its lines, and a\n // line whose axis did not refit is drawn as a flat streak inside the window.\n const source: ZoomFitSource = {\n rows: props.rows ?? [],\n series: [...(props.series ?? [])],\n axes: [...axes],\n xKey: props.x?.key ?? \"x\",\n };\n const state: ZoomState = { x: xWindow, y: ownY };\n const zoomed = xWindow !== undefined || ownY !== null;\n // A chart handed no rows or no series draws its empty state, not a plot — and a\n // \"Reset zoom\" floating over \"No data\" (every line toggled off while zoomed) offers\n // to undo something the reader cannot see. The zoom itself is KEPT: it is where they\n // were looking, and it applies again the moment a line comes back. Only an array\n // that is there and empty counts; a chart that does not pass its data is not known\n // to be empty.\n const empty = props.rows?.length === 0 || props.series?.length === 0;\n\n const clear = () => {\n setXWindow(undefined);\n setOwnY(null);\n };\n\n // Switched off, the chart still gets a binding — with no window and no layer — so a\n // chart whose series change type mid-life is not remounted by a different tree.\n if (setting === \"none\") {\n return (\n <div className=\"relative\">\n <Chart {...props} zoom={{ yDomains: {}, layer: null }} />\n </div>\n );\n }\n\n const binding: ZoomBinding = {\n ...zoomDomains(state, source),\n layer: (\n <ZoomLayer\n axisIds={axes.map((axis) => axis.id)}\n only={only}\n label={labels.zoomHint}\n onZoom={(selection) => {\n const next = zoomAfter(state, selection, source);\n if (next.x !== xWindow) setXWindow(next.x);\n setOwnY(next.y);\n }}\n onReset={clear}\n />\n ),\n };\n\n return (\n <div className=\"relative\">\n <Chart {...props} zoom={binding} />\n {zoomed && !empty && (\n <button\n type=\"button\"\n onClick={clear}\n className={cn(\n \"absolute end-1 top-1 z-10 inline-flex items-center gap-1 rounded border border-[var(--border)] bg-[var(--bg-surface)]/90 px-1.5 py-0.5 text-micro text-[var(--text-muted)] backdrop-blur transition-colors hover:text-[var(--text-primary)]\",\n FOCUS_RING,\n )}\n >\n <X aria-hidden className=\"size-3\" /> {labels.resetZoom}\n </button>\n )}\n </div>\n );\n }\n Zoomable.displayName = `withChartZoom(${Chart.displayName ?? Chart.name ?? \"Chart\"})`;\n return Zoomable;\n}\n\n/**\n * The part that lives INSIDE the recharts chart, where recharts will say where the plot\n * is and what value a pixel is.\n *\n * A transparent rectangle over the plot area that reads the drag. It does NOT stop the\n * event: recharts drives its tooltip from the same pointer move bubbling up to its own\n * wrapper, so swallowing it here would trade the tooltip for the zoom.\n */\nfunction ZoomLayer({\n axisIds,\n only,\n label,\n onZoom,\n onReset,\n}: {\n axisIds: string[];\n only?: \"x\" | \"y\";\n label: string;\n onZoom: (selection: ZoomSelection) => void;\n onReset: () => void;\n}) {\n const plot = usePlotArea();\n const xInverse = useXAxisInverseScale();\n // One probe COMPONENT per axis rather than a hook in a loop: the number of axes\n // changes as series are toggled, and a hook count that changes with the data is the\n // one thing React will not forgive.\n const [scales] = useState(() => new Map<string, InverseScaleFunction | undefined>());\n const [drag, setDrag] = useState<ZoomDrag | null>(null);\n // A finished drag is followed by a click on the same element, and a chart with an\n // `onClick` (keksdose opens a drilldown on one) would read the zoom as a pick.\n const draggedRef = useRef(false);\n\n if (!plot || plot.width <= 0 || plot.height <= 0) return null;\n\n const at = (event: { clientX: number; clientY: number; currentTarget: Element }) => {\n // Against the overlay's own screen box, so padding around the container cannot\n // shift every reading — plus the plot's offset, because the scales are in the\n // chart's coordinates rather than the plot's.\n const box = event.currentTarget.getBoundingClientRect();\n return { x: event.clientX - box.left + plot.x, y: event.clientY - box.top + plot.y };\n };\n\n const finish = () => {\n if (!drag) return;\n setDrag(null);\n const selection = selectionFromDrag(drag, plot, xInverse, (id) => scales.get(id), axisIds, only);\n draggedRef.current = selection !== null;\n if (selection) onZoom(selection);\n };\n\n // What the drag would do, shown while it is being made: a band paints the full width\n // or height, so the reader sees it is about to let the other axis refit.\n const which = drag\n ? zoomAxesFor(\n drag.toX - drag.fromX,\n drag.toY - drag.fromY,\n plot.width,\n plot.height,\n ZOOM_SQUARE_ENOUGH,\n only,\n )\n : null;\n\n return (\n <g>\n {axisIds.map((id) => (\n <AxisProbe key={id} axisId={id} scales={scales} />\n ))}\n {drag && which && (\n <rect\n x={which === \"y\" ? plot.x : Math.min(drag.fromX, drag.toX)}\n y={which === \"x\" ? plot.y : Math.min(drag.fromY, drag.toY)}\n width={which === \"y\" ? plot.width : Math.abs(drag.toX - drag.fromX)}\n height={which === \"x\" ? plot.height : Math.abs(drag.toY - drag.fromY)}\n className=\"fill-[var(--brand)]/15 stroke-[var(--brand)]\"\n strokeDasharray=\"4 3\"\n pointerEvents=\"none\"\n />\n )}\n <rect\n x={plot.x}\n y={plot.y}\n width={plot.width}\n height={plot.height}\n // `transparent`, not `none`: an unpainted shape takes no pointer events.\n fill=\"transparent\"\n role=\"application\"\n aria-label={label}\n style={{ cursor: \"crosshair\" }}\n onPointerDown={(event) => {\n if (event.button !== 0) return;\n draggedRef.current = false;\n const point = at(event);\n // Best effort: capture keeps a drag alive past the plot's edge, but a\n // pointer id the environment does not know throws — jsdom refuses them all —\n // and a zoom that threw on pointer-down would be a chart nobody could click.\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n /* the drag still works; it just stops at the edge of the plot */\n }\n setDrag({ fromX: point.x, fromY: point.y, toX: point.x, toY: point.y });\n }}\n onPointerMove={(event) => {\n if (!drag) return;\n const point = at(event);\n setDrag({ ...drag, toX: point.x, toY: point.y });\n }}\n onPointerUp={finish}\n onPointerCancel={() => setDrag(null)}\n onClick={(event) => {\n if (!draggedRef.current) return;\n draggedRef.current = false;\n event.stopPropagation();\n }}\n onDoubleClick={onReset}\n />\n </g>\n );\n}\n\n/** One axis's pixel→value function, parked where the pointer handler can reach it. */\nfunction AxisProbe({\n axisId,\n scales,\n}: {\n axisId: string;\n scales: Map<string, InverseScaleFunction | undefined>;\n}) {\n const inverse = useYAxisInverseScale(axisId);\n useEffect(() => {\n scales.set(axisId, inverse);\n return () => {\n scales.delete(axisId);\n };\n }, [axisId, inverse, scales]);\n return null;\n}\n"],"mappings":";AA+ZS,cA8EC,YA9ED;AAzYT,SAAS,eAAe,YAAY,WAAW,QAAQ,gBAAgB;AAEvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,SAAS;AAClB,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mCAA2D;AAI7D,MAAM,iBAAiB;AASvB,MAAM,qBAAqB;AAI3B,MAAM,gBAAgB;AAMtB,SAAS,YACd,IACA,IACA,OACA,QACA,YAAoB,o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MAAM,GAAG,KAAK,MAAM,GAAG,KAAK,MAAM,EAAE,CAAC;AAAA,QACxE;AAAA,QACA,eAAe,CAAC,UAAU;AACxB,cAAI,CAAC,KAAM;AACX,gBAAM,QAAQ,GAAG,KAAK;AACtB,kBAAQ,EAAE,GAAG,MAAM,KAAK,MAAM,GAAG,KAAK,MAAM,EAAE,CAAC;AAAA,QACjD;AAAA,QACA,aAAa;AAAA,QACb,iBAAiB,MAAM,QAAQ,IAAI;AAAA,QACnC,SAAS,CAAC,UAAU;AAClB,cAAI,CAAC,WAAW,QAAS;AACzB,qBAAW,UAAU;AACrB,gBAAM,gBAAgB;AAAA,QACxB;AAAA,QACA,eAAe;AAAA;AAAA,IACjB;AAAA,KACF;AAEJ;AAGA,SAAS,UAAU;AAAA,EACjB;AAAA,EACA;AACF,GAGG;AACD,QAAM,UAAU,qBAAqB,MAAM;AAC3C,YAAU,MAAM;AACd,WAAO,IAAI,QAAQ,OAAO;AAC1B,WAAO,MAAM;AACX,aAAO,OAAO,MAAM;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,MAAM,CAAC;AAC5B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/chart-zoom.tsx"],"sourcesContent":["// Drag-to-zoom for cartesian charts — the public face of ./chart-zoom-core, which holds\n// the HOC, the shared x window and the arithmetic (its header says how a drag picks its\n// axes). `SeriesChart` is how an app zooms; `SharedXZoom` gives a column of charts one x\n// window.\n//\n// 0.34 (refactor audit 2026-10, API-6b = MOD-10): the arithmetic and the HOC leave the\n// public surface in 0.35. They were exported because lenkbank's, later Kurvenschmiede's,\n// own tests used them; no file in any of the three apps names one today. The kit's own\n// modules import them from the core, so their removal is the block below.\nimport * as core from \"./chart-zoom-core\";\n\nexport { SharedXZoom } from \"./chart-zoom-core\";\nexport type {\n ZoomAxes,\n ZoomAxesSetting,\n ZoomBinding,\n ZoomDrag,\n ZoomFitSeries,\n ZoomFitSource,\n ZoomRow,\n ZoomSelection,\n ZoomState,\n ZoomTarget,\n} from \"./chart-zoom-core\";\n\n/* ── Deprecated 0.34, removed in 0.35 ─────────────────────────────────────\n * Each is the core's own value under its old public name: SeriesChart draws the zoom\n * these compute, and a chart's `zoomAxes` prop is what an app sets. */\n\n/** @deprecated 0.34 — a series without `axis` is on the chart's single y axis, `\"y\"`;\n * removed in 0.35 (API-6b). */\nexport const DEFAULT_Y_AXIS = core.DEFAULT_Y_AXIS;\n/** @deprecated 0.34 — SeriesChart's zoom, which reads it; removed in 0.35 (API-6b). */\nexport const ZOOM_SQUARE_ENOUGH = core.ZOOM_SQUARE_ENOUGH;\n/** @deprecated 0.34 — SeriesChart's zoom, which reads it; removed in 0.35 (API-6b). */\nexport const ZOOM_MIN_DRAG = core.ZOOM_MIN_DRAG;\n/** @deprecated 0.34 — SeriesChart's zoom, which reads a drag this way; removed in 0.35\n * (API-6b). */\nexport const zoomAxesFor = core.zoomAxesFor;\n/** @deprecated 0.34 — SeriesChart's zoom, which reads a drag this way; removed in 0.35\n * (API-6b). */\nexport const selectionFromDrag = core.selectionFromDrag;\n/** @deprecated 0.34 — SeriesChart fits its axes with it; removed in 0.35 (API-6b). */\nexport const axisExtent = core.axisExtent;\n/** @deprecated 0.34 — SeriesChart's zoom, which refits the axes a drag did not name;\n * removed in 0.35 (API-6b). */\nexport const fitYToX = core.fitYToX;\n/** @deprecated 0.34 — SeriesChart's zoom, which refits the axes a drag did not name;\n * removed in 0.35 (API-6b). */\nexport const fitXToY = core.fitXToY;\n/** @deprecated 0.34 — SeriesChart's zoom, which keeps its own state; removed in 0.35\n * (API-6b). */\nexport const NO_ZOOM = core.NO_ZOOM;\n/** @deprecated 0.34 — SeriesChart's zoom, which keeps its own state; removed in 0.35\n * (API-6b). */\nexport const zoomAfter = core.zoomAfter;\n/** @deprecated 0.34 — SeriesChart's zoom, which keeps its own state; removed in 0.35\n * (API-6b). */\nexport const zoomDomains = core.zoomDomains;\n/** @deprecated 0.34 — SeriesChart's `zoomAxes` prop, which says what its default is;\n * removed in 0.35 (API-6b). */\nexport const defaultZoomAxes = core.defaultZoomAxes;\n/** @deprecated 0.34 — SeriesChart, which is a chart wrapped in it, and SharedXZoom;\n * removed in 0.35 (API-6b). */\nexport const withChartZoom = core.withChartZoom;\n"],"mappings":";AASA,YAAY,UAAU;AAEtB,SAAS,mBAAmB;AAoBrB,MAAM,iBAAiB,KAAK;AAE5B,MAAM,qBAAqB,KAAK;AAEhC,MAAM,gBAAgB,KAAK;AAG3B,MAAM,cAAc,KAAK;AAGzB,MAAM,oBAAoB,KAAK;AAE/B,MAAM,aAAa,KAAK;AAGxB,MAAM,UAAU,KAAK;AAGrB,MAAM,UAAU,KAAK;AAGrB,MAAM,UAAU,KAAK;AAGrB,MAAM,YAAY,KAAK;AAGvB,MAAM,cAAc,KAAK;AAGzB,MAAM,kBAAkB,KAAK;AAG7B,MAAM,gBAAgB,KAAK;","names":[]}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ResponsiveContainer, Tooltip } from
|
|
3
|
-
|
|
4
|
-
import { ReactNode, ComponentProps, RefObject } from 'react';
|
|
5
|
-
|
|
6
|
-
interface ChartSeriesConfig {
|
|
1
|
+
import type { ComponentProps, ReactNode, RefObject } from "react";
|
|
2
|
+
import { ResponsiveContainer, Tooltip as RechartsTooltip } from "recharts";
|
|
3
|
+
export interface ChartSeriesConfig {
|
|
7
4
|
label: ReactNode;
|
|
8
5
|
color: string;
|
|
9
6
|
}
|
|
10
|
-
type ChartConfig = Record<string, ChartSeriesConfig>;
|
|
11
|
-
declare function useChart(): ChartConfig;
|
|
7
|
+
export type ChartConfig = Record<string, ChartSeriesConfig>;
|
|
8
|
+
export declare function useChart(): ChartConfig;
|
|
12
9
|
interface ChartContainerProps extends ComponentProps<"div"> {
|
|
13
10
|
config: ChartConfig;
|
|
14
11
|
children: ComponentProps<typeof ResponsiveContainer>["children"];
|
|
@@ -27,7 +24,7 @@ interface ChartContainerProps extends ComponentProps<"div"> {
|
|
|
27
24
|
* page's direction like any other markup. A consumer who does want a mirrored
|
|
28
25
|
* category axis passes `reversed` on its own `XAxis`.
|
|
29
26
|
*/
|
|
30
|
-
declare function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps): react.JSX.Element;
|
|
27
|
+
export declare function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps): import("react").JSX.Element;
|
|
31
28
|
/**
|
|
32
29
|
* recharts' `Tooltip`, with `filterNull` defaulting to **false**.
|
|
33
30
|
*
|
|
@@ -41,8 +38,8 @@ declare function ChartContainer({ id, className, children, config, ...props }: C
|
|
|
41
38
|
* `ChartTooltipContent` itself (honouring `includeHidden`), so a legend toggle still
|
|
42
39
|
* takes a series out of the tooltip. Pass `filterNull` to get recharts' behaviour back.
|
|
43
40
|
*/
|
|
44
|
-
declare function ChartTooltip(props: ComponentProps<typeof
|
|
45
|
-
declare const ChartLegend: react.MemoExoticComponent<(outsideProps: recharts.LegendProps) => React.ReactPortal | null>;
|
|
41
|
+
export declare function ChartTooltip(props: ComponentProps<typeof RechartsTooltip>): import("react").JSX.Element;
|
|
42
|
+
export declare const ChartLegend: import("react").MemoExoticComponent<(outsideProps: import("recharts").LegendProps) => React.ReactPortal | null>;
|
|
46
43
|
interface TooltipPayloadItem {
|
|
47
44
|
dataKey?: string | number;
|
|
48
45
|
name?: string | number;
|
|
@@ -101,7 +98,7 @@ interface ChartTooltipContentProps {
|
|
|
101
98
|
/** Readout only: the heading while nothing is active. Default "—". */
|
|
102
99
|
idleLabel?: ReactNode;
|
|
103
100
|
}
|
|
104
|
-
declare function ChartTooltipContent({ active, payload, label, indicator, hideLabel, labelFormatter, valueFormatter, formatValue, coordinate, boundaryRef, includeHidden, variant, idleKeys, idleLabel, }: ChartTooltipContentProps): react.JSX.Element | null;
|
|
101
|
+
export declare function ChartTooltipContent({ active, payload, label, indicator, hideLabel, labelFormatter, valueFormatter, formatValue, coordinate, boundaryRef, includeHidden, variant, idleKeys, idleLabel, }: ChartTooltipContentProps): import("react").JSX.Element | null;
|
|
105
102
|
interface LegendPayloadItem {
|
|
106
103
|
value?: string;
|
|
107
104
|
dataKey?: string | number;
|
|
@@ -124,6 +121,5 @@ interface ChartLegendContentProps {
|
|
|
124
121
|
*/
|
|
125
122
|
activeKey?: string | null;
|
|
126
123
|
}
|
|
127
|
-
declare function ChartLegendContent({ payload, onItemClick, hiddenKeys, activeKey, }: ChartLegendContentProps): react.JSX.Element | null;
|
|
128
|
-
|
|
129
|
-
export { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, type ChartSeriesConfig, ChartTooltip, ChartTooltipContent, useChart };
|
|
124
|
+
export declare function ChartLegendContent({ payload, onItemClick, hiddenKeys, activeKey, }: ChartLegendContentProps): import("react").JSX.Element | null;
|
|
125
|
+
export {};
|
package/dist/components/chart.js
CHANGED
|
@@ -30,10 +30,10 @@ function ChartContainer({ id, className, children, config, ...props }) {
|
|
|
30
30
|
"[&_.recharts-surface]:[direction:ltr]",
|
|
31
31
|
// muted axis labels + gridlines; one class each, since the tokens
|
|
32
32
|
// already carry the light/dark values
|
|
33
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-
|
|
34
|
-
"[&_.recharts-cartesian-grid_line]:stroke-
|
|
33
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted",
|
|
34
|
+
"[&_.recharts-cartesian-grid_line]:stroke-subtle/70",
|
|
35
35
|
// hairline hover cursor instead of the heavy default
|
|
36
|
-
"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-
|
|
36
|
+
"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-strong",
|
|
37
37
|
"[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-[var(--bg-hover)]",
|
|
38
38
|
// kill the focus outlines & white sector strokes Recharts adds
|
|
39
39
|
"[&_.recharts-sector]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent",
|
|
@@ -155,7 +155,7 @@ function ChartTooltipContent({
|
|
|
155
155
|
const cfgKey = dk && config[dk] ? dk : nm && config[nm] ? nm : dk ?? nm ?? String(i);
|
|
156
156
|
const series = config[cfgKey];
|
|
157
157
|
const fill = typeof item.payload?.fill === "string" ? item.payload.fill : void 0;
|
|
158
|
-
const color = paintedColor(cfgKey, series) ?? fill ?? item.color ?? "
|
|
158
|
+
const color = paintedColor(cfgKey, series) ?? fill ?? item.color ?? "var(--text-muted)";
|
|
159
159
|
const name = series?.label ?? nm ?? cfgKey;
|
|
160
160
|
const raw = tooltipValue(item.value);
|
|
161
161
|
let text;
|
|
@@ -181,7 +181,7 @@ function ChartTooltipContent({
|
|
|
181
181
|
/* @__PURE__ */ jsx(
|
|
182
182
|
"span",
|
|
183
183
|
{
|
|
184
|
-
className: cn("min-w-0 text-
|
|
184
|
+
className: cn("min-w-0 text-muted", inRow ? "truncate" : "break-words"),
|
|
185
185
|
children: name
|
|
186
186
|
}
|
|
187
187
|
),
|
|
@@ -190,7 +190,7 @@ function ChartTooltipContent({
|
|
|
190
190
|
{
|
|
191
191
|
"data-private": true,
|
|
192
192
|
dir: "auto",
|
|
193
|
-
className: "ms-auto shrink-0 whitespace-nowrap font-mono font-medium tabular-nums text-
|
|
193
|
+
className: "ms-auto shrink-0 whitespace-nowrap font-mono font-medium tabular-nums text-primary",
|
|
194
194
|
children: text
|
|
195
195
|
}
|
|
196
196
|
)
|
|
@@ -202,7 +202,7 @@ function ChartTooltipContent({
|
|
|
202
202
|
if (readout) {
|
|
203
203
|
const rows = shown ? items : (idleKeys ?? Object.keys(config)).map((key) => ({ dataKey: key }));
|
|
204
204
|
return /* @__PURE__ */ jsxs("div", { className: "text-xs", "data-chart-readout": shown ? "active" : "idle", children: [
|
|
205
|
-
/* @__PURE__ */ jsx("div", { "data-readout-heading": true, className: "truncate font-medium leading-6 text-
|
|
205
|
+
/* @__PURE__ */ jsx("div", { "data-readout-heading": true, className: "truncate font-medium leading-6 text-primary", children: shown && !hideLabel && label != null ? labelFormatter ? labelFormatter(label) : label : idleLabel ?? NO_VALUE }),
|
|
206
206
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-x-4 gap-y-1", children: rows.map((item, i) => tooltipRow(item, i, true)) })
|
|
207
207
|
] });
|
|
208
208
|
}
|
|
@@ -217,9 +217,9 @@ function ChartTooltipContent({
|
|
|
217
217
|
nudge ? `translateX(${nudge}px)` : ""
|
|
218
218
|
].filter(Boolean).join(" ")
|
|
219
219
|
} : void 0,
|
|
220
|
-
className: "min-w-[9rem] max-w-[min(20rem,calc(100vw-2rem))] rounded-lg border border-
|
|
220
|
+
className: "min-w-[9rem] max-w-[min(20rem,calc(100vw-2rem))] rounded-lg border border-subtle bg-surface px-2.5 py-2 text-xs shadow-xl",
|
|
221
221
|
children: [
|
|
222
|
-
!hideLabel && label != null && /* @__PURE__ */ jsx("div", { className: "mb-1.5 font-medium text-
|
|
222
|
+
!hideLabel && label != null && /* @__PURE__ */ jsx("div", { className: "mb-1.5 font-medium text-primary", children: labelFormatter ? labelFormatter(label) : label }),
|
|
223
223
|
/* @__PURE__ */ jsx("div", { className: "grid gap-1.5", children: items.map((item, i) => tooltipRow(item, i, false)) })
|
|
224
224
|
]
|
|
225
225
|
}
|
|
@@ -239,12 +239,12 @@ function ChartLegendContent({
|
|
|
239
239
|
const vv = item.value != null ? String(item.value) : void 0;
|
|
240
240
|
const cfgKey = dk && config[dk] ? dk : vv && config[vv] ? vv : dk ?? vv ?? String(i);
|
|
241
241
|
const series = config[cfgKey];
|
|
242
|
-
const color = paintedColor(cfgKey, series) ?? item.color ?? "
|
|
242
|
+
const color = paintedColor(cfgKey, series) ?? item.color ?? "var(--text-muted)";
|
|
243
243
|
const label = series?.label ?? vv ?? cfgKey;
|
|
244
244
|
const off = hidden?.has(cfgKey) ?? false;
|
|
245
245
|
const dimmed = off || activeKey != null && activeKey !== cfgKey;
|
|
246
246
|
const className = cn(
|
|
247
|
-
"flex items-center gap-1.5 text-
|
|
247
|
+
"flex items-center gap-1.5 text-secondary transition-opacity",
|
|
248
248
|
onItemClick ? "cursor-pointer hover:opacity-80" : "cursor-default",
|
|
249
249
|
dimmed && "opacity-40"
|
|
250
250
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/chart.tsx"],"sourcesContent":["// shadcn/ui chart kit — vendored (MIT) and adapted for this app:\n// - Recharts 3 instead of 2\n// - the original keys its styling off shadcn theme tokens (--muted-foreground,\n// --border, bg-background …). This app has no shadcn token layer, so those\n// are mapped onto this kit's own tokens (--text-muted, --border, --bg-surface\n// …), which follow the active palette preset and flip with the theme by\n// themselves — hence no `dark:` variants anywhere below.\n// The value on show is the *structure*: config-driven colors injected as CSS\n// vars, muted axis/grid styling, and a polished tooltip/legend — the things\n// that make shadcn charts read as \"designed\" rather than \"default Recharts\".\nimport { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport type { ComponentProps, CSSProperties, ReactNode, RefObject } from \"react\";\nimport {\n Legend as RechartsLegend,\n ResponsiveContainer,\n Tooltip as RechartsTooltip,\n} from \"recharts\";\nimport { cn } from \"../lib/cn\";\nimport { isRtl } from \"../lib/direction\";\n\nexport interface ChartSeriesConfig {\n label: ReactNode;\n color: string;\n}\n\nexport type ChartConfig = Record<string, ChartSeriesConfig>;\n\nconst ChartContext = createContext<ChartConfig | null>(null);\n\nexport function useChart(): ChartConfig {\n const ctx = useContext(ChartContext);\n if (!ctx) throw new Error(\"useChart must be used within a <ChartContainer />\");\n return ctx;\n}\n\ninterface ChartContainerProps extends ComponentProps<\"div\"> {\n config: ChartConfig;\n children: ComponentProps<typeof ResponsiveContainer>[\"children\"];\n}\n\n/**\n * The shell every chart in the kit is drawn inside.\n *\n * **The plot is not mirrored in RTL.** An x axis is a number line or a timeline, and\n * both run left-to-right in Hebrew and Arabic charts as much as in English ones; a\n * time axis flipped to run right-to-left is the surprise, not the courtesy. So no\n * `reversed` on any axis, and the SVG is pinned to `direction: ltr` — without that it\n * inherits the page's `rtl`, which flips what `text-anchor: end` means, and the tick\n * labels of a left-hand y axis are drawn INTO the plot instead of beside it. Text\n * inside the SVG still shapes by its own script; only the anchoring is physical.\n * The HTML around the plot — legend, tooltip, the zoom reset button — follows the\n * page's direction like any other markup. A consumer who does want a mirrored\n * category axis passes `reversed` on its own `XAxis`.\n */\nexport function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps) {\n const uid = useId();\n // The id is pasted into an UNQUOTED `[data-chart=…]` selector below, so it has to be\n // a CSS identifier: one stray space or `#` and the browser discards the whole rule,\n // taking every series colour with it — silently, because an invalid rule is not an\n // error anywhere. `useId()` gives `:r0:`, and a consumer-supplied id gives whatever\n // they typed, so both are filtered rather than just the colons.\n const chartId = `chart-${(id ?? uid).replace(/[^A-Za-z0-9_-]/g, \"\")}`;\n return (\n <ChartContext.Provider value={config}>\n <div\n data-chart={chartId}\n className={cn(\n // touch-pan-y lets a vertical finger drag still scroll the page while\n // a horizontal drag is handed to recharts for tooltip scrubbing,\n // instead of the page scrolling underneath the gesture (feedback #292).\n \"flex w-full touch-pan-y justify-center text-xs\",\n // physical anchoring for the unmirrored plot (see the doc comment above)\n \"[&_.recharts-surface]:[direction:ltr]\",\n // muted axis labels + gridlines; one class each, since the tokens\n // already carry the light/dark values\n \"[&_.recharts-cartesian-axis-tick_text]:fill-[var(--text-muted)]\",\n \"[&_.recharts-cartesian-grid_line]:stroke-[var(--border)]/70\",\n // hairline hover cursor instead of the heavy default\n \"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-[var(--border-strong)]\",\n \"[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-[var(--bg-hover)]\",\n // kill the focus outlines & white sector strokes Recharts adds\n \"[&_.recharts-sector]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent\",\n \"[&_.recharts-layer]:outline-none [&_.recharts-surface]:outline-none [&_.recharts-dot[stroke='#fff']]:stroke-transparent\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n {children}\n </ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\n/**\n * A config key, which becomes the tail of a custom-property NAME.\n *\n * `dangerouslySetInnerHTML` means what it says: nothing below is escaped by React, and\n * a `ChartConfig` is not necessarily written by hand — kastlan builds one from category\n * rows in its database, so these keys are user data. A key containing `}` closes this\n * rule, and whatever follows it in that key becomes a NEW rule — one that applies to\n * the whole document rather than to this one chart.\n */\nconst CSS_IDENT = /^[A-Za-z_][A-Za-z0-9_-]*$/;\n\n/**\n * A config colour, which becomes a declaration VALUE.\n *\n * Every form a palette actually produces: both hex spellings, the functional notations\n * — with the argument list restricted to the characters those functions can legally\n * contain, so no `;`, no `}` and no nested `url(` — and `var(--token)`, which is what\n * this kit's own `paletteFor`/`CHART_COLORS` return. `var()`'s optional FALLBACK is\n * deliberately not accepted: its second argument is an arbitrary value, i.e. the same\n * hole in a shape that looks safe.\n */\nconst CSS_COLOR =\n /^(?:#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|(?:rgba?|hsla?)\\([0-9A-Za-z.,%/ -]*\\)|var\\(--[A-Za-z0-9_-]+\\))$/;\n\n/**\n * The colour an entry is painted with, or `undefined` when the style block refuses it.\n *\n * The one gate both sides go through: {@link ChartStyle} emits exactly these, and the\n * legend and tooltip swatches show exactly these. They used to read `config[key].color`\n * directly, so an entry the style block had skipped still showed its configured colour\n * in the key — a swatch promising a colour the series was never painted in.\n */\nfunction paintedColor(key: string, entry: ChartSeriesConfig | undefined): string | undefined {\n if (!entry?.color) return undefined;\n return CSS_IDENT.test(key) && CSS_COLOR.test(entry.color) ? entry.color : undefined;\n}\n\n// Inject each series colour as a `--color-<key>` custom property scoped to this\n// chart, so chart JSX can refer to `var(--color-total)` and the legend/tooltip\n// stay in sync from one source of truth.\nfunction ChartStyle({ id, config }: { id: string; config: ChartConfig }) {\n const entries = Object.entries(config).filter(([key, c]) => {\n if (!c.color) return false;\n // Skipping the entry costs that one series its `var(--color-…)` and leaves the rest\n // of the chart painted; emitting it unchecked costs the page. The warning is so the\n // consumer finds out from their console rather than from a colourless bar.\n if (!CSS_IDENT.test(key)) {\n console.warn(`[ui-kit] chart config key is not a CSS identifier, skipped: ${key}`);\n return false;\n }\n if (!CSS_COLOR.test(c.color)) {\n console.warn(`[ui-kit] chart config colour for \"${key}\" is not a colour, skipped: ${c.color}`);\n return false;\n }\n return true;\n });\n if (!entries.length) return null;\n const css = `[data-chart=${id}] {\\n${entries\n .map(([key, c]) => ` --color-${key}: ${c.color};`)\n .join(\"\\n\")}\\n}`;\n return <style dangerouslySetInnerHTML={{ __html: css }} />;\n}\n\n/**\n * recharts' `Tooltip`, with `filterNull` defaulting to **false**.\n *\n * recharts drops every payload entry whose value is `null`/`undefined` before the\n * content sees it, so the missing-value path {@link ChartTooltipContent} documents —\n * the em dash, `formatValue(undefined)` — never ran under the default: a series with a\n * gap at the cursor simply vanished from the tooltip, which reads as \"this series does\n * not exist here\" rather than \"it has no value here\". Kept, the entry prints \"—\".\n *\n * The other half of that filter — dropping series drawn with `hide` — is redone by\n * `ChartTooltipContent` itself (honouring `includeHidden`), so a legend toggle still\n * takes a series out of the tooltip. Pass `filterNull` to get recharts' behaviour back.\n */\nexport function ChartTooltip(props: ComponentProps<typeof RechartsTooltip>) {\n return <RechartsTooltip filterNull={false} {...props} />;\n}\nexport const ChartLegend = RechartsLegend;\n\ninterface TooltipPayloadItem {\n dataKey?: string | number;\n name?: string | number;\n value?: number | string;\n color?: string;\n /** A series drawn with `hide` — dropped here, see {@link ChartTooltip}. */\n hide?: boolean;\n payload?: Record<string, unknown>;\n}\n\n/**\n * What a series has no value for at this point: a gap in a history, a projection that\n * has not happened yet, a field that did not exist at an earlier capture.\n *\n * An em dash rather than an empty cell, so the row still lines up with its siblings and\n * the reader can see that the series WAS asked and had nothing, rather than wondering\n * whether it was dropped. It is a mark, not a word, so there is nothing here to\n * translate and no label prop to resolve; a caller who wants words passes\n * `formatValue`, which is handed the `undefined` and decides.\n */\nconst NO_VALUE = \"—\";\n\n/**\n * The number this payload item carries, or `undefined` when it carries none.\n *\n * This was `item.value ?? 0`, so every one of the absences above printed a confident\n * \"0\" that appears nowhere in the data — a fabricated figure in a tooltip, which is the\n * one place a reader goes to check an exact number. keksdose found it and wrapped the\n * component rather than trust it. `\"\"` and a non-numeric string are the same absence\n * spelled differently (recharts hands a string value straight through from the data),\n * and are answered the same way.\n */\nfunction tooltipValue(value: number | string | undefined): number | undefined {\n if (value == null || value === \"\") return undefined;\n const n = typeof value === \"string\" ? Number(value) : value;\n return Number.isFinite(n) ? n : undefined;\n}\n\ninterface ChartTooltipContentProps {\n active?: boolean;\n payload?: TooltipPayloadItem[];\n label?: string | number;\n indicator?: \"dot\" | \"line\";\n hideLabel?: boolean;\n labelFormatter?: (label: string | number) => ReactNode;\n /** Formats one series' value for display. NOT called when the series has no value at\n * this point — {@link ChartTooltipContentProps.formatValue} is the one that is. */\n valueFormatter?: (value: number) => ReactNode;\n /** Formats one series' value INCLUDING its absence: handed `undefined` for a gap, a\n * projection that has not happened yet, or a field that did not exist at an earlier\n * capture, and whatever it returns is rendered as-is. Only the caller knows whether\n * that absence reads as a dash, a \"not yet\" or a genuine zero, so this is how it\n * says. Supplying it wins over `valueFormatter` for every value.\n *\n * It sits NEXT to `valueFormatter` rather than widening it because that prop's\n * parameter is contextually typed at every call site there is — `(v) => money(v)` —\n * so widening it to `number | undefined` is a compile error in all three consuming\n * apps, which is a breaking change this module does not get to make by itself. */\n formatValue?: (value: number | undefined) => ReactNode;\n /** Cursor position within the chart, injected by recharts. Used with\n * {@link boundaryRef} to decide whether to flip the tooltip. */\n coordinate?: { x?: number; y?: number };\n /** When set, the tooltip flips to the LEFT of the cursor if it would otherwise\n * spill past the right edge of this (usually horizontally-scrolling) container\n * — e.g. a wide chart whose rightmost bars sat off-screen (feedback #77). */\n boundaryRef?: RefObject<HTMLElement | null>;\n /** Injected by recharts: keep series drawn with `hide` in the tooltip. */\n includeHidden?: boolean;\n /**\n * `\"floating\"` (the default): the box recharts moves with the cursor. `\"readout\"`: the\n * same heading and values as a flat row for a FIXED place outside the plot — a\n * `SeriesChart` whose `tooltip.placement` is `\"above\"`/`\"below\"` portals it there, so\n * a finger on a phone no longer sits on the box it is trying to read (keksdose #359).\n * No border, shadow, width cap or viewport nudge; the values flow in a grid whose\n * column count depends on the row's width alone, so the row is the same height\n * whatever is being pointed at — and, idle, it shows {@link idleKeys} with \"—\".\n */\n variant?: \"floating\" | \"readout\";\n /** Readout only: the series to list while nothing is active, so the row keeps the\n * height it will have once something is. */\n idleKeys?: readonly string[];\n /** Readout only: the heading while nothing is active. Default \"—\". */\n idleLabel?: ReactNode;\n}\n\nexport function ChartTooltipContent({\n active,\n payload,\n label,\n indicator = \"dot\",\n hideLabel = false,\n labelFormatter,\n valueFormatter,\n formatValue,\n coordinate,\n boundaryRef,\n includeHidden = false,\n variant = \"floating\",\n idleKeys,\n idleLabel,\n}: ChartTooltipContentProps) {\n const config = useChart();\n const tipRef = useRef<HTMLDivElement>(null);\n const readout = variant === \"readout\";\n // `ChartTooltip` keeps null values (so they can print \"—\"), which also keeps the\n // series a legend toggle switched off with `hide`; those go here instead.\n const items = includeHidden ? payload : payload?.filter((item) => item.hide !== true);\n const shown = Boolean(active && items?.length);\n // Everything below that measures and moves the box is about a FLOATING one.\n const visible = shown && !readout;\n // Recharts anchors the tooltip at coordinate.x inside the full (scrolled) chart\n // width; subtract the container's scrollLeft to get its on-screen x, then flip\n // left if the tooltip's own width would run past the visible right edge.\n //\n // Both the cursor and the flip are PHYSICAL (the plot is never mirrored, see\n // `ChartContainer`), but an RTL scroller counts `scrollLeft` from its right edge —\n // 0 at the start, negative going left — so there the content's left edge sits\n // `scrollWidth - clientWidth + scrollLeft` px to the left of the visible one.\n //\n // Measured in a layout effect (the DOM is not readable during render), so it commits\n // before paint. `payload` and `label` are deps because they change the tooltip's own\n // width, and recharts hands a fresh `payload` on every tooltip render, so a scroll\n // followed by any re-render is re-measured just as it was when this ran in render.\n const [flip, setFlip] = useState(false);\n const x = coordinate?.x;\n useLayoutEffect(() => {\n const boundary = boundaryRef?.current;\n if (!visible || !boundary || x == null) {\n setFlip(false);\n return;\n }\n const offset = isRtl(boundary)\n ? boundary.scrollWidth - boundary.clientWidth + boundary.scrollLeft\n : boundary.scrollLeft;\n const visibleX = x - offset;\n const tipWidth = tipRef.current?.offsetWidth ?? 160;\n setFlip(visibleX + tipWidth + 12 > boundary.clientWidth);\n }, [visible, x, boundaryRef, payload, label]);\n\n // Whatever placed it — recharts' own rule or the boundary flip above — the box then\n // clamps itself into the viewport, 8px off each edge. The width cap alone did not\n // keep it on screen: on a 390px phone recharts opened a near-full-width tooltip to\n // the RIGHT of a pointer 35% into the plot, and the values ran off the edge\n // (lenkbank, on 0.15.2). Measured after placement, minus the shift it already has,\n // so a re-measure never compounds; an unmeasured box (no layout) is left alone.\n const [nudge, setNudge] = useState(0);\n const nudgeRef = useRef(0);\n // recharts slides its wrapper to each new position with a CSS transition, so the box\n // measured on commit is still where it WAS; measure again once the slide ends.\n const [settled, setSettled] = useState(0);\n useEffect(() => {\n const wrapper = tipRef.current?.closest<HTMLElement>(\".recharts-tooltip-wrapper\");\n if (!visible || !wrapper) return;\n const onEnd = () => setSettled((n) => n + 1);\n wrapper.addEventListener(\"transitionend\", onEnd);\n return () => wrapper.removeEventListener(\"transitionend\", onEnd);\n }, [visible]);\n useLayoutEffect(() => {\n const el = tipRef.current;\n if (!visible || !el) {\n nudgeRef.current = 0;\n setNudge(0);\n return;\n }\n const rect = el.getBoundingClientRect();\n if (rect.width === 0) return;\n const margin = 8;\n const viewport = document.documentElement.clientWidth || window.innerWidth;\n const left = rect.left - nudgeRef.current;\n const right = left + rect.width;\n let next = 0;\n if (right > viewport - margin) next = viewport - margin - right;\n if (left + next < margin) next = margin - left;\n if (next !== nudgeRef.current) {\n nudgeRef.current = next;\n setNudge(next);\n }\n }, [visible, x, payload, label, flip, settled]);\n // One series' line — the floating box stacks them; the readout lays them in a grid,\n // where a long name is cut rather than wrapped so every cell stays one line high.\n const tooltipRow = (item: TooltipPayloadItem, i: number, inRow: boolean) => {\n // Bars/lines/areas identify a series by dataKey; pies/treemaps key off\n // `name` (the nameKey value). Prefer whichever the config knows.\n const dk = item.dataKey != null ? String(item.dataKey) : undefined;\n const nm = item.name != null ? String(item.name) : undefined;\n const cfgKey = dk && config[dk] ? dk : nm && config[nm] ? nm : (dk ?? nm ?? String(i));\n const series = config[cfgKey];\n const fill = typeof item.payload?.fill === \"string\" ? item.payload.fill : undefined;\n // The data point's own `fill` before recharts' `item.color`: a treemap tile,\n // or a bar with a per-cell colour, IS the colour the reader is pointing at,\n // while `item.color` is the series-wide one — every tile's swatch came out\n // `--chart-1` whatever colour the tile was.\n const color = paintedColor(cfgKey, series) ?? fill ?? item.color ?? \"#64748b\";\n const name = series?.label ?? nm ?? cfgKey;\n const raw = tooltipValue(item.value);\n let text: ReactNode;\n // An idle readout cell has asked nothing yet, so there is no absence for\n // `formatValue` to word — it is the bare mark.\n if (inRow && !shown) text = NO_VALUE;\n else if (formatValue) text = formatValue(raw);\n else if (raw == null) text = NO_VALUE;\n else text = valueFormatter ? valueFormatter(raw) : raw;\n return (\n <div\n key={`${cfgKey}-${i}`}\n // A readout cell is capped so a wide row does not push its value a column away\n // from its name.\n className={cn(\"flex items-center\", inRow ? \"min-w-0 max-w-[12rem] gap-1.5\" : \"gap-2\")}\n >\n <span\n className={cn(\n \"shrink-0 rounded-[2px]\",\n indicator === \"dot\" ? \"h-2.5 w-2.5 rounded-full\" : \"h-2.5 w-1\",\n )}\n style={{ backgroundColor: color }}\n />\n <span\n className={cn(\"min-w-0 text-[var(--text-muted)]\", inRow ? \"truncate\" : \"break-words\")}\n >\n {name}\n </span>\n <span\n data-private\n // Isolated, so an RTL page does not turn \"-26.6\" into \"26.6-\": a figure has no\n // strong direction of its own, and one formatted with an RTL mark keeps it.\n dir=\"auto\"\n className=\"ms-auto shrink-0 whitespace-nowrap font-mono font-medium tabular-nums text-[var(--text-primary)]\"\n >\n {text}\n </span>\n </div>\n );\n };\n\n if (readout) {\n // Idle, the row lists every series with no value — the same cells it will have, so\n // nothing under it moves on the first tap.\n const rows: TooltipPayloadItem[] = shown\n ? items!\n : (idleKeys ?? Object.keys(config)).map((key) => ({ dataKey: key }));\n return (\n <div className=\"text-xs\" data-chart-readout={shown ? \"active\" : \"idle\"}>\n {/* A full 24 px line: the zoom's reset button sits at the top corner of a chart\n whose row is above it, and has to fit beside the heading, not over a value. */}\n <div data-readout-heading className=\"truncate font-medium leading-6 text-[var(--text-primary)]\">\n {shown && !hideLabel && label != null\n ? labelFormatter\n ? labelFormatter(label)\n : label\n : (idleLabel ?? NO_VALUE)}\n </div>\n <div className=\"grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-x-4 gap-y-1\">\n {rows.map((item, i) => tooltipRow(item, i, true))}\n </div>\n </div>\n );\n }\n if (!visible || !items) return null;\n return (\n <div\n ref={tipRef}\n style={\n boundaryRef || nudge\n ? {\n transform: [\n boundaryRef ? (flip ? \"translateX(calc(-100% - 12px))\" : \"translateX(12px)\") : \"\",\n nudge ? `translateX(${nudge}px)` : \"\",\n ]\n .filter(Boolean)\n .join(\" \"),\n }\n : undefined\n }\n // Capped at the viewport: six long series names (lenkbank's German motion\n // labels) made the box wider than a 390px chart, and recharts, which keeps a box\n // inside the plot only when it fits, let it run off the edge with the values cut.\n // Names wrap inside the cap; the values never do.\n className=\"min-w-[9rem] max-w-[min(20rem,calc(100vw-2rem))] rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] px-2.5 py-2 text-xs shadow-xl\"\n >\n {!hideLabel && label != null && (\n <div className=\"mb-1.5 font-medium text-[var(--text-primary)]\">\n {labelFormatter ? labelFormatter(label) : label}\n </div>\n )}\n <div className=\"grid gap-1.5\">{items.map((item, i) => tooltipRow(item, i, false))}</div>\n </div>\n );\n}\n\ninterface LegendPayloadItem {\n value?: string;\n dataKey?: string | number;\n color?: string;\n}\n\ninterface ChartLegendContentProps {\n payload?: LegendPayloadItem[];\n onItemClick?: (key: string) => void;\n /**\n * TOGGLE mode (recommended): the series currently switched off. Each entry is a\n * toggle button — pressed while its series is shown — and a hidden one is drawn\n * faded with its label struck through. Several can be off at once; pair with\n * `toggleHidden(hidden, key)` in `onItemClick` and `hide` on the chart's series.\n */\n hiddenKeys?: ReadonlySet<string> | readonly string[];\n /**\n * ISOLATE mode: the one series shown in full, every other entry dimmed. Kept for\n * the charts built on it; a legend where each entry switches its own series is\n * what readers expect from a legend, so prefer `hiddenKeys`.\n */\n activeKey?: string | null;\n}\n\nexport function ChartLegendContent({\n payload,\n onItemClick,\n hiddenKeys,\n activeKey,\n}: ChartLegendContentProps) {\n const hidden = hiddenKeys ? new Set(hiddenKeys) : null;\n const config = useChart();\n if (!payload?.length) return null;\n return (\n <div className=\"flex flex-wrap items-center justify-center gap-x-4 gap-y-1 pt-3\">\n {payload.map((item, i) => {\n const dk = item.dataKey != null ? String(item.dataKey) : undefined;\n const vv = item.value != null ? String(item.value) : undefined;\n const cfgKey = dk && config[dk] ? dk : vv && config[vv] ? vv : (dk ?? vv ?? String(i));\n const series = config[cfgKey];\n const color = paintedColor(cfgKey, series) ?? item.color ?? \"#64748b\";\n const label = series?.label ?? vv ?? cfgKey;\n const off = hidden?.has(cfgKey) ?? false;\n const dimmed = off || (activeKey != null && activeKey !== cfgKey);\n const className = cn(\n \"flex items-center gap-1.5 text-[var(--text-secondary)] transition-opacity\",\n onItemClick ? \"cursor-pointer hover:opacity-80\" : \"cursor-default\",\n dimmed && \"opacity-40\",\n );\n const swatch = (\n <span\n aria-hidden\n className=\"h-2.5 w-2.5 shrink-0 rounded-[3px]\"\n style={{ backgroundColor: color } as CSSProperties}\n />\n );\n // A legend with no `onItemClick` is a KEY, not a control — and that is every\n // legend in kastlan, where this rendered N focusable buttons per chart that did\n // nothing when activated. A keyboard user paid the tab stops for all of them,\n // and a screen reader announced each one as a button, promising an action there\n // was none of. The interactive branch is unchanged.\n return onItemClick ? (\n <button\n key={`${cfgKey}-${i}`}\n type=\"button\"\n onClick={() => onItemClick(cfgKey)}\n // Toggles report their state: in toggle mode pressed = the series is shown;\n // in isolate mode pressed = the isolated one. With neither supplied the\n // legend knows nothing about state, and a pressed=\"false\" it cannot vouch\n // for would lie — so it says nothing.\n aria-pressed={\n hidden ? !off : activeKey === undefined ? undefined : activeKey === cfgKey\n }\n className={className}\n >\n {swatch}\n <span className={cn(off && \"line-through\")}>{label}</span>\n </button>\n ) : (\n <span key={`${cfgKey}-${i}`} className={className}>\n {swatch}\n {label}\n </span>\n );\n })}\n </div>\n );\n}\n"],"mappings":";AAgEM,SAuBE,KAvBF;AAtDN,SAAS,eAAe,YAAY,WAAW,OAAO,iBAAiB,QAAQ,gBAAgB;AAE/F;AAAA,EACE,UAAU;AAAA,EACV;AAAA,EACA,WAAW;AAAA,OACN;AACP,SAAS,UAAU;AACnB,SAAS,aAAa;AAStB,MAAM,eAAe,cAAkC,IAAI;AAEpD,SAAS,WAAwB;AACtC,QAAM,MAAM,WAAW,YAAY;AACnC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,mDAAmD;AAC7E,SAAO;AACT;AAqBO,SAAS,eAAe,EAAE,IAAI,WAAW,UAAU,QAAQ,GAAG,MAAM,GAAwB;AACjG,QAAM,MAAM,MAAM;AAMlB,QAAM,UAAU,UAAU,MAAM,KAAK,QAAQ,mBAAmB,EAAE,CAAC;AACnE,SACE,oBAAC,aAAa,UAAb,EAAsB,OAAO,QAC5B;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ,WAAW;AAAA;AAAA;AAAA;AAAA,QAIT;AAAA;AAAA,QAEA;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,cAAW,IAAI,SAAS,QAAgB;AAAA,Q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,QACX,WAAU;AAAA,QACV,OAAO,EAAE,iBAAiB,MAAM;AAAA;AAAA,IAClC;AAOF,WAAO,cACL;AAAA,MAAC;AAAA;AAAA,QAEC,MAAK;AAAA,QACL,SAAS,MAAM,YAAY,MAAM;AAAA,QAKjC,gBACE,SAAS,CAAC,MAAM,cAAc,SAAY,SAAY,cAAc;AAAA,QAEtE;AAAA,QAEC;AAAA;AAAA,UACD,oBAAC,UAAK,WAAW,GAAG,OAAO,cAAc,GAAI,iBAAM;AAAA;AAAA;AAAA,MAb9C,GAAG,MAAM,IAAI,CAAC;AAAA,IAcrB,IAEA,qBAAC,UAA4B,WAC1B;AAAA;AAAA,MACA;AAAA,SAFQ,GAAG,MAAM,IAAI,CAAC,EAGzB;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/chart.tsx"],"sourcesContent":["// shadcn/ui chart kit — vendored (MIT) and adapted for this app:\n// - Recharts 3 instead of 2\n// - the original keys its styling off shadcn theme tokens (--muted-foreground,\n// --border, bg-background …). This app has no shadcn token layer, so those\n// are mapped onto this kit's own tokens (--text-muted, --border, --bg-surface\n// …), which follow the active palette preset and flip with the theme by\n// themselves — hence no `dark:` variants anywhere below.\n// The value on show is the *structure*: config-driven colors injected as CSS\n// vars, muted axis/grid styling, and a polished tooltip/legend — the things\n// that make shadcn charts read as \"designed\" rather than \"default Recharts\".\nimport { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport type { ComponentProps, CSSProperties, ReactNode, RefObject } from \"react\";\nimport {\n Legend as RechartsLegend,\n ResponsiveContainer,\n Tooltip as RechartsTooltip,\n} from \"recharts\";\nimport { cn } from \"../lib/cn\";\nimport { isRtl } from \"../lib/direction\";\n\nexport interface ChartSeriesConfig {\n label: ReactNode;\n color: string;\n}\n\nexport type ChartConfig = Record<string, ChartSeriesConfig>;\n\nconst ChartContext = createContext<ChartConfig | null>(null);\n\nexport function useChart(): ChartConfig {\n const ctx = useContext(ChartContext);\n if (!ctx) throw new Error(\"useChart must be used within a <ChartContainer />\");\n return ctx;\n}\n\ninterface ChartContainerProps extends ComponentProps<\"div\"> {\n config: ChartConfig;\n children: ComponentProps<typeof ResponsiveContainer>[\"children\"];\n}\n\n/**\n * The shell every chart in the kit is drawn inside.\n *\n * **The plot is not mirrored in RTL.** An x axis is a number line or a timeline, and\n * both run left-to-right in Hebrew and Arabic charts as much as in English ones; a\n * time axis flipped to run right-to-left is the surprise, not the courtesy. So no\n * `reversed` on any axis, and the SVG is pinned to `direction: ltr` — without that it\n * inherits the page's `rtl`, which flips what `text-anchor: end` means, and the tick\n * labels of a left-hand y axis are drawn INTO the plot instead of beside it. Text\n * inside the SVG still shapes by its own script; only the anchoring is physical.\n * The HTML around the plot — legend, tooltip, the zoom reset button — follows the\n * page's direction like any other markup. A consumer who does want a mirrored\n * category axis passes `reversed` on its own `XAxis`.\n */\nexport function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps) {\n const uid = useId();\n // The id is pasted into an UNQUOTED `[data-chart=…]` selector below, so it has to be\n // a CSS identifier: one stray space or `#` and the browser discards the whole rule,\n // taking every series colour with it — silently, because an invalid rule is not an\n // error anywhere. `useId()` gives `:r0:`, and a consumer-supplied id gives whatever\n // they typed, so both are filtered rather than just the colons.\n const chartId = `chart-${(id ?? uid).replace(/[^A-Za-z0-9_-]/g, \"\")}`;\n return (\n <ChartContext.Provider value={config}>\n <div\n data-chart={chartId}\n className={cn(\n // touch-pan-y lets a vertical finger drag still scroll the page while\n // a horizontal drag is handed to recharts for tooltip scrubbing,\n // instead of the page scrolling underneath the gesture (feedback #292).\n \"flex w-full touch-pan-y justify-center text-xs\",\n // physical anchoring for the unmirrored plot (see the doc comment above)\n \"[&_.recharts-surface]:[direction:ltr]\",\n // muted axis labels + gridlines; one class each, since the tokens\n // already carry the light/dark values\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted\",\n \"[&_.recharts-cartesian-grid_line]:stroke-subtle/70\",\n // hairline hover cursor instead of the heavy default\n \"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-strong\",\n \"[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-[var(--bg-hover)]\",\n // kill the focus outlines & white sector strokes Recharts adds\n \"[&_.recharts-sector]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent\",\n \"[&_.recharts-layer]:outline-none [&_.recharts-surface]:outline-none [&_.recharts-dot[stroke='#fff']]:stroke-transparent\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n {children}\n </ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\n/**\n * A config key, which becomes the tail of a custom-property NAME.\n *\n * `dangerouslySetInnerHTML` means what it says: nothing below is escaped by React, and\n * a `ChartConfig` is not necessarily written by hand — kastlan builds one from category\n * rows in its database, so these keys are user data. A key containing `}` closes this\n * rule, and whatever follows it in that key becomes a NEW rule — one that applies to\n * the whole document rather than to this one chart.\n */\nconst CSS_IDENT = /^[A-Za-z_][A-Za-z0-9_-]*$/;\n\n/**\n * A config colour, which becomes a declaration VALUE.\n *\n * Every form a palette actually produces: both hex spellings, the functional notations\n * — with the argument list restricted to the characters those functions can legally\n * contain, so no `;`, no `}` and no nested `url(` — and `var(--token)`, which is what\n * this kit's own `paletteFor`/`CHART_COLORS` return. `var()`'s optional FALLBACK is\n * deliberately not accepted: its second argument is an arbitrary value, i.e. the same\n * hole in a shape that looks safe.\n */\nconst CSS_COLOR =\n /^(?:#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|(?:rgba?|hsla?)\\([0-9A-Za-z.,%/ -]*\\)|var\\(--[A-Za-z0-9_-]+\\))$/;\n\n/**\n * The colour an entry is painted with, or `undefined` when the style block refuses it.\n *\n * The one gate both sides go through: {@link ChartStyle} emits exactly these, and the\n * legend and tooltip swatches show exactly these. They used to read `config[key].color`\n * directly, so an entry the style block had skipped still showed its configured colour\n * in the key — a swatch promising a colour the series was never painted in.\n */\nfunction paintedColor(key: string, entry: ChartSeriesConfig | undefined): string | undefined {\n if (!entry?.color) return undefined;\n return CSS_IDENT.test(key) && CSS_COLOR.test(entry.color) ? entry.color : undefined;\n}\n\n// Inject each series colour as a `--color-<key>` custom property scoped to this\n// chart, so chart JSX can refer to `var(--color-total)` and the legend/tooltip\n// stay in sync from one source of truth.\nfunction ChartStyle({ id, config }: { id: string; config: ChartConfig }) {\n const entries = Object.entries(config).filter(([key, c]) => {\n if (!c.color) return false;\n // Skipping the entry costs that one series its `var(--color-…)` and leaves the rest\n // of the chart painted; emitting it unchecked costs the page. The warning is so the\n // consumer finds out from their console rather than from a colourless bar.\n if (!CSS_IDENT.test(key)) {\n console.warn(`[ui-kit] chart config key is not a CSS identifier, skipped: ${key}`);\n return false;\n }\n if (!CSS_COLOR.test(c.color)) {\n console.warn(`[ui-kit] chart config colour for \"${key}\" is not a colour, skipped: ${c.color}`);\n return false;\n }\n return true;\n });\n if (!entries.length) return null;\n const css = `[data-chart=${id}] {\\n${entries\n .map(([key, c]) => ` --color-${key}: ${c.color};`)\n .join(\"\\n\")}\\n}`;\n return <style dangerouslySetInnerHTML={{ __html: css }} />;\n}\n\n/**\n * recharts' `Tooltip`, with `filterNull` defaulting to **false**.\n *\n * recharts drops every payload entry whose value is `null`/`undefined` before the\n * content sees it, so the missing-value path {@link ChartTooltipContent} documents —\n * the em dash, `formatValue(undefined)` — never ran under the default: a series with a\n * gap at the cursor simply vanished from the tooltip, which reads as \"this series does\n * not exist here\" rather than \"it has no value here\". Kept, the entry prints \"—\".\n *\n * The other half of that filter — dropping series drawn with `hide` — is redone by\n * `ChartTooltipContent` itself (honouring `includeHidden`), so a legend toggle still\n * takes a series out of the tooltip. Pass `filterNull` to get recharts' behaviour back.\n */\nexport function ChartTooltip(props: ComponentProps<typeof RechartsTooltip>) {\n return <RechartsTooltip filterNull={false} {...props} />;\n}\nexport const ChartLegend = RechartsLegend;\n\ninterface TooltipPayloadItem {\n dataKey?: string | number;\n name?: string | number;\n value?: number | string;\n color?: string;\n /** A series drawn with `hide` — dropped here, see {@link ChartTooltip}. */\n hide?: boolean;\n payload?: Record<string, unknown>;\n}\n\n/**\n * What a series has no value for at this point: a gap in a history, a projection that\n * has not happened yet, a field that did not exist at an earlier capture.\n *\n * An em dash rather than an empty cell, so the row still lines up with its siblings and\n * the reader can see that the series WAS asked and had nothing, rather than wondering\n * whether it was dropped. It is a mark, not a word, so there is nothing here to\n * translate and no label prop to resolve; a caller who wants words passes\n * `formatValue`, which is handed the `undefined` and decides.\n */\nconst NO_VALUE = \"—\";\n\n/**\n * The number this payload item carries, or `undefined` when it carries none.\n *\n * This was `item.value ?? 0`, so every one of the absences above printed a confident\n * \"0\" that appears nowhere in the data — a fabricated figure in a tooltip, which is the\n * one place a reader goes to check an exact number. keksdose found it and wrapped the\n * component rather than trust it. `\"\"` and a non-numeric string are the same absence\n * spelled differently (recharts hands a string value straight through from the data),\n * and are answered the same way.\n */\nfunction tooltipValue(value: number | string | undefined): number | undefined {\n if (value == null || value === \"\") return undefined;\n const n = typeof value === \"string\" ? Number(value) : value;\n return Number.isFinite(n) ? n : undefined;\n}\n\ninterface ChartTooltipContentProps {\n active?: boolean;\n payload?: TooltipPayloadItem[];\n label?: string | number;\n indicator?: \"dot\" | \"line\";\n hideLabel?: boolean;\n labelFormatter?: (label: string | number) => ReactNode;\n /** Formats one series' value for display. NOT called when the series has no value at\n * this point — {@link ChartTooltipContentProps.formatValue} is the one that is. */\n valueFormatter?: (value: number) => ReactNode;\n /** Formats one series' value INCLUDING its absence: handed `undefined` for a gap, a\n * projection that has not happened yet, or a field that did not exist at an earlier\n * capture, and whatever it returns is rendered as-is. Only the caller knows whether\n * that absence reads as a dash, a \"not yet\" or a genuine zero, so this is how it\n * says. Supplying it wins over `valueFormatter` for every value.\n *\n * It sits NEXT to `valueFormatter` rather than widening it because that prop's\n * parameter is contextually typed at every call site there is — `(v) => money(v)` —\n * so widening it to `number | undefined` is a compile error in all three consuming\n * apps, which is a breaking change this module does not get to make by itself. */\n formatValue?: (value: number | undefined) => ReactNode;\n /** Cursor position within the chart, injected by recharts. Used with\n * {@link boundaryRef} to decide whether to flip the tooltip. */\n coordinate?: { x?: number; y?: number };\n /** When set, the tooltip flips to the LEFT of the cursor if it would otherwise\n * spill past the right edge of this (usually horizontally-scrolling) container\n * — e.g. a wide chart whose rightmost bars sat off-screen (feedback #77). */\n boundaryRef?: RefObject<HTMLElement | null>;\n /** Injected by recharts: keep series drawn with `hide` in the tooltip. */\n includeHidden?: boolean;\n /**\n * `\"floating\"` (the default): the box recharts moves with the cursor. `\"readout\"`: the\n * same heading and values as a flat row for a FIXED place outside the plot — a\n * `SeriesChart` whose `tooltip.placement` is `\"above\"`/`\"below\"` portals it there, so\n * a finger on a phone no longer sits on the box it is trying to read (keksdose #359).\n * No border, shadow, width cap or viewport nudge; the values flow in a grid whose\n * column count depends on the row's width alone, so the row is the same height\n * whatever is being pointed at — and, idle, it shows {@link idleKeys} with \"—\".\n */\n variant?: \"floating\" | \"readout\";\n /** Readout only: the series to list while nothing is active, so the row keeps the\n * height it will have once something is. */\n idleKeys?: readonly string[];\n /** Readout only: the heading while nothing is active. Default \"—\". */\n idleLabel?: ReactNode;\n}\n\nexport function ChartTooltipContent({\n active,\n payload,\n label,\n indicator = \"dot\",\n hideLabel = false,\n labelFormatter,\n valueFormatter,\n formatValue,\n coordinate,\n boundaryRef,\n includeHidden = false,\n variant = \"floating\",\n idleKeys,\n idleLabel,\n}: ChartTooltipContentProps) {\n const config = useChart();\n const tipRef = useRef<HTMLDivElement>(null);\n const readout = variant === \"readout\";\n // `ChartTooltip` keeps null values (so they can print \"—\"), which also keeps the\n // series a legend toggle switched off with `hide`; those go here instead.\n const items = includeHidden ? payload : payload?.filter((item) => item.hide !== true);\n const shown = Boolean(active && items?.length);\n // Everything below that measures and moves the box is about a FLOATING one.\n const visible = shown && !readout;\n // Recharts anchors the tooltip at coordinate.x inside the full (scrolled) chart\n // width; subtract the container's scrollLeft to get its on-screen x, then flip\n // left if the tooltip's own width would run past the visible right edge.\n //\n // Both the cursor and the flip are PHYSICAL (the plot is never mirrored, see\n // `ChartContainer`), but an RTL scroller counts `scrollLeft` from its right edge —\n // 0 at the start, negative going left — so there the content's left edge sits\n // `scrollWidth - clientWidth + scrollLeft` px to the left of the visible one.\n //\n // Measured in a layout effect (the DOM is not readable during render), so it commits\n // before paint. `payload` and `label` are deps because they change the tooltip's own\n // width, and recharts hands a fresh `payload` on every tooltip render, so a scroll\n // followed by any re-render is re-measured just as it was when this ran in render.\n const [flip, setFlip] = useState(false);\n const x = coordinate?.x;\n useLayoutEffect(() => {\n const boundary = boundaryRef?.current;\n if (!visible || !boundary || x == null) {\n setFlip(false);\n return;\n }\n const offset = isRtl(boundary)\n ? boundary.scrollWidth - boundary.clientWidth + boundary.scrollLeft\n : boundary.scrollLeft;\n const visibleX = x - offset;\n const tipWidth = tipRef.current?.offsetWidth ?? 160;\n setFlip(visibleX + tipWidth + 12 > boundary.clientWidth);\n }, [visible, x, boundaryRef, payload, label]);\n\n // Whatever placed it — recharts' own rule or the boundary flip above — the box then\n // clamps itself into the viewport, 8px off each edge. The width cap alone did not\n // keep it on screen: on a 390px phone recharts opened a near-full-width tooltip to\n // the RIGHT of a pointer 35% into the plot, and the values ran off the edge\n // (lenkbank, on 0.15.2). Measured after placement, minus the shift it already has,\n // so a re-measure never compounds; an unmeasured box (no layout) is left alone.\n const [nudge, setNudge] = useState(0);\n const nudgeRef = useRef(0);\n // recharts slides its wrapper to each new position with a CSS transition, so the box\n // measured on commit is still where it WAS; measure again once the slide ends.\n const [settled, setSettled] = useState(0);\n useEffect(() => {\n const wrapper = tipRef.current?.closest<HTMLElement>(\".recharts-tooltip-wrapper\");\n if (!visible || !wrapper) return;\n const onEnd = () => setSettled((n) => n + 1);\n wrapper.addEventListener(\"transitionend\", onEnd);\n return () => wrapper.removeEventListener(\"transitionend\", onEnd);\n }, [visible]);\n useLayoutEffect(() => {\n const el = tipRef.current;\n if (!visible || !el) {\n nudgeRef.current = 0;\n setNudge(0);\n return;\n }\n const rect = el.getBoundingClientRect();\n if (rect.width === 0) return;\n const margin = 8;\n const viewport = document.documentElement.clientWidth || window.innerWidth;\n const left = rect.left - nudgeRef.current;\n const right = left + rect.width;\n let next = 0;\n if (right > viewport - margin) next = viewport - margin - right;\n if (left + next < margin) next = margin - left;\n if (next !== nudgeRef.current) {\n nudgeRef.current = next;\n setNudge(next);\n }\n }, [visible, x, payload, label, flip, settled]);\n // One series' line — the floating box stacks them; the readout lays them in a grid,\n // where a long name is cut rather than wrapped so every cell stays one line high.\n const tooltipRow = (item: TooltipPayloadItem, i: number, inRow: boolean) => {\n // Bars/lines/areas identify a series by dataKey; pies/treemaps key off\n // `name` (the nameKey value). Prefer whichever the config knows.\n const dk = item.dataKey != null ? String(item.dataKey) : undefined;\n const nm = item.name != null ? String(item.name) : undefined;\n const cfgKey = dk && config[dk] ? dk : nm && config[nm] ? nm : (dk ?? nm ?? String(i));\n const series = config[cfgKey];\n const fill = typeof item.payload?.fill === \"string\" ? item.payload.fill : undefined;\n // The data point's own `fill` before recharts' `item.color`: a treemap tile,\n // or a bar with a per-cell colour, IS the colour the reader is pointing at,\n // while `item.color` is the series-wide one — every tile's swatch came out\n // `--chart-1` whatever colour the tile was.\n const color = paintedColor(cfgKey, series) ?? fill ?? item.color ?? \"var(--text-muted)\";\n const name = series?.label ?? nm ?? cfgKey;\n const raw = tooltipValue(item.value);\n let text: ReactNode;\n // An idle readout cell has asked nothing yet, so there is no absence for\n // `formatValue` to word — it is the bare mark.\n if (inRow && !shown) text = NO_VALUE;\n else if (formatValue) text = formatValue(raw);\n else if (raw == null) text = NO_VALUE;\n else text = valueFormatter ? valueFormatter(raw) : raw;\n return (\n <div\n key={`${cfgKey}-${i}`}\n // A readout cell is capped so a wide row does not push its value a column away\n // from its name.\n className={cn(\"flex items-center\", inRow ? \"min-w-0 max-w-[12rem] gap-1.5\" : \"gap-2\")}\n >\n <span\n className={cn(\n \"shrink-0 rounded-[2px]\",\n indicator === \"dot\" ? \"h-2.5 w-2.5 rounded-full\" : \"h-2.5 w-1\",\n )}\n style={{ backgroundColor: color }}\n />\n <span\n className={cn(\"min-w-0 text-muted\", inRow ? \"truncate\" : \"break-words\")}\n >\n {name}\n </span>\n <span\n data-private\n // Isolated, so an RTL page does not turn \"-26.6\" into \"26.6-\": a figure has no\n // strong direction of its own, and one formatted with an RTL mark keeps it.\n dir=\"auto\"\n className=\"ms-auto shrink-0 whitespace-nowrap font-mono font-medium tabular-nums text-primary\"\n >\n {text}\n </span>\n </div>\n );\n };\n\n if (readout) {\n // Idle, the row lists every series with no value — the same cells it will have, so\n // nothing under it moves on the first tap.\n const rows: TooltipPayloadItem[] = shown\n ? items!\n : (idleKeys ?? Object.keys(config)).map((key) => ({ dataKey: key }));\n return (\n <div className=\"text-xs\" data-chart-readout={shown ? \"active\" : \"idle\"}>\n {/* A full 24 px line: the zoom's reset button sits at the top corner of a chart\n whose row is above it, and has to fit beside the heading, not over a value. */}\n <div data-readout-heading className=\"truncate font-medium leading-6 text-primary\">\n {shown && !hideLabel && label != null\n ? labelFormatter\n ? labelFormatter(label)\n : label\n : (idleLabel ?? NO_VALUE)}\n </div>\n <div className=\"grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-x-4 gap-y-1\">\n {rows.map((item, i) => tooltipRow(item, i, true))}\n </div>\n </div>\n );\n }\n if (!visible || !items) return null;\n return (\n <div\n ref={tipRef}\n style={\n boundaryRef || nudge\n ? {\n transform: [\n boundaryRef ? (flip ? \"translateX(calc(-100% - 12px))\" : \"translateX(12px)\") : \"\",\n nudge ? `translateX(${nudge}px)` : \"\",\n ]\n .filter(Boolean)\n .join(\" \"),\n }\n : undefined\n }\n // Capped at the viewport: six long series names (lenkbank's German motion\n // labels) made the box wider than a 390px chart, and recharts, which keeps a box\n // inside the plot only when it fits, let it run off the edge with the values cut.\n // Names wrap inside the cap; the values never do.\n className=\"min-w-[9rem] max-w-[min(20rem,calc(100vw-2rem))] rounded-lg border border-subtle bg-surface px-2.5 py-2 text-xs shadow-xl\"\n >\n {!hideLabel && label != null && (\n <div className=\"mb-1.5 font-medium text-primary\">\n {labelFormatter ? labelFormatter(label) : label}\n </div>\n )}\n <div className=\"grid gap-1.5\">{items.map((item, i) => tooltipRow(item, i, false))}</div>\n </div>\n );\n}\n\ninterface LegendPayloadItem {\n value?: string;\n dataKey?: string | number;\n color?: string;\n}\n\ninterface ChartLegendContentProps {\n payload?: LegendPayloadItem[];\n onItemClick?: (key: string) => void;\n /**\n * TOGGLE mode (recommended): the series currently switched off. Each entry is a\n * toggle button — pressed while its series is shown — and a hidden one is drawn\n * faded with its label struck through. Several can be off at once; pair with\n * `toggleHidden(hidden, key)` in `onItemClick` and `hide` on the chart's series.\n */\n hiddenKeys?: ReadonlySet<string> | readonly string[];\n /**\n * ISOLATE mode: the one series shown in full, every other entry dimmed. Kept for\n * the charts built on it; a legend where each entry switches its own series is\n * what readers expect from a legend, so prefer `hiddenKeys`.\n */\n activeKey?: string | null;\n}\n\nexport function ChartLegendContent({\n payload,\n onItemClick,\n hiddenKeys,\n activeKey,\n}: ChartLegendContentProps) {\n const hidden = hiddenKeys ? new Set(hiddenKeys) : null;\n const config = useChart();\n if (!payload?.length) return null;\n return (\n <div className=\"flex flex-wrap items-center justify-center gap-x-4 gap-y-1 pt-3\">\n {payload.map((item, i) => {\n const dk = item.dataKey != null ? String(item.dataKey) : undefined;\n const vv = item.value != null ? String(item.value) : undefined;\n const cfgKey = dk && config[dk] ? dk : vv && config[vv] ? vv : (dk ?? vv ?? String(i));\n const series = config[cfgKey];\n const color = paintedColor(cfgKey, series) ?? item.color ?? \"var(--text-muted)\";\n const label = series?.label ?? vv ?? cfgKey;\n const off = hidden?.has(cfgKey) ?? false;\n const dimmed = off || (activeKey != null && activeKey !== cfgKey);\n const className = cn(\n \"flex items-center gap-1.5 text-secondary transition-opacity\",\n onItemClick ? \"cursor-pointer hover:opacity-80\" : \"cursor-default\",\n dimmed && \"opacity-40\",\n );\n const swatch = (\n <span\n aria-hidden\n className=\"h-2.5 w-2.5 shrink-0 rounded-[3px]\"\n style={{ backgroundColor: color } as CSSProperties}\n />\n );\n // A legend with no `onItemClick` is a KEY, not a control — and that is every\n // legend in kastlan, where this rendered N focusable buttons per chart that did\n // nothing when activated. A keyboard user paid the tab stops for all of them,\n // and a screen reader announced each one as a button, promising an action there\n // was none of. The interactive branch is unchanged.\n return onItemClick ? (\n <button\n key={`${cfgKey}-${i}`}\n type=\"button\"\n onClick={() => onItemClick(cfgKey)}\n // Toggles report their state: in toggle mode pressed = the series is shown;\n // in isolate mode pressed = the isolated one. With neither supplied the\n // legend knows nothing about state, and a pressed=\"false\" it cannot vouch\n // for would lie — so it says nothing.\n aria-pressed={\n hidden ? !off : activeKey === undefined ? undefined : activeKey === cfgKey\n }\n className={className}\n >\n {swatch}\n <span className={cn(off && \"line-through\")}>{label}</span>\n </button>\n ) : (\n <span key={`${cfgKey}-${i}`} className={className}>\n {swatch}\n {label}\n </span>\n );\n })}\n </div>\n );\n}\n"],"mappings":";AAgEM,SAuBE,KAvBF;AAtDN,SAAS,eAAe,YAAY,WAAW,OAAO,iBAAiB,QAAQ,gBAAgB;AAE/F;AAAA,EACE,UAAU;AAAA,EACV;AAAA,EACA,WAAW;AAAA,OACN;AACP,SAAS,UAAU;AACnB,SAAS,aAAa;AAStB,MAAM,eAAe,cAAkC,IAAI;AAEpD,SAAS,WAAwB;AACtC,QAAM,MAAM,WAAW,YAAY;AACnC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,mDAAmD;AAC7E,SAAO;AACT;AAqBO,SAAS,eAAe,EAAE,IAAI,WAAW,UAAU,QAAQ,GAAG,MAAM,GAAwB;AACjG,QAAM,MAAM,MAAM;AAMlB,QAAM,UAAU,UAAU,MAAM,KAAK,QAAQ,mBAAmB,EAAE,CAAC;AACnE,SACE,oBAAC,aAAa,UAAb,EAAsB,OAAO,QAC5B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M,KAAK,KAAK,SAAS;AAC5D,UAAM,QAAQ,QAAQ,SAAS,MAAM;AACrC,UAAM,MAAM,QAAQ,IAAI,MAAM,KAAK;AACnC,UAAM,SAAS,OAAQ,aAAa,QAAQ,cAAc;AAC1D,UAAM,YAAY;AAAA,MAChB;AAAA,MACA,cAAc,oCAAoC;AAAA,MAClD,UAAU;AAAA,IACZ;AACA,UAAM,SACJ;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,QACX,WAAU;AAAA,QACV,OAAO,EAAE,iBAAiB,MAAM;AAAA;AAAA,IAClC;AAOF,WAAO,cACL;AAAA,MAAC;AAAA;AAAA,QAEC,MAAK;AAAA,QACL,SAAS,MAAM,YAAY,MAAM;AAAA,QAKjC,gBACE,SAAS,CAAC,MAAM,cAAc,SAAY,SAAY,cAAc;AAAA,QAEtE;AAAA,QAEC;AAAA;AAAA,UACD,oBAAC,UAAK,WAAW,GAAG,OAAO,cAAc,GAAI,iBAAM;AAAA;AAAA;AAAA,MAb9C,GAAG,MAAM,IAAI,CAAC;AAAA,IAcrB,IAEA,qBAAC,UAA4B,WAC1B;AAAA;AAAA,MACA;AAAA,SAFQ,GAAG,MAAM,IAAI,CAAC,EAGzB;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { CommitScope } from './write-lock.js';
|
|
4
|
-
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type CommitScope } from "./write-lock.js";
|
|
5
3
|
/** One box of a {@link CheckboxGroup}. */
|
|
6
|
-
interface CheckboxGroupOption<T extends string = string> {
|
|
4
|
+
export interface CheckboxGroupOption<T extends string = string> {
|
|
7
5
|
value: T;
|
|
8
6
|
/** The words beside the box — its accessible name. */
|
|
9
7
|
label: ReactNode;
|
|
@@ -15,8 +13,8 @@ interface CheckboxGroupOption<T extends string = string> {
|
|
|
15
13
|
}
|
|
16
14
|
/** Whether the legend is drawn. `"sr-only"` keeps it as the group's name for a screen
|
|
17
15
|
* reader where the dialog's title already says it to the eye. */
|
|
18
|
-
type CheckboxGroupLegendVisibility = "visible" | "sr-only";
|
|
19
|
-
interface CheckboxGroupProps<T extends string = string> {
|
|
16
|
+
export type CheckboxGroupLegendVisibility = "visible" | "sr-only";
|
|
17
|
+
export interface CheckboxGroupProps<T extends string = string> {
|
|
20
18
|
/** The question the boxes answer — the fieldset's `<legend>`, which names the group.
|
|
21
19
|
* Without one, pass `aria-label`. */
|
|
22
20
|
legend?: ReactNode;
|
|
@@ -100,6 +98,4 @@ interface CheckboxGroupProps<T extends string = string> {
|
|
|
100
98
|
* error describe the fieldset. For a choice of ONE, use radios ({@link ChoiceCardGroup},
|
|
101
99
|
* {@link ToggleGroup}).
|
|
102
100
|
*/
|
|
103
|
-
declare function CheckboxGroup<T extends string = string>({ legend, legendVisibility, "aria-label": ariaLabel, options, value, onChange, layout, columns, name, disabled, required, hint, error, invalid, commit, disabledReason, id, className, listClassName, "aria-describedby": ariaDescribedBy, }: CheckboxGroupProps<T>): react.JSX.Element;
|
|
104
|
-
|
|
105
|
-
export { CheckboxGroup, type CheckboxGroupLegendVisibility, type CheckboxGroupOption, type CheckboxGroupProps };
|
|
101
|
+
export declare function CheckboxGroup<T extends string = string>({ legend, legendVisibility, "aria-label": ariaLabel, options, value, onChange, layout, columns, name, disabled, required, hint, error, invalid, commit, disabledReason, id, className, listClassName, "aria-describedby": ariaDescribedBy, }: CheckboxGroupProps<T>): import("react").JSX.Element;
|
|
@@ -3,9 +3,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useId } from "react";
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
5
|
import { Checkbox } from "./checkbox.js";
|
|
6
|
-
import {
|
|
6
|
+
import { hasContent } from "../lib/presence.js";
|
|
7
7
|
import { useCommitReason } from "./write-lock.js";
|
|
8
|
-
import { RequiredStarOnLegend } from "./field-parts.js";
|
|
8
|
+
import { FIELD_ERROR_CLASS, mergeDescribedBy, RequiredStarOnLegend, useInlineHint } from "./field-parts.js";
|
|
9
9
|
const COLUMNS = {
|
|
10
10
|
1: "flex flex-col gap-2",
|
|
11
11
|
2: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
@@ -37,12 +37,13 @@ function CheckboxGroup({
|
|
|
37
37
|
const generated = useId();
|
|
38
38
|
const hintId = `${generated}-hint`;
|
|
39
39
|
const errorId = `${generated}-error`;
|
|
40
|
-
const
|
|
41
|
-
const
|
|
40
|
+
const shownHint = useInlineHint(hint);
|
|
41
|
+
const showHint = hasContent(shownHint);
|
|
42
|
+
const showError = hasContent(error);
|
|
42
43
|
const isInvalid = Boolean(invalid) || showError;
|
|
43
44
|
const ticked = new Set(value);
|
|
44
45
|
const reason = useCommitReason(commit, disabledReason);
|
|
45
|
-
const locked =
|
|
46
|
+
const locked = hasContent(reason);
|
|
46
47
|
const toggle = (v, on) => {
|
|
47
48
|
const next = new Set(value);
|
|
48
49
|
if (on) next.add(v);
|
|
@@ -66,10 +67,10 @@ function CheckboxGroup({
|
|
|
66
67
|
legend !== void 0 && /* @__PURE__ */ jsxs(
|
|
67
68
|
"legend",
|
|
68
69
|
{
|
|
69
|
-
className: legendVisibility === "sr-only" ? "sr-only" : cn("mb-2 p-0 text-sm font-medium text-
|
|
70
|
+
className: legendVisibility === "sr-only" ? "sr-only" : cn("mb-2 p-0 text-sm font-medium text-primary", (disabled || locked) && "opacity-60"),
|
|
70
71
|
children: [
|
|
71
72
|
legend,
|
|
72
|
-
required && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ms-0.5 text-
|
|
73
|
+
required && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "ms-0.5 text-danger", children: "*" })
|
|
73
74
|
]
|
|
74
75
|
}
|
|
75
76
|
),
|
|
@@ -99,8 +100,8 @@ function CheckboxGroup({
|
|
|
99
100
|
}
|
|
100
101
|
) }),
|
|
101
102
|
showHint && // A `div`, not a `p`: a hint may be a node with a link in it.
|
|
102
|
-
/* @__PURE__ */ jsx("div", { id: hintId, className: "mt-1.5 text-caption leading-tight text-
|
|
103
|
-
showError && /* @__PURE__ */ jsx("p", { id: errorId, className:
|
|
103
|
+
/* @__PURE__ */ jsx("div", { id: hintId, className: "mt-1.5 text-caption leading-tight text-muted", children: shownHint }),
|
|
104
|
+
showError && /* @__PURE__ */ jsx("p", { id: errorId, className: FIELD_ERROR_CLASS, children: error })
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
107
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/checkbox-group.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { Checkbox } from \"./checkbox\";\nimport { hasMessage, mergeDescribedBy } from \"./choice-parts\";\nimport { useCommitReason, type CommitScope } from \"./write-lock\";\nimport { RequiredStarOnLegend } from \"./field-parts\";\n\n/** One box of a {@link CheckboxGroup}. */\nexport interface CheckboxGroupOption<T extends string = string> {\n value: T;\n /** The words beside the box — its accessible name. */\n label: ReactNode;\n /** A line under the label (\"Imprint, Privacy Policy and Terms only\"), attached to the\n * box with `aria-describedby` — {@link Checkbox}'s `description`. */\n hint?: ReactNode;\n /** This box cannot be changed; the others can. */\n disabled?: boolean;\n}\n\n/** Whether the legend is drawn. `\"sr-only\"` keeps it as the group's name for a screen\n * reader where the dialog's title already says it to the eye. */\nexport type CheckboxGroupLegendVisibility = \"visible\" | \"sr-only\";\n\nexport interface CheckboxGroupProps<T extends string = string> {\n /** The question the boxes answer — the fieldset's `<legend>`, which names the group.\n * Without one, pass `aria-label`. */\n legend?: ReactNode;\n /** Default `\"visible\"`. */\n legendVisibility?: CheckboxGroupLegendVisibility;\n \"aria-label\"?: string;\n /** One box per option, in this order. */\n options: CheckboxGroupOption<T>[];\n /** The ticked values. Controlled. */\n value: T[];\n /**\n * The new set on every tick. In the ORDER OF `options`, not the order the boxes were\n * ticked, so a list saved from it does not change with the order someone clicked in\n * (ChoiceCardGroup's rule). A value in `value` that no option carries — a grant for a\n * locale the app no longer offers — is kept, after the known ones: a picker that\n * dropped what it could not show would delete it on the next unrelated tick.\n */\n onChange: (value: T[]) => void;\n /**\n * `\"vertical\"` (default): one box per line. `\"horizontal\"`: a wrapping row, for a few\n * short labels. With `columns`, vertical becomes a grid of that many columns from the\n * `sm` breakpoint up and stays one column on a phone — the reviewer dialog's shape.\n */\n layout?: \"vertical\" | \"horizontal\";\n /** Columns for a vertical group, from `sm` up (one on a phone). Default 1. */\n columns?: 1 | 2 | 3 | 4;\n /** Shared by every box — what a plain form submits the values under. */\n name?: string;\n /** Every box: the fieldset's own `disabled` (which disables them all natively), each\n * box faded as a disabled Checkbox is, and the legend with them. */\n disabled?: boolean;\n /**\n * At least one box must be ticked. Draws the required star after the legend, and puts\n * the native `required` on every box while NONE is ticked — so a form refuses an\n * empty set — and on none once one is (ChoiceCardGroup's rule: checkboxes cannot say\n * \"at least one\" natively).\n */\n required?: boolean;\n /**\n * Standing advice for the group, under the boxes, attached to the fieldset with\n * `aria-describedby` before the error — the field anatomy every kit field keeps.\n */\n hint?: ReactNode;\n /** What is wrong with the set, in the caller's words. Under the boxes, on the\n * fieldset's `aria-describedby`, and paints every box invalid. */\n error?: ReactNode;\n /** Paints every box invalid without a message (the message lives elsewhere). */\n invalid?: boolean;\n /**\n * The group SAVES on change — each tick is written straight away (a reviewer's\n * per-locale grants). Under a locked {@link WriteLockProvider} every box is locked\n * the focusable way with the lock's reason. See {@link Checkbox}'s `commit`.\n */\n commit?: CommitScope;\n /** Why no box can be changed — every box gets it, and it wins over `disabled` (the\n * boxes stay focusable to say it). See {@link Checkbox}'s `disabledReason`. */\n disabledReason?: ReactNode;\n /** The fieldset's id. */\n id?: string;\n /** Classes for the fieldset — the outermost element, where layout belongs. */\n className?: string;\n /** Classes for the box list (the grid or the row). */\n listClassName?: string;\n /** Ids of something else on the page that describes the group; merged before the\n * group's own hint and error. */\n \"aria-describedby\"?: string;\n}\n\n// Literal class strings so Tailwind's scanner sees each one.\nconst COLUMNS: Record<NonNullable<CheckboxGroupProps[\"columns\"]>, string> = {\n 1: \"flex flex-col gap-2\",\n 2: \"grid grid-cols-1 gap-2 sm:grid-cols-2\",\n 3: \"grid grid-cols-1 gap-2 sm:grid-cols-3\",\n 4: \"grid grid-cols-1 gap-2 sm:grid-cols-2 md:grid-cols-4\",\n};\n\n/**\n * A set of kit {@link Checkbox}es answering one question, in a `<fieldset>`.\n *\n * Kurvenschmiede's reviewer dialog (features/admin/reviewer-dialog.tsx) builds this by\n * hand — a fieldset, an `sr-only` legend, a grid of checkboxes, a `toggle(code, on)`\n * that adds or filters a `string[]` — and keksdose's and kastlan's reviewer grants build\n * the same picker for the same per-locale grant. The hand-built ones differ in the parts\n * that are easy to get wrong: whether the legend names the group, whether a hint or an\n * error is attached to anything, what order the saved list comes out in, and whether a\n * value the picker cannot show survives a tick.\n *\n * Every box is a kit {@link Checkbox}, so the native checkbox semantics stay (each box\n * submits under `name` in a plain form). The legend is the group's name; the hint and\n * error describe the fieldset. For a choice of ONE, use radios ({@link ChoiceCardGroup},\n * {@link ToggleGroup}).\n */\nexport function CheckboxGroup<T extends string = string>({\n legend,\n legendVisibility = \"visible\",\n \"aria-label\": ariaLabel,\n options,\n value,\n onChange,\n layout = \"vertical\",\n columns = 1,\n name,\n disabled,\n required,\n hint,\n error,\n invalid,\n commit,\n disabledReason,\n id,\n className,\n listClassName,\n \"aria-describedby\": ariaDescribedBy,\n}: CheckboxGroupProps<T>) {\n const generated = useId();\n const hintId = `${generated}-hint`;\n const errorId = `${generated}-error`;\n const showHint = hasMessage(hint);\n const showError = hasMessage(error);\n const isInvalid = Boolean(invalid) || showError;\n const ticked = new Set(value);\n // Resolved here rather than per box: a reason has to keep the fieldset from being\n // natively `disabled` too, or it would take every box out of the tab order — the\n // thing a reason exists to prevent.\n const reason = useCommitReason(commit, disabledReason);\n const locked = hasMessage(reason);\n\n const toggle = (v: T, on: boolean) => {\n const next = new Set(value);\n if (on) next.add(v);\n else next.delete(v);\n const known = new Set(options.map((o) => o.value));\n onChange([\n ...options.map((o) => o.value).filter((x) => next.has(x)),\n // Values no option carries, kept in their own order — see `onChange`.\n ...value.filter((x) => !known.has(x)),\n ]);\n };\n\n return (\n <fieldset\n id={id}\n aria-label={ariaLabel}\n aria-describedby={mergeDescribedBy(ariaDescribedBy, showHint && hintId, showError && errorId)}\n disabled={disabled && !locked}\n // `relative` holds an `sr-only` legend (sr-only-containment.test); `min-w-0`\n // undoes a fieldset's `min-width: min-content`, which would otherwise push a long\n // label past a phone's edge instead of wrapping it.\n className={cn(\"relative m-0 min-w-0 border-0 p-0\", className)}\n >\n {legend !== undefined && (\n <legend\n className={\n legendVisibility === \"sr-only\"\n ? \"sr-only\"\n : cn(\"mb-2 p-0 text-sm font-medium text-[var(--text-primary)]\", (disabled || locked) && \"opacity-60\")\n }\n >\n {legend}\n {required && (\n <span aria-hidden className=\"ms-0.5 text-[var(--danger)]\">\n *\n </span>\n )}\n </legend>\n )}\n <RequiredStarOnLegend.Provider value={true}>\n <div\n className={cn(\n layout === \"horizontal\" ? \"flex flex-wrap gap-x-4 gap-y-2\" : COLUMNS[columns],\n listClassName,\n )}\n >\n {options.map((o) => (\n <Checkbox\n key={o.value}\n name={name}\n value={o.value}\n label={o.label}\n description={o.hint}\n checked={ticked.has(o.value)}\n onCheckedChange={(on) => toggle(o.value, on)}\n disabled={disabled || o.disabled}\n invalid={isInvalid || undefined}\n required={required && value.length === 0 ? true : undefined}\n disabledReason={reason}\n />\n ))}\n </div>\n </RequiredStarOnLegend.Provider>\n {showHint && (\n // A `div`, not a `p`: a hint may be a node with a link in it.\n <div id={hintId} className=\"mt-1.5 text-caption leading-tight text-[var(--text-muted)]\">\n {hint}\n </div>\n )}\n {showError && (\n <p id={errorId} className=\"mt-1 text-caption leading-tight text-[var(--danger)]\">\n {error}\n </p>\n )}\n </fieldset>\n );\n}\n"],"mapp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src/components/checkbox-group.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { Checkbox } from \"./checkbox\";\nimport { hasContent } from \"../lib/presence\";\nimport { useCommitReason, type CommitScope } from \"./write-lock\";\nimport { FIELD_ERROR_CLASS, mergeDescribedBy, RequiredStarOnLegend, useInlineHint } from \"./field-parts\";\n\n/** One box of a {@link CheckboxGroup}. */\nexport interface CheckboxGroupOption<T extends string = string> {\n value: T;\n /** The words beside the box — its accessible name. */\n label: ReactNode;\n /** A line under the label (\"Imprint, Privacy Policy and Terms only\"), attached to the\n * box with `aria-describedby` — {@link Checkbox}'s `description`. */\n hint?: ReactNode;\n /** This box cannot be changed; the others can. */\n disabled?: boolean;\n}\n\n/** Whether the legend is drawn. `\"sr-only\"` keeps it as the group's name for a screen\n * reader where the dialog's title already says it to the eye. */\nexport type CheckboxGroupLegendVisibility = \"visible\" | \"sr-only\";\n\nexport interface CheckboxGroupProps<T extends string = string> {\n /** The question the boxes answer — the fieldset's `<legend>`, which names the group.\n * Without one, pass `aria-label`. */\n legend?: ReactNode;\n /** Default `\"visible\"`. */\n legendVisibility?: CheckboxGroupLegendVisibility;\n \"aria-label\"?: string;\n /** One box per option, in this order. */\n options: CheckboxGroupOption<T>[];\n /** The ticked values. Controlled. */\n value: T[];\n /**\n * The new set on every tick. In the ORDER OF `options`, not the order the boxes were\n * ticked, so a list saved from it does not change with the order someone clicked in\n * (ChoiceCardGroup's rule). A value in `value` that no option carries — a grant for a\n * locale the app no longer offers — is kept, after the known ones: a picker that\n * dropped what it could not show would delete it on the next unrelated tick.\n */\n onChange: (value: T[]) => void;\n /**\n * `\"vertical\"` (default): one box per line. `\"horizontal\"`: a wrapping row, for a few\n * short labels. With `columns`, vertical becomes a grid of that many columns from the\n * `sm` breakpoint up and stays one column on a phone — the reviewer dialog's shape.\n */\n layout?: \"vertical\" | \"horizontal\";\n /** Columns for a vertical group, from `sm` up (one on a phone). Default 1. */\n columns?: 1 | 2 | 3 | 4;\n /** Shared by every box — what a plain form submits the values under. */\n name?: string;\n /** Every box: the fieldset's own `disabled` (which disables them all natively), each\n * box faded as a disabled Checkbox is, and the legend with them. */\n disabled?: boolean;\n /**\n * At least one box must be ticked. Draws the required star after the legend, and puts\n * the native `required` on every box while NONE is ticked — so a form refuses an\n * empty set — and on none once one is (ChoiceCardGroup's rule: checkboxes cannot say\n * \"at least one\" natively).\n */\n required?: boolean;\n /**\n * Standing advice for the group, under the boxes, attached to the fieldset with\n * `aria-describedby` before the error — the field anatomy every kit field keeps.\n */\n hint?: ReactNode;\n /** What is wrong with the set, in the caller's words. Under the boxes, on the\n * fieldset's `aria-describedby`, and paints every box invalid. */\n error?: ReactNode;\n /** Paints every box invalid without a message (the message lives elsewhere). */\n invalid?: boolean;\n /**\n * The group SAVES on change — each tick is written straight away (a reviewer's\n * per-locale grants). Under a locked {@link WriteLockProvider} every box is locked\n * the focusable way with the lock's reason. See {@link Checkbox}'s `commit`.\n */\n commit?: CommitScope;\n /** Why no box can be changed — every box gets it, and it wins over `disabled` (the\n * boxes stay focusable to say it). See {@link Checkbox}'s `disabledReason`. */\n disabledReason?: ReactNode;\n /** The fieldset's id. */\n id?: string;\n /** Classes for the fieldset — the outermost element, where layout belongs. */\n className?: string;\n /** Classes for the box list (the grid or the row). */\n listClassName?: string;\n /** Ids of something else on the page that describes the group; merged before the\n * group's own hint and error. */\n \"aria-describedby\"?: string;\n}\n\n// Literal class strings so Tailwind's scanner sees each one.\nconst COLUMNS: Record<NonNullable<CheckboxGroupProps[\"columns\"]>, string> = {\n 1: \"flex flex-col gap-2\",\n 2: \"grid grid-cols-1 gap-2 sm:grid-cols-2\",\n 3: \"grid grid-cols-1 gap-2 sm:grid-cols-3\",\n 4: \"grid grid-cols-1 gap-2 sm:grid-cols-2 md:grid-cols-4\",\n};\n\n/**\n * A set of kit {@link Checkbox}es answering one question, in a `<fieldset>`.\n *\n * Kurvenschmiede's reviewer dialog (features/admin/reviewer-dialog.tsx) builds this by\n * hand — a fieldset, an `sr-only` legend, a grid of checkboxes, a `toggle(code, on)`\n * that adds or filters a `string[]` — and keksdose's and kastlan's reviewer grants build\n * the same picker for the same per-locale grant. The hand-built ones differ in the parts\n * that are easy to get wrong: whether the legend names the group, whether a hint or an\n * error is attached to anything, what order the saved list comes out in, and whether a\n * value the picker cannot show survives a tick.\n *\n * Every box is a kit {@link Checkbox}, so the native checkbox semantics stay (each box\n * submits under `name` in a plain form). The legend is the group's name; the hint and\n * error describe the fieldset. For a choice of ONE, use radios ({@link ChoiceCardGroup},\n * {@link ToggleGroup}).\n */\nexport function CheckboxGroup<T extends string = string>({\n legend,\n legendVisibility = \"visible\",\n \"aria-label\": ariaLabel,\n options,\n value,\n onChange,\n layout = \"vertical\",\n columns = 1,\n name,\n disabled,\n required,\n hint,\n error,\n invalid,\n commit,\n disabledReason,\n id,\n className,\n listClassName,\n \"aria-describedby\": ariaDescribedBy,\n}: CheckboxGroupProps<T>) {\n const generated = useId();\n const hintId = `${generated}-hint`;\n const errorId = `${generated}-error`;\n // §4: a FieldHint under the group is its words at Large and on a touch screen, not a\n // lone \"?\" (DUP-2, refactor audit 2026-10). A HelpPopover stays a \"?\".\n const shownHint = useInlineHint(hint);\n const showHint = hasContent(shownHint);\n const showError = hasContent(error);\n const isInvalid = Boolean(invalid) || showError;\n const ticked = new Set(value);\n // Resolved here rather than per box: a reason has to keep the fieldset from being\n // natively `disabled` too, or it would take every box out of the tab order — the\n // thing a reason exists to prevent.\n const reason = useCommitReason(commit, disabledReason);\n const locked = hasContent(reason);\n\n const toggle = (v: T, on: boolean) => {\n const next = new Set(value);\n if (on) next.add(v);\n else next.delete(v);\n const known = new Set(options.map((o) => o.value));\n onChange([\n ...options.map((o) => o.value).filter((x) => next.has(x)),\n // Values no option carries, kept in their own order — see `onChange`.\n ...value.filter((x) => !known.has(x)),\n ]);\n };\n\n return (\n <fieldset\n id={id}\n aria-label={ariaLabel}\n aria-describedby={mergeDescribedBy(ariaDescribedBy, showHint && hintId, showError && errorId)}\n disabled={disabled && !locked}\n // `relative` holds an `sr-only` legend (sr-only-containment.test); `min-w-0`\n // undoes a fieldset's `min-width: min-content`, which would otherwise push a long\n // label past a phone's edge instead of wrapping it.\n className={cn(\"relative m-0 min-w-0 border-0 p-0\", className)}\n >\n {legend !== undefined && (\n <legend\n className={\n legendVisibility === \"sr-only\"\n ? \"sr-only\"\n : cn(\"mb-2 p-0 text-sm font-medium text-primary\", (disabled || locked) && \"opacity-60\")\n }\n >\n {legend}\n {required && (\n <span aria-hidden className=\"ms-0.5 text-danger\">\n *\n </span>\n )}\n </legend>\n )}\n <RequiredStarOnLegend.Provider value={true}>\n <div\n className={cn(\n layout === \"horizontal\" ? \"flex flex-wrap gap-x-4 gap-y-2\" : COLUMNS[columns],\n listClassName,\n )}\n >\n {options.map((o) => (\n <Checkbox\n key={o.value}\n name={name}\n value={o.value}\n label={o.label}\n description={o.hint}\n checked={ticked.has(o.value)}\n onCheckedChange={(on) => toggle(o.value, on)}\n disabled={disabled || o.disabled}\n invalid={isInvalid || undefined}\n required={required && value.length === 0 ? true : undefined}\n disabledReason={reason}\n />\n ))}\n </div>\n </RequiredStarOnLegend.Provider>\n {showHint && (\n // A `div`, not a `p`: a hint may be a node with a link in it.\n <div id={hintId} className=\"mt-1.5 text-caption leading-tight text-muted\">\n {shownHint}\n </div>\n )}\n {showError && (\n <p id={errorId} className={FIELD_ERROR_CLASS}>\n {error}\n </p>\n )}\n </fieldset>\n );\n}\n"],"mappings":";AAmLQ,SASI,KATJ;AAnLR,SAAS,aAAa;AAEtB,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,uBAAyC;AAClD,SAAS,mBAAmB,kBAAkB,sBAAsB,qBAAqB;AAwFzF,MAAM,UAAsE;AAAA,EAC1E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAkBO,SAAS,cAAyC;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A,mBAAW,UACV;AAAA,UAAC;AAAA;AAAA,YACC,WACE,qBAAqB,YACjB,YACA,GAAG,8CAA8C,YAAY,WAAW,YAAY;AAAA,YAGzF;AAAA;AAAA,cACA,YACC,oBAAC,UAAK,eAAW,MAAC,WAAU,sBAAqB,eAEjD;AAAA;AAAA;AAAA,QAEJ;AAAA,QAEF,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,MACpC;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT,WAAW,eAAe,mCAAmC,QAAQ,OAAO;AAAA,cAC5E;AAAA,YACF;AAAA,YAEC,kBAAQ,IAAI,CAAC,MACZ;AAAA,cAAC;AAAA;AAAA,gBAEC;AAAA,gBACA,OAAO,EAAE;AAAA,gBACT,OAAO,EAAE;AAAA,gBACT,aAAa,EAAE;AAAA,gBACf,SAAS,OAAO,IAAI,EAAE,KAAK;AAAA,gBAC3B,iBAAiB,CAAC,OAAO,OAAO,EAAE,OAAO,EAAE;AAAA,gBAC3C,UAAU,YAAY,EAAE;AAAA,gBACxB,SAAS,aAAa;AAAA,gBACtB,UAAU,YAAY,MAAM,WAAW,IAAI,OAAO;AAAA,gBAClD,gBAAgB;AAAA;AAAA,cAVX,EAAE;AAAA,YAWT,CACD;AAAA;AAAA,QACH,GACF;AAAA,QACC;AAAA,QAEC,oBAAC,SAAI,IAAI,QAAQ,WAAU,gDACxB,qBACH;AAAA,QAED,aACC,oBAAC,OAAE,IAAI,SAAS,WAAW,mBACxB,iBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import './tooltip.js';
|
|
6
|
-
import '../hooks/use-anchored-rect.js';
|
|
7
|
-
import '../lib/clipping.js';
|
|
8
|
-
|
|
9
|
-
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
import { type DisabledReasonDisplay } from "./field-parts.js";
|
|
3
|
+
import type { CommitScope } from "./write-lock.js";
|
|
4
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
10
5
|
/**
|
|
11
6
|
* The words beside the box. Rendered as a `<label for>` rather than a label that
|
|
12
7
|
* wraps the input, so `description` and `error` can sit under it without becoming
|
|
@@ -74,6 +69,9 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "typ
|
|
|
74
69
|
* No provider, or an unlocked one: no effect. Button's `commit`, for keksdose K3.
|
|
75
70
|
*/
|
|
76
71
|
commit?: CommitScope;
|
|
72
|
+
/** The `<input type="checkbox">`. A React 19 ref prop since 0.34 (MOD-4, refactor
|
|
73
|
+
* audit 2026-10); it was `forwardRef`. */
|
|
74
|
+
ref?: Ref<HTMLInputElement>;
|
|
77
75
|
}
|
|
78
76
|
/**
|
|
79
77
|
* A native checkbox in the kit's tokens, with an optional label, description and
|
|
@@ -85,6 +83,4 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "typ
|
|
|
85
83
|
* (`checked`, `defaultChecked`, `name`, `required`, `data-*`, `aria-*`), so it works
|
|
86
84
|
* controlled, uncontrolled, and inside a plain `<form>`.
|
|
87
85
|
*/
|
|
88
|
-
declare
|
|
89
|
-
|
|
90
|
-
export { Checkbox, type CheckboxProps };
|
|
86
|
+
export declare function Checkbox({ ref, label, description, indeterminate, invalid, error, onCheckedChange, onChange, className, inputClassName, id, disabled, required, disabledReason, disabledReasonDisplay, commit, onClick, ...rest }: CheckboxProps): import("react").JSX.Element;
|