@wordpress/components 32.2.1-next.v.202602111440.0 → 32.2.1
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/CLAUDE.md +1 -0
- package/build/alignment-matrix-control/cell.cjs +2 -2
- package/build/alignment-matrix-control/cell.cjs.map +1 -1
- package/build/alignment-matrix-control/index.cjs +2 -2
- package/build/alignment-matrix-control/index.cjs.map +1 -1
- package/build/angle-picker-control/angle-circle.cjs +4 -4
- package/build/angle-picker-control/angle-circle.cjs.map +2 -2
- package/build/autocomplete/index.cjs +16 -8
- package/build/autocomplete/index.cjs.map +2 -2
- package/build/clipboard-button/index.cjs +1 -1
- package/build/clipboard-button/index.cjs.map +2 -2
- package/build/color-picker/color-copy-button.cjs +1 -1
- package/build/color-picker/color-copy-button.cjs.map +2 -2
- package/build/confirm-dialog/component.cjs +2 -2
- package/build/confirm-dialog/component.cjs.map +2 -2
- package/build/context/context-system-provider.cjs.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.cjs +2 -2
- package/build/custom-gradient-picker/gradient-bar/control-points.cjs.map +2 -2
- package/build/date-time/date/index.cjs +1 -1
- package/build/date-time/date/index.cjs.map +2 -2
- package/build/date-time/time/index.cjs +1 -1
- package/build/date-time/time/index.cjs.map +2 -2
- package/build/date-time/utils.cjs +9 -0
- package/build/date-time/utils.cjs.map +2 -2
- package/build/dropdown/index.cjs +1 -1
- package/build/dropdown/index.cjs.map +2 -2
- package/build/external-link/index.cjs +5 -1
- package/build/external-link/index.cjs.map +2 -2
- package/build/higher-order/with-spoken-messages/index.cjs.map +2 -2
- package/build/modal/index.cjs +2 -2
- package/build/modal/index.cjs.map +2 -2
- package/build/modal/use-modal-exit-animation.cjs +2 -2
- package/build/modal/use-modal-exit-animation.cjs.map +2 -2
- package/build/number-control/index.cjs +1 -1
- package/build/number-control/index.cjs.map +2 -2
- package/build/palette-edit/index.cjs +1 -1
- package/build/palette-edit/index.cjs.map +2 -2
- package/build/panel/body.cjs +1 -1
- package/build/panel/body.cjs.map +2 -2
- package/build/private-apis.cjs +0 -2
- package/build/private-apis.cjs.map +2 -2
- package/build/range-control/index.cjs +1 -1
- package/build/range-control/index.cjs.map +2 -2
- package/build/resizable-box/resize-tooltip/utils.cjs +1 -1
- package/build/resizable-box/resize-tooltip/utils.cjs.map +2 -2
- package/build/sandbox/index.cjs +126 -2
- package/build/sandbox/index.cjs.map +2 -2
- package/build/select-control/styles/select-control-styles.cjs +8 -8
- package/build/select-control/styles/select-control-styles.cjs.map +2 -2
- package/build/snackbar/list.cjs +4 -1
- package/build/snackbar/list.cjs.map +2 -2
- package/build/tabs/styles.cjs +5 -5
- package/build/tabs/styles.cjs.map +2 -2
- package/build/text/utils.cjs.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs +8 -8
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs.map +2 -2
- package/build/tree-grid/roving-tab-index-item.cjs +1 -1
- package/build/tree-grid/roving-tab-index-item.cjs.map +2 -2
- package/build/utils/element-rect.cjs +1 -1
- package/build/utils/element-rect.cjs.map +2 -2
- package/build/utils/hooks/use-update-effect.cjs.map +1 -1
- package/build/utils/rtl.cjs +2 -2
- package/build/utils/rtl.cjs.map +2 -2
- package/build/utils/use-responsive-value.cjs +1 -7
- package/build/utils/use-responsive-value.cjs.map +2 -2
- package/build/validated-form-controls/control-with-error.cjs +26 -3
- package/build/validated-form-controls/control-with-error.cjs.map +2 -2
- package/build/validated-form-controls/validity-indicator.cjs +2 -0
- package/build/validated-form-controls/validity-indicator.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +2 -2
- package/build-module/alignment-matrix-control/cell.mjs.map +1 -1
- package/build-module/alignment-matrix-control/index.mjs +2 -2
- package/build-module/alignment-matrix-control/index.mjs.map +1 -1
- package/build-module/angle-picker-control/angle-circle.mjs +4 -4
- package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
- package/build-module/autocomplete/index.mjs +14 -7
- package/build-module/autocomplete/index.mjs.map +2 -2
- package/build-module/clipboard-button/index.mjs +1 -1
- package/build-module/clipboard-button/index.mjs.map +2 -2
- package/build-module/color-picker/color-copy-button.mjs +1 -1
- package/build-module/color-picker/color-copy-button.mjs.map +2 -2
- package/build-module/confirm-dialog/component.mjs +2 -2
- package/build-module/confirm-dialog/component.mjs.map +2 -2
- package/build-module/context/context-system-provider.mjs.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs +2 -2
- package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs.map +2 -2
- package/build-module/date-time/date/index.mjs +1 -1
- package/build-module/date-time/date/index.mjs.map +2 -2
- package/build-module/date-time/time/index.mjs +2 -2
- package/build-module/date-time/time/index.mjs.map +2 -2
- package/build-module/date-time/utils.mjs +8 -0
- package/build-module/date-time/utils.mjs.map +2 -2
- package/build-module/dropdown/index.mjs +1 -1
- package/build-module/dropdown/index.mjs.map +2 -2
- package/build-module/external-link/index.mjs +5 -1
- package/build-module/external-link/index.mjs.map +2 -2
- package/build-module/higher-order/with-spoken-messages/index.mjs.map +2 -2
- package/build-module/modal/index.mjs +2 -2
- package/build-module/modal/index.mjs.map +2 -2
- package/build-module/modal/use-modal-exit-animation.mjs +2 -2
- package/build-module/modal/use-modal-exit-animation.mjs.map +2 -2
- package/build-module/number-control/index.mjs +1 -1
- package/build-module/number-control/index.mjs.map +2 -2
- package/build-module/palette-edit/index.mjs +1 -1
- package/build-module/palette-edit/index.mjs.map +2 -2
- package/build-module/panel/body.mjs +1 -1
- package/build-module/panel/body.mjs.map +2 -2
- package/build-module/private-apis.mjs +0 -2
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/range-control/index.mjs +1 -1
- package/build-module/range-control/index.mjs.map +2 -2
- package/build-module/resizable-box/resize-tooltip/utils.mjs +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.mjs.map +2 -2
- package/build-module/sandbox/index.mjs +127 -3
- package/build-module/sandbox/index.mjs.map +2 -2
- package/build-module/select-control/styles/select-control-styles.mjs +8 -8
- package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
- package/build-module/snackbar/list.mjs +4 -1
- package/build-module/snackbar/list.mjs.map +2 -2
- package/build-module/tabs/styles.mjs +5 -5
- package/build-module/tabs/styles.mjs.map +2 -2
- package/build-module/text/utils.mjs.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs.map +2 -2
- package/build-module/tree-grid/roving-tab-index-item.mjs +1 -1
- package/build-module/tree-grid/roving-tab-index-item.mjs.map +2 -2
- package/build-module/utils/element-rect.mjs +1 -1
- package/build-module/utils/element-rect.mjs.map +2 -2
- package/build-module/utils/hooks/use-update-effect.mjs.map +1 -1
- package/build-module/utils/rtl.mjs +2 -2
- package/build-module/utils/rtl.mjs.map +2 -2
- package/build-module/utils/use-responsive-value.mjs +1 -7
- package/build-module/utils/use-responsive-value.mjs.map +2 -2
- package/build-module/validated-form-controls/control-with-error.mjs +27 -4
- package/build-module/validated-form-controls/control-with-error.mjs.map +2 -2
- package/build-module/validated-form-controls/validity-indicator.mjs +2 -0
- package/build-module/validated-form-controls/validity-indicator.mjs.map +2 -2
- package/build-style/style-rtl.css +8 -4
- package/build-style/style.css +8 -4
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +19 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +23 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -0
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
- package/build-types/angle-picker-control/index.d.ts +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +25 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -0
- package/build-types/animate/index.d.ts +1 -1
- package/build-types/animate/index.d.ts.map +1 -1
- package/build-types/animate/types.d.ts +1 -1
- package/build-types/animate/types.d.ts.map +1 -1
- package/build-types/autocomplete/get-autocomplete-match.d.ts +20 -0
- package/build-types/autocomplete/get-autocomplete-match.d.ts.map +1 -0
- package/build-types/autocomplete/index.d.ts +10 -2
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/autocomplete/test/get-autocomplete-match.d.ts +2 -0
- package/build-types/autocomplete/test/get-autocomplete-match.d.ts.map +1 -0
- package/build-types/autocomplete/types.d.ts +1 -1
- package/build-types/autocomplete/types.d.ts.map +1 -1
- package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
- package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
- package/build-types/base-control/index.d.ts +2 -2
- package/build-types/base-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +1 -1
- package/build-types/border-control/border-control/hook.d.ts +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +267 -0
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -0
- package/build-types/box-control/all-input-control.d.ts +4 -0
- package/build-types/box-control/all-input-control.d.ts.map +1 -0
- package/build-types/box-control/axial-input-controls.d.ts +4 -0
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -0
- package/build-types/box-control/input-controls.d.ts +4 -0
- package/build-types/box-control/input-controls.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +46 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +1 -0
- package/build-types/box-control/unit-control.d.ts +4 -0
- package/build-types/box-control/unit-control.d.ts.map +1 -0
- package/build-types/card/card/hook.d.ts +1 -1
- package/build-types/card/card-body/hook.d.ts +1 -1
- package/build-types/card/card-footer/hook.d.ts +1 -1
- package/build-types/card/card-header/hook.d.ts +1 -1
- package/build-types/card/card-media/hook.d.ts +1 -1
- package/build-types/color-palette/stories/index.story.d.ts +6 -5
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -2
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/styles.d.ts +1 -1
- package/build-types/context/context-connect.d.ts +2 -2
- package/build-types/context/context-connect.d.ts.map +1 -1
- package/build-types/context/context-system-provider.d.ts +2 -2
- package/build-types/context/context-system-provider.d.ts.map +1 -1
- package/build-types/context/wordpress-component.d.ts +3 -3
- package/build-types/context/wordpress-component.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
- package/build-types/custom-gradient-picker/test/index.d.ts +2 -0
- package/build-types/custom-gradient-picker/test/index.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/types.d.ts +1 -1
- package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
- package/build-types/custom-select-control/styles.d.ts +11 -0
- package/build-types/custom-select-control/styles.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/types.d.ts +4 -4
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +2 -2
- package/build-types/date-time/date-picker/index.d.ts +23 -0
- package/build-types/date-time/date-picker/index.d.ts.map +1 -0
- package/build-types/date-time/date-picker/styles.d.ts +45 -0
- package/build-types/date-time/date-picker/styles.d.ts.map +1 -0
- package/build-types/date-time/date-picker/test/index.d.ts +2 -0
- package/build-types/date-time/date-picker/test/index.d.ts.map +1 -0
- package/build-types/date-time/date-picker/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date-picker/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date-picker/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date-picker/use-lilius/index.d.ts.map +1 -0
- package/build-types/date-time/date-time/styles.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/time-picker/index.d.ts +27 -0
- package/build-types/date-time/time-picker/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/styles.d.ts +93 -0
- package/build-types/date-time/time-picker/styles.d.ts.map +1 -0
- package/build-types/date-time/time-picker/test/index.d.ts +2 -0
- package/build-types/date-time/time-picker/test/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/time-input/index.d.ts +4 -0
- package/build-types/date-time/time-picker/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/time-input/test/index.d.ts +2 -0
- package/build-types/date-time/time-picker/time-input/test/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/timezone.d.ts +7 -0
- package/build-types/date-time/time-picker/timezone.d.ts.map +1 -0
- package/build-types/date-time/utils.d.ts +9 -0
- package/build-types/date-time/utils.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +28 -0
- package/build-types/dimension-control/index.d.ts.map +1 -0
- package/build-types/dimension-control/sizes.d.ts +26 -0
- package/build-types/dimension-control/sizes.d.ts.map +1 -0
- package/build-types/dimension-control/stories/index.story.d.ts +4 -0
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -0
- package/build-types/dimension-control/types.d.ts +47 -0
- package/build-types/dimension-control/types.d.ts.map +1 -0
- package/build-types/draggable/types.d.ts +1 -1
- package/build-types/draggable/types.d.ts.map +1 -1
- package/build-types/drop-zone/types.d.ts +1 -1
- package/build-types/drop-zone/types.d.ts.map +1 -1
- package/build-types/dropdown-menu/types.d.ts +1 -1
- package/build-types/dropdown-menu/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/index.d.ts +17 -0
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +11 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/styles.d.ts +42 -0
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts +2 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/types.d.ts +252 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -0
- package/build-types/elevation/hook.d.ts +1 -1
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
- package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
- package/build-types/flex/flex/hook.d.ts +1 -1
- package/build-types/flex/flex-block/hook.d.ts +1 -1
- package/build-types/flex/flex-item/hook.d.ts +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts +8 -7
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +2 -2
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +6 -5
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +1 -1
- package/build-types/heading/hook.d.ts +1 -1
- package/build-types/higher-order/navigate-regions/index.d.ts +1 -1
- package/build-types/higher-order/with-notices/types.d.ts +1 -1
- package/build-types/higher-order/with-notices/types.d.ts.map +1 -1
- package/build-types/higher-order/with-spoken-messages/index.d.ts +2 -3
- package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
- package/build-types/icon/index.d.ts +2 -2
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -2
- package/build-types/item-group/item/hook.d.ts +1 -1
- package/build-types/item-group/item-group/hook.d.ts +1 -1
- package/build-types/menu/index.d.ts +2 -2
- package/build-types/menu/item-help-text.d.ts +1 -1
- package/build-types/menu/item-label.d.ts +1 -1
- package/build-types/menu/styles.d.ts +2 -2
- package/build-types/menu-item/index.d.ts +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/menu-item/types.d.ts +1 -1
- package/build-types/menu-item/types.d.ts.map +1 -1
- package/build-types/mobile/inserter-button/sparkles.d.ts +3 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts.map +1 -0
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +1 -1
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/modal/use-modal-exit-animation.d.ts +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +2 -2
- package/build-types/navigation/types.d.ts +1 -1
- package/build-types/navigation/types.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-provider/component.d.ts +38 -0
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-provider/index.d.ts +2 -0
- package/build-types/navigator/navigator-provider/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-screen/index.d.ts +2 -0
- package/build-types/navigator/navigator-screen/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +1 -0
- package/build-types/palette-edit/styles.d.ts +1 -1
- package/build-types/palette-edit/types.d.ts +1 -1
- package/build-types/palette-edit/types.d.ts.map +1 -1
- package/build-types/panel/types.d.ts +2 -2
- package/build-types/panel/types.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/radio-group/radio/index.d.ts +7 -0
- package/build-types/radio-group/radio/index.d.ts.map +1 -0
- package/build-types/radio-group/radio-context/index.d.ts +6 -0
- package/build-types/radio-group/radio-context/index.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/input-range.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +2 -2
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/sandbox/types.d.ts +11 -0
- package/build-types/sandbox/types.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +1 -1
- package/build-types/search-control/types.d.ts +1 -1
- package/build-types/search-control/types.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +2 -2
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts +5 -0
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +12 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +4 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/slot-fill/use-slot.d.ts +9 -0
- package/build-types/slot-fill/use-slot.d.ts.map +1 -0
- package/build-types/snackbar/index.d.ts +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +1 -1
- package/build-types/style-provider/test/index.d.ts +2 -0
- package/build-types/style-provider/test/index.d.ts.map +1 -0
- package/build-types/surface/hook.d.ts +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/text/utils.d.ts +18 -18
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toggle-group-control/types.d.ts +1 -1
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +1 -1
- package/build-types/tree-grid/types.d.ts +1 -1
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +1 -1
- package/build-types/ui/context/constants.d.ts +8 -0
- package/build-types/ui/context/constants.d.ts.map +1 -0
- package/build-types/ui/context/context-connect.d.ts +40 -0
- package/build-types/ui/context/context-connect.d.ts.map +1 -0
- package/build-types/ui/context/context-system-provider.d.ts +7 -0
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -0
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +2 -0
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts.map +1 -0
- package/build-types/ui/context/index.d.ts +5 -0
- package/build-types/ui/context/index.d.ts.map +1 -0
- package/build-types/ui/context/test/context-connect.d.ts +2 -0
- package/build-types/ui/context/test/context-connect.d.ts.map +1 -0
- package/build-types/ui/context/test/wordpress-component.d.ts +2 -0
- package/build-types/ui/context/test/wordpress-component.d.ts.map +1 -0
- package/build-types/ui/context/use-context-system.d.ts +20 -0
- package/build-types/ui/context/use-context-system.d.ts.map +1 -0
- package/build-types/ui/context/utils.d.ts +26 -0
- package/build-types/ui/context/utils.d.ts.map +1 -0
- package/build-types/ui/context/wordpress-component.d.ts +32 -0
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -0
- package/build-types/ui/shortcut/component.d.ts +12 -0
- package/build-types/ui/shortcut/component.d.ts.map +1 -0
- package/build-types/ui/shortcut/index.d.ts +3 -0
- package/build-types/ui/shortcut/index.d.ts.map +1 -0
- package/build-types/ui/tooltip/component.d.ts +29 -0
- package/build-types/ui/tooltip/component.d.ts.map +1 -0
- package/build-types/ui/tooltip/content.d.ts +9 -0
- package/build-types/ui/tooltip/content.d.ts.map +1 -0
- package/build-types/ui/tooltip/context.d.ts +10 -0
- package/build-types/ui/tooltip/context.d.ts.map +1 -0
- package/build-types/ui/tooltip/index.d.ts +3 -0
- package/build-types/ui/tooltip/index.d.ts.map +1 -0
- package/build-types/ui/tooltip/styles.d.ts +12 -0
- package/build-types/ui/tooltip/styles.d.ts.map +1 -0
- package/build-types/ui/tooltip/types.d.ts +62 -0
- package/build-types/ui/tooltip/types.d.ts.map +1 -0
- package/build-types/ui/utils/colors.d.ts +17 -0
- package/build-types/ui/utils/colors.d.ts.map +1 -0
- package/build-types/ui/utils/font-size.d.ts +18 -0
- package/build-types/ui/utils/font-size.d.ts.map +1 -0
- package/build-types/ui/utils/get-valid-children.d.ts +13 -0
- package/build-types/ui/utils/get-valid-children.d.ts.map +1 -0
- package/build-types/ui/utils/index.d.ts +2 -0
- package/build-types/ui/utils/index.d.ts.map +1 -0
- package/build-types/ui/utils/space.d.ts +23 -0
- package/build-types/ui/utils/space.d.ts.map +1 -0
- package/build-types/ui/utils/types.d.ts +14 -0
- package/build-types/ui/utils/types.d.ts.map +1 -0
- package/build-types/ui/utils/use-responsive-value.d.ts +5 -0
- package/build-types/ui/utils/use-responsive-value.d.ts.map +1 -0
- package/build-types/utils/hooks/use-latest-ref.d.ts +15 -0
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +1 -0
- package/build-types/utils/hooks/use-update-effect.d.ts +3 -3
- package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
- package/build-types/utils/input/base.d.ts +3 -0
- package/build-types/utils/input/base.d.ts.map +1 -0
- package/build-types/utils/input/index.d.ts +2 -0
- package/build-types/utils/input/index.d.ts.map +1 -0
- package/build-types/utils/input/input-control.d.ts +2 -0
- package/build-types/utils/input/input-control.d.ts.map +1 -0
- package/build-types/utils/reduce-motion.d.ts +8 -0
- package/build-types/utils/reduce-motion.d.ts.map +1 -0
- package/build-types/utils/rtl.d.ts +4 -4
- package/build-types/utils/rtl.d.ts.map +1 -1
- package/build-types/utils/use-responsive-value.d.ts.map +1 -1
- package/build-types/utils/z-index.d.ts +3 -0
- package/build-types/utils/z-index.d.ts.map +1 -0
- package/build-types/v-stack/hook.d.ts +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/build-types/validated-form-controls/test/checkbox-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/checkbox-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/combobox-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/combobox-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/custom-select-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/custom-select-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/form-token-field.d.ts +2 -0
- package/build-types/validated-form-controls/test/form-token-field.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/input-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/input-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/number-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/number-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/radio-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/radio-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/range-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/range-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/select-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/select-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/text-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/text-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/textarea-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/textarea-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/toggle-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/toggle-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/toggle-group-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/toggle-group-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/validity-indicator.d.ts +2 -1
- package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -1
- package/build-types/view/types.d.ts +8 -0
- package/build-types/view/types.d.ts.map +1 -0
- package/package.json +24 -24
- package/src/alignment-matrix-control/test/index.tsx +1 -1
- package/src/angle-picker-control/angle-circle.tsx +6 -5
- package/src/animate/types.ts +1 -1
- package/src/autocomplete/autocompleter-ui.tsx +1 -1
- package/src/autocomplete/index.tsx +33 -8
- package/src/autocomplete/test/index.tsx +110 -1
- package/src/autocomplete/types.ts +1 -1
- package/src/button/style.scss +8 -5
- package/src/calendar/style.scss +4 -2
- package/src/clipboard-button/index.tsx +1 -1
- package/src/color-palette/stories/index.story.tsx +56 -48
- package/src/color-picker/color-copy-button.tsx +1 -3
- package/src/composite/stories/index.story.tsx +1 -1
- package/src/confirm-dialog/component.tsx +2 -2
- package/src/context/context-connect.ts +3 -3
- package/src/context/context-system-provider.js +4 -4
- package/src/context/wordpress-component.ts +3 -5
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +3 -2
- package/src/custom-gradient-picker/types.ts +1 -1
- package/src/custom-select-control-v2/custom-select.tsx +1 -1
- package/src/custom-select-control-v2/stories/index.story.tsx +3 -3
- package/src/custom-select-control-v2/test/index.tsx +3 -3
- package/src/custom-select-control-v2/types.ts +4 -4
- package/src/date-time/date/index.tsx +1 -1
- package/src/date-time/test/utils.test.ts +8 -11
- package/src/date-time/time/index.tsx +2 -12
- package/src/date-time/time/test/index.tsx +69 -0
- package/src/date-time/utils.ts +18 -0
- package/src/draggable/index.native.js +17 -17
- package/src/draggable/types.ts +1 -1
- package/src/drop-zone/types.ts +1 -1
- package/src/dropdown/index.tsx +1 -1
- package/src/dropdown-menu/types.ts +1 -1
- package/src/external-link/index.tsx +5 -1
- package/src/font-size-picker/stories/index.story.tsx +133 -125
- package/src/form-token-field/style.scss +1 -0
- package/src/gradient-picker/stories/index.story.tsx +48 -42
- package/src/h-stack/test/index.tsx +1 -1
- package/src/heading/hook.ts +2 -2
- package/src/higher-order/with-notices/test/index.tsx +2 -2
- package/src/higher-order/with-notices/types.ts +1 -1
- package/src/higher-order/with-spoken-messages/index.tsx +2 -4
- package/src/icon/index.tsx +2 -2
- package/src/keyboard-shortcuts/index.tsx +1 -1
- package/src/menu/stories/index.story.tsx +1 -1
- package/src/menu-item/types.ts +1 -1
- package/src/modal/index.tsx +4 -3
- package/src/modal/types.ts +1 -1
- package/src/modal/use-modal-exit-animation.ts +2 -2
- package/src/navigation/README.md +1 -1
- package/src/navigation/types.ts +1 -1
- package/src/number-control/index.tsx +1 -1
- package/src/palette-edit/index.tsx +2 -2
- package/src/palette-edit/types.ts +1 -1
- package/src/panel/README.md +1 -1
- package/src/panel/body.tsx +1 -1
- package/src/panel/types.ts +2 -2
- package/src/popover/stories/index.story.tsx +1 -1
- package/src/private-apis.ts +0 -2
- package/src/radio-control/test/index.tsx +5 -4
- package/src/range-control/index.tsx +1 -1
- package/src/range-control/types.ts +2 -2
- package/src/resizable-box/index.tsx +1 -1
- package/src/resizable-box/resize-tooltip/index.tsx +1 -1
- package/src/resizable-box/resize-tooltip/label.tsx +1 -1
- package/src/resizable-box/resize-tooltip/utils.ts +2 -2
- package/src/sandbox/index.tsx +190 -10
- package/src/sandbox/test/index.tsx +65 -24
- package/src/sandbox/types.ts +11 -0
- package/src/search-control/types.ts +1 -1
- package/src/select-control/styles/select-control-styles.ts +1 -0
- package/src/slot-fill/types.ts +1 -1
- package/src/snackbar/list.tsx +7 -2
- package/src/tabs/styles.ts +1 -0
- package/src/text/utils.ts +18 -18
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -16
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +1 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +4 -6
- package/src/toggle-group-control/types.ts +1 -1
- package/src/tree-grid/roving-tab-index-item.tsx +1 -1
- package/src/tree-grid/types.ts +1 -1
- package/src/utils/element-rect.ts +1 -1
- package/src/utils/hooks/use-update-effect.js +2 -2
- package/src/utils/rtl.js +4 -4
- package/src/utils/use-responsive-value.ts +1 -5
- package/src/v-stack/test/index.tsx +1 -1
- package/src/validated-form-controls/components/stories/overview.story.tsx +2 -1
- package/src/validated-form-controls/control-with-error.tsx +44 -4
- package/src/validated-form-controls/test/checkbox-control.tsx +49 -0
- package/src/validated-form-controls/test/combobox-control.tsx +61 -0
- package/src/validated-form-controls/test/control-with-error.tsx +182 -1
- package/src/validated-form-controls/test/custom-select-control.tsx +60 -0
- package/src/validated-form-controls/test/form-token-field.tsx +52 -0
- package/src/validated-form-controls/test/input-control.tsx +42 -0
- package/src/validated-form-controls/test/number-control.tsx +44 -0
- package/src/validated-form-controls/test/radio-control.tsx +61 -0
- package/src/validated-form-controls/test/range-control.tsx +73 -0
- package/src/validated-form-controls/test/select-control.tsx +57 -0
- package/src/validated-form-controls/test/text-control.tsx +49 -0
- package/src/validated-form-controls/test/textarea-control.tsx +51 -0
- package/src/validated-form-controls/test/toggle-control.tsx +49 -0
- package/src/validated-form-controls/test/toggle-group-control.tsx +28 -0
- package/src/validated-form-controls/validity-indicator.tsx +3 -0
|
@@ -137,7 +137,6 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
137
137
|
user-select: none;
|
|
138
138
|
width: 100%;
|
|
139
139
|
z-index: 2;
|
|
140
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
141
140
|
height: 38px;
|
|
142
141
|
aspect-ratio: 1;
|
|
143
142
|
padding-left: 0;
|
|
@@ -157,12 +156,13 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
157
156
|
border: 0;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
.emotion-12[disabled]
|
|
159
|
+
.emotion-12[disabled],
|
|
160
|
+
.emotion-12[aria-disabled='true'] {
|
|
161
161
|
opacity: 0.4;
|
|
162
162
|
cursor: default;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.emotion-12:hover {
|
|
165
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
166
166
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -211,7 +211,6 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
211
211
|
user-select: none;
|
|
212
212
|
width: 100%;
|
|
213
213
|
z-index: 2;
|
|
214
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
215
214
|
height: 38px;
|
|
216
215
|
aspect-ratio: 1;
|
|
217
216
|
padding-left: 0;
|
|
@@ -229,12 +228,13 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
229
228
|
border: 0;
|
|
230
229
|
}
|
|
231
230
|
|
|
232
|
-
.emotion-17[disabled]
|
|
231
|
+
.emotion-17[disabled],
|
|
232
|
+
.emotion-17[aria-disabled='true'] {
|
|
233
233
|
opacity: 0.4;
|
|
234
234
|
cursor: default;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
.emotion-17:hover {
|
|
237
|
+
.emotion-17:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
238
238
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -491,12 +491,13 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
491
491
|
border: 0;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
.emotion-12[disabled]
|
|
494
|
+
.emotion-12[disabled],
|
|
495
|
+
.emotion-12[aria-disabled='true'] {
|
|
495
496
|
opacity: 0.4;
|
|
496
497
|
cursor: default;
|
|
497
498
|
}
|
|
498
499
|
|
|
499
|
-
.emotion-12:hover {
|
|
500
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
500
501
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
501
502
|
}
|
|
502
503
|
|
|
@@ -726,7 +727,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
726
727
|
user-select: none;
|
|
727
728
|
width: 100%;
|
|
728
729
|
z-index: 2;
|
|
729
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
730
730
|
height: 38px;
|
|
731
731
|
aspect-ratio: 1;
|
|
732
732
|
padding-left: 0;
|
|
@@ -746,12 +746,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
746
746
|
border: 0;
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
-
.emotion-12[disabled]
|
|
749
|
+
.emotion-12[disabled],
|
|
750
|
+
.emotion-12[aria-disabled='true'] {
|
|
750
751
|
opacity: 0.4;
|
|
751
752
|
cursor: default;
|
|
752
753
|
}
|
|
753
754
|
|
|
754
|
-
.emotion-12:hover {
|
|
755
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
755
756
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
756
757
|
}
|
|
757
758
|
|
|
@@ -800,7 +801,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
800
801
|
user-select: none;
|
|
801
802
|
width: 100%;
|
|
802
803
|
z-index: 2;
|
|
803
|
-
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
804
804
|
height: 38px;
|
|
805
805
|
aspect-ratio: 1;
|
|
806
806
|
padding-left: 0;
|
|
@@ -818,12 +818,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
818
818
|
border: 0;
|
|
819
819
|
}
|
|
820
820
|
|
|
821
|
-
.emotion-17[disabled]
|
|
821
|
+
.emotion-17[disabled],
|
|
822
|
+
.emotion-17[aria-disabled='true'] {
|
|
822
823
|
opacity: 0.4;
|
|
823
824
|
cursor: default;
|
|
824
825
|
}
|
|
825
826
|
|
|
826
|
-
.emotion-17:hover {
|
|
827
|
+
.emotion-17:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
827
828
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
828
829
|
}
|
|
829
830
|
|
|
@@ -1074,12 +1075,13 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1074
1075
|
border: 0;
|
|
1075
1076
|
}
|
|
1076
1077
|
|
|
1077
|
-
.emotion-12[disabled]
|
|
1078
|
+
.emotion-12[disabled],
|
|
1079
|
+
.emotion-12[aria-disabled='true'] {
|
|
1078
1080
|
opacity: 0.4;
|
|
1079
1081
|
cursor: default;
|
|
1080
1082
|
}
|
|
1081
1083
|
|
|
1082
|
-
.emotion-12:hover {
|
|
1084
|
+
.emotion-12:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
1083
1085
|
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
1084
1086
|
}
|
|
1085
1087
|
|
|
@@ -114,7 +114,7 @@ function ToggleGroupControlOptionBase(
|
|
|
114
114
|
ref: forwardedRef,
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const labelRef = useRef< HTMLDivElement
|
|
117
|
+
const labelRef = useRef< HTMLDivElement >( null );
|
|
118
118
|
useLayoutEffect( () => {
|
|
119
119
|
if ( isPressed && labelRef.current ) {
|
|
120
120
|
toggleGroupControlContext.setSelectedElement( labelRef.current );
|
|
@@ -63,13 +63,14 @@ export const buttonView = ( {
|
|
|
63
63
|
border: 0;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
&[disabled]
|
|
66
|
+
&[disabled],
|
|
67
|
+
&[aria-disabled='true'] {
|
|
67
68
|
opacity: 0.4;
|
|
68
69
|
cursor: default;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
&:hover {
|
|
72
|
-
color: ${ COLORS.theme.
|
|
72
|
+
&:hover:not( [disabled] ):not( [aria-disabled='true'] ) {
|
|
73
|
+
color: ${ COLORS.theme.foreground };
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
${ isDeselectable && deselectable }
|
|
@@ -83,8 +84,6 @@ const pressed = css`
|
|
|
83
84
|
`;
|
|
84
85
|
|
|
85
86
|
const deselectable = css`
|
|
86
|
-
color: ${ COLORS.theme.foreground };
|
|
87
|
-
|
|
88
87
|
&:focus {
|
|
89
88
|
outline: ${ CONFIG.borderWidthFocus } solid ${ COLORS.ui.borderFocus };
|
|
90
89
|
outline-offset: 2px;
|
|
@@ -112,7 +111,6 @@ const isIconStyles = ( {
|
|
|
112
111
|
};
|
|
113
112
|
|
|
114
113
|
return css`
|
|
115
|
-
color: ${ COLORS.theme.foreground };
|
|
116
114
|
height: ${ iconButtonSizes[ size ] };
|
|
117
115
|
aspect-ratio: 1;
|
|
118
116
|
padding-left: 0;
|
|
@@ -35,7 +35,7 @@ export type ToggleGroupControlOptionIconProps = Pick<
|
|
|
35
35
|
* Icon displayed as the content of the option. Usually one of the icons from
|
|
36
36
|
* the `@wordpress/icons` package, or a custom React `<svg>` icon.
|
|
37
37
|
*/
|
|
38
|
-
icon: JSX.Element;
|
|
38
|
+
icon: React.JSX.Element;
|
|
39
39
|
/**
|
|
40
40
|
* The text to accessibly label the icon option. Will also be shown in a tooltip.
|
|
41
41
|
*/
|
|
@@ -14,7 +14,7 @@ export const RovingTabIndexItem = forwardRef(
|
|
|
14
14
|
{ children, as: Component, ...props }: RovingTabIndexItemProps,
|
|
15
15
|
forwardedRef: React.ForwardedRef< any >
|
|
16
16
|
) {
|
|
17
|
-
const localRef = useRef< any >();
|
|
17
|
+
const localRef = useRef< any >( null );
|
|
18
18
|
const ref = forwardedRef || localRef;
|
|
19
19
|
// @ts-expect-error - We actually want to throw an error if this is undefined.
|
|
20
20
|
const { lastFocusedElement, setLastFocusedElement } =
|
package/src/tree-grid/types.ts
CHANGED
|
@@ -61,7 +61,7 @@ export type RovingTabIndexItemProps = {
|
|
|
61
61
|
* </TreeGridCell>
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
children?: ( props: RovingTabIndexItemPassThruProps ) => JSX.Element;
|
|
64
|
+
children?: ( props: RovingTabIndexItemPassThruProps ) => React.JSX.Element;
|
|
65
65
|
/**
|
|
66
66
|
* If `children` is not a function, this component will be used instead.
|
|
67
67
|
*/
|
|
@@ -139,7 +139,7 @@ export function useTrackElementOffsetRect(
|
|
|
139
139
|
) {
|
|
140
140
|
const [ indicatorPosition, setIndicatorPosition ] =
|
|
141
141
|
useState< ElementOffsetRect >( NULL_ELEMENT_OFFSET_RECT );
|
|
142
|
-
const intervalRef = useRef< ReturnType< typeof setInterval > >();
|
|
142
|
+
const intervalRef = useRef< ReturnType< typeof setInterval > >( undefined );
|
|
143
143
|
|
|
144
144
|
const measure = useEvent( () => {
|
|
145
145
|
// Check that the targetElement is still attached to the DOM, in case
|
|
@@ -8,8 +8,8 @@ import { useRef, useEffect } from '@wordpress/element';
|
|
|
8
8
|
* Source:
|
|
9
9
|
* https://github.com/ariakit/ariakit/blob/main/packages/ariakit-react-core/src/utils/hooks.ts
|
|
10
10
|
*
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {
|
|
11
|
+
* @param {React.EffectCallback} effect
|
|
12
|
+
* @param {React.DependencyList} deps
|
|
13
13
|
*/
|
|
14
14
|
function useUpdateEffect( effect, deps ) {
|
|
15
15
|
const mountedRef = useRef( false );
|
package/src/utils/rtl.js
CHANGED
|
@@ -51,9 +51,9 @@ function getConvertedKey( key ) {
|
|
|
51
51
|
/**
|
|
52
52
|
* An incredibly basic ltr -> rtl converter for style properties
|
|
53
53
|
*
|
|
54
|
-
* @param {
|
|
54
|
+
* @param {React.CSSProperties} ltrStyles
|
|
55
55
|
*
|
|
56
|
-
* @return {
|
|
56
|
+
* @return {React.CSSProperties} Converted ltr -> rtl styles
|
|
57
57
|
*/
|
|
58
58
|
export const convertLTRToRTL = ( ltrStyles = {} ) => {
|
|
59
59
|
return Object.fromEntries(
|
|
@@ -67,8 +67,8 @@ export const convertLTRToRTL = ( ltrStyles = {} ) => {
|
|
|
67
67
|
/**
|
|
68
68
|
* A higher-order function that create an incredibly basic ltr -> rtl style converter for CSS objects.
|
|
69
69
|
*
|
|
70
|
-
* @param {
|
|
71
|
-
* @param {
|
|
70
|
+
* @param {React.CSSProperties} ltrStyles Ltr styles. Converts and renders from ltr -> rtl styles, if applicable.
|
|
71
|
+
* @param {React.CSSProperties} [rtlStyles] Rtl styles. Renders if provided.
|
|
72
72
|
*
|
|
73
73
|
* @return {() => import('@emotion/react').SerializedStyles} A function to output CSS styles for Emotion's renderer
|
|
74
74
|
*/
|
|
@@ -66,9 +66,5 @@ export function useResponsiveValue< T >(
|
|
|
66
66
|
|
|
67
67
|
const array = values || [];
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
return /** @type {T[]} */ array[
|
|
71
|
-
/* eslint-enable jsdoc/no-undefined-types */
|
|
72
|
-
index >= array.length ? array.length - 1 : index
|
|
73
|
-
];
|
|
69
|
+
return array[ index >= array.length ? array.length - 1 : index ];
|
|
74
70
|
}
|
|
@@ -41,7 +41,7 @@ describe( 'props', () => {
|
|
|
41
41
|
} );
|
|
42
42
|
|
|
43
43
|
test( 'should not pass through invalid props to the `as` component', () => {
|
|
44
|
-
const AsComponent = ( props: JSX.IntrinsicElements[ 'div' ] ) => {
|
|
44
|
+
const AsComponent = ( props: React.JSX.IntrinsicElements[ 'div' ] ) => {
|
|
45
45
|
return <div { ...props } />;
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -149,7 +149,8 @@ export const AsyncValidation: StoryObj< typeof ValidatedInputControl > = {
|
|
|
149
149
|
>[ 'customValidity' ]
|
|
150
150
|
>( undefined );
|
|
151
151
|
|
|
152
|
-
const timeoutRef =
|
|
152
|
+
const timeoutRef =
|
|
153
|
+
useRef< ReturnType< typeof setTimeout > >( undefined );
|
|
153
154
|
|
|
154
155
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
156
|
const debouncedValidate = useCallback(
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
cloneElement,
|
|
7
7
|
forwardRef,
|
|
8
8
|
useEffect,
|
|
9
|
+
useId,
|
|
9
10
|
useState,
|
|
10
11
|
} from '@wordpress/element';
|
|
11
12
|
|
|
@@ -238,22 +239,61 @@ function UnforwardedControlWithError< C extends React.ReactElement >(
|
|
|
238
239
|
}
|
|
239
240
|
};
|
|
240
241
|
|
|
241
|
-
const
|
|
242
|
+
const messageId = useId();
|
|
243
|
+
|
|
244
|
+
const message = ( () => {
|
|
242
245
|
if ( errorMessage ) {
|
|
243
246
|
return (
|
|
244
|
-
<ValidityIndicator
|
|
247
|
+
<ValidityIndicator
|
|
248
|
+
id={ messageId }
|
|
249
|
+
type="invalid"
|
|
250
|
+
message={ errorMessage }
|
|
251
|
+
/>
|
|
245
252
|
);
|
|
246
253
|
}
|
|
247
254
|
if ( statusMessage?.type ) {
|
|
248
255
|
return (
|
|
249
256
|
<ValidityIndicator
|
|
257
|
+
id={ messageId }
|
|
250
258
|
type={ statusMessage.type }
|
|
251
259
|
message={ statusMessage.message }
|
|
252
260
|
/>
|
|
253
261
|
);
|
|
254
262
|
}
|
|
255
263
|
return null;
|
|
256
|
-
};
|
|
264
|
+
} )();
|
|
265
|
+
|
|
266
|
+
const visibleMessage = showMessage ? message : null;
|
|
267
|
+
|
|
268
|
+
// Imperatively manage `aria-describedby` on the validity target so we
|
|
269
|
+
// merge with any value the child control sets internally (e.g. from a
|
|
270
|
+
// `help` prop), rather than competing with it at the props level.
|
|
271
|
+
useEffect( () => {
|
|
272
|
+
const target = getValidityTarget();
|
|
273
|
+
if ( ! target ) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function setDescribedBy( el: Element, shouldAdd: boolean ) {
|
|
278
|
+
const ids = ( el.getAttribute( 'aria-describedby' ) ?? '' )
|
|
279
|
+
.split( ' ' )
|
|
280
|
+
.filter( ( id ) => id && id !== messageId );
|
|
281
|
+
|
|
282
|
+
if ( shouldAdd ) {
|
|
283
|
+
ids.push( messageId );
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if ( ids.length ) {
|
|
287
|
+
el.setAttribute( 'aria-describedby', ids.join( ' ' ) );
|
|
288
|
+
} else {
|
|
289
|
+
el.removeAttribute( 'aria-describedby' );
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
setDescribedBy( target, !! visibleMessage );
|
|
294
|
+
|
|
295
|
+
return () => setDescribedBy( target, false );
|
|
296
|
+
}, [ visibleMessage, messageId, getValidityTarget ] );
|
|
257
297
|
|
|
258
298
|
return (
|
|
259
299
|
<div className={ className } ref={ forwardedRef } onBlur={ onBlur }>
|
|
@@ -265,7 +305,7 @@ function UnforwardedControlWithError< C extends React.ReactElement >(
|
|
|
265
305
|
),
|
|
266
306
|
required,
|
|
267
307
|
} ) }
|
|
268
|
-
<div aria-live="polite">{
|
|
308
|
+
<div aria-live="polite">{ visibleMessage }</div>
|
|
269
309
|
</div>
|
|
270
310
|
);
|
|
271
311
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { ValidatedCheckboxControl } from '../components';
|
|
4
|
+
|
|
5
|
+
describe( 'ValidatedCheckboxControl', () => {
|
|
6
|
+
it( 'should preserve the help description', () => {
|
|
7
|
+
render(
|
|
8
|
+
<ValidatedCheckboxControl
|
|
9
|
+
label="Agree"
|
|
10
|
+
help="You must agree to continue."
|
|
11
|
+
onChange={ () => {} }
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(
|
|
16
|
+
screen.getByRole( 'checkbox', { name: 'Agree' } )
|
|
17
|
+
).toHaveAccessibleDescription( 'You must agree to continue.' );
|
|
18
|
+
} );
|
|
19
|
+
|
|
20
|
+
it( 'should append the validation error alongside the help description', async () => {
|
|
21
|
+
const user = userEvent.setup();
|
|
22
|
+
render(
|
|
23
|
+
<form>
|
|
24
|
+
<ValidatedCheckboxControl
|
|
25
|
+
label="Agree"
|
|
26
|
+
help="You must agree to continue."
|
|
27
|
+
onChange={ () => {} }
|
|
28
|
+
required
|
|
29
|
+
/>
|
|
30
|
+
<button type="submit">Submit</button>
|
|
31
|
+
</form>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const checkbox = screen.getByRole( 'checkbox', {
|
|
35
|
+
name: /^Agree/,
|
|
36
|
+
} );
|
|
37
|
+
|
|
38
|
+
await user.click( screen.getByRole( 'button', { name: 'Submit' } ) );
|
|
39
|
+
|
|
40
|
+
await waitFor( () => {
|
|
41
|
+
expect( checkbox ).toHaveAccessibleDescription(
|
|
42
|
+
expect.stringContaining( 'Constraints not satisfied' )
|
|
43
|
+
);
|
|
44
|
+
} );
|
|
45
|
+
expect( checkbox ).toHaveAccessibleDescription(
|
|
46
|
+
expect.stringContaining( 'You must agree to continue.' )
|
|
47
|
+
);
|
|
48
|
+
} );
|
|
49
|
+
} );
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { ValidatedComboboxControl } from '../components';
|
|
4
|
+
|
|
5
|
+
// The `help` prop is rendered visually by BaseControl but is not
|
|
6
|
+
// programmatically associated with the combobox input via aria-describedby.
|
|
7
|
+
// This is a pre-existing bug in ComboboxControl, not caused by ControlWithError.
|
|
8
|
+
describe( 'ValidatedComboboxControl', () => {
|
|
9
|
+
const options = [
|
|
10
|
+
{ label: 'Apple', value: 'apple' },
|
|
11
|
+
{ label: 'Banana', value: 'banana' },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line jest/no-disabled-tests
|
|
15
|
+
it.skip( 'should preserve the help description', () => {
|
|
16
|
+
render(
|
|
17
|
+
<ValidatedComboboxControl
|
|
18
|
+
label="Fruit"
|
|
19
|
+
help="Pick a fruit."
|
|
20
|
+
options={ options }
|
|
21
|
+
onChange={ () => {} }
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
expect(
|
|
26
|
+
screen.getByRole( 'combobox', { name: 'Fruit' } )
|
|
27
|
+
).toHaveAccessibleDescription( 'Pick a fruit.' );
|
|
28
|
+
} );
|
|
29
|
+
|
|
30
|
+
// eslint-disable-next-line jest/no-disabled-tests
|
|
31
|
+
it.skip( 'should append the validation error alongside the help description', async () => {
|
|
32
|
+
const user = userEvent.setup();
|
|
33
|
+
render(
|
|
34
|
+
<form>
|
|
35
|
+
<ValidatedComboboxControl
|
|
36
|
+
label="Fruit"
|
|
37
|
+
help="Pick a fruit."
|
|
38
|
+
options={ options }
|
|
39
|
+
onChange={ () => {} }
|
|
40
|
+
required
|
|
41
|
+
/>
|
|
42
|
+
<button type="submit">Submit</button>
|
|
43
|
+
</form>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const combobox = screen.getByRole( 'combobox', {
|
|
47
|
+
name: /^Fruit/,
|
|
48
|
+
} );
|
|
49
|
+
|
|
50
|
+
await user.click( screen.getByRole( 'button', { name: 'Submit' } ) );
|
|
51
|
+
|
|
52
|
+
await waitFor( () => {
|
|
53
|
+
expect( combobox ).toHaveAccessibleDescription(
|
|
54
|
+
expect.stringContaining( 'Constraints not satisfied' )
|
|
55
|
+
);
|
|
56
|
+
} );
|
|
57
|
+
expect( combobox ).toHaveAccessibleDescription(
|
|
58
|
+
expect.stringContaining( 'Pick a fruit.' )
|
|
59
|
+
);
|
|
60
|
+
} );
|
|
61
|
+
} );
|
|
@@ -7,7 +7,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { useState, useCallback, useRef } from '@wordpress/element';
|
|
10
|
+
import { useState, useCallback, useId, useRef } from '@wordpress/element';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
@@ -283,6 +283,187 @@ describe( 'ControlWithError', () => {
|
|
|
283
283
|
} );
|
|
284
284
|
} );
|
|
285
285
|
|
|
286
|
+
describe( 'aria-describedby', () => {
|
|
287
|
+
it( 'should connect the error message to the input via aria-describedby', async () => {
|
|
288
|
+
const user = userEvent.setup();
|
|
289
|
+
render(
|
|
290
|
+
<form>
|
|
291
|
+
<ValidatedInputControl label="URL" required />
|
|
292
|
+
<button type="submit">Submit</button>
|
|
293
|
+
</form>
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
const input = screen.getByRole( 'textbox', { name: /^URL/ } );
|
|
297
|
+
|
|
298
|
+
expect( input ).not.toHaveAttribute( 'aria-describedby' );
|
|
299
|
+
|
|
300
|
+
await user.click(
|
|
301
|
+
screen.getByRole( 'button', { name: 'Submit' } )
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
await waitFor( () => {
|
|
305
|
+
expect( input ).toHaveAccessibleDescription(
|
|
306
|
+
expect.stringContaining( 'Constraints not satisfied' )
|
|
307
|
+
);
|
|
308
|
+
} );
|
|
309
|
+
} );
|
|
310
|
+
|
|
311
|
+
it( 'should preserve existing aria-describedby values', async () => {
|
|
312
|
+
const user = userEvent.setup();
|
|
313
|
+
|
|
314
|
+
function TestComponent() {
|
|
315
|
+
const hintId = useId();
|
|
316
|
+
return (
|
|
317
|
+
<form>
|
|
318
|
+
<ValidatedInputControl
|
|
319
|
+
label="URL"
|
|
320
|
+
required
|
|
321
|
+
aria-describedby={ hintId }
|
|
322
|
+
/>
|
|
323
|
+
<p id={ hintId }>Enter a full URL.</p>
|
|
324
|
+
<button type="submit">Submit</button>
|
|
325
|
+
</form>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
render( <TestComponent /> );
|
|
330
|
+
|
|
331
|
+
const input = screen.getByRole( 'textbox', { name: /^URL/ } );
|
|
332
|
+
|
|
333
|
+
expect( input ).toHaveAccessibleDescription( 'Enter a full URL.' );
|
|
334
|
+
|
|
335
|
+
await user.click(
|
|
336
|
+
screen.getByRole( 'button', { name: 'Submit' } )
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
await waitFor( () => {
|
|
340
|
+
expect( input ).toHaveAccessibleDescription(
|
|
341
|
+
expect.stringContaining( 'Constraints not satisfied' )
|
|
342
|
+
);
|
|
343
|
+
} );
|
|
344
|
+
expect( input ).toHaveAccessibleDescription(
|
|
345
|
+
expect.stringContaining( 'Enter a full URL.' )
|
|
346
|
+
);
|
|
347
|
+
} );
|
|
348
|
+
|
|
349
|
+
it( 'should connect a custom validity error to the input via aria-describedby', async () => {
|
|
350
|
+
const user = userEvent.setup();
|
|
351
|
+
|
|
352
|
+
function TestComponent() {
|
|
353
|
+
const [ customValidity, setCustomValidity ] =
|
|
354
|
+
useState<
|
|
355
|
+
React.ComponentProps<
|
|
356
|
+
typeof ValidatedInputControl
|
|
357
|
+
>[ 'customValidity' ]
|
|
358
|
+
>( undefined );
|
|
359
|
+
const inputRef = useRef< HTMLInputElement >( null );
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<>
|
|
363
|
+
<ValidatedInputControl
|
|
364
|
+
ref={ inputRef }
|
|
365
|
+
label="URL"
|
|
366
|
+
customValidity={ customValidity }
|
|
367
|
+
/>
|
|
368
|
+
<button
|
|
369
|
+
type="button"
|
|
370
|
+
onClick={ () => {
|
|
371
|
+
setCustomValidity( {
|
|
372
|
+
type: 'invalid',
|
|
373
|
+
message: 'Please enter a valid URL.',
|
|
374
|
+
} );
|
|
375
|
+
requestAnimationFrame(
|
|
376
|
+
() => inputRef.current?.reportValidity()
|
|
377
|
+
);
|
|
378
|
+
} }
|
|
379
|
+
>
|
|
380
|
+
Validate
|
|
381
|
+
</button>
|
|
382
|
+
</>
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
render( <TestComponent /> );
|
|
387
|
+
|
|
388
|
+
const input = screen.getByRole( 'textbox', { name: 'URL' } );
|
|
389
|
+
expect( input ).not.toHaveAttribute( 'aria-describedby' );
|
|
390
|
+
|
|
391
|
+
await user.click(
|
|
392
|
+
screen.getByRole( 'button', { name: 'Validate' } )
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
await waitFor( () => {
|
|
396
|
+
expect( input ).toHaveAccessibleDescription(
|
|
397
|
+
expect.stringContaining( 'Please enter a valid URL.' )
|
|
398
|
+
);
|
|
399
|
+
} );
|
|
400
|
+
} );
|
|
401
|
+
|
|
402
|
+
it( 'should remove aria-describedby when the error is resolved', async () => {
|
|
403
|
+
const user = userEvent.setup();
|
|
404
|
+
|
|
405
|
+
function TestComponent() {
|
|
406
|
+
const [ customValidity, setCustomValidity ] =
|
|
407
|
+
useState<
|
|
408
|
+
React.ComponentProps<
|
|
409
|
+
typeof ValidatedInputControl
|
|
410
|
+
>[ 'customValidity' ]
|
|
411
|
+
>( undefined );
|
|
412
|
+
const inputRef = useRef< HTMLInputElement >( null );
|
|
413
|
+
|
|
414
|
+
return (
|
|
415
|
+
<>
|
|
416
|
+
<ValidatedInputControl
|
|
417
|
+
ref={ inputRef }
|
|
418
|
+
label="URL"
|
|
419
|
+
customValidity={ customValidity }
|
|
420
|
+
/>
|
|
421
|
+
<button
|
|
422
|
+
type="button"
|
|
423
|
+
onClick={ () => {
|
|
424
|
+
setCustomValidity( {
|
|
425
|
+
type: 'invalid',
|
|
426
|
+
message: 'Please enter a valid URL.',
|
|
427
|
+
} );
|
|
428
|
+
requestAnimationFrame(
|
|
429
|
+
() => inputRef.current?.reportValidity()
|
|
430
|
+
);
|
|
431
|
+
} }
|
|
432
|
+
>
|
|
433
|
+
Validate
|
|
434
|
+
</button>
|
|
435
|
+
<button
|
|
436
|
+
type="button"
|
|
437
|
+
onClick={ () => setCustomValidity( undefined ) }
|
|
438
|
+
>
|
|
439
|
+
Clear
|
|
440
|
+
</button>
|
|
441
|
+
</>
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
render( <TestComponent /> );
|
|
446
|
+
|
|
447
|
+
const input = screen.getByRole( 'textbox', { name: 'URL' } );
|
|
448
|
+
|
|
449
|
+
await user.click(
|
|
450
|
+
screen.getByRole( 'button', { name: 'Validate' } )
|
|
451
|
+
);
|
|
452
|
+
|
|
453
|
+
await waitFor( () => {
|
|
454
|
+
expect( input ).toHaveAccessibleDescription(
|
|
455
|
+
expect.stringContaining( 'Please enter a valid URL.' )
|
|
456
|
+
);
|
|
457
|
+
} );
|
|
458
|
+
|
|
459
|
+
await user.click( screen.getByRole( 'button', { name: 'Clear' } ) );
|
|
460
|
+
|
|
461
|
+
await waitFor( () => {
|
|
462
|
+
expect( input ).not.toHaveAttribute( 'aria-describedby' );
|
|
463
|
+
} );
|
|
464
|
+
} );
|
|
465
|
+
} );
|
|
466
|
+
|
|
286
467
|
describe( 'Focus behavior', () => {
|
|
287
468
|
it( 'should focus the first error in the form', async () => {
|
|
288
469
|
const user = userEvent.setup();
|