@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
package/src/rhf/fields.tsx
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* - **The red border.** Every field gets `invalid` from the field state, so an errored
|
|
28
28
|
* field PAINTS as well as announces. kastlan's number, money, date and entity fields
|
|
29
29
|
* passed only `aria-invalid` through `FormControl`, or nothing, and `Input`, `Select`
|
|
30
|
-
* and `Textarea` paint only from the prop (see the note in ./form).
|
|
30
|
+
* and `Textarea` paint only from the prop (see the note in ./form-core).
|
|
31
31
|
* - **Focus on error.** `field.ref` reaches the focusable element itself — the input,
|
|
32
32
|
* a picker's trigger, a toggle group whose `focus()` lands on its option (since 0.34
|
|
33
33
|
* every kit field takes a ref; the number field and the pickers were reached by an id
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* through react-hook-form's context. Pass it for the field's value types
|
|
38
38
|
* (`control={form.control}` checks `name` against the form's values).
|
|
39
39
|
*
|
|
40
|
-
* The common props: `name`, `control`, `label` (
|
|
40
|
+
* The common props: `name`, `control`, `label` (the label above the field;
|
|
41
41
|
* omitted, none — then give the field an `aria-label`), `hint` (standing advice under
|
|
42
42
|
* the field, attached to it with `aria-describedby`), `required` (the label's mark,
|
|
43
43
|
* and `aria-required` where the control takes it — validation is `rules`' or the
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
type InlineEntityComboboxProps,
|
|
92
92
|
} from "../components/combobox";
|
|
93
93
|
import type { ComboClearValue } from "../components/combobox-core";
|
|
94
|
-
import { mergeRefs, useInlineHint } from "../components/field-parts";
|
|
94
|
+
import { fieldHelpMark, mergeRefs, useInlineHint } from "../components/field-parts";
|
|
95
95
|
import { useKitLocale } from "../i18n/kit-labels";
|
|
96
96
|
import { cn } from "../lib/cn";
|
|
97
97
|
import { decimalMark, readTyped } from "../lib/decimal-marks";
|
|
@@ -110,13 +110,19 @@ export interface RhfFieldBaseProps<
|
|
|
110
110
|
control?: ControllerProps<TFieldValues, TName, TTransformed>["control"];
|
|
111
111
|
/** react-hook-form's `rules` (`required`, `min`, `validate` …). */
|
|
112
112
|
rules?: ControllerProps<TFieldValues, TName, TTransformed>["rules"];
|
|
113
|
-
/**
|
|
113
|
+
/** The label above the field. Omitted: no label — name the control with
|
|
114
114
|
* an `aria-label` instead. */
|
|
115
115
|
label?: ReactNode;
|
|
116
116
|
/** Standing advice under the field ("As printed on the card"), attached to the
|
|
117
117
|
* control with `aria-describedby`. A `FieldHint` is its words at Large and on a
|
|
118
|
-
* touch screen (§4, DUP-2), not a lone "?"; a `HelpPopover` stays a "?".
|
|
118
|
+
* touch screen (§4, DUP-2), not a lone "?"; a `HelpPopover` stays a "?". Beside a
|
|
119
|
+
* `help` it is that caption at every size. */
|
|
119
120
|
hint?: ReactNode;
|
|
121
|
+
/** Help the field is usable without — why, how to choose — behind the field's one
|
|
122
|
+
* "?" after the label: a `HelpPopover` named "About <label>" (round 0.36,
|
|
123
|
+
* docs/text-size-harmonization.md §4); pass a `HelpPopover` to name it yourself.
|
|
124
|
+
* `hint` stays the visible fact under the field. */
|
|
125
|
+
help?: ReactNode;
|
|
120
126
|
/** Draws the label's required mark and sets `aria-required` where the control
|
|
121
127
|
* takes it. Whether the field IS required is `rules`' or the resolver's to say. */
|
|
122
128
|
required?: boolean;
|
|
@@ -146,8 +152,8 @@ export interface RhfFieldRenderContext<
|
|
|
146
152
|
invalid: boolean;
|
|
147
153
|
/** The error's message, if any. */
|
|
148
154
|
error: string | undefined;
|
|
149
|
-
/** The control's id, which the label points at.
|
|
150
|
-
*
|
|
155
|
+
/** The control's id, which the label points at. The rendered element has it already
|
|
156
|
+
* (unless `asControl` is false); this is for a control that routes it elsewhere. */
|
|
151
157
|
id: string;
|
|
152
158
|
/** The label's id, for a control that is named with `aria-labelledby`. */
|
|
153
159
|
labelId: string;
|
|
@@ -160,16 +166,16 @@ export interface RhfFieldProps<
|
|
|
160
166
|
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
161
167
|
TTransformed = TFieldValues,
|
|
162
168
|
> extends RhfFieldBaseProps<TFieldValues, TName, TTransformed> {
|
|
163
|
-
/** The control.
|
|
164
|
-
* `
|
|
169
|
+
/** The control. Given the field's `id`, `aria-describedby` and `aria-invalid` unless
|
|
170
|
+
* `asControl` is false. */
|
|
165
171
|
render: (ctx: RhfFieldRenderContext<TFieldValues, TName>) => ReactElement;
|
|
166
172
|
/** `false`: render the control as is, for one that wires its own ids from the
|
|
167
173
|
* context. Default `true`. */
|
|
168
174
|
asControl?: boolean;
|
|
169
|
-
/** `false`: no
|
|
175
|
+
/** `false`: no error message under the field, for a control that renders its own (its
|
|
170
176
|
* `error` prop). Default `true`. */
|
|
171
177
|
message?: boolean;
|
|
172
|
-
/** `false`: no
|
|
178
|
+
/** `false`: no label above the field, for a control that carries its label itself (a
|
|
173
179
|
* checkbox). Default `true`. */
|
|
174
180
|
showLabel?: boolean;
|
|
175
181
|
}
|
|
@@ -229,6 +235,7 @@ export function RhfField<
|
|
|
229
235
|
rules,
|
|
230
236
|
label,
|
|
231
237
|
hint,
|
|
238
|
+
help,
|
|
232
239
|
required,
|
|
233
240
|
disabled,
|
|
234
241
|
excludeWhenDisabled,
|
|
@@ -240,8 +247,11 @@ export function RhfField<
|
|
|
240
247
|
}: RhfFieldProps<TFieldValues, TName, TTransformed>) {
|
|
241
248
|
// §4: a FieldHint is a fact, so at Large and on a touch screen it is its words under
|
|
242
249
|
// the field, not a lone "?" there (DUP-2, refactor audit 2026-10). A HelpPopover stays
|
|
243
|
-
// a "?" at every size.
|
|
244
|
-
|
|
250
|
+
// a "?" at every size. With a `help` (0.36) its "?" follows the label and is the
|
|
251
|
+
// field's only one, so a FieldHint is its words at every size.
|
|
252
|
+
const helpMark = fieldHelpMark(help, label);
|
|
253
|
+
const shownHint = useInlineHint(hint, helpMark !== undefined);
|
|
254
|
+
const labelEl = showLabel && hasContent(label) && <RhfLabel required={required}>{label}</RhfLabel>;
|
|
245
255
|
return (
|
|
246
256
|
<FormField
|
|
247
257
|
control={control}
|
|
@@ -250,7 +260,14 @@ export function RhfField<
|
|
|
250
260
|
disabled={excludeWhenDisabled ? disabled : undefined}
|
|
251
261
|
render={({ field, fieldState }) => (
|
|
252
262
|
<FormItem className={className}>
|
|
253
|
-
{
|
|
263
|
+
{helpMark === undefined ? (
|
|
264
|
+
labelEl
|
|
265
|
+
) : (
|
|
266
|
+
<div className="flex items-center gap-1">
|
|
267
|
+
{labelEl}
|
|
268
|
+
<span className="flex shrink-0 items-center">{helpMark}</span>
|
|
269
|
+
</div>
|
|
270
|
+
)}
|
|
254
271
|
<ControlSlot
|
|
255
272
|
field={disabled && !field.disabled ? { ...field, disabled: true } : field}
|
|
256
273
|
fieldState={fieldState}
|
|
@@ -298,6 +315,7 @@ export function RhfTextField<
|
|
|
298
315
|
rules,
|
|
299
316
|
label,
|
|
300
317
|
hint,
|
|
318
|
+
help,
|
|
301
319
|
required,
|
|
302
320
|
disabled,
|
|
303
321
|
excludeWhenDisabled,
|
|
@@ -306,7 +324,7 @@ export function RhfTextField<
|
|
|
306
324
|
}: RhfTextFieldProps<TFieldValues, TName, TTransformed>) {
|
|
307
325
|
return (
|
|
308
326
|
<RhfField
|
|
309
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
327
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
310
328
|
render={({ field, invalid }) => (
|
|
311
329
|
<Input
|
|
312
330
|
aria-required={required || undefined}
|
|
@@ -349,6 +367,7 @@ export function RhfTextarea<
|
|
|
349
367
|
rules,
|
|
350
368
|
label,
|
|
351
369
|
hint,
|
|
370
|
+
help,
|
|
352
371
|
required,
|
|
353
372
|
disabled,
|
|
354
373
|
excludeWhenDisabled,
|
|
@@ -358,7 +377,7 @@ export function RhfTextarea<
|
|
|
358
377
|
}: RhfTextareaProps<TFieldValues, TName, TTransformed>) {
|
|
359
378
|
return (
|
|
360
379
|
<RhfField
|
|
361
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
380
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
362
381
|
render={({ field, invalid }) => (
|
|
363
382
|
<Textarea
|
|
364
383
|
aria-required={required || undefined}
|
|
@@ -435,6 +454,7 @@ export function RhfNumberField<
|
|
|
435
454
|
rules,
|
|
436
455
|
label,
|
|
437
456
|
hint,
|
|
457
|
+
help,
|
|
438
458
|
required,
|
|
439
459
|
disabled,
|
|
440
460
|
excludeWhenDisabled,
|
|
@@ -445,7 +465,7 @@ export function RhfNumberField<
|
|
|
445
465
|
}: RhfNumberFieldProps<TFieldValues, TName, TTransformed>) {
|
|
446
466
|
return (
|
|
447
467
|
<RhfField
|
|
448
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
468
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
449
469
|
render={({ field, invalid, id }) => (
|
|
450
470
|
// FormControl clones this element with `id` / `aria-describedby` /
|
|
451
471
|
// `aria-invalid`, which NumberControl hands on to the field.
|
|
@@ -647,6 +667,7 @@ export function RhfMoneyField<
|
|
|
647
667
|
rules,
|
|
648
668
|
label,
|
|
649
669
|
hint,
|
|
670
|
+
help,
|
|
650
671
|
required,
|
|
651
672
|
disabled,
|
|
652
673
|
excludeWhenDisabled,
|
|
@@ -655,7 +676,7 @@ export function RhfMoneyField<
|
|
|
655
676
|
}: RhfMoneyFieldProps<TFieldValues, TName, TTransformed>) {
|
|
656
677
|
return (
|
|
657
678
|
<RhfField
|
|
658
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
679
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
659
680
|
asControl={false}
|
|
660
681
|
render={({ field, invalid, id, describedBy }) => (
|
|
661
682
|
<MoneyControl
|
|
@@ -743,6 +764,7 @@ export function RhfDateField<
|
|
|
743
764
|
rules,
|
|
744
765
|
label,
|
|
745
766
|
hint,
|
|
767
|
+
help,
|
|
746
768
|
required,
|
|
747
769
|
disabled,
|
|
748
770
|
excludeWhenDisabled,
|
|
@@ -753,7 +775,7 @@ export function RhfDateField<
|
|
|
753
775
|
}: RhfDateFieldProps<TFieldValues, TName, TTransformed>) {
|
|
754
776
|
return (
|
|
755
777
|
<RhfField
|
|
756
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
778
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
757
779
|
render={({ field, invalid, id }) => (
|
|
758
780
|
// FormControl clones this element with `aria-describedby` / `aria-invalid`,
|
|
759
781
|
// which DateControl hands on to the picker's trigger.
|
|
@@ -853,6 +875,7 @@ export function RhfDateRangePicker<
|
|
|
853
875
|
toRules,
|
|
854
876
|
label,
|
|
855
877
|
hint,
|
|
878
|
+
help,
|
|
856
879
|
required,
|
|
857
880
|
disabled,
|
|
858
881
|
excludeWhenDisabled,
|
|
@@ -886,6 +909,7 @@ export function RhfDateRangePicker<
|
|
|
886
909
|
toState={to.fieldState}
|
|
887
910
|
label={label}
|
|
888
911
|
hint={hint}
|
|
912
|
+
help={help}
|
|
889
913
|
required={required}
|
|
890
914
|
disabled={Boolean(disabled)}
|
|
891
915
|
emptyValue={emptyValue}
|
|
@@ -905,6 +929,7 @@ function RangeBody({
|
|
|
905
929
|
toState,
|
|
906
930
|
label,
|
|
907
931
|
hint,
|
|
932
|
+
help,
|
|
908
933
|
required,
|
|
909
934
|
disabled,
|
|
910
935
|
emptyValue,
|
|
@@ -917,6 +942,7 @@ function RangeBody({
|
|
|
917
942
|
toState: ControllerFieldState;
|
|
918
943
|
label: ReactNode;
|
|
919
944
|
hint: ReactNode;
|
|
945
|
+
help: ReactNode;
|
|
920
946
|
required?: boolean;
|
|
921
947
|
disabled: boolean;
|
|
922
948
|
emptyValue: "" | null;
|
|
@@ -924,8 +950,10 @@ function RangeBody({
|
|
|
924
950
|
pickerProps: OwnDateRangeProps;
|
|
925
951
|
}) {
|
|
926
952
|
const { id, formItemId, formMessageId, describedBy } = useFormField();
|
|
927
|
-
// RhfField's rule: a FieldHint is its words at Large and on touch (DUP-2)
|
|
928
|
-
|
|
953
|
+
// RhfField's rule: a FieldHint is its words at Large and on touch (DUP-2) — and at
|
|
954
|
+
// every size beside a `help`, whose "?" follows the label (0.36).
|
|
955
|
+
const helpMark = fieldHelpMark(help, label);
|
|
956
|
+
const shownHint = useInlineHint(hint, helpMark !== undefined);
|
|
929
957
|
// Both fields' refs go to the one trigger (API-3, refactor audit 2026-10), so
|
|
930
958
|
// `shouldFocusError` lands there whichever of the two is first in error.
|
|
931
959
|
const triggerRef = useMemo(() => mergeRefs(from.ref, to.ref), [from.ref, to.ref]);
|
|
@@ -936,14 +964,22 @@ function RangeBody({
|
|
|
936
964
|
const messageIds = messages.map((_, i) => `${formMessageId}-${i}`);
|
|
937
965
|
const fromValue: unknown = from.value;
|
|
938
966
|
const toValue: unknown = to.value;
|
|
967
|
+
const labelEl = hasContent(label) && (
|
|
968
|
+
// FormLabel colours from the START's error alone (its context is that field); the
|
|
969
|
+
// pair's state says it here.
|
|
970
|
+
<FormLabel id={`${id}-label`} required={required} data-error={invalid || undefined}>
|
|
971
|
+
{label}
|
|
972
|
+
</FormLabel>
|
|
973
|
+
);
|
|
939
974
|
return (
|
|
940
975
|
<>
|
|
941
|
-
{
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
<
|
|
945
|
-
{
|
|
946
|
-
|
|
976
|
+
{helpMark === undefined ? (
|
|
977
|
+
labelEl
|
|
978
|
+
) : (
|
|
979
|
+
<div className="flex items-center gap-1">
|
|
980
|
+
{labelEl}
|
|
981
|
+
<span className="flex shrink-0 items-center">{helpMark}</span>
|
|
982
|
+
</div>
|
|
947
983
|
)}
|
|
948
984
|
<DateRangePicker
|
|
949
985
|
{...pickerProps}
|
|
@@ -1034,6 +1070,7 @@ export function RhfTimeInput<
|
|
|
1034
1070
|
rules,
|
|
1035
1071
|
label,
|
|
1036
1072
|
hint,
|
|
1073
|
+
help,
|
|
1037
1074
|
required,
|
|
1038
1075
|
disabled,
|
|
1039
1076
|
excludeWhenDisabled,
|
|
@@ -1043,7 +1080,7 @@ export function RhfTimeInput<
|
|
|
1043
1080
|
}: RhfTimeInputProps<TFieldValues, TName, TTransformed>) {
|
|
1044
1081
|
return (
|
|
1045
1082
|
<RhfField
|
|
1046
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1083
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1047
1084
|
render={({ field, invalid }) => {
|
|
1048
1085
|
const value: unknown = field.value;
|
|
1049
1086
|
return (
|
|
@@ -1105,6 +1142,7 @@ export function RhfIbanInput<
|
|
|
1105
1142
|
rules,
|
|
1106
1143
|
label,
|
|
1107
1144
|
hint,
|
|
1145
|
+
help,
|
|
1108
1146
|
required,
|
|
1109
1147
|
disabled,
|
|
1110
1148
|
excludeWhenDisabled,
|
|
@@ -1113,7 +1151,7 @@ export function RhfIbanInput<
|
|
|
1113
1151
|
}: RhfIbanInputProps<TFieldValues, TName, TTransformed>) {
|
|
1114
1152
|
return (
|
|
1115
1153
|
<RhfField
|
|
1116
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1154
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1117
1155
|
render={({ field, invalid }) => {
|
|
1118
1156
|
const value: unknown = field.value;
|
|
1119
1157
|
return (
|
|
@@ -1156,6 +1194,7 @@ export function RhfPhoneInput<
|
|
|
1156
1194
|
rules,
|
|
1157
1195
|
label,
|
|
1158
1196
|
hint,
|
|
1197
|
+
help,
|
|
1159
1198
|
required,
|
|
1160
1199
|
disabled,
|
|
1161
1200
|
excludeWhenDisabled,
|
|
@@ -1164,7 +1203,7 @@ export function RhfPhoneInput<
|
|
|
1164
1203
|
}: RhfPhoneInputProps<TFieldValues, TName, TTransformed>) {
|
|
1165
1204
|
return (
|
|
1166
1205
|
<RhfField
|
|
1167
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1206
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1168
1207
|
render={({ field, invalid }) => {
|
|
1169
1208
|
const value: unknown = field.value;
|
|
1170
1209
|
return (
|
|
@@ -1251,6 +1290,7 @@ export function RhfCountrySelect<
|
|
|
1251
1290
|
rules,
|
|
1252
1291
|
label,
|
|
1253
1292
|
hint,
|
|
1293
|
+
help,
|
|
1254
1294
|
required,
|
|
1255
1295
|
disabled,
|
|
1256
1296
|
excludeWhenDisabled,
|
|
@@ -1267,7 +1307,7 @@ export function RhfCountrySelect<
|
|
|
1267
1307
|
const ownLabels = typeof label === "string" ? { country: label, ...labels } : labels;
|
|
1268
1308
|
return (
|
|
1269
1309
|
<RhfField
|
|
1270
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1310
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1271
1311
|
render={({ field, invalid, labelId }) => {
|
|
1272
1312
|
const value: unknown = field.value;
|
|
1273
1313
|
return (
|
|
@@ -1403,6 +1443,7 @@ export function RhfMonthPicker<
|
|
|
1403
1443
|
rules,
|
|
1404
1444
|
label,
|
|
1405
1445
|
hint,
|
|
1446
|
+
help,
|
|
1406
1447
|
required,
|
|
1407
1448
|
disabled,
|
|
1408
1449
|
excludeWhenDisabled,
|
|
@@ -1414,7 +1455,7 @@ export function RhfMonthPicker<
|
|
|
1414
1455
|
}: RhfMonthPickerProps<TFieldValues, TName, TTransformed>) {
|
|
1415
1456
|
return (
|
|
1416
1457
|
<RhfField
|
|
1417
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1458
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1418
1459
|
render={({ field, invalid, id }) => (
|
|
1419
1460
|
// FormControl clones this element with `aria-describedby` / `aria-invalid`,
|
|
1420
1461
|
// which MonthControl hands on to the picker's trigger.
|
|
@@ -1473,6 +1514,7 @@ export function RhfSelect<
|
|
|
1473
1514
|
rules,
|
|
1474
1515
|
label,
|
|
1475
1516
|
hint,
|
|
1517
|
+
help,
|
|
1476
1518
|
required,
|
|
1477
1519
|
disabled,
|
|
1478
1520
|
excludeWhenDisabled,
|
|
@@ -1486,7 +1528,7 @@ export function RhfSelect<
|
|
|
1486
1528
|
}: RhfSelectProps<TFieldValues, TName, TTransformed>) {
|
|
1487
1529
|
return (
|
|
1488
1530
|
<RhfField
|
|
1489
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1531
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1490
1532
|
render={({ field, invalid }) => (
|
|
1491
1533
|
<Select
|
|
1492
1534
|
aria-required={required || undefined}
|
|
@@ -1523,7 +1565,9 @@ export type RhfCheckboxProps<
|
|
|
1523
1565
|
TFieldValues extends FieldValues = FieldValues,
|
|
1524
1566
|
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
1525
1567
|
TTransformed = TFieldValues,
|
|
1526
|
-
> =
|
|
1568
|
+
> = // No `help` (0.36): a box has no label line — its label sits beside it, inside the
|
|
1569
|
+
// `<label>` a "?" cannot join — and Checkbox takes none.
|
|
1570
|
+
Omit<RhfFieldBaseProps<TFieldValues, TName, TTransformed>, "help"> &
|
|
1527
1571
|
// Checkbox's own — its lock (`commit`, `disabledReason`) among them, which a `Pick`
|
|
1528
1572
|
// list dropped until 0.34 (DUP-9) — less the box's state the form holds, and its
|
|
1529
1573
|
// `description`, which is the twin's `hint`.
|
|
@@ -1622,7 +1666,7 @@ export type RhfToggleGroupProps<
|
|
|
1622
1666
|
* asked for it with {@link RhfTimeInput} and {@link RhfDateRangePicker}: the controls
|
|
1623
1667
|
* its forms still had to wire by hand through {@link RhfField}'s render.
|
|
1624
1668
|
*
|
|
1625
|
-
* The label is the
|
|
1669
|
+
* The label is the field's own label above the bare group, as on every other
|
|
1626
1670
|
* bound field — the `labelPlacement="above"` shape, not the group's own field chrome —
|
|
1627
1671
|
* and it names the group (`aria-labelledby`); the hint and the message describe it,
|
|
1628
1672
|
* and an error paints the group's border. Focus on error goes to the option a
|
|
@@ -1646,6 +1690,7 @@ export function RhfToggleGroup<
|
|
|
1646
1690
|
rules,
|
|
1647
1691
|
label,
|
|
1648
1692
|
hint,
|
|
1693
|
+
help,
|
|
1649
1694
|
required,
|
|
1650
1695
|
disabled,
|
|
1651
1696
|
excludeWhenDisabled,
|
|
@@ -1655,7 +1700,7 @@ export function RhfToggleGroup<
|
|
|
1655
1700
|
const labelled = hasContent(label);
|
|
1656
1701
|
return (
|
|
1657
1702
|
<RhfField
|
|
1658
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1703
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1659
1704
|
asControl={false}
|
|
1660
1705
|
render={({ field, invalid, id, labelId, describedBy }) => (
|
|
1661
1706
|
<ToggleControl<T>
|
|
@@ -1846,6 +1891,7 @@ export function RhfCombobox<
|
|
|
1846
1891
|
rules,
|
|
1847
1892
|
label,
|
|
1848
1893
|
hint,
|
|
1894
|
+
help,
|
|
1849
1895
|
required,
|
|
1850
1896
|
disabled,
|
|
1851
1897
|
excludeWhenDisabled,
|
|
@@ -1856,7 +1902,7 @@ export function RhfCombobox<
|
|
|
1856
1902
|
}: RhfComboboxProps<TFieldValues, TName, V, TTransformed>) {
|
|
1857
1903
|
return (
|
|
1858
1904
|
<RhfField
|
|
1859
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
1905
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1860
1906
|
asControl={false}
|
|
1861
1907
|
message={false}
|
|
1862
1908
|
render={({ field, invalid, error, id, describedBy }) => (
|
|
@@ -1956,6 +2002,7 @@ export function RhfInlineEntityCombobox<
|
|
|
1956
2002
|
rules,
|
|
1957
2003
|
label,
|
|
1958
2004
|
hint,
|
|
2005
|
+
help,
|
|
1959
2006
|
required,
|
|
1960
2007
|
disabled,
|
|
1961
2008
|
excludeWhenDisabled,
|
|
@@ -1966,7 +2013,7 @@ export function RhfInlineEntityCombobox<
|
|
|
1966
2013
|
}: RhfInlineEntityComboboxProps<TFieldValues, TName, V, TTransformed>) {
|
|
1967
2014
|
return (
|
|
1968
2015
|
<RhfField
|
|
1969
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
2016
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
1970
2017
|
render={({ field, invalid }) => {
|
|
1971
2018
|
const value: unknown = field.value;
|
|
1972
2019
|
return (
|
|
@@ -2021,6 +2068,7 @@ export function RhfTextCombobox<
|
|
|
2021
2068
|
rules,
|
|
2022
2069
|
label,
|
|
2023
2070
|
hint,
|
|
2071
|
+
help,
|
|
2024
2072
|
required,
|
|
2025
2073
|
disabled,
|
|
2026
2074
|
excludeWhenDisabled,
|
|
@@ -2030,7 +2078,7 @@ export function RhfTextCombobox<
|
|
|
2030
2078
|
}: RhfTextComboboxProps<TFieldValues, TName, TTransformed>) {
|
|
2031
2079
|
return (
|
|
2032
2080
|
<RhfField
|
|
2033
|
-
{...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}
|
|
2081
|
+
{...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}
|
|
2034
2082
|
asControl={false}
|
|
2035
2083
|
message={false}
|
|
2036
2084
|
render={({ field, invalid, error, id, describedBy }) => (
|
package/src/rhf/form-core.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The react-hook-form adapter: the five parts every
|
|
3
|
-
* they share. `@eifi1/ui-kit/rhf
|
|
2
|
+
* The react-hook-form adapter: the five parts every bound field is built from, and the
|
|
3
|
+
* hook they share. Behind `@eifi1/ui-kit/rhf`, which exports `Form` alone of them.
|
|
4
4
|
*
|
|
5
5
|
* The kit's own module since 0.34 (refactor audit 2026-10, API-6f): the bound `Rhf*`
|
|
6
|
-
* fields build on these parts, and import them from here. ./form is the
|
|
7
|
-
*
|
|
6
|
+
* fields and `RhfField` build on these parts, and import them from here. ./form is the
|
|
7
|
+
* public face — `Form`; the parts left the public surface in 0.35 (deprecated in 0.34),
|
|
8
|
+
* when no app imported them any more.
|
|
8
9
|
*
|
|
9
10
|
* ```tsx
|
|
10
11
|
* <Form {...form}>
|
package/src/rhf/form.tsx
CHANGED
|
@@ -1,48 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `Form
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* `Form` — the public face of ./form-core, where the shadcn scaffold the bound fields are
|
|
3
|
+
* built from lives (its header has the whole story: what differs from shadcn's file, why
|
|
4
|
+
* /rhf is its own entry, how a picker clears).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* The scaffold itself (`FormField`, `useFormField`, `FormItem`, `FormLabel`, `FormControl`,
|
|
7
|
+
* `FormDescription`, `FormMessage` and five props types) was public until 0.35 (refactor
|
|
8
|
+
* audit 2026-10, API-6f; deprecated in 0.34): no app builds a form from it any more.
|
|
7
9
|
* kastlan, the one /rhf consumer, uses `Form`, the bound `Rhf*` fields and `RhfField` for
|
|
8
|
-
* a control of its own
|
|
9
|
-
* surface in 0.35. The bound fields import the parts from the core, so the removal is
|
|
10
|
-
* the block below.
|
|
10
|
+
* a control of its own — the same parts, folded into one element.
|
|
11
11
|
*/
|
|
12
|
-
import * as core from "./form-core";
|
|
13
|
-
|
|
14
12
|
export { Form } from "./form-core";
|
|
15
|
-
|
|
16
|
-
/* ── Deprecated 0.34, removed in 0.35 ───────────────────────────────────────
|
|
17
|
-
* Each is the core's own value under its public name. The replacement for all of them:
|
|
18
|
-
* a bound field (`RhfTextField`, `RhfSelect`, …), or `RhfField` around a control of
|
|
19
|
-
* your own — the same parts, folded into one element. */
|
|
20
|
-
|
|
21
|
-
/** @deprecated 0.34 — the bound `Rhf*` fields, or `RhfField` for a control of your own;
|
|
22
|
-
* removed in 0.35 (API-6f). */
|
|
23
|
-
export const FormField = core.FormField;
|
|
24
|
-
/** @deprecated 0.34 — `RhfField`, which reads the field's ids itself; removed in 0.35
|
|
25
|
-
* (API-6f). */
|
|
26
|
-
export const useFormField = core.useFormField;
|
|
27
|
-
/** @deprecated 0.34 — the bound `Rhf*` fields, or `RhfField`; removed in 0.35 (API-6f). */
|
|
28
|
-
export const FormItem = core.FormItem;
|
|
29
|
-
/** @deprecated 0.34 — the bound fields' and `RhfField`'s `label`; removed in 0.35 (API-6f). */
|
|
30
|
-
export const FormLabel = core.FormLabel;
|
|
31
|
-
/** @deprecated 0.34 — `RhfField`, which wires its control the same way; removed in 0.35
|
|
32
|
-
* (API-6f). */
|
|
33
|
-
export const FormControl = core.FormControl;
|
|
34
|
-
/** @deprecated 0.34 — the bound fields' and `RhfField`'s `hint`; removed in 0.35 (API-6f). */
|
|
35
|
-
export const FormDescription = core.FormDescription;
|
|
36
|
-
/** @deprecated 0.34 — the bound fields and `RhfField`, which show the error themselves;
|
|
37
|
-
* removed in 0.35 (API-6f). */
|
|
38
|
-
export const FormMessage = core.FormMessage;
|
|
39
|
-
/** @deprecated 0.34 — goes with `FormItem`; removed in 0.35 (API-6f). */
|
|
40
|
-
export type FormItemProps = core.FormItemProps;
|
|
41
|
-
/** @deprecated 0.34 — goes with `FormLabel`; removed in 0.35 (API-6f). */
|
|
42
|
-
export type FormLabelProps = core.FormLabelProps;
|
|
43
|
-
/** @deprecated 0.34 — goes with `FormControl`; removed in 0.35 (API-6f). */
|
|
44
|
-
export type FormControlProps = core.FormControlProps;
|
|
45
|
-
/** @deprecated 0.34 — goes with `FormDescription`; removed in 0.35 (API-6f). */
|
|
46
|
-
export type FormDescriptionProps = core.FormDescriptionProps;
|
|
47
|
-
/** @deprecated 0.34 — goes with `FormMessage`; removed in 0.35 (API-6f). */
|
|
48
|
-
export type FormMessageProps = core.FormMessageProps;
|
package/src/rhf/line-items.tsx
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* `summary`, `fieldLabels`, `narrowColumns`, `removePlacement` and `removeAlign` pass
|
|
28
28
|
* through to {@link LineItems}. With
|
|
29
29
|
* `fieldLabels="floating"` a cell's `fieldLabel` is the column's name; the bound
|
|
30
|
-
* fields' own `label` is a
|
|
30
|
+
* fields' own `label` is a label ABOVE the control, so for the floating
|
|
31
31
|
* one render the kit field through `RhfField`:
|
|
32
32
|
* `render={({ field, invalid }) => <Input label={fieldLabel} aria-label={label} {...field} invalid={invalid} />}`.
|
|
33
33
|
*/
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Inside a `<StepperNav>` the hook registers the step's validator with the wizard, so
|
|
14
14
|
* Next (and Finish on a form-bearing last step) runs it: on success the values go to
|
|
15
|
-
* `onValid` and the wizard advances; on failure
|
|
16
|
-
*
|
|
17
|
-
* since the result carries no per-field errors, says its "fill in the
|
|
18
|
-
* fields" line so the button did not seem to do nothing. It also RETURNS the
|
|
15
|
+
* `onValid` and the wizard advances; on failure the bound fields show their inline
|
|
16
|
+
* messages, react-hook-form focuses the first field in error, and the wizard stays
|
|
17
|
+
* put — and, since the result carries no per-field errors, says its "fill in the
|
|
18
|
+
* required fields" line so the button did not seem to do nothing. It also RETURNS the
|
|
19
19
|
* validator, for a nav of your own outside `<StepperNav>` (where there is no wizard
|
|
20
20
|
* context to register with, so nothing is registered).
|
|
21
21
|
*
|
package/src/rhf.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// `@eifi1/ui-kit/rhf` — the react-hook-form adapter: Form and the bound Rhf* fields (and
|
|
2
|
-
// RhfField as the escape hatch). The shadcn scaffold (FormField,
|
|
3
|
-
// FormControl, FormDescription, FormMessage, useFormField)
|
|
2
|
+
// RhfField as the escape hatch). The shadcn scaffold they are built from (FormField,
|
|
3
|
+
// FormItem, FormLabel, FormControl, FormDescription, FormMessage, useFormField) left the
|
|
4
|
+
// surface in 0.35 (refactor audit 2026-10, API-6f; deprecated in 0.34).
|
|
4
5
|
//
|
|
5
6
|
// The only entry point in the package that requires `react-hook-form`, and an optional
|
|
6
7
|
// peer for that reason: an app without a form library installs nothing for it. NOT
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// The English words of ./device-reset-setting, in a module with no component code: the
|
|
2
|
+
// English catalogue (src/i18n/defaults.ts) imports them without the component, so `en`
|
|
3
|
+
// loads as one chunk like the other languages (0.34, KS U8). ./device-reset-setting
|
|
4
|
+
// re-exports them.
|
|
5
|
+
|
|
6
|
+
import type { DeviceResetLabels } from "./device-reset-setting";
|
|
7
|
+
|
|
8
|
+
/** docs/settings-harmonization.md §11.3, word for word. */
|
|
9
|
+
export const DEFAULT_DEVICE_RESET_LABELS: DeviceResetLabels = {
|
|
10
|
+
title: "Reset this device",
|
|
11
|
+
description:
|
|
12
|
+
"Puts this device's appearance, and the way its tables and panels were left, back to the defaults. Your account, your data and your sign-in are not touched.",
|
|
13
|
+
action: "Reset this device's settings",
|
|
14
|
+
confirmTitle: "Reset this device's settings?",
|
|
15
|
+
confirmBody:
|
|
16
|
+
"Theme, colours, text size, contrast and language go back to their defaults here, and tables and panels open as they first did. Where your account has a language, a text size or a contrast, this device follows it again. Your account and your other devices stay as they are.",
|
|
17
|
+
confirmAction: "Reset",
|
|
18
|
+
done: "This device's settings are back to their defaults.",
|
|
19
|
+
keywords: "reset defaults device restore appearance tables layout",
|
|
20
|
+
};
|