@eifi1/ui-kit 0.33.1 → 0.35.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 +512 -306
- 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 +12 -110
- 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 +12 -110
- 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 +64 -111
- 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 +6 -108
- package/dist/components/calculator.js +8 -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 +2 -205
- package/dist/components/chart-zoom.js +2 -330
- 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 +69 -0
- package/dist/components/chip-input.js +220 -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 +15 -160
- 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 +74 -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 +58 -0
- package/dist/components/currency-option-list.js +107 -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 +40 -23
- 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 +83 -15
- package/dist/components/data-table-labels.js +4 -29
- 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 +93 -0
- package/dist/components/data-table-shared.js +99 -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 +613 -15
- package/dist/components/data-table.js +150 -939
- 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 +10 -12
- 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 +61 -30
- package/dist/components/dropdown.js +61 -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 +11 -12
- 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 +255 -0
- package/dist/components/field-base.js +223 -0
- package/dist/components/field-base.js.map +1 -0
- package/dist/components/field-parts.d.ts +180 -87
- package/dist/components/field-parts.js +52 -33
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-strip.d.ts +12 -36
- package/dist/components/field-strip.js +24 -22
- 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 +16 -19
- package/dist/components/field-sync.js +4 -14
- 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 +12 -18
- package/dist/components/hover-menu.js +19 -18
- 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 +34 -18
- package/dist/components/modal.js +13 -13
- 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 +74 -25
- package/dist/components/multi-select.js +166 -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 +28 -112
- package/dist/components/number-input.js +33 -67
- 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 +29 -26
- package/dist/components/server-wake.js +15 -35
- package/dist/components/server-wake.js.map +1 -1
- package/dist/components/settings-fields.d.ts +50 -120
- 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 +21 -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 +11 -39
- package/dist/components/swipeable-row.js +13 -18
- 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 +24 -15
- package/dist/components/tooltip.js +24 -14
- 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 +35 -25
- package/dist/components/translation-review.js +24 -13
- 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 +182 -15
- package/dist/components/use-table-state.js +53 -8
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/components/user-avatar.d.ts +10 -23
- package/dist/components/user-avatar.js +1 -1
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/wizard-stepper.d.ts +4 -7
- package/dist/components/wizard-stepper.js +3 -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/currencies.d.ts +23 -0
- package/dist/currencies.js +38 -0
- package/dist/currencies.js.map +1 -0
- package/dist/data-table.d.ts +10 -18
- package/dist/data-table.js.map +1 -1
- package/dist/demo/demo-banner.d.ts +15 -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/eslint/index.d.ts +83 -0
- package/dist/eslint/index.js +69 -0
- package/dist/eslint/index.js.map +1 -0
- package/dist/eslint/role-utilities.d.ts +48 -0
- package/dist/eslint/role-utilities.generated.d.ts +2 -0
- package/dist/eslint/role-utilities.generated.js +143 -0
- package/dist/eslint/role-utilities.generated.js.map +1 -0
- package/dist/eslint/role-utilities.js +43 -0
- package/dist/eslint/role-utilities.js.map +1 -0
- 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 +373 -101
- package/dist/feedback/feedback-thread.js +26 -35
- 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 +50 -11
- package/dist/hooks/use-dismiss.js +80 -9
- 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 +619 -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 +56 -10
- 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 +56 -10
- 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 +330 -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/refs.d.ts +13 -0
- package/dist/lib/refs.js +15 -0
- package/dist/lib/refs.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 +131 -197
- package/dist/rhf/fields.js +46 -54
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form-core.d.ts +154 -0
- package/dist/rhf/form-core.js +143 -0
- package/dist/rhf/form-core.js.map +1 -0
- package/dist/rhf/form.d.ts +9 -175
- package/dist/rhf/form.js +2 -139
- 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/use-rhf-wizard-step.js.map +1 -1
- 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 +7 -9
- package/dist/shell/option-switcher-menu.js +4 -4
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/role-switcher.d.ts +3 -7
- package/dist/shell/role-switcher.js +3 -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 +18 -31
- package/dist/shell/topbar-action-menu.js +10 -10
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.d.ts +14 -21
- package/dist/shell/topbar-controls.js +11 -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 +11 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/viewport.d.ts +116 -0
- package/dist/testing/viewport.js +203 -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 +18 -15
- package/dist/theme/palette-presets.js +66 -345
- 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 +13 -18
- package/dist/wizard/types.js +2 -24
- 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 +17 -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 +7 -3
- 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 +6 -3
- package/src/billing/subscription-actions.tsx +4 -4
- package/src/chart.ts +9 -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 +458 -406
- 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 +14 -12
- 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 +21 -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 +370 -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 +70 -896
- 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 +15 -13
- package/src/components/country-select-labels.ts +11 -0
- package/src/components/country-select.tsx +74 -89
- package/src/components/currency-option-list.tsx +182 -0
- package/src/components/currency-select.tsx +85 -196
- package/src/components/danger-confirm-labels.ts +20 -0
- package/src/components/danger-confirm.tsx +72 -80
- 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 +51 -25
- 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 +21 -71
- 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 +225 -0
- package/src/components/data-table.tsx +205 -1315
- 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 +11 -7
- package/src/components/disclosure.tsx +14 -14
- package/src/components/dropdown.tsx +129 -43
- package/src/components/empty-state.tsx +137 -0
- package/src/components/entity-combobox.tsx +18 -13
- 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 +604 -0
- package/src/components/field-parts.tsx +192 -77
- package/src/components/field-strip.tsx +12 -33
- package/src/components/field-sync-labels.ts +13 -0
- package/src/components/field-sync.tsx +8 -16
- package/src/components/field.tsx +17 -15
- 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 +28 -25
- package/src/components/grouped-picker.tsx +118 -96
- package/src/components/help-popover.tsx +115 -0
- package/src/components/hover-menu.tsx +45 -38
- 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 +49 -20
- 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 +300 -292
- package/src/components/nav-pills.tsx +19 -8
- package/src/components/number-field.tsx +7 -5
- package/src/components/number-input.tsx +69 -99
- 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 +36 -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 +125 -326
- package/src/components/server-wake-labels.ts +11 -0
- package/src/components/server-wake.tsx +39 -66
- package/src/components/settings-fields.tsx +50 -19
- 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 +39 -38
- 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 +17 -39
- 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 +47 -27
- package/src/components/translation-review-editor.tsx +8 -7
- package/src/components/translation-review-parts.tsx +9 -13
- package/src/components/translation-review.tsx +50 -20
- package/src/components/tree-view.tsx +14 -12
- package/src/components/ui-labels.ts +22 -0
- package/src/components/use-table-state.ts +91 -10
- package/src/components/user-avatar.tsx +5 -5
- package/src/components/wizard-stepper.tsx +7 -6
- package/src/components/write-lock-labels.ts +9 -0
- package/src/components/write-lock.tsx +10 -12
- package/src/currencies.ts +70 -0
- package/src/data-table.ts +4 -0
- package/src/demo/demo-banner.tsx +16 -27
- 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/eslint/index.ts +161 -0
- package/src/eslint/role-utilities.generated.ts +146 -0
- package/src/eslint/role-utilities.ts +99 -0
- 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 +46 -50
- 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 +210 -18
- 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 +85 -124
- package/src/i18n/locales/en.ts +46 -0
- package/src/i18n/locales/es.ts +50 -6
- package/src/i18n/locales/fr.ts +55 -9
- package/src/i18n/locales/hu.ts +50 -6
- package/src/i18n/locales/it.ts +54 -8
- 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 +414 -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/refs.ts +22 -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 +141 -189
- package/src/rhf/form-core.tsx +328 -0
- package/src/rhf/form.tsx +9 -320
- package/src/rhf/line-items.tsx +2 -2
- package/src/rhf/use-rhf-wizard-step.ts +4 -4
- package/src/rhf.ts +4 -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 +7 -5
- package/src/shell/role-switcher.tsx +4 -4
- package/src/shell/top-bar-brand.tsx +1 -1
- package/src/shell/top-bar.tsx +6 -5
- package/src/shell/topbar-action-menu.tsx +21 -19
- package/src/shell/topbar-controls.tsx +15 -15
- package/src/shell.ts +1 -1
- package/src/testing/index.ts +13 -0
- package/src/testing/viewport.ts +357 -0
- package/src/theme/color.ts +7 -1
- package/src/theme/palette-derive.ts +29 -7
- package/src/theme/palette-presets.ts +82 -355
- 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 +3 -26
- 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/hooks/use-authed-src.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\n\n/**\n * Fetch a file with the app's own credentials and hand back an object URL for it.\n *\n * A plain `<img src=\"/api/v1/…\">` cannot carry a Bearer token, so the browser gets a\n * 401 and the image — and any \"open it\" link built on the same path — fails. Both apps\n * solved this once each, by hand: kastlan's `shared/components/authed-image.tsx` (ported\n * from keksdose) and its `useDocumentBlobUrl` for floor plans. This is that code, once,\n * with the two things neither copy did: a loading/error state a caller can render, and\n * an abort when the URL changes mid-flight (a stale response used to overwrite the new\n * one's object URL — and leak the old one, since nothing revoked it).\n *\n * The kit does no auth of its own: the caller hands over a {@link AuthedFetcher} — its\n * axios client, its `fetch` with the header — and the kit only manages the blob's life:\n *\n * - created when the bytes arrive,\n * - revoked when the URL changes, the fetcher reports an error, or the component\n * unmounts — so a long gallery session does not accumulate blobs,\n * - never exposed as a token-bearing URL: the object URL is `blob:` and local.\n */\n\n/**\n * The app's authenticated GET. Resolve to the file's bytes: a `Blob` (axios with\n * `responseType: \"blob\"`), or a `Response` (plain `fetch`), whose `ok` is checked here.\n *\n * Honour `signal` if you can — a thumbnail scrolled past, or a lightbox paged on, then\n * stops downloading. Ignoring it is safe; the result of a superseded call is discarded\n * either way.\n */\nexport type AuthedFetcher = (url: string, init: { signal: AbortSignal }) => Promise<Blob | Response>;\n\n/** `idle`: no URL. `loading`: the fetch is in flight. `ready`: `src` is usable.\n * `error`: the fetch failed (see `error`). */\nexport type AuthedSrcStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\nexport interface UseAuthedSrcOptions {\n /**\n * How to fetch. Left out (or `null`), the URL is used as it is — `src` is the URL and\n * the status `ready` at once — so a component that takes an OPTIONAL fetcher (the\n * image grid, the lightbox) has one code path for public and protected images.\n */\n fetcher?: AuthedFetcher | null;\n /** `false` holds the fetch — a lightbox slide that is not on screen. Default `true`. */\n enabled?: boolean;\n}\n\nexport interface UseAuthedSrcResult {\n /** The object URL (or, without a fetcher, the URL itself); `null` until ready. */\n src: string | null;\n status: AuthedSrcStatus;\n /** What the fetcher threw, when `status` is `error`. */\n error: unknown;\n /** The blob's MIME type, once fetched (`\"\"` when the server sent none). `undefined`\n * without a fetcher — nothing was fetched to ask. Lets a caller that does not know\n * whether a URL is an image or a PDF find out. */\n type: string | undefined;\n /** Fetch again — after an `error`, or to pick up a changed file at the same URL. */\n retry: () => void;\n}\n\ninterface State {\n /** Which request this state belongs to — see the effect. */\n key: string | null;\n src: string | null;\n status: AuthedSrcStatus;\n error: unknown;\n type: string | undefined;\n}\n\nasync function toBlob(res: Blob | Response): Promise<Blob> {\n if (typeof Response !== \"undefined\" && res instanceof Response) {\n if (!res.ok) throw new Error(`HTTP ${res.status}`);\n return res.blob();\n }\n return res as Blob;\n}\n\n/**\n * `useAuthedSrc(url, { fetcher })` — see the module note.\n *\n * ```tsx\n * const fetcher: AuthedFetcher = (url, { signal }) =>\n * apiClient.get(url, { responseType: \"blob\", signal }).then((r) => r.data);\n * const { src, status } = useAuthedSrc(photo.file_path, { fetcher });\n * ```\n *\n * The fetcher is read through a ref, so an inline arrow does not refetch on every\n * render; a change of `url` (or `retry`) does.\n */\nexport function useAuthedSrc(\n url: string | null | undefined,\n { fetcher, enabled = true }: UseAuthedSrcOptions = {},\n): UseAuthedSrcResult {\n const fetcherRef = useRef(fetcher);\n useEffect(() => {\n fetcherRef.current = fetcher;\n });\n const hasFetcher = !!fetcher;\n const [attempt, setAttempt] = useState(0);\n const key = url && enabled && hasFetcher ? `${attempt}|${url}` : null;\n const [state, setState] = useState<State>(
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-authed-src.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\n\n/**\n * Fetch a file with the app's own credentials and hand back an object URL for it.\n *\n * A plain `<img src=\"/api/v1/…\">` cannot carry a Bearer token, so the browser gets a\n * 401 and the image — and any \"open it\" link built on the same path — fails. Both apps\n * solved this once each, by hand: kastlan's `shared/components/authed-image.tsx` (ported\n * from keksdose) and its `useDocumentBlobUrl` for floor plans. This is that code, once,\n * with the two things neither copy did: a loading/error state a caller can render, and\n * an abort when the URL changes mid-flight (a stale response used to overwrite the new\n * one's object URL — and leak the old one, since nothing revoked it).\n *\n * The kit does no auth of its own: the caller hands over a {@link AuthedFetcher} — its\n * axios client, its `fetch` with the header — and the kit only manages the blob's life:\n *\n * - created when the bytes arrive,\n * - revoked when the URL changes, the fetcher reports an error, or the component\n * unmounts — so a long gallery session does not accumulate blobs,\n * - never exposed as a token-bearing URL: the object URL is `blob:` and local.\n */\n\n/**\n * The app's authenticated GET. Resolve to the file's bytes: a `Blob` (axios with\n * `responseType: \"blob\"`), or a `Response` (plain `fetch`), whose `ok` is checked here.\n *\n * Honour `signal` if you can — a thumbnail scrolled past, or a lightbox paged on, then\n * stops downloading. Ignoring it is safe; the result of a superseded call is discarded\n * either way.\n */\nexport type AuthedFetcher = (url: string, init: { signal: AbortSignal }) => Promise<Blob | Response>;\n\n/** `idle`: no URL. `loading`: the fetch is in flight. `ready`: `src` is usable.\n * `error`: the fetch failed (see `error`). */\nexport type AuthedSrcStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\nexport interface UseAuthedSrcOptions {\n /**\n * How to fetch. Left out (or `null`), the URL is used as it is — `src` is the URL and\n * the status `ready` at once — so a component that takes an OPTIONAL fetcher (the\n * image grid, the lightbox) has one code path for public and protected images.\n */\n fetcher?: AuthedFetcher | null;\n /** `false` holds the fetch — a lightbox slide that is not on screen. Default `true`. */\n enabled?: boolean;\n}\n\nexport interface UseAuthedSrcResult {\n /** The object URL (or, without a fetcher, the URL itself); `null` until ready. */\n src: string | null;\n status: AuthedSrcStatus;\n /** What the fetcher threw, when `status` is `error`. */\n error: unknown;\n /** The blob's MIME type, once fetched (`\"\"` when the server sent none). `undefined`\n * without a fetcher — nothing was fetched to ask. Lets a caller that does not know\n * whether a URL is an image or a PDF find out. */\n type: string | undefined;\n /** Fetch again — after an `error`, or to pick up a changed file at the same URL. */\n retry: () => void;\n}\n\ninterface State {\n /** Which request this state belongs to — see the effect. */\n key: string | null;\n src: string | null;\n status: AuthedSrcStatus;\n error: unknown;\n type: string | undefined;\n}\n\nconst NO_STATE: State = { key: null, src: null, status: \"idle\", error: undefined, type: undefined };\n\nasync function toBlob(res: Blob | Response): Promise<Blob> {\n if (typeof Response !== \"undefined\" && res instanceof Response) {\n if (!res.ok) throw new Error(`HTTP ${res.status}`);\n return res.blob();\n }\n return res as Blob;\n}\n\n/**\n * `useAuthedSrc(url, { fetcher })` — see the module note.\n *\n * ```tsx\n * const fetcher: AuthedFetcher = (url, { signal }) =>\n * apiClient.get(url, { responseType: \"blob\", signal }).then((r) => r.data);\n * const { src, status } = useAuthedSrc(photo.file_path, { fetcher });\n * ```\n *\n * The fetcher is read through a ref, so an inline arrow does not refetch on every\n * render; a change of `url` (or `retry`) does.\n */\nexport function useAuthedSrc(\n url: string | null | undefined,\n { fetcher, enabled = true }: UseAuthedSrcOptions = {},\n): UseAuthedSrcResult {\n const fetcherRef = useRef(fetcher);\n useEffect(() => {\n fetcherRef.current = fetcher;\n });\n const hasFetcher = !!fetcher;\n const [attempt, setAttempt] = useState(0);\n const key = url && enabled && hasFetcher ? `${attempt}|${url}` : null;\n const [state, setState] = useState<State>(NO_STATE);\n // The state answers one key, and only while that key is current. Once the key moves\n // on, that request's effect is cleaned up and its object URL revoked, and a key can\n // come back: Lightbox passes `enabled: open`, so closing and reopening a photo goes\n // K → null → K, and paging back before the next picture loaded goes A → B → A. Kept,\n // the state would answer the returning key with the revoked `blob:` as \"ready\" (or\n // with the old error) until the refetch lands (BUG-3, refactor audit 2026-10).\n // Dropped here, while rendering, rather than in the cleanup: a setState from a\n // cleanup lands at a lower priority than the click that reopens, so that render\n // could still see the old state.\n if (state.key !== null && state.key !== key) setState(NO_STATE);\n\n useEffect(() => {\n const fetchFn = fetcherRef.current;\n if (!key || !url || !fetchFn) return;\n const controller = new AbortController();\n let created: string | null = null;\n let active = true;\n // Settled: the response is in (or failed). Aborting then would signal a request\n // that is long over — a fetcher that listens for `abort` (to log, to cancel a\n // retry it scheduled, to count cancellations) would see a cancellation that\n // never happened on every URL change and unmount.\n let settled = false;\n // No \"loading\" state is set here: a key the state does not describe yet already\n // reads as loading (see the end of the hook).\n fetchFn(url, { signal: controller.signal })\n .then(toBlob)\n .then((blob) => {\n settled = true;\n if (!active) return;\n created = URL.createObjectURL(blob);\n setState({ key, src: created, status: \"ready\", error: undefined, type: blob.type });\n })\n .catch((error: unknown) => {\n settled = true;\n if (!active) return;\n setState({ key, src: null, status: \"error\", error, type: undefined });\n });\n return () => {\n // `active` first: an in-flight response that lands after this must neither set\n // state on an unmounted component nor create a blob nobody will revoke.\n active = false;\n // Only a request still in flight is aborted; `active` above is the stale-response\n // guard either way.\n if (!settled) controller.abort();\n if (created) URL.revokeObjectURL(created);\n };\n }, [key, url]);\n\n const retry = useCallback(() => setAttempt((n) => n + 1), []);\n\n if (!url || !enabled) {\n return { src: null, status: \"idle\", error: undefined, type: undefined, retry };\n }\n if (!hasFetcher) {\n return { src: url, status: \"ready\", error: undefined, type: undefined, retry };\n }\n // Until the effect for THIS key has run, the state still describes the previous URL\n // — a render in between must not show the old picture under the new name.\n if (state.key !== key) {\n return { src: null, status: \"loading\", error: undefined, type: undefined, retry };\n }\n return { src: state.src, status: state.status, error: state.error, type: state.type, retry };\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAsEzD,MAAM,WAAkB,EAAE,KAAK,MAAM,KAAK,MAAM,QAAQ,QAAQ,OAAO,QAAW,MAAM,OAAU;AAElG,eAAe,OAAO,KAAqC;AACzD,MAAI,OAAO,aAAa,eAAe,eAAe,UAAU;AAC9D,QAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,QAAQ,IAAI,MAAM,EAAE;AACjD,WAAO,IAAI,KAAK;AAAA,EAClB;AACA,SAAO;AACT;AAcO,SAAS,aACd,KACA,EAAE,SAAS,UAAU,KAAK,IAAyB,CAAC,GAChC;AACpB,QAAM,aAAa,OAAO,OAAO;AACjC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,CAAC;AACD,QAAM,aAAa,CAAC,CAAC;AACrB,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,CAAC;AACxC,QAAM,MAAM,OAAO,WAAW,aAAa,GAAG,OAAO,IAAI,GAAG,KAAK;AACjE,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAgB,QAAQ;AAUlD,MAAI,MAAM,QAAQ,QAAQ,MAAM,QAAQ,IAAK,UAAS,QAAQ;AAE9D,YAAU,MAAM;AACd,UAAM,UAAU,WAAW;AAC3B,QAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAS;AAC9B,UAAM,aAAa,IAAI,gBAAgB;AACvC,QAAI,UAAyB;AAC7B,QAAI,SAAS;AAKb,QAAI,UAAU;AAGd,YAAQ,KAAK,EAAE,QAAQ,WAAW,OAAO,CAAC,EACvC,KAAK,MAAM,EACX,KAAK,CAAC,SAAS;AACd,gBAAU;AACV,UAAI,CAAC,OAAQ;AACb,gBAAU,IAAI,gBAAgB,IAAI;AAClC,eAAS,EAAE,KAAK,KAAK,SAAS,QAAQ,SAAS,OAAO,QAAW,MAAM,KAAK,KAAK,CAAC;AAAA,IACpF,CAAC,EACA,MAAM,CAAC,UAAmB;AACzB,gBAAU;AACV,UAAI,CAAC,OAAQ;AACb,eAAS,EAAE,KAAK,KAAK,MAAM,QAAQ,SAAS,OAAO,MAAM,OAAU,CAAC;AAAA,IACtE,CAAC;AACH,WAAO,MAAM;AAGX,eAAS;AAGT,UAAI,CAAC,QAAS,YAAW,MAAM;AAC/B,UAAI,QAAS,KAAI,gBAAgB,OAAO;AAAA,IAC1C;AAAA,EACF,GAAG,CAAC,KAAK,GAAG,CAAC;AAEb,QAAM,QAAQ,YAAY,MAAM,WAAW,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5D,MAAI,CAAC,OAAO,CAAC,SAAS;AACpB,WAAO,EAAE,KAAK,MAAM,QAAQ,QAAQ,OAAO,QAAW,MAAM,QAAW,MAAM;AAAA,EAC/E;AACA,MAAI,CAAC,YAAY;AACf,WAAO,EAAE,KAAK,KAAK,QAAQ,SAAS,OAAO,QAAW,MAAM,QAAW,MAAM;AAAA,EAC/E;AAGA,MAAI,MAAM,QAAQ,KAAK;AACrB,WAAO,EAAE,KAAK,MAAM,QAAQ,WAAW,OAAO,QAAW,MAAM,QAAW,MAAM;AAAA,EAClF;AACA,SAAO,EAAE,KAAK,MAAM,KAAK,QAAQ,MAAM,QAAQ,OAAO,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM;AAC7F;","names":[]}
|
|
@@ -4,6 +4,4 @@
|
|
|
4
4
|
* the note above for why that has to be a property of the hook rather than of each
|
|
5
5
|
* caller's discipline.
|
|
6
6
|
*/
|
|
7
|
-
declare function useBodyScrollLock(locked: boolean): void;
|
|
8
|
-
|
|
9
|
-
export { useBodyScrollLock };
|
|
7
|
+
export declare function useBodyScrollLock(locked: boolean): void;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
/** The breakpoints at Normal, in rem: Tailwind's five, and `3xl` (keksdose's
|
|
16
16
|
* `min-[2400px]`, §10.4). tokens.css multiplies each by the text size. */
|
|
17
|
-
declare const BREAKPOINT_REM: {
|
|
17
|
+
export declare const BREAKPOINT_REM: {
|
|
18
18
|
readonly sm: 40;
|
|
19
19
|
readonly md: 48;
|
|
20
20
|
readonly lg: 64;
|
|
@@ -22,10 +22,10 @@ declare const BREAKPOINT_REM: {
|
|
|
22
22
|
readonly "2xl": 96;
|
|
23
23
|
readonly "3xl": 150;
|
|
24
24
|
};
|
|
25
|
-
type Breakpoint = keyof typeof BREAKPOINT_REM;
|
|
25
|
+
export type Breakpoint = keyof typeof BREAKPOINT_REM;
|
|
26
26
|
/** A breakpoint variant, spelled as in a class: `"md"` is `md:` (at least md), `"max-md"`
|
|
27
27
|
* is `max-md:` (below md). */
|
|
28
|
-
type BreakpointVariant = Breakpoint | `max-${Breakpoint}`;
|
|
28
|
+
export type BreakpointVariant = Breakpoint | `max-${Breakpoint}`;
|
|
29
29
|
/**
|
|
30
30
|
* How many CSS px one `rem` is at `scale` (`TEXT_SCALE` of the size in force): the
|
|
31
31
|
* browser's own default font size times the text size — what `<html>`'s computed font
|
|
@@ -33,18 +33,18 @@ type BreakpointVariant = Breakpoint | `max-${Breakpoint}`;
|
|
|
33
33
|
* width against the viewport edge, a chart constant (§3.1, §3.2). 16 × `scale` outside a
|
|
34
34
|
* browser and in jsdom, which computes no default font size.
|
|
35
35
|
*/
|
|
36
|
-
declare function remPx(scale?: number): number;
|
|
36
|
+
export declare function remPx(scale?: number): number;
|
|
37
37
|
/** {@link remPx} at the text size in force, re-rendering when it changes. */
|
|
38
|
-
declare function useRemPx(): number;
|
|
38
|
+
export declare function useRemPx(): number;
|
|
39
39
|
/** A length in rem as the kit spells one in JS — `"18rem"` — where a prop also takes px
|
|
40
40
|
* as a plain number. */
|
|
41
|
-
type RemLength = `${number}rem`;
|
|
41
|
+
export type RemLength = `${number}rem`;
|
|
42
42
|
/**
|
|
43
43
|
* A `number | RemLength` in CSS px now: a number is px as given, `"18rem"` is 18 ×
|
|
44
44
|
* `rootRemPx` (see {@link remPx}). `undefined` stays `undefined`.
|
|
45
45
|
*/
|
|
46
|
-
declare function lengthPx(length: number | RemLength, rootRemPx: number): number;
|
|
47
|
-
declare function lengthPx(length: number | RemLength | undefined, rootRemPx: number): number | undefined;
|
|
46
|
+
export declare function lengthPx(length: number | RemLength, rootRemPx: number): number;
|
|
47
|
+
export declare function lengthPx(length: number | RemLength | undefined, rootRemPx: number): number | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* The media query a breakpoint variant means at `scale` (`TEXT_SCALE` of the size in
|
|
50
50
|
* force). `"md"` → `(min-width: 768px)` at Normal, `(min-width: 960px)` at Large;
|
|
@@ -65,24 +65,23 @@ declare function lengthPx(length: number | RemLength | undefined, rootRemPx: num
|
|
|
65
65
|
* inside the floor the kit already sets: tokens.css's breakpoint variants are written in
|
|
66
66
|
* it, and Tailwind v4 itself needs Safari 16.4, Chrome 111 and Firefox 128.
|
|
67
67
|
*
|
|
68
|
-
* A test's `matchMedia` stub that keyed on the old string (`"max-width: 767px"`,
|
|
69
|
-
*
|
|
70
|
-
* character for character.
|
|
68
|
+
* A test's `matchMedia` stub that keyed on the old string (`"max-width: 767px"`,
|
|
69
|
+
* `PHONE_QUERY`'s, which went in 0.34) has to answer `(width < 768px)` now. `min-*` is
|
|
70
|
+
* unchanged, character for character.
|
|
71
71
|
*/
|
|
72
|
-
declare function breakpointQuery(variant: BreakpointVariant, scale?: number, remPx?: number): string;
|
|
72
|
+
export declare function breakpointQuery(variant: BreakpointVariant, scale?: number, remPx?: number): string;
|
|
73
73
|
/**
|
|
74
74
|
* Whether the viewport matches a breakpoint variant at the text size in force — the JS
|
|
75
75
|
* twin of the class: `useBreakpoint("md")` is true exactly where `md:` applies,
|
|
76
76
|
* `useBreakpoint("max-sm")` where `max-sm:` does. `fallback` answers where there is no
|
|
77
77
|
* `matchMedia` (SSR, jsdom).
|
|
78
78
|
*/
|
|
79
|
-
declare function useBreakpoint(variant: BreakpointVariant, fallback?: boolean): boolean;
|
|
79
|
+
export declare function useBreakpoint(variant: BreakpointVariant, fallback?: boolean): boolean;
|
|
80
80
|
/**
|
|
81
81
|
* The phone layout: below `md` at the text size in force — `max-md:` in CSS. The single
|
|
82
82
|
* answer for "is this the phone layout" (§10.4): the kit's own sheets and cards use it,
|
|
83
83
|
* and an app's phone checks must too, so a tablet at 150 % gets every phone treatment
|
|
84
|
-
* at once or none of them.
|
|
84
|
+
* at once or none of them. Replaced `useMediaQuery(PHONE_QUERY)` in 0.32; that string
|
|
85
|
+
* went in 0.34.
|
|
85
86
|
*/
|
|
86
|
-
declare function usePhoneLayout(fallback?: boolean): boolean;
|
|
87
|
-
|
|
88
|
-
export { BREAKPOINT_REM, type Breakpoint, type BreakpointVariant, type RemLength, breakpointQuery, lengthPx, remPx, useBreakpoint, usePhoneLayout, useRemPx };
|
|
87
|
+
export declare function usePhoneLayout(fallback?: boolean): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-breakpoint.ts"],"sourcesContent":["import { useMediaQuery } from \"./use-media-query\";\nimport { useTextSize } from \"../theme/text-size\";\n\n/**\n * Breakpoints that follow the text size, in JS (docs/text-size-harmonization.md §3.3,\n * §10.4).\n *\n * A media query's rem resolves against the browser's default font size, not `<html>`'s,\n * so Tailwind's `md:` would stay at 48rem when the root grows. tokens.css therefore\n * redefines every breakpoint variant per text size — `md:` is 48rem at Normal, 60rem at\n * Large, 72rem at Extra large — and these hooks ask the same question with the same\n * numbers, so the CSS and the JS answer always agree: AppShell's `md:hidden` and its\n * `isMdUp`, DataTable's cards and its full-screen dialog, an app's sticky footer\n * (keksdose's must be the SAME `usePhoneLayout()` the dialog uses, §10.4).\n *\n * Width queries only. Pointer and display-mode queries stay `useMediaQuery` (§10.4).\n */\n\n/** The breakpoints at Normal, in rem: Tailwind's five, and `3xl` (keksdose's\n * `min-[2400px]`, §10.4). tokens.css multiplies each by the text size. */\nexport const BREAKPOINT_REM = { sm: 40, md: 48, lg: 64, xl: 80, \"2xl\": 96, \"3xl\": 150 } as const;\n\nexport type Breakpoint = keyof typeof BREAKPOINT_REM;\n\n/** A breakpoint variant, spelled as in a class: `\"md\"` is `md:` (at least md), `\"max-md\"`\n * is `max-md:` (below md). */\nexport type BreakpointVariant = Breakpoint | `max-${Breakpoint}`;\n\n/**\n * The browser's own default font size in px — what a media query's rem means (the\n * initial `font-size: medium`, never `<html>`'s). 16 unless the person changed it, and 16\n * outside a browser. Read once: changing it takes a browser setting, after which the\n * page is reloaded in practice.\n */\nlet browserRemPx: number | null = null;\nfunction readBrowserRemPx(): number {\n if (browserRemPx !== null) return browserRemPx;\n // Outside a browser (SSR): 16, uncached, so the client's first real read still counts.\n if (typeof document === \"undefined\" || !document.body) return 16;\n const probe = document.createElement(\"div\");\n probe.style.cssText = \"position:absolute;visibility:hidden;font-size:medium\";\n document.body.appendChild(probe);\n const px = Number.parseFloat(getComputedStyle(probe).fontSize);\n probe.remove();\n // jsdom computes no font size (\"medium\" or nothing): the default it stands for.\n browserRemPx = px > 0 ? px : 16;\n return browserRemPx;\n}\n\n/**\n * How many CSS px one `rem` is at `scale` (`TEXT_SCALE` of the size in force): the\n * browser's own default font size times the text size — what `<html>`'s computed font\n * size is, by tokens.css. For the few lengths JS has to do arithmetic with: a popover's\n * width against the viewport edge, a chart constant (§3.1, §3.2). 16 × `scale` outside a\n * browser and in jsdom, which computes no default font size.\n */\nexport function remPx(scale = 1): number {\n return readBrowserRemPx() * scale;\n}\n\n/** {@link remPx} at the text size in force, re-rendering when it changes. */\nexport function useRemPx(): number {\n const { scale } = useTextSize();\n return remPx(scale);\n}\n\n/** A length in rem as the kit spells one in JS — `\"18rem\"` — where a prop also takes px\n * as a plain number. */\nexport type RemLength = `${number}rem`;\n\n/**\n * A `number | RemLength` in CSS px now: a number is px as given, `\"18rem\"` is 18 ×\n * `rootRemPx` (see {@link remPx}). `undefined` stays `undefined`.\n */\nexport function lengthPx(length: number | RemLength, rootRemPx: number): number;\nexport function lengthPx(length: number | RemLength | undefined, rootRemPx: number): number | undefined;\nexport function lengthPx(length: number | RemLength | undefined, rootRemPx: number): number | undefined {\n if (length === undefined) return undefined;\n return typeof length === \"number\" ? length : Number.parseFloat(length) * rootRemPx;\n}\n\n/**\n * The media query a breakpoint variant means at `scale` (`TEXT_SCALE` of the size in\n * force). `\"md\"` → `(min-width: 768px)` at Normal, `(min-width: 960px)` at Large;\n * `\"max-md\"` → `(width < 768px)` at Normal. In px, scaled by the browser's own default\n * font size as well, so a person who set 20 px in the browser gets 960 px for `md` at\n * Normal — as the CSS does.\n *\n * `max-*` is written in range syntax, `(width < N)`, against the same `N` its `min-*`\n * twin starts at, so the two are exact complements at EVERY width: exactly one of\n * `md` and `max-md` matches, as with tokens.css's `width >= 48rem` / `width < 48rem`\n * (and Tailwind's own `max-*`). Until 0.32.1 it was `(max-width: 767px)`, which left a\n * gap: on a fractional viewport width (767.5 px under zoom or at some Android\n * device-pixel ratios) neither query matched, so DataTable, asking `!md`, said phone\n * while `usePhoneLayout()`, asking `max-md`, said not (0.32.1, keksdose's 0.32 report;\n * docs/text-size-harmonization.md §3.3: \"the CSS and JS answers always agree\").\n *\n * Range syntax in media queries is Chrome / Edge 104, Firefox 63, Safari 16.4. That is\n * inside the floor the kit already sets: tokens.css's breakpoint variants are written in\n * it, and Tailwind v4 itself needs Safari 16.4, Chrome 111 and Firefox 128.\n *\n * A test's `matchMedia` stub that keyed on the old string (`\"max-width: 767px\"
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-breakpoint.ts"],"sourcesContent":["import { useMediaQuery } from \"./use-media-query\";\nimport { useTextSize } from \"../theme/text-size\";\n\n/**\n * Breakpoints that follow the text size, in JS (docs/text-size-harmonization.md §3.3,\n * §10.4).\n *\n * A media query's rem resolves against the browser's default font size, not `<html>`'s,\n * so Tailwind's `md:` would stay at 48rem when the root grows. tokens.css therefore\n * redefines every breakpoint variant per text size — `md:` is 48rem at Normal, 60rem at\n * Large, 72rem at Extra large — and these hooks ask the same question with the same\n * numbers, so the CSS and the JS answer always agree: AppShell's `md:hidden` and its\n * `isMdUp`, DataTable's cards and its full-screen dialog, an app's sticky footer\n * (keksdose's must be the SAME `usePhoneLayout()` the dialog uses, §10.4).\n *\n * Width queries only. Pointer and display-mode queries stay `useMediaQuery` (§10.4).\n */\n\n/** The breakpoints at Normal, in rem: Tailwind's five, and `3xl` (keksdose's\n * `min-[2400px]`, §10.4). tokens.css multiplies each by the text size. */\nexport const BREAKPOINT_REM = { sm: 40, md: 48, lg: 64, xl: 80, \"2xl\": 96, \"3xl\": 150 } as const;\n\nexport type Breakpoint = keyof typeof BREAKPOINT_REM;\n\n/** A breakpoint variant, spelled as in a class: `\"md\"` is `md:` (at least md), `\"max-md\"`\n * is `max-md:` (below md). */\nexport type BreakpointVariant = Breakpoint | `max-${Breakpoint}`;\n\n/**\n * The browser's own default font size in px — what a media query's rem means (the\n * initial `font-size: medium`, never `<html>`'s). 16 unless the person changed it, and 16\n * outside a browser. Read once: changing it takes a browser setting, after which the\n * page is reloaded in practice.\n */\nlet browserRemPx: number | null = null;\nfunction readBrowserRemPx(): number {\n if (browserRemPx !== null) return browserRemPx;\n // Outside a browser (SSR): 16, uncached, so the client's first real read still counts.\n if (typeof document === \"undefined\" || !document.body) return 16;\n const probe = document.createElement(\"div\");\n probe.style.cssText = \"position:absolute;visibility:hidden;font-size:medium\";\n document.body.appendChild(probe);\n const px = Number.parseFloat(getComputedStyle(probe).fontSize);\n probe.remove();\n // jsdom computes no font size (\"medium\" or nothing): the default it stands for.\n browserRemPx = px > 0 ? px : 16;\n return browserRemPx;\n}\n\n/**\n * How many CSS px one `rem` is at `scale` (`TEXT_SCALE` of the size in force): the\n * browser's own default font size times the text size — what `<html>`'s computed font\n * size is, by tokens.css. For the few lengths JS has to do arithmetic with: a popover's\n * width against the viewport edge, a chart constant (§3.1, §3.2). 16 × `scale` outside a\n * browser and in jsdom, which computes no default font size.\n */\nexport function remPx(scale = 1): number {\n return readBrowserRemPx() * scale;\n}\n\n/** {@link remPx} at the text size in force, re-rendering when it changes. */\nexport function useRemPx(): number {\n const { scale } = useTextSize();\n return remPx(scale);\n}\n\n/** A length in rem as the kit spells one in JS — `\"18rem\"` — where a prop also takes px\n * as a plain number. */\nexport type RemLength = `${number}rem`;\n\n/**\n * A `number | RemLength` in CSS px now: a number is px as given, `\"18rem\"` is 18 ×\n * `rootRemPx` (see {@link remPx}). `undefined` stays `undefined`.\n */\nexport function lengthPx(length: number | RemLength, rootRemPx: number): number;\nexport function lengthPx(length: number | RemLength | undefined, rootRemPx: number): number | undefined;\nexport function lengthPx(length: number | RemLength | undefined, rootRemPx: number): number | undefined {\n if (length === undefined) return undefined;\n return typeof length === \"number\" ? length : Number.parseFloat(length) * rootRemPx;\n}\n\n/**\n * The media query a breakpoint variant means at `scale` (`TEXT_SCALE` of the size in\n * force). `\"md\"` → `(min-width: 768px)` at Normal, `(min-width: 960px)` at Large;\n * `\"max-md\"` → `(width < 768px)` at Normal. In px, scaled by the browser's own default\n * font size as well, so a person who set 20 px in the browser gets 960 px for `md` at\n * Normal — as the CSS does.\n *\n * `max-*` is written in range syntax, `(width < N)`, against the same `N` its `min-*`\n * twin starts at, so the two are exact complements at EVERY width: exactly one of\n * `md` and `max-md` matches, as with tokens.css's `width >= 48rem` / `width < 48rem`\n * (and Tailwind's own `max-*`). Until 0.32.1 it was `(max-width: 767px)`, which left a\n * gap: on a fractional viewport width (767.5 px under zoom or at some Android\n * device-pixel ratios) neither query matched, so DataTable, asking `!md`, said phone\n * while `usePhoneLayout()`, asking `max-md`, said not (0.32.1, keksdose's 0.32 report;\n * docs/text-size-harmonization.md §3.3: \"the CSS and JS answers always agree\").\n *\n * Range syntax in media queries is Chrome / Edge 104, Firefox 63, Safari 16.4. That is\n * inside the floor the kit already sets: tokens.css's breakpoint variants are written in\n * it, and Tailwind v4 itself needs Safari 16.4, Chrome 111 and Firefox 128.\n *\n * A test's `matchMedia` stub that keyed on the old string (`\"max-width: 767px\"`,\n * `PHONE_QUERY`'s, which went in 0.34) has to answer `(width < 768px)` now. `min-*` is\n * unchanged, character for character.\n */\nexport function breakpointQuery(variant: BreakpointVariant, scale = 1, remPx: number = readBrowserRemPx()): string {\n const max = variant.startsWith(\"max-\");\n const name = (max ? variant.slice(4) : variant) as Breakpoint;\n const px = Math.round(BREAKPOINT_REM[name] * remPx * scale);\n return max ? `(width < ${px}px)` : `(min-width: ${px}px)`;\n}\n\n/**\n * Whether the viewport matches a breakpoint variant at the text size in force — the JS\n * twin of the class: `useBreakpoint(\"md\")` is true exactly where `md:` applies,\n * `useBreakpoint(\"max-sm\")` where `max-sm:` does. `fallback` answers where there is no\n * `matchMedia` (SSR, jsdom).\n */\nexport function useBreakpoint(variant: BreakpointVariant, fallback = false): boolean {\n const { scale } = useTextSize();\n return useMediaQuery(breakpointQuery(variant, scale), fallback);\n}\n\n/**\n * The phone layout: below `md` at the text size in force — `max-md:` in CSS. The single\n * answer for \"is this the phone layout\" (§10.4): the kit's own sheets and cards use it,\n * and an app's phone checks must too, so a tablet at 150 % gets every phone treatment\n * at once or none of them. Replaced `useMediaQuery(PHONE_QUERY)` in 0.32; that string\n * went in 0.34.\n */\nexport function usePhoneLayout(fallback = false): boolean {\n return useBreakpoint(\"max-md\", fallback);\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAmBrB,MAAM,iBAAiB,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,OAAO,IAAI;AActF,IAAI,eAA8B;AAClC,SAAS,mBAA2B;AAClC,MAAI,iBAAiB,KAAM,QAAO;AAElC,MAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAM,QAAO;AAC9D,QAAM,QAAQ,SAAS,cAAc,KAAK;AAC1C,QAAM,MAAM,UAAU;AACtB,WAAS,KAAK,YAAY,KAAK;AAC/B,QAAM,KAAK,OAAO,WAAW,iBAAiB,KAAK,EAAE,QAAQ;AAC7D,QAAM,OAAO;AAEb,iBAAe,KAAK,IAAI,KAAK;AAC7B,SAAO;AACT;AASO,SAAS,MAAM,QAAQ,GAAW;AACvC,SAAO,iBAAiB,IAAI;AAC9B;AAGO,SAAS,WAAmB;AACjC,QAAM,EAAE,MAAM,IAAI,YAAY;AAC9B,SAAO,MAAM,KAAK;AACpB;AAYO,SAAS,SAAS,QAAwC,WAAuC;AACtG,MAAI,WAAW,OAAW,QAAO;AACjC,SAAO,OAAO,WAAW,WAAW,SAAS,OAAO,WAAW,MAAM,IAAI;AAC3E;AA0BO,SAAS,gBAAgB,SAA4B,QAAQ,GAAGA,SAAgB,iBAAiB,GAAW;AACjH,QAAM,MAAM,QAAQ,WAAW,MAAM;AACrC,QAAM,OAAQ,MAAM,QAAQ,MAAM,CAAC,IAAI;AACvC,QAAM,KAAK,KAAK,MAAM,eAAe,IAAI,IAAIA,SAAQ,KAAK;AAC1D,SAAO,MAAM,YAAY,EAAE,QAAQ,eAAe,EAAE;AACtD;AAQO,SAAS,cAAc,SAA4B,WAAW,OAAgB;AACnF,QAAM,EAAE,MAAM,IAAI,YAAY;AAC9B,SAAO,cAAc,gBAAgB,SAAS,KAAK,GAAG,QAAQ;AAChE;AASO,SAAS,eAAe,WAAW,OAAgB;AACxD,SAAO,cAAc,UAAU,QAAQ;AACzC;","names":["remPx"]}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* tokens.css — the sheet is the slower of the two, so it is what the unmount waits
|
|
3
3
|
* for. Exported so a test can advance a fake clock by the real number rather than
|
|
4
4
|
* by a copy of it. */
|
|
5
|
-
declare const OVERLAY_EXIT_MS = 220;
|
|
5
|
+
export declare const OVERLAY_EXIT_MS = 220;
|
|
6
6
|
/**
|
|
7
|
-
* Whether the user
|
|
8
|
-
*
|
|
9
|
-
* correct answer
|
|
7
|
+
* Whether an exit animation is skipped, read NOW: the user asked for no motion, or there
|
|
8
|
+
* is no `matchMedia` (jsdom, SSR) — nothing is painting there, so "no animation" is the
|
|
9
|
+
* only correct answer, and a closed overlay is gone at once in every test suite. Shared
|
|
10
|
+
* by every exit timer in the package, so they agree. The kit's one `prefersReducedMotion`
|
|
11
|
+
* (lib/reduced-motion), asked with that answer for the unknown case (DUP-11).
|
|
10
12
|
*/
|
|
11
|
-
declare function
|
|
13
|
+
export declare function skipsExitAnimation(): boolean;
|
|
12
14
|
/**
|
|
13
15
|
* The state machine an exit animation needs, written once for every overlay in this
|
|
14
16
|
* package (Keksdose live #320 rework: *"Recognized the opening transition. Choose
|
|
@@ -39,9 +41,7 @@ declare function prefersReducedMotion(): boolean;
|
|
|
39
41
|
* be made to wait 220ms for an animation they are not being shown, and the `-out`
|
|
40
42
|
* classes are never applied, so tokens.css needs no reduced-motion rule for them.
|
|
41
43
|
*/
|
|
42
|
-
declare function useCloseTransition(onClose: () => void, ms?: number): {
|
|
44
|
+
export declare function useCloseTransition(onClose: () => void, ms?: number): {
|
|
43
45
|
closing: boolean;
|
|
44
46
|
requestClose: () => void;
|
|
45
47
|
};
|
|
46
|
-
|
|
47
|
-
export { OVERLAY_EXIT_MS, prefersReducedMotion, useCloseTransition };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { prefersReducedMotion } from "../lib/reduced-motion.js";
|
|
3
4
|
const OVERLAY_EXIT_MS = 220;
|
|
4
|
-
function
|
|
5
|
-
return
|
|
5
|
+
function skipsExitAnimation() {
|
|
6
|
+
return prefersReducedMotion(true);
|
|
6
7
|
}
|
|
7
8
|
function useCloseTransition(onClose, ms = OVERLAY_EXIT_MS) {
|
|
8
9
|
const [closing, setClosing] = useState(false);
|
|
@@ -19,7 +20,7 @@ function useCloseTransition(onClose, ms = OVERLAY_EXIT_MS) {
|
|
|
19
20
|
);
|
|
20
21
|
const requestClose = useCallback(() => {
|
|
21
22
|
if (timer.current) return;
|
|
22
|
-
if (
|
|
23
|
+
if (skipsExitAnimation() || ms <= 0) {
|
|
23
24
|
latest.current();
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
@@ -34,7 +35,7 @@ function useCloseTransition(onClose, ms = OVERLAY_EXIT_MS) {
|
|
|
34
35
|
}
|
|
35
36
|
export {
|
|
36
37
|
OVERLAY_EXIT_MS,
|
|
37
|
-
|
|
38
|
+
skipsExitAnimation,
|
|
38
39
|
useCloseTransition
|
|
39
40
|
};
|
|
40
41
|
//# sourceMappingURL=use-close-transition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-close-transition.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\n\n/** How long the exit animation runs, in ms. Mirrors `.animate-sheet-out` in\n * tokens.css — the sheet is the slower of the two, so it is what the unmount waits\n * for. Exported so a test can advance a fake clock by the real number rather than\n * by a copy of it. */\nexport const OVERLAY_EXIT_MS = 220;\n\n/**\n * Whether the user
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-close-transition.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { prefersReducedMotion } from \"../lib/reduced-motion\";\n\n/** How long the exit animation runs, in ms. Mirrors `.animate-sheet-out` in\n * tokens.css — the sheet is the slower of the two, so it is what the unmount waits\n * for. Exported so a test can advance a fake clock by the real number rather than\n * by a copy of it. */\nexport const OVERLAY_EXIT_MS = 220;\n\n/**\n * Whether an exit animation is skipped, read NOW: the user asked for no motion, or there\n * is no `matchMedia` (jsdom, SSR) — nothing is painting there, so \"no animation\" is the\n * only correct answer, and a closed overlay is gone at once in every test suite. Shared\n * by every exit timer in the package, so they agree. The kit's one `prefersReducedMotion`\n * (lib/reduced-motion), asked with that answer for the unknown case (DUP-11).\n */\nexport function skipsExitAnimation(): boolean {\n return prefersReducedMotion(true);\n}\n\n/**\n * The state machine an exit animation needs, written once for every overlay in this\n * package (Keksdose live #320 rework: *\"Recognized the opening transition. Choose\n * transition should be the same, only backwards\"*).\n *\n * ## Why a hook and not a class on the panel\n *\n * An enter animation is free: the element mounts, the keyframes run. An exit is not —\n * by the time the state says \"closed\" the element is already gone, so something has to\n * hold it on screen for exactly as long as the animation lasts. That something cannot\n * be the caller (every caller would need the same timer) and it cannot be the panel's\n * markup. It is this: the overlay's own affordances call {@link requestClose} instead\n * of `onClose`, render the `-out` classes while `closing` is true, and the real\n * `onClose` — the one that unmounts them — fires when the animation has finished.\n *\n * ## What it deliberately does not do\n *\n * It does not intercept a close the CALLER decides on. A dialog that closes itself\n * after a successful save sets its own state and unmounts, with no exit animation, and\n * that is the right trade: making it otherwise would mean every overlay owning an\n * `open` prop and every caller waiting on a callback to learn when its own state took\n * effect. What is animated is what the user dismissed — the X, the backdrop, Escape,\n * the Back gesture — which is the motion the row was about.\n *\n * ## Reduced motion\n *\n * Closes immediately, without the delay. A user who has asked for no motion must not\n * be made to wait 220ms for an animation they are not being shown, and the `-out`\n * classes are never applied, so tokens.css needs no reduced-motion rule for them.\n */\nexport function useCloseTransition(\n onClose: () => void,\n ms: number = OVERLAY_EXIT_MS,\n): { closing: boolean; requestClose: () => void } {\n const [closing, setClosing] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n // Latest-ref rather than a dependency: callers pass inline arrows, so a dependency\n // would hand every render a new `requestClose` — and this one is read once, by a\n // timer that has already been scheduled. Assigned in an effect, never during render\n // (`react-hooks/refs`), matching `use-long-press.ts` next door.\n const latest = useRef(onClose);\n useEffect(() => {\n latest.current = onClose;\n });\n\n // One timer, ever. A second Escape while the panel is already leaving must not\n // schedule a second unmount — two `onClose` calls is a caller's state machine being\n // run twice, which is how a \"close\" ends up also discarding the row behind it.\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n\n const requestClose = useCallback(() => {\n if (timer.current) return;\n // Read at close time, not at mount: the setting can change under a long-lived\n // page, and `matchMedia` is absent in jsdom and in SSR — where \"no animation\" is\n // also the only correct answer, since nothing is painting.\n if (skipsExitAnimation() || ms <= 0) {\n latest.current();\n return;\n }\n setClosing(true);\n timer.current = setTimeout(() => {\n timer.current = null;\n // ⚠️ Reset BEFORE handing control back — reported from a phone within the hour\n // of the 0.4.52 deploy that first shipped this hook, against every table at once.\n // A panel that returns `null` while closed is still MOUNTED — `FullBleedDialog`\n // early-returns after its hooks, and DataTable renders it once and flips `open`\n // — so this state outlives the panel it describes. Left true, the NEXT open\n // rendered `animate-*-out` with `animation-fill-mode: forwards` on a sheet that\n // had only just arrived: it lowered itself off the screen in 220ms and stayed\n // there, invisible but still holding the backdrop's pointer events. Every table\n // on every phone, first open fine and every one after it not, until a route\n // change remounted the component.\n //\n // Batched with the `onClose` below, so a caller that unmounts on close still\n // renders exactly once and nothing flashes.\n setClosing(false);\n latest.current();\n }, ms);\n }, [ms]);\n\n return { closing, requestClose };\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAAS,4BAA4B;AAM9B,MAAM,kBAAkB;AASxB,SAAS,qBAA8B;AAC5C,SAAO,qBAAqB,IAAI;AAClC;AAgCO,SAAS,mBACd,SACA,KAAa,iBACmC;AAChD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,QAAQ,OAA6C,IAAI;AAK/D,QAAM,SAAS,OAAO,OAAO;AAC7B,YAAU,MAAM;AACd,WAAO,UAAU;AAAA,EACnB,CAAC;AAKD;AAAA,IACE,MAAM,MAAM;AACV,UAAI,MAAM,QAAS,cAAa,MAAM,OAAO;AAAA,IAC/C;AAAA,IACA,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,YAAY,MAAM;AACrC,QAAI,MAAM,QAAS;AAInB,QAAI,mBAAmB,KAAK,MAAM,GAAG;AACnC,aAAO,QAAQ;AACf;AAAA,IACF;AACA,eAAW,IAAI;AACf,UAAM,UAAU,WAAW,MAAM;AAC/B,YAAM,UAAU;AAchB,iBAAW,KAAK;AAChB,aAAO,QAAQ;AAAA,IACjB,GAAG,EAAE;AAAA,EACP,GAAG,CAAC,EAAE,CAAC;AAEP,SAAO,EAAE,SAAS,aAAa;AACjC;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
type CopyState = "idle" | "copied" | "failed";
|
|
2
|
-
interface UseCopyToClipboardOptions {
|
|
1
|
+
export type CopyState = "idle" | "copied" | "failed";
|
|
2
|
+
export interface UseCopyToClipboardOptions {
|
|
3
3
|
/** How long `copied` / `failed` stays up before the state returns to `idle`, in
|
|
4
4
|
* ms. `0` keeps it until the next copy or {@link UseCopyToClipboardReturn.reset}. */
|
|
5
5
|
resetAfter?: number;
|
|
6
6
|
}
|
|
7
|
-
interface UseCopyToClipboardReturn {
|
|
7
|
+
export interface UseCopyToClipboardReturn {
|
|
8
8
|
state: CopyState;
|
|
9
9
|
/** Copy `text`. Resolves to whether it actually reached the clipboard — the same
|
|
10
10
|
* answer `state` gives, for a caller that wants to act on it directly. */
|
|
@@ -14,7 +14,7 @@ interface UseCopyToClipboardReturn {
|
|
|
14
14
|
/** Copy `text`, by the Clipboard API when there is one and the legacy path when
|
|
15
15
|
* there is not — or when the API refuses (a denied permission, a document that is
|
|
16
16
|
* not focused). Never throws. */
|
|
17
|
-
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
17
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
18
18
|
/**
|
|
19
19
|
* Copy text and KNOW whether it worked.
|
|
20
20
|
*
|
|
@@ -23,6 +23,4 @@ declare function copyToClipboard(text: string): Promise<boolean>;
|
|
|
23
23
|
* confirmed a copy that had not happened. The state here is set from the result, and
|
|
24
24
|
* a failure is a state of its own rather than a quiet return to idle.
|
|
25
25
|
*/
|
|
26
|
-
declare function useCopyToClipboard({ resetAfter }?: UseCopyToClipboardOptions): UseCopyToClipboardReturn;
|
|
27
|
-
|
|
28
|
-
export { type CopyState, type UseCopyToClipboardOptions, type UseCopyToClipboardReturn, copyToClipboard, useCopyToClipboard };
|
|
26
|
+
export declare function useCopyToClipboard({ resetAfter }?: UseCopyToClipboardOptions): UseCopyToClipboardReturn;
|
|
@@ -8,9 +8,18 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The first render returns `value` itself, not `undefined`: a list filtered by the
|
|
10
10
|
* debounced query must render its initial state immediately, not after `ms`.
|
|
11
|
+
*
|
|
12
|
+
* **It re-arms when `value`'s IDENTITY changes** (an effect on `[value, ms]`), not its
|
|
13
|
+
* content. Pass a primitive — the typed query, a JSON string — or a value whose
|
|
14
|
+
* identity is stable (state, a `useMemo`). An object or array built in render is a new
|
|
15
|
+
* one every render, so the timer is re-armed on every render and the value never
|
|
16
|
+
* settles — or, when the debounced value feeds the render that built it, settles,
|
|
17
|
+
* renders, builds another and fires again, every `ms`, with nobody typing
|
|
18
|
+
* (Kurvenschmiede's control page, KS U9). Debounce `JSON.stringify(body)`, or a key that
|
|
19
|
+
* changes exactly when the content does, and build the object from that.
|
|
11
20
|
*/
|
|
12
|
-
declare function useDebounce<T>(value: T, ms: number): T;
|
|
13
|
-
interface DebouncedCallbackOptions {
|
|
21
|
+
export declare function useDebounce<T>(value: T, ms: number): T;
|
|
22
|
+
export interface DebouncedCallbackOptions {
|
|
14
23
|
/**
|
|
15
24
|
* The longest a call may be held back, however often it is re-triggered. Without
|
|
16
25
|
* it a user who never stops typing never saves; with it, a draft autosave still
|
|
@@ -19,7 +28,7 @@ interface DebouncedCallbackOptions {
|
|
|
19
28
|
maxWait?: number;
|
|
20
29
|
}
|
|
21
30
|
/** The debounced function, plus the two escapes a caller needs around it. */
|
|
22
|
-
type DebouncedFunction<A extends unknown[]> = ((...args: A) => void) & {
|
|
31
|
+
export type DebouncedFunction<A extends unknown[]> = ((...args: A) => void) & {
|
|
23
32
|
/** Drop the pending call, if there is one. */
|
|
24
33
|
cancel: () => void;
|
|
25
34
|
/** Run the pending call now, if there is one — e.g. on blur or before navigating
|
|
@@ -38,6 +47,4 @@ type DebouncedFunction<A extends unknown[]> = ((...args: A) => void) & {
|
|
|
38
47
|
* A pending call is cancelled on unmount: a debounced save firing into an unmounted
|
|
39
48
|
* form is the bug kastlan reported, not a feature.
|
|
40
49
|
*/
|
|
41
|
-
declare function useDebouncedCallback<A extends unknown[]>(fn: (...args: A) => void, ms: number, { maxWait }?: DebouncedCallbackOptions): DebouncedFunction<A>;
|
|
42
|
-
|
|
43
|
-
export { type DebouncedCallbackOptions, type DebouncedFunction, useDebounce, useDebouncedCallback };
|
|
50
|
+
export declare function useDebouncedCallback<A extends unknown[]>(fn: (...args: A) => void, ms: number, { maxWait }?: DebouncedCallbackOptions): DebouncedFunction<A>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-debounce.ts"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\n/**\n * A value that follows `value`, but only once it has stopped changing for `ms`.\n *\n * kastlan asked for the pair in this module because each of its search boxes carried\n * its own copy of the same six lines — a `useEffect` with a `setTimeout` — and two of\n * them forgot the cleanup, so a stale query landed AFTER the fresh one and replaced\n * its results. The cleanup is the whole point of having one implementation.\n *\n * The first render returns `value` itself, not `undefined`: a list filtered by the\n * debounced query must render its initial state immediately, not after `ms`.\n */\nexport function useDebounce<T>(value: T, ms: number): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), ms);\n return () => clearTimeout(timer);\n }, [value, ms]);\n return debounced;\n}\n\nexport interface DebouncedCallbackOptions {\n /**\n * The longest a call may be held back, however often it is re-triggered. Without\n * it a user who never stops typing never saves; with it, a draft autosave still\n * lands every `maxWait` ms while the typing goes on.\n */\n maxWait?: number;\n}\n\n/** The debounced function, plus the two escapes a caller needs around it. */\nexport type DebouncedFunction<A extends unknown[]> = ((...args: A) => void) & {\n /** Drop the pending call, if there is one. */\n cancel: () => void;\n /** Run the pending call now, if there is one — e.g. on blur or before navigating\n * away, so the last keystrokes of a form are not lost. */\n flush: () => void;\n /** Whether a call is waiting. */\n pending: () => boolean;\n};\n\n/**\n * `fn`, called only once calls have stopped arriving for `ms` — with the arguments\n * of the LAST call.\n *\n * The returned function keeps its identity across renders (so it can sit in an\n * effect's dependency list or be handed to a memoised child) and always calls the\n * LATEST `fn`, so a handler that closes over current state never runs a stale copy.\n * A pending call is cancelled on unmount: a debounced save firing into an unmounted\n * form is the bug kastlan reported, not a feature.\n */\nexport function useDebouncedCallback<A extends unknown[]>(\n fn: (...args: A) => void,\n ms: number,\n { maxWait }: DebouncedCallbackOptions = {},\n): DebouncedFunction<A> {\n const fnRef = useRef(fn);\n // Layout effect, not render-time assignment: a ref written during render is a\n // side effect React may replay or discard. Nothing can call the debounced function\n // between this commit and the layout effect, so it is never one render behind.\n useLayoutEffect(() => {\n fnRef.current = fn;\n });\n\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const maxTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const lastArgs = useRef<A | null>(null);\n\n const clear = useCallback(() => {\n if (timer.current) clearTimeout(timer.current);\n if (maxTimer.current) clearTimeout(maxTimer.current);\n timer.current = null;\n maxTimer.current = null;\n }, []);\n\n const invoke = useCallback(() => {\n const args = lastArgs.current;\n clear();\n lastArgs.current = null;\n if (args) fnRef.current(...args);\n }, [clear]);\n\n useEffect(() => clear, [clear]);\n\n return useMemo(() => {\n const debounced = ((...args: A) => {\n lastArgs.current = args;\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(invoke, ms);\n if (maxWait !== undefined && !maxTimer.current) {\n maxTimer.current = setTimeout(invoke, maxWait);\n }\n }) as DebouncedFunction<A>;\n debounced.cancel = () => {\n clear();\n lastArgs.current = null;\n };\n debounced.flush = () => {\n if (lastArgs.current) invoke();\n };\n debounced.pending = () => lastArgs.current !== null;\n return debounced;\n }, [ms, maxWait, invoke, clear]);\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,iBAAiB,SAAS,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-debounce.ts"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\n/**\n * A value that follows `value`, but only once it has stopped changing for `ms`.\n *\n * kastlan asked for the pair in this module because each of its search boxes carried\n * its own copy of the same six lines — a `useEffect` with a `setTimeout` — and two of\n * them forgot the cleanup, so a stale query landed AFTER the fresh one and replaced\n * its results. The cleanup is the whole point of having one implementation.\n *\n * The first render returns `value` itself, not `undefined`: a list filtered by the\n * debounced query must render its initial state immediately, not after `ms`.\n *\n * **It re-arms when `value`'s IDENTITY changes** (an effect on `[value, ms]`), not its\n * content. Pass a primitive — the typed query, a JSON string — or a value whose\n * identity is stable (state, a `useMemo`). An object or array built in render is a new\n * one every render, so the timer is re-armed on every render and the value never\n * settles — or, when the debounced value feeds the render that built it, settles,\n * renders, builds another and fires again, every `ms`, with nobody typing\n * (Kurvenschmiede's control page, KS U9). Debounce `JSON.stringify(body)`, or a key that\n * changes exactly when the content does, and build the object from that.\n */\nexport function useDebounce<T>(value: T, ms: number): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), ms);\n return () => clearTimeout(timer);\n }, [value, ms]);\n return debounced;\n}\n\nexport interface DebouncedCallbackOptions {\n /**\n * The longest a call may be held back, however often it is re-triggered. Without\n * it a user who never stops typing never saves; with it, a draft autosave still\n * lands every `maxWait` ms while the typing goes on.\n */\n maxWait?: number;\n}\n\n/** The debounced function, plus the two escapes a caller needs around it. */\nexport type DebouncedFunction<A extends unknown[]> = ((...args: A) => void) & {\n /** Drop the pending call, if there is one. */\n cancel: () => void;\n /** Run the pending call now, if there is one — e.g. on blur or before navigating\n * away, so the last keystrokes of a form are not lost. */\n flush: () => void;\n /** Whether a call is waiting. */\n pending: () => boolean;\n};\n\n/**\n * `fn`, called only once calls have stopped arriving for `ms` — with the arguments\n * of the LAST call.\n *\n * The returned function keeps its identity across renders (so it can sit in an\n * effect's dependency list or be handed to a memoised child) and always calls the\n * LATEST `fn`, so a handler that closes over current state never runs a stale copy.\n * A pending call is cancelled on unmount: a debounced save firing into an unmounted\n * form is the bug kastlan reported, not a feature.\n */\nexport function useDebouncedCallback<A extends unknown[]>(\n fn: (...args: A) => void,\n ms: number,\n { maxWait }: DebouncedCallbackOptions = {},\n): DebouncedFunction<A> {\n const fnRef = useRef(fn);\n // Layout effect, not render-time assignment: a ref written during render is a\n // side effect React may replay or discard. Nothing can call the debounced function\n // between this commit and the layout effect, so it is never one render behind.\n useLayoutEffect(() => {\n fnRef.current = fn;\n });\n\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const maxTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const lastArgs = useRef<A | null>(null);\n\n const clear = useCallback(() => {\n if (timer.current) clearTimeout(timer.current);\n if (maxTimer.current) clearTimeout(maxTimer.current);\n timer.current = null;\n maxTimer.current = null;\n }, []);\n\n const invoke = useCallback(() => {\n const args = lastArgs.current;\n clear();\n lastArgs.current = null;\n if (args) fnRef.current(...args);\n }, [clear]);\n\n useEffect(() => clear, [clear]);\n\n return useMemo(() => {\n const debounced = ((...args: A) => {\n lastArgs.current = args;\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(invoke, ms);\n if (maxWait !== undefined && !maxTimer.current) {\n maxTimer.current = setTimeout(invoke, maxWait);\n }\n }) as DebouncedFunction<A>;\n debounced.cancel = () => {\n clear();\n lastArgs.current = null;\n };\n debounced.flush = () => {\n if (lastArgs.current) invoke();\n };\n debounced.pending = () => lastArgs.current !== null;\n return debounced;\n }, [ms, maxWait, invoke, clear]);\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,iBAAiB,SAAS,QAAQ,gBAAgB;AAsB5E,SAAS,YAAe,OAAU,IAAe;AACtD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,YAAU,MAAM;AACd,UAAM,QAAQ,WAAW,MAAM,aAAa,KAAK,GAAG,EAAE;AACtD,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,OAAO,EAAE,CAAC;AACd,SAAO;AACT;AAgCO,SAAS,qBACd,IACA,IACA,EAAE,QAAQ,IAA8B,CAAC,GACnB;AACtB,QAAM,QAAQ,OAAO,EAAE;AAIvB,kBAAgB,MAAM;AACpB,UAAM,UAAU;AAAA,EAClB,CAAC;AAED,QAAM,QAAQ,OAA6C,IAAI;AAC/D,QAAM,WAAW,OAA6C,IAAI;AAClE,QAAM,WAAW,OAAiB,IAAI;AAEtC,QAAM,QAAQ,YAAY,MAAM;AAC9B,QAAI,MAAM,QAAS,cAAa,MAAM,OAAO;AAC7C,QAAI,SAAS,QAAS,cAAa,SAAS,OAAO;AACnD,UAAM,UAAU;AAChB,aAAS,UAAU;AAAA,EACrB,GAAG,CAAC,CAAC;AAEL,QAAM,SAAS,YAAY,MAAM;AAC/B,UAAM,OAAO,SAAS;AACtB,UAAM;AACN,aAAS,UAAU;AACnB,QAAI,KAAM,OAAM,QAAQ,GAAG,IAAI;AAAA,EACjC,GAAG,CAAC,KAAK,CAAC;AAEV,YAAU,MAAM,OAAO,CAAC,KAAK,CAAC;AAE9B,SAAO,QAAQ,MAAM;AACnB,UAAM,aAAa,IAAI,SAAY;AACjC,eAAS,UAAU;AACnB,UAAI,MAAM,QAAS,cAAa,MAAM,OAAO;AAC7C,YAAM,UAAU,WAAW,QAAQ,EAAE;AACrC,UAAI,YAAY,UAAa,CAAC,SAAS,SAAS;AAC9C,iBAAS,UAAU,WAAW,QAAQ,OAAO;AAAA,MAC/C;AAAA,IACF;AACA,cAAU,SAAS,MAAM;AACvB,YAAM;AACN,eAAS,UAAU;AAAA,IACrB;AACA,cAAU,QAAQ,MAAM;AACtB,UAAI,SAAS,QAAS,QAAO;AAAA,IAC/B;AACA,cAAU,UAAU,MAAM,SAAS,YAAY;AAC/C,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,SAAS,QAAQ,KAAK,CAAC;AACjC;","names":[]}
|
|
@@ -1,13 +1,53 @@
|
|
|
1
|
-
import { RefObject } from
|
|
2
|
-
|
|
1
|
+
import type { KeyboardEvent as ReactKeyboardEvent, RefObject } from "react";
|
|
2
|
+
/** A layer's handler, read through a ref so the stack holds one stable entry per open. */
|
|
3
|
+
interface Layer {
|
|
4
|
+
escape: (e: KeyboardEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
/** What {@link useDismissLayer} hands back: its layer while open, for
|
|
7
|
+
* {@link runOwnKeyDown} to tell whether that layer is the one on top. */
|
|
8
|
+
export type DismissLayer = RefObject<Layer | null>;
|
|
3
9
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
10
|
+
* An Escape layer on the stack while `open`: the topmost layer is handed the next
|
|
11
|
+
* Escape and calls `onEscape`, every layer under it waits its turn. A list opened inside
|
|
12
|
+
* a dialog is above the dialog; a popover opened from a list, above the list.
|
|
13
|
+
*
|
|
14
|
+
* Where focus can be INSIDE the layer, its element's `onKeyDown` calls
|
|
15
|
+
* {@link takeEscape} too, so the key stops there — see the module note. `onEscape` is
|
|
16
|
+
* read live, so it need not be memoised; the layer is pushed and popped only when
|
|
17
|
+
* `open` flips. The layer it returns is for the owner's {@link runOwnKeyDown}.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useDismissLayer(open: boolean, onEscape: (e: KeyboardEvent) => void): DismissLayer;
|
|
20
|
+
/**
|
|
21
|
+
* For a layer's own element, in its `onKeyDown`: hands an Escape on its way up to the
|
|
22
|
+
* topmost layer — this one, unless something opened over it without taking focus (a
|
|
23
|
+
* tooltip, the numpad) — and stops it here. True when it did; false for any other key,
|
|
24
|
+
* a claimed Escape, or one already handed over.
|
|
25
|
+
*/
|
|
26
|
+
export declare function takeEscape(e: KeyboardEvent | ReactKeyboardEvent): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* For an Escape that means "undo this step", not "close": the key is the caller's, and
|
|
29
|
+
* no layer is handed it. `preventDefault()`s it as well, so a handler further out that
|
|
30
|
+
* checks `defaultPrevented` leaves it alone, as before.
|
|
31
|
+
*/
|
|
32
|
+
export declare function claimEscape(e: KeyboardEvent | ReactKeyboardEvent): void;
|
|
33
|
+
/**
|
|
34
|
+
* Runs a layer owner's own key handler — a dialog's `onKeyDown` prop — and turns a
|
|
35
|
+
* `preventDefault()` it makes on Escape into a claim: the one way, beside
|
|
36
|
+
* {@link claimEscape}, to keep a layer open.
|
|
37
|
+
*
|
|
38
|
+
* Given the owner's `layer` (what {@link useDismissLayer} returned), an Escape that went
|
|
39
|
+
* down while another layer was above that one skips the handler: the press is the
|
|
40
|
+
* layer's on top, and the owner hears the next (0.35, KS). Without it, or while the
|
|
41
|
+
* owner's layer is not open, the handler sees every key, as before.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runOwnKeyDown<E extends ReactKeyboardEvent>(e: E, handler: ((e: E) => void) | undefined, layer?: DismissLayer): void;
|
|
44
|
+
/**
|
|
45
|
+
* Calls `handler` on an Escape while `enabled` — as an Escape layer. Since 0.34 this is
|
|
46
|
+
* {@link useDismissLayer} with its arguments the other way round: it hears the key only
|
|
47
|
+
* while nothing opened above it, and inside a dialog it no longer loses the key to the
|
|
48
|
+
* dialog (Wave 2, DUP-1). `handler` is read live, so it need not be memoised.
|
|
9
49
|
*/
|
|
10
|
-
declare function useEscapeKey(handler: () => void, enabled?: boolean): void;
|
|
50
|
+
export declare function useEscapeKey(handler: () => void, enabled?: boolean): void;
|
|
11
51
|
/**
|
|
12
52
|
* Calls `handler` on a press that lands outside every supplied element, while
|
|
13
53
|
* `enabled` — the outside-click-to-close half of the same dismissal story. Pass one
|
|
@@ -29,6 +69,5 @@ declare function useEscapeKey(handler: () => void, enabled?: boolean): void;
|
|
|
29
69
|
* the anchored panels re-measure on scroll precisely because the page moves under
|
|
30
70
|
* them.
|
|
31
71
|
*/
|
|
32
|
-
declare function useOutsideClick(refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], handler: () => void, enabled?: boolean): void;
|
|
33
|
-
|
|
34
|
-
export { useEscapeKey, useOutsideClick };
|
|
72
|
+
export declare function useOutsideClick(refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], handler: () => void, enabled?: boolean): void;
|
|
73
|
+
export {};
|
|
@@ -1,18 +1,85 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { isComposing } from "../lib/ime.js";
|
|
4
|
+
const layers = [];
|
|
5
|
+
const claimed = /* @__PURE__ */ new WeakSet();
|
|
6
|
+
let inFlight = null;
|
|
7
|
+
function nativeOf(e) {
|
|
8
|
+
return "nativeEvent" in e ? e.nativeEvent : e;
|
|
9
|
+
}
|
|
10
|
+
function onCapture(e) {
|
|
11
|
+
if (e.key !== "Escape") return;
|
|
12
|
+
const top = isComposing(e) ? void 0 : layers[layers.length - 1];
|
|
13
|
+
inFlight = top ? { event: e, layer: top, done: false } : null;
|
|
14
|
+
}
|
|
15
|
+
function onBubble(e) {
|
|
16
|
+
handOver(e, false);
|
|
17
|
+
}
|
|
18
|
+
function handOver(e, stop) {
|
|
19
|
+
const native = nativeOf(e);
|
|
20
|
+
const flight = inFlight;
|
|
21
|
+
if (native.key !== "Escape" || !flight || flight.event !== native || flight.done) return false;
|
|
22
|
+
if (claimed.has(native)) return false;
|
|
23
|
+
flight.done = true;
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if (stop) e.stopPropagation();
|
|
26
|
+
if (layers.includes(flight.layer)) flight.layer.escape(native);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function push(layer) {
|
|
30
|
+
if (layers.length === 0) {
|
|
31
|
+
document.addEventListener("keydown", onCapture, true);
|
|
32
|
+
document.addEventListener("keydown", onBubble);
|
|
33
|
+
}
|
|
34
|
+
layers.push(layer);
|
|
35
|
+
}
|
|
36
|
+
function pop(layer) {
|
|
37
|
+
const at = layers.indexOf(layer);
|
|
38
|
+
if (at >= 0) layers.splice(at, 1);
|
|
39
|
+
if (layers.length > 0) return;
|
|
40
|
+
document.removeEventListener("keydown", onCapture, true);
|
|
41
|
+
document.removeEventListener("keydown", onBubble);
|
|
42
|
+
inFlight = null;
|
|
43
|
+
}
|
|
44
|
+
function useDismissLayer(open, onEscape) {
|
|
45
|
+
const handlerRef = useRef(onEscape);
|
|
46
|
+
const layerRef = useRef(null);
|
|
5
47
|
useEffect(() => {
|
|
6
|
-
handlerRef.current =
|
|
48
|
+
handlerRef.current = onEscape;
|
|
7
49
|
});
|
|
8
50
|
useEffect(() => {
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
|
|
51
|
+
if (!open || typeof document === "undefined") return;
|
|
52
|
+
const layer = { escape: (e) => handlerRef.current(e) };
|
|
53
|
+
layerRef.current = layer;
|
|
54
|
+
push(layer);
|
|
55
|
+
return () => {
|
|
56
|
+
pop(layer);
|
|
57
|
+
layerRef.current = null;
|
|
12
58
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
59
|
+
}, [open]);
|
|
60
|
+
return layerRef;
|
|
61
|
+
}
|
|
62
|
+
function takeEscape(e) {
|
|
63
|
+
return handOver(e, true);
|
|
64
|
+
}
|
|
65
|
+
function claimEscape(e) {
|
|
66
|
+
claimed.add(nativeOf(e));
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
}
|
|
69
|
+
function runOwnKeyDown(e, handler, layer) {
|
|
70
|
+
if (!handler) return;
|
|
71
|
+
if (layer && aboveOwner(e, layer.current)) return;
|
|
72
|
+
const before = e.defaultPrevented;
|
|
73
|
+
handler(e);
|
|
74
|
+
if (e.key === "Escape" && !before && e.defaultPrevented) claimed.add(nativeOf(e));
|
|
75
|
+
}
|
|
76
|
+
function aboveOwner(e, owner) {
|
|
77
|
+
const flight = inFlight;
|
|
78
|
+
if (e.key !== "Escape" || !owner || !flight || flight.event !== nativeOf(e)) return false;
|
|
79
|
+
return flight.layer !== owner && layers.includes(owner);
|
|
80
|
+
}
|
|
81
|
+
function useEscapeKey(handler, enabled = true) {
|
|
82
|
+
useDismissLayer(enabled, handler);
|
|
16
83
|
}
|
|
17
84
|
function useOutsideClick(refs, handler, enabled = true) {
|
|
18
85
|
const refsRef = useRef(refs);
|
|
@@ -36,6 +103,10 @@ function useOutsideClick(refs, handler, enabled = true) {
|
|
|
36
103
|
}, [enabled]);
|
|
37
104
|
}
|
|
38
105
|
export {
|
|
106
|
+
claimEscape,
|
|
107
|
+
runOwnKeyDown,
|
|
108
|
+
takeEscape,
|
|
109
|
+
useDismissLayer,
|
|
39
110
|
useEscapeKey,
|
|
40
111
|
useOutsideClick
|
|
41
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-dismiss.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport type { RefObject } from \"react\";\n\n/**\n * Calls `handler` on an Escape keydown while `enabled`. A single document-level\n * listener owns the \"press Escape to dismiss\" behaviour that popovers, flyouts\n * and menus otherwise each re-implement. `handler` is read live at event time,\n * so it need not be memoised and the listener only re-subscribes when `enabled`\n * flips (typically the open/closed transition).\n */\nexport function useEscapeKey(handler: () => void, enabled = true): void {\n const handlerRef = useRef(handler);\n // Written in an effect, not during render, so it satisfies react-hooks/refs: a\n // render that React starts and then discards — a transition, a Suspense retry —\n // would otherwise leave this holding a handler from a tree that never committed,\n // and the document listener below would go on to call it. Keydown events fire\n // after the commit, so the ref is always current by the time one arrives.\n useEffect(() => {\n handlerRef.current = handler;\n });\n useEffect(() => {\n if (!enabled) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") handlerRef.current();\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [enabled]);\n}\n\n/**\n * Calls `handler` on a press that lands outside every supplied element, while\n * `enabled` — the outside-click-to-close half of the same dismissal story. Pass one\n * ref or several (trigger + panel); a press inside any of them is ignored. Refs and\n * `handler` are read live, so an inline `[triggerRef, panelRef]` array is fine and\n * won't churn the listener.\n *\n * **`pointerdown`, not `mousedown`** — one event covering mouse, touch and pen.\n * This listened for `mousedown` alone, which on a touch platform is a SYNTHESISED\n * event: the browser emits it for most taps, which is why nothing obviously broke,\n * but the synthesis is not guaranteed. A tap that begins a scroll, or one that lands\n * on an element which preventDefaults the touch sequence, may never produce one — and\n * on a phone-first PWA whose pickers, menus and flyouts all dismiss through this hook,\n * inheriting that is worse than choosing it.\n *\n * The one behaviour this changes deliberately: a touch-drag that starts outside an\n * open panel now dismisses it at touch-down, where before it did not dismiss at all\n * (a drag synthesises no mousedown). That matches every other platform surface, and\n * the anchored panels re-measure on scroll precisely because the page moves under\n * them.\n */\nexport function useOutsideClick(\n refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n handler: () => void,\n enabled = true,\n): void {\n const refsRef = useRef(refs);\n const handlerRef = useRef(handler);\n // In an effect rather than during render — see the note on useEscapeKey.\n useEffect(() => {\n refsRef.current = refs;\n handlerRef.current = handler;\n });\n useEffect(() => {\n if (!enabled) return;\n const onPointerDown = (e: Event) => {\n const target = e.target as Node;\n const list = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];\n for (const r of list) {\n if (r.current?.contains(target)) return;\n }\n handlerRef.current();\n };\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => document.removeEventListener(\"pointerdown\", onPointerDown);\n }, [enabled]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAU3B,SAAS,aAAa,SAAqB,UAAU,MAAY;AACtE,QAAM,aAAa,OAAO,OAAO;AAMjC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,CAAC;AACD,YAAU,MAAM;AACd,QAAI,CAAC,QAAS;AACd,UAAM,QAAQ,CAAC,MAAqB;AAClC,UAAI,EAAE,QAAQ,SAAU,YAAW,QAAQ;AAAA,IAC7C;AACA,aAAS,iBAAiB,WAAW,KAAK;AAC1C,WAAO,MAAM,SAAS,oBAAoB,WAAW,KAAK;AAAA,EAC5D,GAAG,CAAC,OAAO,CAAC;AACd;AAuBO,SAAS,gBACd,MACA,SACA,UAAU,MACJ;AACN,QAAM,UAAU,OAAO,IAAI;AAC3B,QAAM,aAAa,OAAO,OAAO;AAEjC,YAAU,MAAM;AACd,YAAQ,UAAU;AAClB,eAAW,UAAU;AAAA,EACvB,CAAC;AACD,YAAU,MAAM;AACd,QAAI,CAAC,QAAS;AACd,UAAM,gBAAgB,CAAC,MAAa;AAClC,YAAM,SAAS,EAAE;AACjB,YAAM,OAAO,MAAM,QAAQ,QAAQ,OAAO,IAAI,QAAQ,UAAU,CAAC,QAAQ,OAAO;AAChF,iBAAW,KAAK,MAAM;AACpB,YAAI,EAAE,SAAS,SAAS,MAAM,EAAG;AAAA,MACnC;AACA,iBAAW,QAAQ;AAAA,IACrB;AACA,aAAS,iBAAiB,eAAe,aAAa;AACtD,WAAO,MAAM,SAAS,oBAAoB,eAAe,aAAa;AAAA,EACxE,GAAG,CAAC,OAAO,CAAC;AACd;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-dismiss.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport type { KeyboardEvent as ReactKeyboardEvent, RefObject } from \"react\";\nimport { isComposing } from \"../lib/ime\";\n\n/*\n * # One Escape stack (round 0.34 Wave 2, DUP-1)\n *\n * Escape closes the TOPMOST thing on screen, and only that: a list open in a dialog\n * closes and the dialog stays; the next press closes the dialog.\n *\n * \"Who owns Escape\" used to be decided five ways. The anchored pickers listened on the\n * document; Modal, FullBleedDialog, PickerSheet and Popover closed in their own panel's\n * `onKeyDown` and stopped the key; CommandPalette closed without stopping it. A dialog's\n * handler sits earlier on the key's path than any document listener, so Escape in an\n * open list inside a Modal closed the MODAL and threw the form away (BUG-1, sev 4,\n * kastlan's lease dialog), and HoverMenu, the numpad and a tooltip could not be\n * dismissed inside a dialog at all. And Modal and FullBleedDialog disagreed on when a\n * child had \"claimed\" the key: a ChipInput clearing its draft kept a Modal open and\n * closed a FullBleedDialog.\n *\n * Now every overlay and picker pushes a layer while it is open ({@link useDismissLayer}),\n * last in, first out, the way `use-overlay-history` stacks the Back gesture. One\n * capture-phase listener on the document notes which layer is on top as each Escape\n * goes down — before any handler on the page runs, so a layer that closes on the way\n * cannot pass the key on to the one beneath it. That layer, and only that one, is\n * handed the key:\n *\n * - at the first layer element the key passes on its way back up ({@link takeEscape},\n * which Modal's panel, a picker's search box and the rest call from their\n * `onKeyDown`). The key is stopped there, so nothing around the layers — a\n * FloatingPanel, an app's own panel — closes with it;\n * - or, when focus is in none of them (a hover menu, a tooltip, the numpad over its\n * field, a press on the page), at the document once the key has been everywhere else.\n *\n * Layers stack in the order they OPEN, which is the order their effects run. Two that\n * open in the same commit stack child first — the one case that order gets wrong, and\n * one no overlay in the kit does: each opens on a press, after whatever it sits in.\n *\n * ## Claiming the key: one rule\n *\n * An Escape that means \"undo this step\" is not a dismissal: ChipInput clearing its\n * draft, InlineEditField cancelling its edit, the date picker's month grid going back to\n * the days. Those call {@link claimEscape}, and no layer is handed the key. The only\n * other claim is the layer owner's OWN handler — a dialog's `onKeyDown` prop calling\n * `preventDefault()` on Escape (a busy reauth dialog holding itself open, Kurvenschmiede's\n * gear wizard asking first), through {@link runOwnKeyDown}. A `preventDefault()`\n * anywhere else claims nothing: a search box keeping Chromium from clearing itself\n * must not hold a dialog open (FullBleedDialog's 0.8.0 fix, which Modal never had).\n *\n * The owner's handler hears Escape only while its own layer is on top (0.35, KS). It\n * runs before the stack is asked, so with a tooltip, a hover menu or a list open over\n * the dialog and focus on the panel, the gear wizard asked \"Discard this gear?\" and the\n * tooltip stayed. Now the layer above takes that press, and the next one is the\n * owner's. Every other key reaches the handler as before.\n *\n * A handler that STOPS the key before it reaches a layer element has taken it too —\n * that is the DOM, and it is what the kit's cell editors and confirm buttons do.\n */\n\n/** A layer's handler, read through a ref so the stack holds one stable entry per open. */\ninterface Layer {\n escape: (e: KeyboardEvent) => void;\n}\n\n/** What {@link useDismissLayer} hands back: its layer while open, for\n * {@link runOwnKeyDown} to tell whether that layer is the one on top. */\nexport type DismissLayer = RefObject<Layer | null>;\n\n/** Open layers, oldest first. Module-level, because the order is ACROSS instances. */\nconst layers: Layer[] = [];\n\n/** Escapes a claimant has taken — see {@link claimEscape}. Weak: an event is garbage\n * once its dispatch is over. */\nconst claimed = new WeakSet<Event>();\n\n/** The Escape on its way through the page: the layer that was topmost as it went down,\n * and whether that layer has been handed it yet. */\nlet inFlight: { event: KeyboardEvent; layer: Layer; done: boolean } | null = null;\n\nfunction nativeOf(e: KeyboardEvent | ReactKeyboardEvent): KeyboardEvent {\n return \"nativeEvent\" in e ? e.nativeEvent : e;\n}\n\nfunction onCapture(e: KeyboardEvent): void {\n if (e.key !== \"Escape\") return;\n // An Escape inside an IME composition cancels the composition and nothing else.\n const top = isComposing(e) ? undefined : layers[layers.length - 1];\n inFlight = top ? { event: e, layer: top, done: false } : null;\n}\n\n/** The fallback: no layer element was on the key's path, or none took it. */\nfunction onBubble(e: KeyboardEvent): void {\n handOver(e, false);\n}\n\nfunction handOver(e: KeyboardEvent | ReactKeyboardEvent, stop: boolean): boolean {\n const native = nativeOf(e);\n const flight = inFlight;\n if (native.key !== \"Escape\" || !flight || flight.event !== native || flight.done) return false;\n if (claimed.has(native)) return false;\n flight.done = true;\n // Consumed: a type=\"search\" box does not clear itself as well, and a handler further\n // out that checks `defaultPrevented` (FloatingPanel, an app's own panel) leaves it.\n e.preventDefault();\n if (stop) e.stopPropagation();\n // A layer that closed on the way, by a handler of its own, has had its Escape.\n if (layers.includes(flight.layer)) flight.layer.escape(native);\n return true;\n}\n\nfunction push(layer: Layer): void {\n if (layers.length === 0) {\n document.addEventListener(\"keydown\", onCapture, true);\n document.addEventListener(\"keydown\", onBubble);\n }\n layers.push(layer);\n}\n\nfunction pop(layer: Layer): void {\n const at = layers.indexOf(layer);\n if (at >= 0) layers.splice(at, 1);\n if (layers.length > 0) return;\n document.removeEventListener(\"keydown\", onCapture, true);\n document.removeEventListener(\"keydown\", onBubble);\n inFlight = null;\n}\n\n/**\n * An Escape layer on the stack while `open`: the topmost layer is handed the next\n * Escape and calls `onEscape`, every layer under it waits its turn. A list opened inside\n * a dialog is above the dialog; a popover opened from a list, above the list.\n *\n * Where focus can be INSIDE the layer, its element's `onKeyDown` calls\n * {@link takeEscape} too, so the key stops there — see the module note. `onEscape` is\n * read live, so it need not be memoised; the layer is pushed and popped only when\n * `open` flips. The layer it returns is for the owner's {@link runOwnKeyDown}.\n */\nexport function useDismissLayer(open: boolean, onEscape: (e: KeyboardEvent) => void): DismissLayer {\n const handlerRef = useRef(onEscape);\n const layerRef = useRef<Layer | null>(null);\n // Written in an effect, not during render, so it satisfies react-hooks/refs: a\n // render that React starts and then discards — a transition, a Suspense retry —\n // would otherwise leave this holding a handler from a tree that never committed,\n // and the stack would go on to call it. Keydown events fire after the commit, so\n // the ref is always current by the time one arrives.\n useEffect(() => {\n handlerRef.current = onEscape;\n });\n useEffect(() => {\n if (!open || typeof document === \"undefined\") return;\n const layer: Layer = { escape: (e) => handlerRef.current(e) };\n layerRef.current = layer;\n push(layer);\n return () => {\n pop(layer);\n layerRef.current = null;\n };\n }, [open]);\n return layerRef;\n}\n\n/**\n * For a layer's own element, in its `onKeyDown`: hands an Escape on its way up to the\n * topmost layer — this one, unless something opened over it without taking focus (a\n * tooltip, the numpad) — and stops it here. True when it did; false for any other key,\n * a claimed Escape, or one already handed over.\n */\nexport function takeEscape(e: KeyboardEvent | ReactKeyboardEvent): boolean {\n return handOver(e, true);\n}\n\n/**\n * For an Escape that means \"undo this step\", not \"close\": the key is the caller's, and\n * no layer is handed it. `preventDefault()`s it as well, so a handler further out that\n * checks `defaultPrevented` leaves it alone, as before.\n */\nexport function claimEscape(e: KeyboardEvent | ReactKeyboardEvent): void {\n claimed.add(nativeOf(e));\n e.preventDefault();\n}\n\n/**\n * Runs a layer owner's own key handler — a dialog's `onKeyDown` prop — and turns a\n * `preventDefault()` it makes on Escape into a claim: the one way, beside\n * {@link claimEscape}, to keep a layer open.\n *\n * Given the owner's `layer` (what {@link useDismissLayer} returned), an Escape that went\n * down while another layer was above that one skips the handler: the press is the\n * layer's on top, and the owner hears the next (0.35, KS). Without it, or while the\n * owner's layer is not open, the handler sees every key, as before.\n */\nexport function runOwnKeyDown<E extends ReactKeyboardEvent>(\n e: E,\n handler: ((e: E) => void) | undefined,\n layer?: DismissLayer,\n): void {\n if (!handler) return;\n if (layer && aboveOwner(e, layer.current)) return;\n const before = e.defaultPrevented;\n handler(e);\n if (e.key === \"Escape\" && !before && e.defaultPrevented) claimed.add(nativeOf(e));\n}\n\n/** Whether this Escape went down with a layer above `owner` — the topmost one then was\n * another, and `owner` is on the stack. An Escape the stack did not note (one inside an\n * IME composition) is nobody else's. */\nfunction aboveOwner(e: ReactKeyboardEvent, owner: Layer | null): boolean {\n const flight = inFlight;\n if (e.key !== \"Escape\" || !owner || !flight || flight.event !== nativeOf(e)) return false;\n return flight.layer !== owner && layers.includes(owner);\n}\n\n/**\n * Calls `handler` on an Escape while `enabled` — as an Escape layer. Since 0.34 this is\n * {@link useDismissLayer} with its arguments the other way round: it hears the key only\n * while nothing opened above it, and inside a dialog it no longer loses the key to the\n * dialog (Wave 2, DUP-1). `handler` is read live, so it need not be memoised.\n */\nexport function useEscapeKey(handler: () => void, enabled = true): void {\n useDismissLayer(enabled, handler);\n}\n\n/**\n * Calls `handler` on a press that lands outside every supplied element, while\n * `enabled` — the outside-click-to-close half of the same dismissal story. Pass one\n * ref or several (trigger + panel); a press inside any of them is ignored. Refs and\n * `handler` are read live, so an inline `[triggerRef, panelRef]` array is fine and\n * won't churn the listener.\n *\n * **`pointerdown`, not `mousedown`** — one event covering mouse, touch and pen.\n * This listened for `mousedown` alone, which on a touch platform is a SYNTHESISED\n * event: the browser emits it for most taps, which is why nothing obviously broke,\n * but the synthesis is not guaranteed. A tap that begins a scroll, or one that lands\n * on an element which preventDefaults the touch sequence, may never produce one — and\n * on a phone-first PWA whose pickers, menus and flyouts all dismiss through this hook,\n * inheriting that is worse than choosing it.\n *\n * The one behaviour this changes deliberately: a touch-drag that starts outside an\n * open panel now dismisses it at touch-down, where before it did not dismiss at all\n * (a drag synthesises no mousedown). That matches every other platform surface, and\n * the anchored panels re-measure on scroll precisely because the page moves under\n * them.\n */\nexport function useOutsideClick(\n refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n handler: () => void,\n enabled = true,\n): void {\n const refsRef = useRef(refs);\n const handlerRef = useRef(handler);\n // In an effect rather than during render — see the note in useDismissLayer.\n useEffect(() => {\n refsRef.current = refs;\n handlerRef.current = handler;\n });\n useEffect(() => {\n if (!enabled) return;\n const onPointerDown = (e: Event) => {\n const target = e.target as Node;\n const list = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];\n for (const r of list) {\n if (r.current?.contains(target)) return;\n }\n handlerRef.current();\n };\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => document.removeEventListener(\"pointerdown\", onPointerDown);\n }, [enabled]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAElC,SAAS,mBAAmB;AAmE5B,MAAM,SAAkB,CAAC;AAIzB,MAAM,UAAU,oBAAI,QAAe;AAInC,IAAI,WAAyE;AAE7E,SAAS,SAAS,GAAsD;AACtE,SAAO,iBAAiB,IAAI,EAAE,cAAc;AAC9C;AAEA,SAAS,UAAU,GAAwB;AACzC,MAAI,EAAE,QAAQ,SAAU;AAExB,QAAM,MAAM,YAAY,CAAC,IAAI,SAAY,OAAO,OAAO,SAAS,CAAC;AACjE,aAAW,MAAM,EAAE,OAAO,GAAG,OAAO,KAAK,MAAM,MAAM,IAAI;AAC3D;AAGA,SAAS,SAAS,GAAwB;AACxC,WAAS,GAAG,KAAK;AACnB;AAEA,SAAS,SAAS,GAAuC,MAAwB;AAC/E,QAAM,SAAS,SAAS,CAAC;AACzB,QAAM,SAAS;AACf,MAAI,OAAO,QAAQ,YAAY,CAAC,UAAU,OAAO,UAAU,UAAU,OAAO,KAAM,QAAO;AACzF,MAAI,QAAQ,IAAI,MAAM,EAAG,QAAO;AAChC,SAAO,OAAO;AAGd,IAAE,eAAe;AACjB,MAAI,KAAM,GAAE,gBAAgB;AAE5B,MAAI,OAAO,SAAS,OAAO,KAAK,EAAG,QAAO,MAAM,OAAO,MAAM;AAC7D,SAAO;AACT;AAEA,SAAS,KAAK,OAAoB;AAChC,MAAI,OAAO,WAAW,GAAG;AACvB,aAAS,iBAAiB,WAAW,WAAW,IAAI;AACpD,aAAS,iBAAiB,WAAW,QAAQ;AAAA,EAC/C;AACA,SAAO,KAAK,KAAK;AACnB;AAEA,SAAS,IAAI,OAAoB;AAC/B,QAAM,KAAK,OAAO,QAAQ,KAAK;AAC/B,MAAI,MAAM,EAAG,QAAO,OAAO,IAAI,CAAC;AAChC,MAAI,OAAO,SAAS,EAAG;AACvB,WAAS,oBAAoB,WAAW,WAAW,IAAI;AACvD,WAAS,oBAAoB,WAAW,QAAQ;AAChD,aAAW;AACb;AAYO,SAAS,gBAAgB,MAAe,UAAoD;AACjG,QAAM,aAAa,OAAO,QAAQ;AAClC,QAAM,WAAW,OAAqB,IAAI;AAM1C,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,CAAC;AACD,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ,OAAO,aAAa,YAAa;AAC9C,UAAM,QAAe,EAAE,QAAQ,CAAC,MAAM,WAAW,QAAQ,CAAC,EAAE;AAC5D,aAAS,UAAU;AACnB,SAAK,KAAK;AACV,WAAO,MAAM;AACX,UAAI,KAAK;AACT,eAAS,UAAU;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AACT,SAAO;AACT;AAQO,SAAS,WAAW,GAAgD;AACzE,SAAO,SAAS,GAAG,IAAI;AACzB;AAOO,SAAS,YAAY,GAA6C;AACvE,UAAQ,IAAI,SAAS,CAAC,CAAC;AACvB,IAAE,eAAe;AACnB;AAYO,SAAS,cACd,GACA,SACA,OACM;AACN,MAAI,CAAC,QAAS;AACd,MAAI,SAAS,WAAW,GAAG,MAAM,OAAO,EAAG;AAC3C,QAAM,SAAS,EAAE;AACjB,UAAQ,CAAC;AACT,MAAI,EAAE,QAAQ,YAAY,CAAC,UAAU,EAAE,iBAAkB,SAAQ,IAAI,SAAS,CAAC,CAAC;AAClF;AAKA,SAAS,WAAW,GAAuB,OAA8B;AACvE,QAAM,SAAS;AACf,MAAI,EAAE,QAAQ,YAAY,CAAC,SAAS,CAAC,UAAU,OAAO,UAAU,SAAS,CAAC,EAAG,QAAO;AACpF,SAAO,OAAO,UAAU,SAAS,OAAO,SAAS,KAAK;AACxD;AAQO,SAAS,aAAa,SAAqB,UAAU,MAAY;AACtE,kBAAgB,SAAS,OAAO;AAClC;AAuBO,SAAS,gBACd,MACA,SACA,UAAU,MACJ;AACN,QAAM,UAAU,OAAO,IAAI;AAC3B,QAAM,aAAa,OAAO,OAAO;AAEjC,YAAU,MAAM;AACd,YAAQ,UAAU;AAClB,eAAW,UAAU;AAAA,EACvB,CAAC;AACD,YAAU,MAAM;AACd,QAAI,CAAC,QAAS;AACd,UAAM,gBAAgB,CAAC,MAAa;AAClC,YAAM,SAAS,EAAE;AACjB,YAAM,OAAO,MAAM,QAAQ,QAAQ,OAAO,IAAI,QAAQ,UAAU,CAAC,QAAQ,OAAO;AAChF,iBAAW,KAAK,MAAM;AACpB,YAAI,EAAE,SAAS,SAAS,MAAM,EAAG;AAAA,MACnC;AACA,iBAAW,QAAQ;AAAA,IACrB;AACA,aAAS,iBAAiB,eAAe,aAAa;AACtD,WAAO,MAAM,SAAS,oBAAoB,eAAe,aAAa;AAAA,EACxE,GAAG,CAAC,OAAO,CAAC;AACd;","names":[]}
|