@eifi1/ui-kit 0.34.0 → 0.36.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 +115 -41
- package/dist/admin/role-select.d.ts +3 -2
- package/dist/admin/role-select.js +2 -0
- package/dist/admin/role-select.js.map +1 -1
- package/dist/billing/billing-banner.d.ts +5 -2
- package/dist/billing/billing-banner.js.map +1 -1
- package/dist/billing/plan-limit-notice.d.ts +5 -2
- package/dist/billing/plan-limit-notice.js.map +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/components/amount-input.d.ts +2 -5
- package/dist/components/amount-input.js +2 -2
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/autocomplete.d.ts +2 -2
- package/dist/components/autocomplete.js +2 -1
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/button-look.d.ts +1 -1
- package/dist/components/button-look.js +9 -4
- package/dist/components/button-look.js.map +1 -1
- package/dist/components/calculator.d.ts +1 -4
- package/dist/components/calculator.js +1 -3
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/chart-zoom.d.ts +0 -37
- package/dist/components/chart-zoom.js +1 -28
- package/dist/components/chart-zoom.js.map +1 -1
- package/dist/components/checkbox-group.d.ts +5 -2
- package/dist/components/checkbox-group.js +15 -4
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/chip-input.d.ts +0 -4
- package/dist/components/chip-input.js +1 -5
- package/dist/components/chip-input.js.map +1 -1
- package/dist/components/column-mapper.d.ts +5 -3
- package/dist/components/column-mapper.js +2 -0
- package/dist/components/column-mapper.js.map +1 -1
- package/dist/components/combobox.d.ts +3 -3
- package/dist/components/combobox.js +2 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/copy-button.d.ts +5 -1
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/country-select.d.ts +3 -3
- package/dist/components/country-select.js +3 -0
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/currency-option-list.d.ts +3 -8
- package/dist/components/currency-option-list.js +1 -29
- package/dist/components/currency-option-list.js.map +1 -1
- package/dist/components/currency-select.d.ts +3 -2
- package/dist/components/currency-select.js +10 -1
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +3 -3
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filter-popover.js +1 -1
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-labels.d.ts +1 -42
- package/dist/components/data-table-labels.js +2 -31
- package/dist/components/data-table-labels.js.map +1 -1
- package/dist/components/data-table-shared.d.ts +17 -1
- package/dist/components/data-table-shared.js +22 -0
- package/dist/components/data-table-shared.js.map +1 -1
- package/dist/components/data-table.d.ts +12 -2
- package/dist/components/data-table.js +18 -14
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-field.d.ts +2 -1
- package/dist/components/date-field.js.map +1 -1
- package/dist/components/date-picker.js +3 -0
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.js +3 -0
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +3 -1
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/dropdown.d.ts +18 -15
- package/dist/components/dropdown.js +11 -3
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/entity-combobox.d.ts +3 -3
- package/dist/components/entity-combobox.js +2 -1
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/field-base.d.ts +0 -5
- package/dist/components/field-base.js +0 -5
- package/dist/components/field-base.js.map +1 -1
- package/dist/components/field-parts.d.ts +69 -22
- package/dist/components/field-parts.js +33 -19
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-strip.d.ts +9 -23
- package/dist/components/field-strip.js +26 -23
- package/dist/components/field-strip.js.map +1 -1
- package/dist/components/field-sync.d.ts +0 -4
- package/dist/components/field-sync.js +0 -4
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/field.d.ts +7 -6
- package/dist/components/field.js +24 -15
- package/dist/components/field.js.map +1 -1
- package/dist/components/full-bleed-dialog.js +2 -2
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/help-popover.d.ts +9 -7
- package/dist/components/help-popover.js.map +1 -1
- package/dist/components/hover-menu.d.ts +6 -13
- package/dist/components/hover-menu.js +3 -3
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/icon-picker.d.ts +3 -2
- package/dist/components/icon-picker.js +3 -0
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/inline-entity-combobox.d.ts +3 -3
- package/dist/components/inline-entity-combobox.js +2 -1
- package/dist/components/inline-entity-combobox.js.map +1 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +2 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/modal.d.ts +9 -1
- package/dist/components/modal.js +7 -4
- package/dist/components/modal.js.map +1 -1
- package/dist/components/month-picker.d.ts +2 -1
- package/dist/components/month-picker.js +8 -1
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.d.ts +2 -2
- package/dist/components/multi-entity-combobox.js +2 -1
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.d.ts +7 -18
- package/dist/components/multi-select.js +8 -10
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/number-input.d.ts +2 -5
- package/dist/components/number-input.js +2 -4
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numeric-field.d.ts +5 -2
- package/dist/components/numeric-field.js +4 -1
- package/dist/components/numeric-field.js.map +1 -1
- package/dist/components/one-time-code-input.d.ts +2 -1
- package/dist/components/one-time-code-input.js +2 -1
- package/dist/components/one-time-code-input.js.map +1 -1
- package/dist/components/phone-input.d.ts +1 -1
- package/dist/components/phone-input.js +4 -0
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/popover.js +3 -3
- package/dist/components/popover.js.map +1 -1
- package/dist/components/select.d.ts +4 -3
- package/dist/components/select.js +2 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/server-wake.d.ts +0 -6
- package/dist/components/server-wake.js.map +1 -1
- package/dist/components/settings-fields.d.ts +4 -2
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/slider.d.ts +3 -2
- package/dist/components/slider.js +7 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/stat-tile.d.ts +8 -2
- package/dist/components/stat-tile.js +2 -11
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/swatch-picker.d.ts +3 -2
- package/dist/components/swatch-picker.js +3 -0
- package/dist/components/swatch-picker.js.map +1 -1
- package/dist/components/swipeable-row.d.ts +2 -17
- package/dist/components/swipeable-row.js +11 -16
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/text-link.js +3 -1
- package/dist/components/text-link.js.map +1 -1
- package/dist/components/textarea.d.ts +2 -1
- package/dist/components/textarea.js +9 -3
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +7 -3
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/tooltip.d.ts +9 -1
- package/dist/components/tooltip.js +20 -5
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/translation-review.d.ts +10 -2
- package/dist/components/translation-review.js +11 -3
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/use-table-state.d.ts +31 -3
- 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 +2 -2
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/wizard-stepper.d.ts +1 -4
- package/dist/components/wizard-stepper.js +2 -3
- package/dist/components/wizard-stepper.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/demo/demo-banner.d.ts +7 -2
- package/dist/demo/demo-banner.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-menu.d.ts +2 -2
- package/dist/feedback/feedback-menu.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +3 -8
- package/dist/feedback/feedback-thread.js +0 -2
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +16 -3
- package/dist/hooks/use-dismiss.js +14 -2
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/i18n/defaults.js +5 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +97 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +29 -4
- package/dist/i18n/kit-labels.js +21 -1
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +104 -3
- package/dist/i18n/locales/en.js.map +3 -3
- package/dist/i18n/locales/es.js +95 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +99 -3
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +95 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +99 -3
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +95 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +13 -0
- package/dist/i18n/review.js.map +1 -1
- package/dist/i18n/shared-labels.js +3 -1
- package/dist/i18n/shared-labels.js.map +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +40 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/device-settings.d.ts +72 -0
- package/dist/lib/device-settings.js +64 -0
- package/dist/lib/device-settings.js.map +1 -0
- package/dist/lib/plain-text.d.ts +11 -0
- package/dist/lib/plain-text.js +16 -0
- package/dist/lib/plain-text.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/safe-storage.d.ts +6 -0
- package/dist/lib/safe-storage.js +11 -0
- package/dist/lib/safe-storage.js.map +1 -1
- package/dist/notifications/notification-parts.d.ts +39 -0
- package/dist/notifications/notification-parts.js +47 -0
- package/dist/notifications/notification-parts.js.map +1 -0
- package/dist/notifications/notification-types-setting.d.ts +62 -0
- package/dist/notifications/notification-types-setting.js +192 -0
- package/dist/notifications/notification-types-setting.js.map +1 -0
- package/dist/notifications/notification-types.d.ts +75 -0
- package/dist/notifications/notification-types.js +2 -0
- package/dist/notifications/notification-types.js.map +1 -0
- package/dist/notifications/notifications-labels.d.ts +131 -0
- package/dist/notifications/notifications-labels.js +83 -0
- package/dist/notifications/notifications-labels.js.map +1 -0
- package/dist/notifications/push-device-setting.d.ts +37 -0
- package/dist/notifications/push-device-setting.js +164 -0
- package/dist/notifications/push-device-setting.js.map +1 -0
- package/dist/notifications/push-devices-setting.d.ts +44 -0
- package/dist/notifications/push-devices-setting.js +203 -0
- package/dist/notifications/push-devices-setting.js.map +1 -0
- package/dist/notifications/quiet-hours-setting.d.ts +47 -0
- package/dist/notifications/quiet-hours-setting.js +131 -0
- package/dist/notifications/quiet-hours-setting.js.map +1 -0
- package/dist/notifications/time-zone-select.d.ts +50 -0
- package/dist/notifications/time-zone-select.js +76 -0
- package/dist/notifications/time-zone-select.js.map +1 -0
- package/dist/notifications/unsubscribe-panel.d.ts +53 -0
- package/dist/notifications/unsubscribe-panel.js +139 -0
- package/dist/notifications/unsubscribe-panel.js.map +1 -0
- package/dist/notifications/use-push-device.d.ts +122 -0
- package/dist/notifications/use-push-device.js +230 -0
- package/dist/notifications/use-push-device.js.map +1 -0
- package/dist/rhf/fields.d.ts +36 -29
- package/dist/rhf/fields.js +51 -22
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form-core.d.ts +5 -4
- package/dist/rhf/form-core.js.map +1 -1
- package/dist/rhf/form.d.ts +7 -36
- package/dist/rhf/form.js +1 -16
- package/dist/rhf/form.js.map +1 -1
- package/dist/rhf/line-items.d.ts +1 -1
- package/dist/rhf/line-items.js.map +1 -1
- package/dist/rhf/use-rhf-wizard-step.js.map +1 -1
- package/dist/rhf.js.map +1 -1
- package/dist/settings/device-reset-setting-labels.d.ts +3 -0
- package/dist/settings/device-reset-setting-labels.js +15 -0
- package/dist/settings/device-reset-setting-labels.js.map +1 -0
- package/dist/settings/device-reset-setting.d.ts +58 -0
- package/dist/settings/device-reset-setting.js +51 -0
- package/dist/settings/device-reset-setting.js.map +1 -0
- package/dist/shell/app-shell.js +5 -0
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/option-switcher-menu.d.ts +5 -17
- package/dist/shell/option-switcher-menu.js +1 -3
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/role-switcher.d.ts +1 -4
- package/dist/shell/role-switcher.js +2 -3
- package/dist/shell/role-switcher.js.map +1 -1
- package/dist/shell/topbar-action-menu.d.ts +7 -19
- package/dist/shell/topbar-action-menu.js +1 -3
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.d.ts +3 -12
- package/dist/shell/topbar-controls.js +6 -9
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/viewport.d.ts +25 -2
- package/dist/testing/viewport.js +61 -10
- package/dist/testing/viewport.js.map +1 -1
- package/dist/theme/contrast-tokens.d.ts +42 -4
- package/dist/theme/contrast-tokens.js +56 -9
- package/dist/theme/contrast-tokens.js.map +1 -1
- package/dist/theme/contrast.d.ts +4 -2
- package/dist/theme/contrast.js +13 -0
- package/dist/theme/contrast.js.map +1 -1
- package/dist/theme/palette-derive.d.ts +15 -1
- package/dist/theme/palette-derive.js +37 -8
- package/dist/theme/palette-derive.js.map +1 -1
- package/dist/theme/palette-presets.d.ts +2 -8
- package/dist/theme/palette-presets.js +5 -284
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/theme/palette-store.js +6 -0
- package/dist/theme/palette-store.js.map +1 -1
- package/dist/theme/text-size.js +6 -0
- package/dist/theme/text-size.js.map +1 -1
- package/dist/theme/theme-store.js +6 -0
- package/dist/theme/theme-store.js.map +1 -1
- package/dist/wizard/types.d.ts +0 -5
- package/dist/wizard/types.js +1 -5
- package/dist/wizard/types.js.map +1 -1
- package/package.json +9 -1
- package/src/admin/role-select.tsx +4 -1
- package/src/billing/billing-banner.tsx +5 -2
- package/src/billing/plan-limit-notice.tsx +5 -2
- package/src/chart.ts +5 -3
- package/src/components/amount-input.tsx +4 -7
- package/src/components/autocomplete.tsx +5 -2
- package/src/components/button-look.ts +15 -5
- package/src/components/calculator.tsx +2 -7
- package/src/components/chart-zoom.tsx +4 -47
- package/src/components/checkbox-group.tsx +22 -4
- package/src/components/chip-input.tsx +0 -7
- package/src/components/column-mapper.tsx +6 -2
- package/src/components/combobox.tsx +6 -3
- package/src/components/copy-button.tsx +5 -1
- package/src/components/country-select.tsx +6 -1
- package/src/components/currency-option-list.tsx +8 -42
- package/src/components/currency-select.tsx +12 -3
- package/src/components/danger-confirm.tsx +3 -3
- package/src/components/data-table-filter-popover.tsx +2 -1
- package/src/components/data-table-labels.ts +2 -84
- package/src/components/data-table-shared.tsx +55 -2
- package/src/components/data-table.tsx +29 -17
- package/src/components/date-field.tsx +2 -2
- package/src/components/date-picker.tsx +3 -0
- package/src/components/date-range-picker.tsx +3 -0
- package/src/components/dialog-frame.tsx +3 -1
- package/src/components/dropdown.tsx +42 -18
- package/src/components/entity-combobox.tsx +6 -3
- package/src/components/field-base.tsx +0 -11
- package/src/components/field-parts.tsx +112 -38
- package/src/components/field-strip.tsx +12 -27
- package/src/components/field-sync.tsx +0 -7
- package/src/components/field.tsx +32 -19
- package/src/components/full-bleed-dialog.tsx +4 -3
- package/src/components/help-popover.tsx +9 -7
- package/src/components/hover-menu.tsx +12 -16
- package/src/components/icon-picker.tsx +8 -3
- package/src/components/inline-entity-combobox.tsx +6 -3
- package/src/components/input.tsx +4 -2
- package/src/components/modal.tsx +20 -4
- package/src/components/month-picker.tsx +10 -3
- package/src/components/multi-entity-combobox.tsx +5 -2
- package/src/components/multi-select.tsx +19 -31
- package/src/components/number-input.tsx +5 -10
- package/src/components/numeric-field.ts +10 -2
- package/src/components/one-time-code-input.tsx +5 -3
- package/src/components/phone-input.tsx +4 -0
- package/src/components/popover.tsx +8 -4
- package/src/components/select.tsx +6 -3
- package/src/components/series-chart.tsx +1 -1
- package/src/components/server-wake.tsx +0 -6
- package/src/components/settings-fields.tsx +4 -2
- package/src/components/slider.tsx +10 -3
- package/src/components/stat-tile.tsx +11 -20
- package/src/components/swatch-picker.tsx +9 -4
- package/src/components/swipeable-row.tsx +15 -37
- package/src/components/text-link.tsx +3 -1
- package/src/components/textarea.tsx +11 -4
- package/src/components/toggle-group.tsx +21 -5
- package/src/components/tooltip.tsx +37 -6
- package/src/components/translation-review.tsx +25 -7
- package/src/components/use-table-state.ts +91 -10
- package/src/components/user-avatar.tsx +2 -2
- package/src/components/wizard-stepper.tsx +2 -6
- package/src/currencies.ts +70 -0
- package/src/demo/demo-banner.tsx +7 -2
- 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-menu.tsx +2 -2
- package/src/feedback/feedback-thread.tsx +3 -8
- package/src/hooks/use-dismiss.ts +39 -4
- package/src/i18n/defaults.ts +4 -0
- package/src/i18n/german.ts +113 -0
- package/src/i18n/kit-labels.tsx +66 -6
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +106 -0
- package/src/i18n/locales/fr.ts +109 -2
- package/src/i18n/locales/hu.ts +104 -0
- package/src/i18n/locales/it.ts +108 -2
- package/src/i18n/locales/zh.ts +96 -0
- package/src/i18n/review.ts +13 -0
- package/src/i18n/shared-labels.ts +2 -0
- package/src/index.ts +53 -1
- package/src/lib/device-settings.ts +146 -0
- package/src/lib/plain-text.ts +22 -0
- package/src/lib/refs.ts +22 -0
- package/src/lib/safe-storage.ts +16 -0
- package/src/notifications/notification-parts.tsx +83 -0
- package/src/notifications/notification-types-setting.tsx +309 -0
- package/src/notifications/notification-types.ts +80 -0
- package/src/notifications/notifications-labels.ts +238 -0
- package/src/notifications/push-device-setting.tsx +224 -0
- package/src/notifications/push-devices-setting.tsx +306 -0
- package/src/notifications/quiet-hours-setting.tsx +185 -0
- package/src/notifications/time-zone-select.tsx +126 -0
- package/src/notifications/unsubscribe-panel.tsx +203 -0
- package/src/notifications/use-push-device.ts +392 -0
- package/src/rhf/fields.tsx +87 -39
- package/src/rhf/form-core.tsx +5 -4
- package/src/rhf/form.tsx +7 -43
- package/src/rhf/line-items.tsx +1 -1
- package/src/rhf/use-rhf-wizard-step.ts +4 -4
- package/src/rhf.ts +3 -2
- package/src/settings/device-reset-setting-labels.ts +20 -0
- package/src/settings/device-reset-setting.tsx +119 -0
- package/src/shell/app-shell.tsx +8 -0
- package/src/shell/option-switcher-menu.tsx +5 -22
- package/src/shell/role-switcher.tsx +2 -6
- package/src/shell/topbar-action-menu.tsx +7 -24
- package/src/shell/topbar-controls.tsx +6 -18
- package/src/testing/index.ts +3 -1
- package/src/testing/viewport.ts +125 -19
- package/src/theme/contrast-tokens.ts +106 -12
- package/src/theme/contrast.ts +30 -4
- package/src/theme/palette-derive.ts +68 -7
- package/src/theme/palette-presets.ts +16 -299
- package/src/theme/palette-store.ts +12 -0
- package/src/theme/text-size.ts +8 -0
- package/src/theme/theme-store.ts +10 -0
- package/src/wizard/types.ts +0 -8
- package/tokens.css +38 -4
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// The words of the notification cards (docs/notifications-harmonization.md §4.2), in a
|
|
2
|
+
// module with no component code: the English catalogue (src/i18n/defaults.ts) imports
|
|
3
|
+
// them without the components, so `en` loads as one chunk like the other languages
|
|
4
|
+
// (0.34, KS U8). The cards read it through `useKitLabels("notifications", …)`.
|
|
5
|
+
|
|
6
|
+
/** The ten IANA regions `Intl` lists zones under — keksdose's `tz_region_*` — in the
|
|
7
|
+
* kit's words. A region a runtime adds later keeps its IANA name. */
|
|
8
|
+
export interface NotificationRegionLabels {
|
|
9
|
+
Africa: string;
|
|
10
|
+
America: string;
|
|
11
|
+
Antarctica: string;
|
|
12
|
+
Arctic: string;
|
|
13
|
+
Asia: string;
|
|
14
|
+
Atlantic: string;
|
|
15
|
+
Australia: string;
|
|
16
|
+
Europe: string;
|
|
17
|
+
Indian: string;
|
|
18
|
+
Pacific: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Every string the notification parts render — the `notifications` namespace of
|
|
23
|
+
* `<UiKitProvider labels>`, overridable per instance through `labels`: the types card,
|
|
24
|
+
* quiet hours and the zone picker, this device's push, the device list, and the
|
|
25
|
+
* unsubscribe page. Cancel is `common.cancel`.
|
|
26
|
+
*/
|
|
27
|
+
export interface NotificationsLabels {
|
|
28
|
+
/* ── The types card ─────────────────────────────────────────────────── */
|
|
29
|
+
/** The types card's title. */
|
|
30
|
+
typesTitle: string;
|
|
31
|
+
/** The line under it. */
|
|
32
|
+
typesDescription: string;
|
|
33
|
+
/** The e-mail switch under a type that offers mail. */
|
|
34
|
+
byEmail: string;
|
|
35
|
+
/** Under every e-mail switch while the account's address is unverified (decision 16):
|
|
36
|
+
* no notification mail goes to an unverified address. */
|
|
37
|
+
emailUnverified: string;
|
|
38
|
+
/** The digest's cadence select. */
|
|
39
|
+
digestCadence: string;
|
|
40
|
+
digestWeekly: string;
|
|
41
|
+
digestMonthly: string;
|
|
42
|
+
/** While the settings load. */
|
|
43
|
+
typesLoading: string;
|
|
44
|
+
/** The server answered no types for this account. */
|
|
45
|
+
typesEmpty: string;
|
|
46
|
+
|
|
47
|
+
/* ── Quiet hours ────────────────────────────────────────────────────── */
|
|
48
|
+
quietTitle: string;
|
|
49
|
+
/** The line under the title; `inbox`: the app keeps an inbox, which a held push still
|
|
50
|
+
* reaches. */
|
|
51
|
+
quietDescription: (inbox: boolean) => string;
|
|
52
|
+
/** The start time's label. */
|
|
53
|
+
quietFrom: string;
|
|
54
|
+
/** The end time's label. */
|
|
55
|
+
quietUntil: string;
|
|
56
|
+
/** One time set, the other not: quiet hours fail open until both are. */
|
|
57
|
+
quietIncomplete: string;
|
|
58
|
+
/** The zone picker's label. */
|
|
59
|
+
timeZone: string;
|
|
60
|
+
/** Given the device's zone, as the picker names it, when it differs from the one the
|
|
61
|
+
* server applies. */
|
|
62
|
+
deviceZone: (zone: string) => string;
|
|
63
|
+
/** The button that takes the device's zone. */
|
|
64
|
+
useDeviceZone: string;
|
|
65
|
+
/** The zone picker's region headings. */
|
|
66
|
+
regions: NotificationRegionLabels;
|
|
67
|
+
|
|
68
|
+
/* ── This device ────────────────────────────────────────────────────── */
|
|
69
|
+
pushTitle: string;
|
|
70
|
+
pushDescription: string;
|
|
71
|
+
/** The browser has no push. */
|
|
72
|
+
unsupported: string;
|
|
73
|
+
/** iOS outside the installed app, given the app's name. */
|
|
74
|
+
iosInstall: (app: string) => string;
|
|
75
|
+
/** The server has no VAPID keys. */
|
|
76
|
+
notConfigured: string;
|
|
77
|
+
/** The browser's permission is denied. */
|
|
78
|
+
blocked: string;
|
|
79
|
+
/** This device gets notifications for the signed-in account. */
|
|
80
|
+
on: string;
|
|
81
|
+
off: string;
|
|
82
|
+
/** This browser's subscription belongs to another account. */
|
|
83
|
+
otherAccount: string;
|
|
84
|
+
enable: string;
|
|
85
|
+
disable: string;
|
|
86
|
+
sendTest: string;
|
|
87
|
+
/** Turning on did not finish (the permission prompt dismissed, a refusal). */
|
|
88
|
+
enableFailed: string;
|
|
89
|
+
/** No service worker, or one that is not ready in 10 s. */
|
|
90
|
+
noServiceWorker: string;
|
|
91
|
+
/** The browser's push service did not answer in 15 s. */
|
|
92
|
+
pushTimeout: string;
|
|
93
|
+
/** Given how many devices the push service accepted the test for (≥ 1). */
|
|
94
|
+
testSent: (count: number) => string;
|
|
95
|
+
/** The test reached no device. */
|
|
96
|
+
testNone: string;
|
|
97
|
+
testFailed: string;
|
|
98
|
+
/** The explainer before the browser's one permission prompt. */
|
|
99
|
+
explainerTitle: string;
|
|
100
|
+
explainerBody: (app: string) => string;
|
|
101
|
+
explainerHint: string;
|
|
102
|
+
explainerContinue: string;
|
|
103
|
+
|
|
104
|
+
/* ── The device list ────────────────────────────────────────────────── */
|
|
105
|
+
devicesTitle: string;
|
|
106
|
+
devicesDescription: string;
|
|
107
|
+
devicesLoading: string;
|
|
108
|
+
devicesEmpty: string;
|
|
109
|
+
/** A device whose user agent says nothing the kit recognises. */
|
|
110
|
+
unknownDevice: string;
|
|
111
|
+
/** The chip on this browser's row. */
|
|
112
|
+
thisDevice: string;
|
|
113
|
+
/** Given the registration date, formatted. */
|
|
114
|
+
added: (date: string) => string;
|
|
115
|
+
/** Given the last accepted delivery, formatted. */
|
|
116
|
+
lastDelivery: (date: string) => string;
|
|
117
|
+
noDelivery: string;
|
|
118
|
+
/** Given the failed deliveries in a row (≥ 1). */
|
|
119
|
+
failures: (count: number) => string;
|
|
120
|
+
/** A row's button, visible text — and the confirm's answer. */
|
|
121
|
+
remove: string;
|
|
122
|
+
/** The same button's accessible name, given the device: it starts with `remove`. */
|
|
123
|
+
removeItem: (device: string) => string;
|
|
124
|
+
/** The question the row asks before it removes. */
|
|
125
|
+
removePrompt: string;
|
|
126
|
+
|
|
127
|
+
/* ── The unsubscribe page ───────────────────────────────────────────── */
|
|
128
|
+
unsubscribeTitle: string;
|
|
129
|
+
/** Given the type's name in the app's words. */
|
|
130
|
+
unsubscribeAbout: (type: string) => string;
|
|
131
|
+
/** No type name to give. */
|
|
132
|
+
unsubscribeGeneric: string;
|
|
133
|
+
stopThese: string;
|
|
134
|
+
stopAll: (app: string) => string;
|
|
135
|
+
stoppedThese: string;
|
|
136
|
+
stoppedAll: (app: string) => string;
|
|
137
|
+
/** Account mail is not a notification, and keeps coming. */
|
|
138
|
+
accountMail: string;
|
|
139
|
+
turnBackOn: string;
|
|
140
|
+
openSettings: string;
|
|
141
|
+
/** A token the server refused, or one that does not parse. */
|
|
142
|
+
invalidLink: string;
|
|
143
|
+
|
|
144
|
+
/* ── Every card ─────────────────────────────────────────────────────── */
|
|
145
|
+
/** A request failed, and the app had no words of its own. */
|
|
146
|
+
failed: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const DEFAULT_NOTIFICATIONS_LABELS: NotificationsLabels = {
|
|
150
|
+
typesTitle: "Notify me about",
|
|
151
|
+
typesDescription: "Choose what you hear about, and how.",
|
|
152
|
+
byEmail: "By e-mail",
|
|
153
|
+
emailUnverified: "Confirm your address to receive these.",
|
|
154
|
+
digestCadence: "Frequency",
|
|
155
|
+
digestWeekly: "Weekly",
|
|
156
|
+
digestMonthly: "Monthly",
|
|
157
|
+
typesLoading: "Loading notification settings…",
|
|
158
|
+
typesEmpty: "There are no notifications for this account.",
|
|
159
|
+
|
|
160
|
+
quietTitle: "Quiet hours",
|
|
161
|
+
quietDescription: (inbox) =>
|
|
162
|
+
inbox
|
|
163
|
+
? "No push notifications during this window. They still reach your inbox."
|
|
164
|
+
: "No push notifications during this window.",
|
|
165
|
+
quietFrom: "From",
|
|
166
|
+
quietUntil: "Until",
|
|
167
|
+
quietIncomplete: "Set both a start and an end time. Quiet hours take effect once both are set.",
|
|
168
|
+
timeZone: "Time zone",
|
|
169
|
+
deviceZone: (zone) => `This device is in ${zone}.`,
|
|
170
|
+
useDeviceZone: "Use it",
|
|
171
|
+
regions: {
|
|
172
|
+
Africa: "Africa",
|
|
173
|
+
America: "Americas",
|
|
174
|
+
Antarctica: "Antarctica",
|
|
175
|
+
Arctic: "Arctic",
|
|
176
|
+
Asia: "Asia",
|
|
177
|
+
Atlantic: "Atlantic",
|
|
178
|
+
Australia: "Australia",
|
|
179
|
+
Europe: "Europe",
|
|
180
|
+
Indian: "Indian Ocean",
|
|
181
|
+
Pacific: "Pacific",
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
pushTitle: "Push notifications",
|
|
185
|
+
pushDescription: "Notifications on this device, also while the app is closed.",
|
|
186
|
+
unsupported: "This browser doesn’t support push notifications.",
|
|
187
|
+
iosInstall: (app) =>
|
|
188
|
+
`On iPhone or iPad, add ${app} to your Home Screen first: iOS delivers notifications only to the installed app.`,
|
|
189
|
+
notConfigured: "Push notifications aren’t set up on this server.",
|
|
190
|
+
blocked: "Notifications are blocked in this browser’s settings.",
|
|
191
|
+
on: "Notifications are on for this device.",
|
|
192
|
+
off: "Notifications are off for this device.",
|
|
193
|
+
otherAccount:
|
|
194
|
+
"This browser gets notifications for another account. Turn them on here to get them for the account you’re signed in with.",
|
|
195
|
+
enable: "Turn on notifications",
|
|
196
|
+
disable: "Turn off",
|
|
197
|
+
sendTest: "Send a test",
|
|
198
|
+
enableFailed: "Couldn’t turn on notifications.",
|
|
199
|
+
noServiceWorker: "Couldn’t reach the app’s service worker. Reload the page and try again.",
|
|
200
|
+
pushTimeout: "The browser’s push service didn’t answer. Check your connection and try again.",
|
|
201
|
+
testSent: (count) => (count === 1 ? "Test sent to 1 device" : `Test sent to ${count} devices`),
|
|
202
|
+
testNone: "No device accepted the test. Turn notifications on for this device first.",
|
|
203
|
+
testFailed: "Couldn’t send a test notification.",
|
|
204
|
+
explainerTitle: "Turn on notifications?",
|
|
205
|
+
explainerBody: (app) =>
|
|
206
|
+
`${app} sends a notification only for the kinds you choose, and you can turn them off at any time.`,
|
|
207
|
+
explainerHint: "Your browser asks for permission next.",
|
|
208
|
+
explainerContinue: "Continue",
|
|
209
|
+
|
|
210
|
+
devicesTitle: "Notification devices",
|
|
211
|
+
devicesDescription: "Every device that gets push notifications for your account. Remove any you no longer use.",
|
|
212
|
+
devicesLoading: "Loading devices…",
|
|
213
|
+
devicesEmpty: "No device gets notifications yet.",
|
|
214
|
+
unknownDevice: "Unknown device",
|
|
215
|
+
thisDevice: "This device",
|
|
216
|
+
added: (date) => `Added ${date}`,
|
|
217
|
+
lastDelivery: (date) => `Last delivery ${date}`,
|
|
218
|
+
noDelivery: "No delivery yet",
|
|
219
|
+
failures: (count) =>
|
|
220
|
+
count === 1 ? "1 failed delivery in a row" : `${count} failed deliveries in a row`,
|
|
221
|
+
remove: "Remove",
|
|
222
|
+
removeItem: (device) => `Remove ${device}`,
|
|
223
|
+
removePrompt: "Stop sending notifications to this device?",
|
|
224
|
+
|
|
225
|
+
unsubscribeTitle: "E-mail notifications",
|
|
226
|
+
unsubscribeAbout: (type) => `You get e-mails about: ${type}.`,
|
|
227
|
+
unsubscribeGeneric: "You get notification e-mails.",
|
|
228
|
+
stopThese: "Stop these e-mails",
|
|
229
|
+
stopAll: (app) => `Stop all notification e-mails from ${app}`,
|
|
230
|
+
stoppedThese: "Done. You won’t get these e-mails any more.",
|
|
231
|
+
stoppedAll: (app) => `Done. You won’t get notification e-mails from ${app} any more.`,
|
|
232
|
+
accountMail: "E-mails about your account still come.",
|
|
233
|
+
turnBackOn: "You can turn them back on at any time in Settings.",
|
|
234
|
+
openSettings: "Open Settings",
|
|
235
|
+
invalidLink: "This link doesn’t work any more. You can turn e-mails off in Settings instead.",
|
|
236
|
+
|
|
237
|
+
failed: "That didn’t work. Please try again.",
|
|
238
|
+
};
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import { useKitLabels, type LabelOverride } from "../i18n/kit-labels";
|
|
5
|
+
import { DEFAULT_COMMON_LABELS } from "../i18n/shared-labels";
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
import { AlertBanner } from "../components/alert-banner";
|
|
8
|
+
import { Button } from "../components/button";
|
|
9
|
+
import { Card } from "../components/card";
|
|
10
|
+
import { DialogFrame } from "../components/dialog-frame";
|
|
11
|
+
import { COMMIT_EXCEPT_BILLING } from "../components/write-lock";
|
|
12
|
+
import { CARD_DESCRIPTION_CLASS } from "../settings/settings-card-classes";
|
|
13
|
+
import { SettingsCardTitle } from "../settings/settings-heading";
|
|
14
|
+
import { useMounted } from "../account/account-parts";
|
|
15
|
+
import { describeFailure, FailureLine, useNotificationsLabels } from "./notification-parts";
|
|
16
|
+
import type { NotificationsLabels } from "./notifications-labels";
|
|
17
|
+
import { PushDeviceError } from "./use-push-device";
|
|
18
|
+
import type { PushDevice } from "./use-push-device";
|
|
19
|
+
|
|
20
|
+
/** Which action failed — {@link PushDeviceSettingProps.describeError}'s second argument. */
|
|
21
|
+
export type PushDeviceAction = "enable" | "disable" | "test";
|
|
22
|
+
|
|
23
|
+
export interface PushDeviceSettingProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
24
|
+
/** This browser's push, from {@link usePushDevice}. */
|
|
25
|
+
push: PushDevice;
|
|
26
|
+
/** The app's name, for the iOS line and the explainer. */
|
|
27
|
+
appName: string;
|
|
28
|
+
/** The app's own words for a failure, or `undefined` for the kit's. The kit already
|
|
29
|
+
* has words for a missing service worker and an unanswered push service. */
|
|
30
|
+
describeError?: (error: unknown, action: PushDeviceAction) => ReactNode | undefined;
|
|
31
|
+
labels?: LabelOverride<NotificationsLabels>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** What the line under the buttons says. */
|
|
35
|
+
type Outcome = { tone: "status" | "warning" | "danger"; text: ReactNode } | null;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Push on THIS device (docs/notifications-harmonization.md §2.2, §2.7, §4.2): keksdose's
|
|
39
|
+
* push block, as a card of its own. Registering the device is the switch — push has no
|
|
40
|
+
* account switch. One state at a time, in keksdose's order
|
|
41
|
+
* (`notifications-card.tsx:333-402`):
|
|
42
|
+
*
|
|
43
|
+
* 1. the browser has no push;
|
|
44
|
+
* 2. iOS outside the installed app (iOS delivers only to the installed app);
|
|
45
|
+
* 3. push is not set up on the server (no VAPID keys);
|
|
46
|
+
* 4. notifications blocked in the browser;
|
|
47
|
+
* 5. on or off — with "another account" when this browser's subscription is someone
|
|
48
|
+
* else's — and "Turn on notifications", or "Send a test" and "Turn off".
|
|
49
|
+
*
|
|
50
|
+
* **The explainer comes before the browser's one prompt**: turning on while the
|
|
51
|
+
* permission is still `"default"` opens a dialog first (what the notifications are for,
|
|
52
|
+
* that the browser asks next); with it granted, it goes straight on. A test that reached
|
|
53
|
+
* no device says so (`testNone`) — a 404/410 removes the row on the server while this
|
|
54
|
+
* browser still holds its subscription. Outcomes are a line under the buttons; nothing
|
|
55
|
+
* toasts.
|
|
56
|
+
*/
|
|
57
|
+
export function PushDeviceSetting({
|
|
58
|
+
push,
|
|
59
|
+
appName,
|
|
60
|
+
describeError,
|
|
61
|
+
labels: labelsProp,
|
|
62
|
+
className,
|
|
63
|
+
...rest
|
|
64
|
+
}: PushDeviceSettingProps) {
|
|
65
|
+
const labels = useNotificationsLabels(labelsProp);
|
|
66
|
+
const common = useKitLabels("common", DEFAULT_COMMON_LABELS);
|
|
67
|
+
const [explainer, setExplainer] = useState(false);
|
|
68
|
+
const [running, setRunning] = useState<PushDeviceAction | null>(null);
|
|
69
|
+
const [outcome, setOutcome] = useState<Outcome>(null);
|
|
70
|
+
const mounted = useMounted();
|
|
71
|
+
|
|
72
|
+
const failureOf = (error: unknown, action: PushDeviceAction, fallback: string): ReactNode => {
|
|
73
|
+
if (error instanceof PushDeviceError) {
|
|
74
|
+
return error.code === "no_service_worker" ? labels.noServiceWorker : labels.pushTimeout;
|
|
75
|
+
}
|
|
76
|
+
return describeFailure(describeError?.(error, action), fallback);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const run = <T,>(action: PushDeviceAction, call: () => Promise<T>, done: (value: T) => Outcome, fallback: string) => {
|
|
80
|
+
if (running) return;
|
|
81
|
+
setRunning(action);
|
|
82
|
+
setOutcome(null);
|
|
83
|
+
call().then(
|
|
84
|
+
(value) => {
|
|
85
|
+
if (!mounted.current) return;
|
|
86
|
+
setRunning(null);
|
|
87
|
+
setOutcome(done(value));
|
|
88
|
+
},
|
|
89
|
+
(error: unknown) => {
|
|
90
|
+
if (!mounted.current) return;
|
|
91
|
+
setRunning(null);
|
|
92
|
+
setOutcome({ tone: "danger", text: failureOf(error, action, fallback) });
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const enable = () =>
|
|
98
|
+
run(
|
|
99
|
+
"enable",
|
|
100
|
+
() => push.enable(),
|
|
101
|
+
(ok): Outcome => (ok ? null : { tone: "danger", text: labels.enableFailed }),
|
|
102
|
+
labels.enableFailed,
|
|
103
|
+
);
|
|
104
|
+
const disable = () => run("disable", () => push.disable(), () => null, labels.failed);
|
|
105
|
+
const test = () =>
|
|
106
|
+
run(
|
|
107
|
+
"test",
|
|
108
|
+
() => push.sendTest(),
|
|
109
|
+
({ sent }): Outcome =>
|
|
110
|
+
sent > 0 ? { tone: "status", text: labels.testSent(sent) } : { tone: "warning", text: labels.testNone },
|
|
111
|
+
labels.testFailed,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const turnOn = () => {
|
|
115
|
+
if (push.permission === "granted") enable();
|
|
116
|
+
else setExplainer(true);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
let state: ReactNode;
|
|
120
|
+
if (!push.supported) {
|
|
121
|
+
state = <p className={CARD_DESCRIPTION_CLASS}>{labels.unsupported}</p>;
|
|
122
|
+
} else if (push.ios && !push.installed) {
|
|
123
|
+
state = <p className={CARD_DESCRIPTION_CLASS}>{labels.iosInstall(appName)}</p>;
|
|
124
|
+
} else if (push.configured === false) {
|
|
125
|
+
state = <p className={CARD_DESCRIPTION_CLASS}>{labels.notConfigured}</p>;
|
|
126
|
+
} else if (push.permission === "denied") {
|
|
127
|
+
state = <p className="text-xs text-warning">{labels.blocked}</p>;
|
|
128
|
+
} else {
|
|
129
|
+
const busy = push.busy || running !== null;
|
|
130
|
+
state = (
|
|
131
|
+
<>
|
|
132
|
+
<p className={CARD_DESCRIPTION_CLASS} data-push-state={push.subscribed ? "on" : "off"}>
|
|
133
|
+
{push.subscribed ? labels.on : labels.off}
|
|
134
|
+
</p>
|
|
135
|
+
{push.foreignSubscription && <p className="text-xs text-warning">{labels.otherAccount}</p>}
|
|
136
|
+
<div className="flex flex-wrap gap-2">
|
|
137
|
+
{push.subscribed ? (
|
|
138
|
+
<>
|
|
139
|
+
<Button
|
|
140
|
+
type="button"
|
|
141
|
+
size="sm"
|
|
142
|
+
variant="secondary"
|
|
143
|
+
commit={COMMIT_EXCEPT_BILLING}
|
|
144
|
+
pending={running === "test"}
|
|
145
|
+
disabled={busy && running !== "test"}
|
|
146
|
+
onClick={test}
|
|
147
|
+
>
|
|
148
|
+
{labels.sendTest}
|
|
149
|
+
</Button>
|
|
150
|
+
<Button
|
|
151
|
+
type="button"
|
|
152
|
+
size="sm"
|
|
153
|
+
variant="ghost"
|
|
154
|
+
commit={COMMIT_EXCEPT_BILLING}
|
|
155
|
+
pending={running === "disable"}
|
|
156
|
+
disabled={busy && running !== "disable"}
|
|
157
|
+
onClick={disable}
|
|
158
|
+
>
|
|
159
|
+
{labels.disable}
|
|
160
|
+
</Button>
|
|
161
|
+
</>
|
|
162
|
+
) : (
|
|
163
|
+
<Button
|
|
164
|
+
type="button"
|
|
165
|
+
size="sm"
|
|
166
|
+
commit={COMMIT_EXCEPT_BILLING}
|
|
167
|
+
pending={running === "enable"}
|
|
168
|
+
disabled={busy && running !== "enable"}
|
|
169
|
+
onClick={turnOn}
|
|
170
|
+
>
|
|
171
|
+
{labels.enable}
|
|
172
|
+
</Button>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
{outcome?.tone === "status" && (
|
|
176
|
+
<p role="status" className={CARD_DESCRIPTION_CLASS}>
|
|
177
|
+
{outcome.text}
|
|
178
|
+
</p>
|
|
179
|
+
)}
|
|
180
|
+
{outcome?.tone === "warning" && (
|
|
181
|
+
<AlertBanner tone="warning" size="sm" role="status">
|
|
182
|
+
{outcome.text}
|
|
183
|
+
</AlertBanner>
|
|
184
|
+
)}
|
|
185
|
+
{outcome?.tone === "danger" && <FailureLine>{outcome.text}</FailureLine>}
|
|
186
|
+
</>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<Card {...rest} className={cn("p-4 space-y-3", className)}>
|
|
192
|
+
<div>
|
|
193
|
+
<SettingsCardTitle>{labels.pushTitle}</SettingsCardTitle>
|
|
194
|
+
<div className={CARD_DESCRIPTION_CLASS}>{labels.pushDescription}</div>
|
|
195
|
+
</div>
|
|
196
|
+
{state}
|
|
197
|
+
<DialogFrame
|
|
198
|
+
open={explainer}
|
|
199
|
+
onClose={() => setExplainer(false)}
|
|
200
|
+
title={labels.explainerTitle}
|
|
201
|
+
description={labels.explainerBody(appName)}
|
|
202
|
+
actions={(close) => (
|
|
203
|
+
<div className="flex justify-end gap-2">
|
|
204
|
+
<Button type="button" variant="ghost" onClick={close}>
|
|
205
|
+
{common.cancel}
|
|
206
|
+
</Button>
|
|
207
|
+
<Button
|
|
208
|
+
type="button"
|
|
209
|
+
onClick={() => {
|
|
210
|
+
setExplainer(false);
|
|
211
|
+
// Only now the browser's one permission prompt.
|
|
212
|
+
enable();
|
|
213
|
+
}}
|
|
214
|
+
>
|
|
215
|
+
{labels.explainerContinue}
|
|
216
|
+
</Button>
|
|
217
|
+
</div>
|
|
218
|
+
)}
|
|
219
|
+
>
|
|
220
|
+
<p className={CARD_DESCRIPTION_CLASS}>{labels.explainerHint}</p>
|
|
221
|
+
</DialogFrame>
|
|
222
|
+
</Card>
|
|
223
|
+
);
|
|
224
|
+
}
|