@wordpress/dataviews 11.3.1-next.v.0 → 12.0.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/CHANGELOG.md +46 -1
- package/README.md +44 -2
- package/build/components/dataform-controls/adaptive-select.cjs +52 -0
- package/build/components/dataform-controls/adaptive-select.cjs.map +7 -0
- package/build/components/dataform-controls/array.cjs +2 -0
- package/build/components/dataform-controls/array.cjs.map +2 -2
- package/build/components/dataform-controls/checkbox.cjs +2 -0
- package/build/components/dataform-controls/checkbox.cjs.map +2 -2
- package/build/components/dataform-controls/color.cjs +21 -30
- package/build/components/dataform-controls/color.cjs.map +3 -3
- package/build/components/dataform-controls/combobox.cjs +80 -0
- package/build/components/dataform-controls/combobox.cjs.map +7 -0
- package/build/components/dataform-controls/date.cjs +58 -19
- package/build/components/dataform-controls/date.cjs.map +2 -2
- package/build/components/dataform-controls/datetime.cjs +11 -3
- package/build/components/dataform-controls/datetime.cjs.map +2 -2
- package/build/components/dataform-controls/email.cjs +2 -0
- package/build/components/dataform-controls/email.cjs.map +2 -2
- package/build/components/dataform-controls/index.cjs +5 -1
- package/build/components/dataform-controls/index.cjs.map +3 -3
- package/build/components/dataform-controls/password.cjs +2 -0
- package/build/components/dataform-controls/password.cjs.map +2 -2
- package/build/components/dataform-controls/radio.cjs +2 -0
- package/build/components/dataform-controls/radio.cjs.map +2 -2
- package/build/components/dataform-controls/select.cjs +2 -0
- package/build/components/dataform-controls/select.cjs.map +2 -2
- package/build/components/dataform-controls/telephone.cjs +2 -0
- package/build/components/dataform-controls/telephone.cjs.map +2 -2
- package/build/components/dataform-controls/text.cjs +2 -0
- package/build/components/dataform-controls/text.cjs.map +2 -2
- package/build/components/dataform-controls/textarea.cjs +2 -0
- package/build/components/dataform-controls/textarea.cjs.map +2 -2
- package/build/components/dataform-controls/toggle-group.cjs +2 -0
- package/build/components/dataform-controls/toggle-group.cjs.map +2 -2
- package/build/components/dataform-controls/toggle.cjs +2 -0
- package/build/components/dataform-controls/toggle.cjs.map +2 -2
- package/build/components/dataform-controls/url.cjs +2 -0
- package/build/components/dataform-controls/url.cjs.map +2 -2
- package/build/components/dataform-controls/utils/relative-date-control.cjs +1 -1
- package/build/components/dataform-controls/utils/relative-date-control.cjs.map +1 -1
- package/build/components/dataform-controls/utils/validated-input.cjs +2 -0
- package/build/components/dataform-controls/utils/validated-input.cjs.map +2 -2
- package/build/components/dataform-controls/utils/validated-number.cjs +2 -0
- package/build/components/dataform-controls/utils/validated-number.cjs.map +2 -2
- package/build/components/dataform-layouts/card/index.cjs +28 -3
- package/build/components/dataform-layouts/card/index.cjs.map +3 -3
- package/build/components/dataform-layouts/data-form-layout.cjs +11 -2
- package/build/components/dataform-layouts/data-form-layout.cjs.map +2 -2
- package/build/components/dataform-layouts/details/index.cjs +69 -12
- package/build/components/dataform-layouts/details/index.cjs.map +3 -3
- package/build/components/dataform-layouts/index.cjs +5 -5
- package/build/components/dataform-layouts/index.cjs.map +1 -1
- package/build/components/dataform-layouts/normalize-form.cjs +2 -1
- package/build/components/dataform-layouts/normalize-form.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/dropdown.cjs +88 -63
- package/build/components/dataform-layouts/panel/dropdown.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/index.cjs +13 -175
- package/build/components/dataform-layouts/panel/index.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/modal.cjs +28 -18
- package/build/components/dataform-layouts/panel/modal.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/summary-button.cjs +125 -56
- package/build/components/dataform-layouts/panel/summary-button.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/utils/get-first-validation-error.cjs +59 -0
- package/build/components/dataform-layouts/panel/utils/get-first-validation-error.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/get-label-classname.cjs +45 -0
- package/build/components/dataform-layouts/panel/utils/get-label-classname.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs +36 -0
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/use-field-from-form-field.cjs +77 -0
- package/build/components/dataform-layouts/panel/utils/use-field-from-form-field.cjs.map +7 -0
- package/build/components/dataform-layouts/regular/index.cjs +6 -3
- package/build/components/dataform-layouts/regular/index.cjs.map +2 -2
- package/build/components/dataform-layouts/row/index.cjs +5 -2
- package/build/components/dataform-layouts/row/index.cjs.map +2 -2
- package/build/components/dataform-layouts/validation-badge.cjs +67 -0
- package/build/components/dataform-layouts/validation-badge.cjs.map +7 -0
- package/build/components/dataviews-bulk-actions/index.cjs +4 -4
- package/build/components/dataviews-bulk-actions/index.cjs.map +2 -2
- package/build/components/dataviews-context/index.cjs.map +2 -2
- package/build/components/dataviews-filters/filter.cjs +1 -1
- package/build/components/dataviews-filters/filter.cjs.map +1 -1
- package/build/components/dataviews-filters/filters.cjs +1 -1
- package/build/components/dataviews-filters/filters.cjs.map +1 -1
- package/build/components/dataviews-filters/search-widget.cjs +25 -11
- package/build/components/dataviews-filters/search-widget.cjs.map +2 -2
- package/build/components/dataviews-filters/toggle.cjs.map +1 -1
- package/build/components/dataviews-footer/index.cjs +1 -1
- package/build/components/dataviews-footer/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/activity/activity-item.cjs +4 -4
- package/build/components/dataviews-layouts/activity/activity-item.cjs.map +1 -1
- package/build/components/dataviews-layouts/activity/index.cjs +1 -1
- package/build/components/dataviews-layouts/activity/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/grid/composite-grid.cjs +27 -38
- package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
- package/build/components/dataviews-layouts/grid/index.cjs +2 -2
- package/build/components/dataviews-layouts/grid/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/list/index.cjs +7 -8
- package/build/components/dataviews-layouts/list/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/picker-grid/index.cjs +5 -5
- package/build/components/dataviews-layouts/picker-grid/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/picker-table/index.cjs +1 -1
- package/build/components/dataviews-layouts/picker-table/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/table/column-primary.cjs +1 -1
- package/build/components/dataviews-layouts/table/column-primary.cjs.map +1 -1
- package/build/components/dataviews-layouts/table/index.cjs +1 -1
- package/build/components/dataviews-layouts/table/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/utils/item-click-wrapper.cjs.map +2 -2
- package/build/components/dataviews-pagination/index.cjs +3 -3
- package/build/components/dataviews-pagination/index.cjs.map +2 -2
- package/build/components/dataviews-picker-footer/index.cjs +3 -3
- package/build/components/dataviews-picker-footer/index.cjs.map +2 -2
- package/build/components/dataviews-view-config/index.cjs +74 -57
- package/build/components/dataviews-view-config/index.cjs.map +3 -3
- package/build/components/dataviews-view-config/properties-section.cjs +1 -1
- package/build/components/dataviews-view-config/properties-section.cjs.map +1 -1
- package/build/dataviews/index.cjs +7 -5
- package/build/dataviews/index.cjs.map +2 -2
- package/build/dataviews-picker/index.cjs +3 -3
- package/build/dataviews-picker/index.cjs.map +2 -2
- package/build/hooks/use-form-validity.cjs +61 -28
- package/build/hooks/use-form-validity.cjs.map +2 -2
- package/build/hooks/use-report-validity.cjs +39 -0
- package/build/hooks/use-report-validity.cjs.map +7 -0
- package/build/types/dataform.cjs.map +1 -1
- package/build/types/field-api.cjs.map +1 -1
- package/build-module/components/dataform-controls/adaptive-select.mjs +21 -0
- package/build-module/components/dataform-controls/adaptive-select.mjs.map +7 -0
- package/build-module/components/dataform-controls/array.mjs +2 -0
- package/build-module/components/dataform-controls/array.mjs.map +2 -2
- package/build-module/components/dataform-controls/checkbox.mjs +2 -0
- package/build-module/components/dataform-controls/checkbox.mjs.map +2 -2
- package/build-module/components/dataform-controls/color.mjs +26 -31
- package/build-module/components/dataform-controls/color.mjs.map +2 -2
- package/build-module/components/dataform-controls/combobox.mjs +49 -0
- package/build-module/components/dataform-controls/combobox.mjs.map +7 -0
- package/build-module/components/dataform-controls/date.mjs +58 -19
- package/build-module/components/dataform-controls/date.mjs.map +2 -2
- package/build-module/components/dataform-controls/datetime.mjs +11 -3
- package/build-module/components/dataform-controls/datetime.mjs.map +2 -2
- package/build-module/components/dataform-controls/email.mjs +2 -0
- package/build-module/components/dataform-controls/email.mjs.map +2 -2
- package/build-module/components/dataform-controls/index.mjs +5 -1
- package/build-module/components/dataform-controls/index.mjs.map +2 -2
- package/build-module/components/dataform-controls/password.mjs +2 -0
- package/build-module/components/dataform-controls/password.mjs.map +2 -2
- package/build-module/components/dataform-controls/radio.mjs +2 -0
- package/build-module/components/dataform-controls/radio.mjs.map +2 -2
- package/build-module/components/dataform-controls/select.mjs +2 -0
- package/build-module/components/dataform-controls/select.mjs.map +2 -2
- package/build-module/components/dataform-controls/telephone.mjs +2 -0
- package/build-module/components/dataform-controls/telephone.mjs.map +2 -2
- package/build-module/components/dataform-controls/text.mjs +2 -0
- package/build-module/components/dataform-controls/text.mjs.map +2 -2
- package/build-module/components/dataform-controls/textarea.mjs +2 -0
- package/build-module/components/dataform-controls/textarea.mjs.map +2 -2
- package/build-module/components/dataform-controls/toggle-group.mjs +2 -0
- package/build-module/components/dataform-controls/toggle-group.mjs.map +2 -2
- package/build-module/components/dataform-controls/toggle.mjs +2 -0
- package/build-module/components/dataform-controls/toggle.mjs.map +2 -2
- package/build-module/components/dataform-controls/url.mjs +2 -0
- package/build-module/components/dataform-controls/url.mjs.map +2 -2
- package/build-module/components/dataform-controls/utils/relative-date-control.mjs +1 -1
- package/build-module/components/dataform-controls/utils/relative-date-control.mjs.map +1 -1
- package/build-module/components/dataform-controls/utils/validated-input.mjs +2 -0
- package/build-module/components/dataform-controls/utils/validated-input.mjs.map +2 -2
- package/build-module/components/dataform-controls/utils/validated-number.mjs +2 -0
- package/build-module/components/dataform-controls/utils/validated-number.mjs.map +2 -2
- package/build-module/components/dataform-layouts/card/index.mjs +29 -3
- package/build-module/components/dataform-layouts/card/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/data-form-layout.mjs +12 -3
- package/build-module/components/dataform-layouts/data-form-layout.mjs.map +2 -2
- package/build-module/components/dataform-layouts/details/index.mjs +77 -13
- package/build-module/components/dataform-layouts/details/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/index.mjs +5 -5
- package/build-module/components/dataform-layouts/index.mjs.map +1 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs +2 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/dropdown.mjs +91 -66
- package/build-module/components/dataform-layouts/panel/dropdown.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/index.mjs +14 -176
- package/build-module/components/dataform-layouts/panel/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/modal.mjs +30 -20
- package/build-module/components/dataform-layouts/panel/modal.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/summary-button.mjs +117 -58
- package/build-module/components/dataform-layouts/panel/summary-button.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs +38 -0
- package/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs +14 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs +15 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs +46 -0
- package/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs.map +7 -0
- package/build-module/components/dataform-layouts/regular/index.mjs +6 -3
- package/build-module/components/dataform-layouts/regular/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/row/index.mjs +5 -2
- package/build-module/components/dataform-layouts/row/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/validation-badge.mjs +46 -0
- package/build-module/components/dataform-layouts/validation-badge.mjs.map +7 -0
- package/build-module/components/dataviews-bulk-actions/index.mjs +4 -4
- package/build-module/components/dataviews-bulk-actions/index.mjs.map +2 -2
- package/build-module/components/dataviews-context/index.mjs.map +2 -2
- package/build-module/components/dataviews-filters/filter.mjs +1 -1
- package/build-module/components/dataviews-filters/filter.mjs.map +1 -1
- package/build-module/components/dataviews-filters/filters.mjs +1 -1
- package/build-module/components/dataviews-filters/filters.mjs.map +1 -1
- package/build-module/components/dataviews-filters/search-widget.mjs +25 -11
- package/build-module/components/dataviews-filters/search-widget.mjs.map +2 -2
- package/build-module/components/dataviews-filters/toggle.mjs.map +1 -1
- package/build-module/components/dataviews-footer/index.mjs +1 -1
- package/build-module/components/dataviews-footer/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/activity/activity-item.mjs +4 -4
- package/build-module/components/dataviews-layouts/activity/activity-item.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/activity/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/activity/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs +27 -38
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/index.mjs +2 -2
- package/build-module/components/dataviews-layouts/grid/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/list/index.mjs +7 -8
- package/build-module/components/dataviews-layouts/list/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs +5 -5
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-table/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/picker-table/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/table/column-primary.mjs +1 -1
- package/build-module/components/dataviews-layouts/table/column-primary.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/table/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/table/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs.map +2 -2
- package/build-module/components/dataviews-pagination/index.mjs +3 -3
- package/build-module/components/dataviews-pagination/index.mjs.map +2 -2
- package/build-module/components/dataviews-picker-footer/index.mjs +3 -3
- package/build-module/components/dataviews-picker-footer/index.mjs.map +2 -2
- package/build-module/components/dataviews-view-config/index.mjs +74 -59
- package/build-module/components/dataviews-view-config/index.mjs.map +2 -2
- package/build-module/components/dataviews-view-config/properties-section.mjs +1 -1
- package/build-module/components/dataviews-view-config/properties-section.mjs.map +1 -1
- package/build-module/dataviews/index.mjs +7 -5
- package/build-module/dataviews/index.mjs.map +2 -2
- package/build-module/dataviews-picker/index.mjs +3 -3
- package/build-module/dataviews-picker/index.mjs.map +2 -2
- package/build-module/hooks/use-form-validity.mjs +61 -28
- package/build-module/hooks/use-form-validity.mjs.map +2 -2
- package/build-module/hooks/use-report-validity.mjs +18 -0
- package/build-module/hooks/use-report-validity.mjs.map +7 -0
- package/build-style/style-rtl.css +149 -217
- package/build-style/style.css +149 -217
- package/build-types/components/dataform-controls/adaptive-select.d.ts +6 -0
- package/build-types/components/dataform-controls/adaptive-select.d.ts.map +1 -0
- package/build-types/components/dataform-controls/array.d.ts +1 -1
- package/build-types/components/dataform-controls/array.d.ts.map +1 -1
- package/build-types/components/dataform-controls/checkbox.d.ts +1 -1
- package/build-types/components/dataform-controls/checkbox.d.ts.map +1 -1
- package/build-types/components/dataform-controls/color.d.ts +1 -1
- package/build-types/components/dataform-controls/color.d.ts.map +1 -1
- package/build-types/components/dataform-controls/combobox.d.ts +6 -0
- package/build-types/components/dataform-controls/combobox.d.ts.map +1 -0
- package/build-types/components/dataform-controls/date.d.ts +1 -1
- package/build-types/components/dataform-controls/date.d.ts.map +1 -1
- package/build-types/components/dataform-controls/datetime.d.ts +1 -1
- package/build-types/components/dataform-controls/datetime.d.ts.map +1 -1
- package/build-types/components/dataform-controls/email.d.ts +1 -1
- package/build-types/components/dataform-controls/email.d.ts.map +1 -1
- package/build-types/components/dataform-controls/index.d.ts.map +1 -1
- package/build-types/components/dataform-controls/password.d.ts +1 -1
- package/build-types/components/dataform-controls/password.d.ts.map +1 -1
- package/build-types/components/dataform-controls/radio.d.ts +1 -1
- package/build-types/components/dataform-controls/radio.d.ts.map +1 -1
- package/build-types/components/dataform-controls/select.d.ts +1 -1
- package/build-types/components/dataform-controls/select.d.ts.map +1 -1
- package/build-types/components/dataform-controls/telephone.d.ts +1 -1
- package/build-types/components/dataform-controls/telephone.d.ts.map +1 -1
- package/build-types/components/dataform-controls/text.d.ts +1 -1
- package/build-types/components/dataform-controls/text.d.ts.map +1 -1
- package/build-types/components/dataform-controls/textarea.d.ts +1 -1
- package/build-types/components/dataform-controls/textarea.d.ts.map +1 -1
- package/build-types/components/dataform-controls/toggle-group.d.ts +1 -1
- package/build-types/components/dataform-controls/toggle-group.d.ts.map +1 -1
- package/build-types/components/dataform-controls/toggle.d.ts +1 -1
- package/build-types/components/dataform-controls/toggle.d.ts.map +1 -1
- package/build-types/components/dataform-controls/url.d.ts +1 -1
- package/build-types/components/dataform-controls/url.d.ts.map +1 -1
- package/build-types/components/dataform-controls/utils/validated-input.d.ts +1 -1
- package/build-types/components/dataform-controls/utils/validated-input.d.ts.map +1 -1
- package/build-types/components/dataform-controls/utils/validated-number.d.ts +1 -1
- package/build-types/components/dataform-controls/utils/validated-number.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/card/index.d.ts +3 -1
- package/build-types/components/dataform-layouts/card/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/data-form-layout.d.ts +2 -1
- package/build-types/components/dataform-layouts/data-form-layout.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/details/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/details/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/normalize-form.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/dropdown.d.ts +2 -12
- package/build-types/components/dataform-layouts/panel/dropdown.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/panel/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/modal.d.ts +2 -10
- package/build-types/components/dataform-layouts/panel/modal.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts +6 -5
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/utils/get-first-validation-error.d.ts +4 -0
- package/build-types/components/dataform-layouts/panel/utils/get-first-validation-error.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-classname.d.ts +4 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-classname.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts +3 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/use-field-from-form-field.d.ts +23 -0
- package/build-types/components/dataform-layouts/panel/utils/use-field-from-form-field.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/regular/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/regular/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/row/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/row/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/validation-badge.d.ts +8 -0
- package/build-types/components/dataform-layouts/validation-badge.d.ts.map +1 -0
- package/build-types/components/dataviews-context/index.d.ts +1 -0
- package/build-types/components/dataviews-context/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/list/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/utils/item-click-wrapper.d.ts +1 -0
- package/build-types/components/dataviews-layouts/utils/item-click-wrapper.d.ts.map +1 -1
- package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
- package/build-types/dataform/stories/content.story.d.ts +14 -0
- package/build-types/dataform/stories/content.story.d.ts.map +1 -0
- package/build-types/dataform/stories/index.story.d.ts +10 -2
- package/build-types/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/dataform/stories/layout-panel.d.ts +3 -1
- package/build-types/dataform/stories/layout-panel.d.ts.map +1 -1
- package/build-types/dataform/stories/validation.d.ts +1 -1
- package/build-types/dataform/stories/validation.d.ts.map +1 -1
- package/build-types/dataviews/index.d.ts +2 -1
- package/build-types/dataviews/index.d.ts.map +1 -1
- package/build-types/dataviews/stories/fixtures.d.ts +1 -0
- package/build-types/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/dataviews/stories/index.story.d.ts +14 -2
- package/build-types/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-activity.d.ts +2 -1
- package/build-types/dataviews/stories/layout-activity.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-list.d.ts +2 -1
- package/build-types/dataviews/stories/layout-list.d.ts.map +1 -1
- package/build-types/field-types/stories/index.story.d.ts +42 -16
- package/build-types/field-types/stories/index.story.d.ts.map +1 -1
- package/build-types/hooks/use-form-validity.d.ts.map +1 -1
- package/build-types/hooks/use-report-validity.d.ts +14 -0
- package/build-types/hooks/use-report-validity.d.ts.map +1 -0
- package/build-types/types/dataform.d.ts +4 -0
- package/build-types/types/dataform.d.ts.map +1 -1
- package/build-types/types/field-api.d.ts +4 -0
- package/build-types/types/field-api.d.ts.map +1 -1
- package/build-wp/index.js +3749 -2632
- package/package.json +22 -21
- package/src/components/dataform-controls/adaptive-select.tsx +23 -0
- package/src/components/dataform-controls/array.tsx +2 -0
- package/src/components/dataform-controls/checkbox.tsx +2 -0
- package/src/components/dataform-controls/color.tsx +31 -36
- package/src/components/dataform-controls/combobox.tsx +58 -0
- package/src/components/dataform-controls/date.tsx +69 -26
- package/src/components/dataform-controls/datetime.tsx +16 -6
- package/src/components/dataform-controls/email.tsx +2 -0
- package/src/components/dataform-controls/index.tsx +5 -1
- package/src/components/dataform-controls/password.tsx +2 -0
- package/src/components/dataform-controls/radio.tsx +2 -0
- package/src/components/dataform-controls/select.tsx +2 -0
- package/src/components/dataform-controls/style.scss +4 -0
- package/src/components/dataform-controls/telephone.tsx +2 -0
- package/src/components/dataform-controls/text.tsx +2 -0
- package/src/components/dataform-controls/textarea.tsx +2 -0
- package/src/components/dataform-controls/toggle-group.tsx +2 -0
- package/src/components/dataform-controls/toggle.tsx +2 -0
- package/src/components/dataform-controls/url.tsx +2 -0
- package/src/components/dataform-controls/utils/relative-date-control.tsx +1 -1
- package/src/components/dataform-controls/utils/validated-input.tsx +2 -0
- package/src/components/dataform-controls/utils/validated-number.tsx +2 -0
- package/src/components/dataform-layouts/card/index.tsx +40 -3
- package/src/components/dataform-layouts/data-form-layout.tsx +18 -4
- package/src/components/dataform-layouts/details/index.tsx +66 -4
- package/src/components/dataform-layouts/details/style.scss +5 -0
- package/src/components/dataform-layouts/index.tsx +5 -5
- package/src/components/dataform-layouts/normalize-form.ts +1 -0
- package/src/components/dataform-layouts/panel/dropdown.tsx +110 -94
- package/src/components/dataform-layouts/panel/index.tsx +10 -243
- package/src/components/dataform-layouts/panel/modal.tsx +43 -29
- package/src/components/dataform-layouts/panel/style.scss +109 -27
- package/src/components/dataform-layouts/panel/summary-button.tsx +140 -62
- package/src/components/dataform-layouts/panel/utils/get-first-validation-error.ts +47 -0
- package/src/components/dataform-layouts/panel/utils/get-label-classname.ts +18 -0
- package/src/components/dataform-layouts/panel/utils/get-label-content.tsx +26 -0
- package/src/components/dataform-layouts/panel/utils/use-field-from-form-field.ts +78 -0
- package/src/components/dataform-layouts/regular/index.tsx +8 -3
- package/src/components/dataform-layouts/regular/style.scss +10 -0
- package/src/components/dataform-layouts/row/index.tsx +5 -2
- package/src/components/dataform-layouts/test/normalize-form.ts +5 -0
- package/src/components/dataform-layouts/validation-badge.tsx +63 -0
- package/src/components/dataviews-bulk-actions/index.tsx +4 -4
- package/src/components/dataviews-context/index.ts +1 -0
- package/src/components/dataviews-filters/filter.tsx +2 -2
- package/src/components/dataviews-filters/filters.tsx +1 -1
- package/src/components/dataviews-filters/search-widget.tsx +10 -2
- package/src/components/dataviews-filters/style.scss +8 -0
- package/src/components/dataviews-filters/toggle.tsx +1 -1
- package/src/components/dataviews-footer/index.tsx +1 -1
- package/src/components/dataviews-layouts/activity/activity-item.tsx +4 -4
- package/src/components/dataviews-layouts/activity/index.tsx +1 -1
- package/src/components/dataviews-layouts/grid/composite-grid.tsx +35 -35
- package/src/components/dataviews-layouts/grid/index.tsx +2 -2
- package/src/components/dataviews-layouts/grid/style.scss +15 -1
- package/src/components/dataviews-layouts/list/index.tsx +7 -8
- package/src/components/dataviews-layouts/list/style.scss +1 -0
- package/src/components/dataviews-layouts/picker-grid/index.tsx +5 -5
- package/src/components/dataviews-layouts/picker-table/index.tsx +1 -1
- package/src/components/dataviews-layouts/table/column-primary.tsx +1 -1
- package/src/components/dataviews-layouts/table/index.tsx +1 -1
- package/src/components/dataviews-layouts/utils/item-click-wrapper.tsx +1 -0
- package/src/components/dataviews-pagination/index.tsx +3 -3
- package/src/components/dataviews-picker-footer/index.tsx +3 -3
- package/src/components/dataviews-view-config/index.tsx +61 -50
- package/src/components/dataviews-view-config/properties-section.tsx +1 -1
- package/src/components/dataviews-view-config/style.scss +21 -0
- package/src/dataform/stories/content.story.mdx +159 -0
- package/src/dataform/stories/content.story.tsx +390 -0
- package/src/dataform/stories/index.story.tsx +14 -2
- package/src/dataform/stories/layout-panel.tsx +19 -2
- package/src/dataform/stories/validation.tsx +100 -7
- package/src/dataform/test/dataform.tsx +2 -2
- package/src/dataviews/index.tsx +7 -4
- package/src/dataviews/stories/empty.tsx +1 -1
- package/src/dataviews/stories/fixtures.tsx +93 -4
- package/src/dataviews/stories/free-composition.tsx +6 -6
- package/src/dataviews/stories/index.story.tsx +12 -0
- package/src/dataviews/stories/layout-activity.tsx +6 -3
- package/src/dataviews/stories/layout-list.tsx +3 -0
- package/src/dataviews-picker/index.tsx +4 -4
- package/src/dataviews-picker/stories/fixtures.tsx +2 -2
- package/src/dataviews-picker/stories/index.story.tsx +1 -1
- package/src/field-types/stories/index.story.tsx +101 -5
- package/src/hooks/test/use-form-validity.ts +303 -178
- package/src/hooks/use-form-validity.ts +85 -36
- package/src/hooks/use-report-validity.ts +32 -0
- package/src/style.scss +0 -2
- package/src/types/dataform.ts +5 -0
- package/src/types/field-api.ts +4 -0
|
@@ -51,13 +51,13 @@ export function DataViewsPagination() {
|
|
|
51
51
|
className="dataviews-pagination"
|
|
52
52
|
justify="end"
|
|
53
53
|
align="center"
|
|
54
|
-
gap="
|
|
54
|
+
gap="xl"
|
|
55
55
|
>
|
|
56
56
|
<Stack
|
|
57
57
|
direction="row"
|
|
58
58
|
justify="flex-start"
|
|
59
59
|
align="center"
|
|
60
|
-
gap="
|
|
60
|
+
gap="xs"
|
|
61
61
|
className="dataviews-pagination__page-select"
|
|
62
62
|
>
|
|
63
63
|
{ createInterpolateElement(
|
|
@@ -90,7 +90,7 @@ export function DataViewsPagination() {
|
|
|
90
90
|
}
|
|
91
91
|
) }
|
|
92
92
|
</Stack>
|
|
93
|
-
<Stack direction="row" gap="
|
|
93
|
+
<Stack direction="row" gap="xs" align="center">
|
|
94
94
|
<Button
|
|
95
95
|
onClick={ () =>
|
|
96
96
|
onChangeView( {
|
|
@@ -88,7 +88,7 @@ function ActionButtons< Item >( {
|
|
|
88
88
|
);
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<Stack direction="row" gap="
|
|
91
|
+
<Stack direction="row" gap="xs">
|
|
92
92
|
{ actions.map( ( action ) => {
|
|
93
93
|
// Only support actions with callbacks for DataViewsPicker.
|
|
94
94
|
// This is because many use cases of the picker will be already within modals.
|
|
@@ -158,12 +158,12 @@ export function DataViewsPickerFooter() {
|
|
|
158
158
|
justify="space-between"
|
|
159
159
|
align="center"
|
|
160
160
|
className="dataviews-footer"
|
|
161
|
-
gap="
|
|
161
|
+
gap="sm"
|
|
162
162
|
>
|
|
163
163
|
<Stack
|
|
164
164
|
direction="row"
|
|
165
165
|
className="dataviews-picker-footer__bulk-selection"
|
|
166
|
-
gap="
|
|
166
|
+
gap="md"
|
|
167
167
|
align="center"
|
|
168
168
|
>
|
|
169
169
|
{ isMultiselect && (
|
|
@@ -14,9 +14,7 @@ import {
|
|
|
14
14
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
15
15
|
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
16
16
|
SelectControl,
|
|
17
|
-
__experimentalGrid as Grid,
|
|
18
17
|
__experimentalHeading as Heading,
|
|
19
|
-
__experimentalText as Text,
|
|
20
18
|
privateApis as componentsPrivateApis,
|
|
21
19
|
} from '@wordpress/components';
|
|
22
20
|
import { __, _x } from '@wordpress/i18n';
|
|
@@ -247,46 +245,36 @@ function ItemsPerPageControl() {
|
|
|
247
245
|
);
|
|
248
246
|
}
|
|
249
247
|
|
|
250
|
-
function
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
248
|
+
function ResetViewButton() {
|
|
249
|
+
const { onReset } = useContext( DataViewsContext );
|
|
250
|
+
|
|
251
|
+
// Don't render if no persistence support (onReset is undefined)
|
|
252
|
+
if ( onReset === undefined ) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const isDisabled = onReset === false;
|
|
257
|
+
|
|
259
258
|
return (
|
|
260
|
-
<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
</Text>
|
|
275
|
-
) }
|
|
276
|
-
</div>
|
|
277
|
-
<Grid
|
|
278
|
-
columns={ 8 }
|
|
279
|
-
gap={ 4 }
|
|
280
|
-
className="dataviews-settings-section__content"
|
|
281
|
-
>
|
|
282
|
-
{ children }
|
|
283
|
-
</Grid>
|
|
284
|
-
</Grid>
|
|
259
|
+
<Button
|
|
260
|
+
variant="tertiary"
|
|
261
|
+
size="compact"
|
|
262
|
+
disabled={ isDisabled }
|
|
263
|
+
accessibleWhenDisabled
|
|
264
|
+
className="dataviews-view-config__reset-button"
|
|
265
|
+
onClick={ () => {
|
|
266
|
+
if ( typeof onReset === 'function' ) {
|
|
267
|
+
onReset();
|
|
268
|
+
}
|
|
269
|
+
} }
|
|
270
|
+
>
|
|
271
|
+
{ __( 'Reset view' ) }
|
|
272
|
+
</Button>
|
|
285
273
|
);
|
|
286
274
|
}
|
|
287
275
|
|
|
288
276
|
export function DataviewsViewConfigDropdown() {
|
|
289
|
-
const { view } = useContext( DataViewsContext );
|
|
277
|
+
const { view, onReset } = useContext( DataViewsContext );
|
|
290
278
|
const popoverId = useInstanceId(
|
|
291
279
|
_DataViewsViewConfig,
|
|
292
280
|
'dataviews-view-config-dropdown'
|
|
@@ -294,6 +282,7 @@ export function DataviewsViewConfigDropdown() {
|
|
|
294
282
|
const activeLayout = VIEW_LAYOUTS.find(
|
|
295
283
|
( layout ) => layout.type === view.type
|
|
296
284
|
);
|
|
285
|
+
const isModified = typeof onReset === 'function';
|
|
297
286
|
return (
|
|
298
287
|
<Dropdown
|
|
299
288
|
expandOnMobile
|
|
@@ -303,14 +292,22 @@ export function DataviewsViewConfigDropdown() {
|
|
|
303
292
|
} }
|
|
304
293
|
renderToggle={ ( { onToggle, isOpen } ) => {
|
|
305
294
|
return (
|
|
306
|
-
<
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
295
|
+
<div className="dataviews-view-config__toggle-wrapper">
|
|
296
|
+
<Button
|
|
297
|
+
size="compact"
|
|
298
|
+
icon={ cog }
|
|
299
|
+
label={ _x(
|
|
300
|
+
'View options',
|
|
301
|
+
'View is used as a noun'
|
|
302
|
+
) }
|
|
303
|
+
onClick={ onToggle }
|
|
304
|
+
aria-expanded={ isOpen ? 'true' : 'false' }
|
|
305
|
+
aria-controls={ popoverId }
|
|
306
|
+
/>
|
|
307
|
+
{ isModified && (
|
|
308
|
+
<span className="dataviews-view-config__modified-indicator" />
|
|
309
|
+
) }
|
|
310
|
+
</div>
|
|
314
311
|
);
|
|
315
312
|
} }
|
|
316
313
|
renderContent={ () => (
|
|
@@ -321,13 +318,27 @@ export function DataviewsViewConfigDropdown() {
|
|
|
321
318
|
<Stack
|
|
322
319
|
direction="column"
|
|
323
320
|
className="dataviews-view-config"
|
|
324
|
-
gap="
|
|
321
|
+
gap="xl"
|
|
325
322
|
>
|
|
326
|
-
<
|
|
323
|
+
<Stack
|
|
324
|
+
direction="row"
|
|
325
|
+
justify="space-between"
|
|
326
|
+
align="center"
|
|
327
|
+
className="dataviews-view-config__header"
|
|
328
|
+
>
|
|
329
|
+
<Heading
|
|
330
|
+
level={ 2 }
|
|
331
|
+
className="dataviews-settings-section__title"
|
|
332
|
+
>
|
|
333
|
+
{ __( 'Appearance' ) }
|
|
334
|
+
</Heading>
|
|
335
|
+
<ResetViewButton />
|
|
336
|
+
</Stack>
|
|
337
|
+
<Stack direction="column" gap="lg">
|
|
327
338
|
<Stack
|
|
328
339
|
direction="row"
|
|
329
|
-
gap="
|
|
330
|
-
className="
|
|
340
|
+
gap="sm"
|
|
341
|
+
className="dataviews-view-config__sort-controls"
|
|
331
342
|
>
|
|
332
343
|
<SortFieldControl />
|
|
333
344
|
<SortDirectionControl />
|
|
@@ -338,7 +349,7 @@ export function DataviewsViewConfigDropdown() {
|
|
|
338
349
|
<InfiniteScrollToggle />
|
|
339
350
|
<ItemsPerPageControl />
|
|
340
351
|
<PropertiesSection />
|
|
341
|
-
</
|
|
352
|
+
</Stack>
|
|
342
353
|
</Stack>
|
|
343
354
|
</DropdownContentWrapper>
|
|
344
355
|
) }
|
|
@@ -30,7 +30,7 @@ function FieldItem( {
|
|
|
30
30
|
} ) {
|
|
31
31
|
return (
|
|
32
32
|
<Item onClick={ field.enableHiding ? onToggleVisibility : undefined }>
|
|
33
|
-
<Stack direction="row" gap="
|
|
33
|
+
<Stack direction="row" gap="sm" justify="flex-start" align="center">
|
|
34
34
|
<div style={ { height: 24, width: 24 } }>
|
|
35
35
|
{ isVisible && <Icon icon={ check } /> }
|
|
36
36
|
</div>
|
|
@@ -59,6 +59,27 @@
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
.dataviews-view-config__sort-controls > * {
|
|
63
|
+
flex: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
62
66
|
.dataviews-view-config__label {
|
|
63
67
|
text-wrap: nowrap;
|
|
64
68
|
}
|
|
69
|
+
|
|
70
|
+
.dataviews-view-config__toggle-wrapper {
|
|
71
|
+
position: relative;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dataviews-view-config__modified-indicator {
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: $grid-unit-05;
|
|
78
|
+
right: $grid-unit-05;
|
|
79
|
+
width: $grid-unit-05;
|
|
80
|
+
height: $grid-unit-05;
|
|
81
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as ContentStories from './content.story';
|
|
3
|
+
|
|
4
|
+
<Meta of={ ContentStories } />
|
|
5
|
+
|
|
6
|
+
# Content Elements
|
|
7
|
+
|
|
8
|
+
Guidance on understanding the semantics and proper usage of content elements in `DataForm` instances, including when and how to use high-level help text, labels, placeholders, field-level help text, and validation messages.
|
|
9
|
+
|
|
10
|
+
## Accessibility
|
|
11
|
+
|
|
12
|
+
Proper use of content elements is essential for accessibility. Each element serves a specific semantic purpose that assistive technologies rely on:
|
|
13
|
+
|
|
14
|
+
- **Labels** are announced by screen readers to identify form fields. Every field must have a label.
|
|
15
|
+
- **Placeholders** provide example input to hint at expected format. They are not a substitute for labels—they disappear on input and are not reliably announced.
|
|
16
|
+
- **Help text** provides additional context that is programmatically associated with fields and read by assistive technologies.
|
|
17
|
+
- **Validation messages** are announced when they appear so users know how to correct errors.
|
|
18
|
+
|
|
19
|
+
Following these semantics benefits all users, including those navigating with keyboards, using screen readers, or experiencing cognitive challenges.
|
|
20
|
+
|
|
21
|
+
## High-level help text
|
|
22
|
+
|
|
23
|
+
High-level help text provides context and guidance for an entire form. It should be used to explain the purpose of the form, the information that will be collected, and how the information will be used. To add high-level help text, use the `description` property on a field group object (a `FormField` type) in the form configuration's `fields` array that wraps all the form fields as children.
|
|
24
|
+
|
|
25
|
+
<Canvas of={ ContentStories.HighLevelHelpText } />
|
|
26
|
+
|
|
27
|
+
## Labels
|
|
28
|
+
|
|
29
|
+
A label tells users what information they need to enter in a field. Labels must be short, clear, and descriptive to avoid confusion.
|
|
30
|
+
|
|
31
|
+
<Canvas of={ ContentStories.Labels } />
|
|
32
|
+
|
|
33
|
+
### Guidelines
|
|
34
|
+
|
|
35
|
+
<table style={ { width: '100%' } }>
|
|
36
|
+
<thead>
|
|
37
|
+
<tr>
|
|
38
|
+
<th style={ { width: '50%' } }>✅ Do</th>
|
|
39
|
+
<th style={ { width: '50%' } }>🚫 Don't</th>
|
|
40
|
+
</tr>
|
|
41
|
+
</thead>
|
|
42
|
+
<tbody>
|
|
43
|
+
<tr>
|
|
44
|
+
<td style={ { width: '50%' } }>Use clear and straightforward language.</td>
|
|
45
|
+
<td style={ { width: '50%' } }>Use vague or ambiguous terms like "Information" or "Details".</td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td style={ { width: '50%' } }>Limit labels to 1 to 3 concise words.</td>
|
|
49
|
+
<td style={ { width: '50%' } }>Exceed 3 words—longer labels create visual clutter.</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td style={ { width: '50%' } }>Remove filler words and redundant phrasing.</td>
|
|
53
|
+
<td style={ { width: '50%' } }>Include filler words like "Please enter your" or "Kindly provide".</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td style={ { width: '50%' } }>Use plain language that users understand.</td>
|
|
57
|
+
<td style={ { width: '50%' } }>Use technical jargon that users might not understand.</td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<td style={ { width: '50%' } }>Be specific and descriptive.</td>
|
|
61
|
+
<td style={ { width: '50%' } }>Use generic labels like "Input" or "Field 1".</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
|
|
66
|
+
## Placeholders
|
|
67
|
+
|
|
68
|
+
A placeholder provides example input to help users understand the expected format. Use placeholders sparingly, keep them short (1 to 3 words), and use real-world examples where possible. They should only be used for formatting hints or common examples, never as a replacement for labels or instructions.
|
|
69
|
+
|
|
70
|
+
<Canvas of={ ContentStories.Placeholders } />
|
|
71
|
+
|
|
72
|
+
<table style={ { width: '100%' } }>
|
|
73
|
+
<thead>
|
|
74
|
+
<tr>
|
|
75
|
+
<th style={ { width: '50%' } }>✅ Good</th>
|
|
76
|
+
<th style={ { width: '50%' } }>🚫 Bad</th>
|
|
77
|
+
</tr>
|
|
78
|
+
</thead>
|
|
79
|
+
<tbody>
|
|
80
|
+
<tr>
|
|
81
|
+
<td style={ { width: '50%' } }>For a name field: "Jane Doe".</td>
|
|
82
|
+
<td style={ { width: '50%' } }>For a name field: "Enter your full name here" (Should be a label or help text, not a placeholder).</td>
|
|
83
|
+
</tr>
|
|
84
|
+
<tr>
|
|
85
|
+
<td style={ { width: '50%' } }>For an email field: "you@example.com".</td>
|
|
86
|
+
<td style={ { width: '50%' } }>For a password field: "At least 8 characters" (Belongs in help text, not a placeholder).</td>
|
|
87
|
+
</tr>
|
|
88
|
+
</tbody>
|
|
89
|
+
</table>
|
|
90
|
+
|
|
91
|
+
## Help text
|
|
92
|
+
|
|
93
|
+
For complicated inputs, use help text to explain how the user should proceed. Help text is always visible, appears immediately after the input, and provides essential guidance for completing the input correctly. Help text can also inform users about how their information might be used, providing transparency and context that helps build trust and sets appropriate expectations.
|
|
94
|
+
|
|
95
|
+
Use help text when the user needs contextual guidance upfront to avoid errors, when the instruction explains why or how to complete the field correctly, when the form field has complex requirements or constraints (e.g., password rules, business logic), or when the information should be accessible without additional interaction.
|
|
96
|
+
|
|
97
|
+
<Canvas of={ ContentStories.HelpText } />
|
|
98
|
+
|
|
99
|
+
### Guidelines
|
|
100
|
+
|
|
101
|
+
<table style={ { width: '100%' } }>
|
|
102
|
+
<thead>
|
|
103
|
+
<tr>
|
|
104
|
+
<th style={ { width: '50%' } }>✅ Do</th>
|
|
105
|
+
<th style={ { width: '50%' } }>🚫 Don't</th>
|
|
106
|
+
</tr>
|
|
107
|
+
</thead>
|
|
108
|
+
<tbody>
|
|
109
|
+
<tr>
|
|
110
|
+
<td style={ { width: '50%' } }>Keep help text concise—one to two sentences maximum.</td>
|
|
111
|
+
<td style={ { width: '50%' } }>Write lengthy paragraphs that overwhelm the user.</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td style={ { width: '50%' } }>Provide actionable, contextual guidance about why or how to complete the field.</td>
|
|
115
|
+
<td style={ { width: '50%' } }>State the obvious or repeat what the label already conveys.</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td style={ { width: '50%' } }>Explain requirements or constraints that aren't obvious from the label.</td>
|
|
119
|
+
<td style={ { width: '50%' } }>Duplicate format examples that belong in placeholders (e.g., "Use YYYY-MM-DD format").</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td style={ { width: '50%' } }>Focus on what the user needs to know to succeed.</td>
|
|
123
|
+
<td style={ { width: '50%' } }>Include unnecessary background information or explanations.</td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td style={ { width: '50%' } }>Write in plain, user-friendly language.</td>
|
|
127
|
+
<td style={ { width: '50%' } }>Use technical terms or system-specific jargon.</td>
|
|
128
|
+
</tr>
|
|
129
|
+
<tr>
|
|
130
|
+
<td style={ { width: '50%' } }>For radios or selects, explain how to choose between options.</td>
|
|
131
|
+
<td style={ { width: '50%' } }>Use help text to describe what a selected value means after selection.</td>
|
|
132
|
+
</tr>
|
|
133
|
+
</tbody>
|
|
134
|
+
</table>
|
|
135
|
+
|
|
136
|
+
## Validation messages
|
|
137
|
+
|
|
138
|
+
Validation messages help users understand and fix errors in a form. They should be clear, concise, and actionable to guide users toward correcting their input.
|
|
139
|
+
|
|
140
|
+
Where possible, messages should infer what is wrong and how the user can fix it.
|
|
141
|
+
|
|
142
|
+
<Canvas of={ ContentStories.ValidationMessages } />
|
|
143
|
+
|
|
144
|
+
### Guidelines
|
|
145
|
+
|
|
146
|
+
<table style={ { width: '100%' } }>
|
|
147
|
+
<thead>
|
|
148
|
+
<tr>
|
|
149
|
+
<th style={ { width: '50%' } }>✅ Good</th>
|
|
150
|
+
<th style={ { width: '50%' } }>🚫 Bad</th>
|
|
151
|
+
</tr>
|
|
152
|
+
</thead>
|
|
153
|
+
<tbody>
|
|
154
|
+
<tr>
|
|
155
|
+
<td style={ { width: '50%' } }>Name must be at least 2 characters long.</td>
|
|
156
|
+
<td style={ { width: '50%' } }>Invalid name.</td>
|
|
157
|
+
</tr>
|
|
158
|
+
</tbody>
|
|
159
|
+
</table>
|