@wordpress/components 32.5.2-next.v.202604091042.0 → 33.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/build/alignment-matrix-control/cell.cjs +3 -3
- package/build/alignment-matrix-control/cell.cjs.map +2 -2
- package/build/alignment-matrix-control/index.cjs +3 -3
- package/build/alignment-matrix-control/index.cjs.map +2 -2
- package/build/autocomplete/get-autocomplete-match.cjs +11 -2
- package/build/autocomplete/get-autocomplete-match.cjs.map +2 -2
- package/build/autocomplete/index.cjs +42 -11
- package/build/autocomplete/index.cjs.map +2 -2
- package/build/custom-gradient-picker/index.cjs.map +2 -2
- package/build/date-time/{date → date-picker}/index.cjs +6 -6
- package/build/date-time/{date → date-picker}/index.cjs.map +2 -2
- package/build/date-time/{date → date-picker}/styles.cjs +17 -17
- package/build/date-time/{date → date-picker}/styles.cjs.map +2 -2
- package/build/date-time/{date → date-picker}/use-lilius/index.cjs +1 -1
- package/build/date-time/{date → date-picker}/use-lilius/index.cjs.map +1 -1
- package/build/date-time/date-time/index.cjs +6 -6
- package/build/date-time/date-time/index.cjs.map +2 -2
- package/build/date-time/index.cjs +4 -4
- package/build/date-time/index.cjs.map +2 -2
- package/build/date-time/{time → time-picker}/index.cjs +6 -6
- package/build/date-time/time-picker/index.cjs.map +7 -0
- package/build/date-time/{time → time-picker}/styles.cjs +21 -21
- package/build/date-time/{time → time-picker}/styles.cjs.map +2 -2
- package/build/date-time/{time → time-picker}/time-input/index.cjs +1 -1
- package/build/date-time/{time → time-picker}/time-input/index.cjs.map +1 -1
- package/build/date-time/{time → time-picker}/timezone.cjs +1 -1
- package/build/date-time/{time → time-picker}/timezone.cjs.map +1 -1
- package/build/external-link/index.cjs +1 -1
- package/build/external-link/index.cjs.map +2 -2
- package/build/form-token-field/index.cjs +22 -6
- package/build/form-token-field/index.cjs.map +3 -3
- package/build/form-token-field/token-input.cjs +1 -1
- package/build/form-token-field/token-input.cjs.map +2 -2
- package/build/menu/popover.cjs +7 -3
- package/build/menu/popover.cjs.map +2 -2
- package/build/menu/styles.cjs +39 -16
- package/build/menu/styles.cjs.map +2 -2
- package/build/modal/index.cjs.map +2 -2
- package/build/navigable-container/container.cjs +72 -110
- package/build/navigable-container/container.cjs.map +2 -2
- package/build/palette-edit/index.cjs.map +2 -2
- package/build/radio-control/index.cjs +2 -0
- package/build/radio-control/index.cjs.map +2 -2
- package/build/sandbox/index.cjs +125 -1
- package/build/sandbox/index.cjs.map +2 -2
- package/build/textarea-control/styles/textarea-control-styles.cjs +3 -3
- package/build/textarea-control/styles/textarea-control-styles.cjs.map +2 -2
- package/build/utils/breakpoint.cjs.map +1 -1
- package/build/utils/font.cjs.map +1 -1
- package/build/visually-hidden/component.cjs +1 -0
- package/build/visually-hidden/component.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +3 -3
- package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
- package/build-module/alignment-matrix-control/index.mjs +3 -3
- package/build-module/alignment-matrix-control/index.mjs.map +2 -2
- package/build-module/autocomplete/get-autocomplete-match.mjs +11 -2
- package/build-module/autocomplete/get-autocomplete-match.mjs.map +2 -2
- package/build-module/autocomplete/index.mjs +42 -11
- package/build-module/autocomplete/index.mjs.map +2 -2
- package/build-module/custom-gradient-picker/index.mjs.map +2 -2
- package/build-module/date-time/{date → date-picker}/index.mjs +3 -3
- package/build-module/date-time/{date → date-picker}/index.mjs.map +2 -2
- package/build-module/date-time/{date → date-picker}/styles.mjs +17 -17
- package/build-module/date-time/{date → date-picker}/styles.mjs.map +2 -2
- package/build-module/date-time/{date → date-picker}/use-lilius/index.mjs +1 -1
- package/build-module/date-time/{date → date-picker}/use-lilius/index.mjs.map +1 -1
- package/build-module/date-time/date-time/index.mjs +2 -2
- package/build-module/date-time/date-time/index.mjs.map +1 -1
- package/build-module/date-time/index.mjs +2 -2
- package/build-module/date-time/index.mjs.map +1 -1
- package/build-module/date-time/{time → time-picker}/index.mjs +3 -3
- package/build-module/date-time/time-picker/index.mjs.map +7 -0
- package/build-module/date-time/{time → time-picker}/styles.mjs +21 -21
- package/build-module/date-time/{time → time-picker}/styles.mjs.map +2 -2
- package/build-module/date-time/{time → time-picker}/time-input/index.mjs +1 -1
- package/build-module/date-time/{time → time-picker}/time-input/index.mjs.map +1 -1
- package/build-module/date-time/{time → time-picker}/timezone.mjs +1 -1
- package/build-module/date-time/{time → time-picker}/timezone.mjs.map +1 -1
- package/build-module/external-link/index.mjs +1 -1
- package/build-module/external-link/index.mjs.map +2 -2
- package/build-module/form-token-field/index.mjs +22 -6
- package/build-module/form-token-field/index.mjs.map +2 -2
- package/build-module/form-token-field/token-input.mjs +1 -1
- package/build-module/form-token-field/token-input.mjs.map +2 -2
- package/build-module/menu/popover.mjs +7 -3
- package/build-module/menu/popover.mjs.map +2 -2
- package/build-module/menu/styles.mjs +37 -16
- package/build-module/menu/styles.mjs.map +2 -2
- package/build-module/modal/index.mjs.map +2 -2
- package/build-module/navigable-container/container.mjs +73 -111
- package/build-module/navigable-container/container.mjs.map +2 -2
- package/build-module/palette-edit/index.mjs.map +2 -2
- package/build-module/radio-control/index.mjs +2 -0
- package/build-module/radio-control/index.mjs.map +2 -2
- package/build-module/sandbox/index.mjs +126 -2
- package/build-module/sandbox/index.mjs.map +2 -2
- package/build-module/textarea-control/styles/textarea-control-styles.mjs +3 -3
- package/build-module/textarea-control/styles/textarea-control-styles.mjs.map +2 -2
- package/build-module/utils/breakpoint.mjs.map +1 -1
- package/build-module/utils/font.mjs.map +1 -1
- package/build-module/visually-hidden/component.mjs +1 -0
- package/build-module/visually-hidden/component.mjs.map +2 -2
- package/build-style/style-rtl.css +109 -25
- package/build-style/style.css +109 -25
- package/build-types/autocomplete/get-autocomplete-match.d.ts +10 -1
- package/build-types/autocomplete/get-autocomplete-match.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts +0 -6
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/checkbox-control/types.d.ts +4 -0
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date-picker/index.d.ts.map +1 -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.map +1 -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.map +1 -0
- package/build-types/date-time/date-time/index.d.ts +2 -2
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/index.d.ts +2 -2
- package/build-types/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/date.story.d.ts +1 -1
- package/build-types/date-time/stories/date.story.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/{time → time-picker}/index.d.ts +1 -1
- package/build-types/date-time/time-picker/index.d.ts.map +1 -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.map +1 -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.map +1 -0
- package/build-types/date-time/time-picker/timezone.d.ts.map +1 -0
- package/build-types/date-time/types.d.ts +1 -1
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/external-link/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +16 -2
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/popover.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts +16 -1
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +3 -8
- package/build-types/navigable-container/container.d.ts.map +1 -1
- package/build-types/navigable-container/types.d.ts +1 -5
- package/build-types/navigable-container/types.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-control/types.d.ts +6 -0
- package/build-types/radio-control/types.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.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/stories/index.story.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/scroll-lock/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/spinner/stories/index.story.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/utils/breakpoint.d.ts +2 -1
- package/build-types/utils/breakpoint.d.ts.map +1 -1
- package/build-types/utils/font.d.ts +3 -2
- package/build-types/utils/font.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts +2 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts +2 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
- package/build-types/visually-hidden/component.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts +0 -6
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/alignment-matrix-control/style.module.scss +1 -1
- package/src/autocomplete/get-autocomplete-match.ts +25 -4
- package/src/autocomplete/index.tsx +69 -21
- package/src/autocomplete/test/get-autocomplete-match.ts +97 -75
- package/src/base-control/stories/index.story.tsx +1 -0
- package/src/button/stories/index.story.tsx +1 -0
- package/src/button/style.scss +1 -1
- package/src/button-group/style.scss +1 -2
- package/src/calendar/style.scss +3 -3
- package/src/card/stories/index.story.tsx +2 -9
- package/src/checkbox-control/stories/index.story.tsx +1 -0
- package/src/checkbox-control/style.scss +17 -5
- package/src/checkbox-control/types.ts +4 -0
- package/src/circular-option-picker/style.scss +9 -7
- package/src/color-indicator/stories/index.story.tsx +1 -0
- package/src/color-palette/stories/index.story.tsx +1 -0
- package/src/color-palette/style.scss +1 -1
- package/src/color-picker/stories/index.story.tsx +1 -0
- package/src/combobox-control/stories/index.story.tsx +1 -0
- package/src/composite/stories/index.story.tsx +1 -0
- package/src/confirm-dialog/stories/index.story.tsx +1 -1
- package/src/css.d.ts +1 -0
- package/src/custom-gradient-picker/index.tsx +1 -0
- package/src/custom-select-control/stories/index.story.tsx +1 -0
- package/src/date-time/README.md +3 -3
- package/src/date-time/date-picker/README.md +65 -0
- package/src/date-time/date-time/index.tsx +2 -2
- package/src/date-time/index.ts +2 -2
- package/src/date-time/stories/date.story.tsx +1 -1
- package/src/date-time/stories/time.story.tsx +1 -1
- package/src/date-time/time-picker/README.md +119 -0
- package/src/date-time/{time → time-picker}/index.tsx +1 -1
- package/src/date-time/types.ts +1 -1
- package/src/disabled/stories/index.story.tsx +1 -0
- package/src/drop-zone/stories/index.story.tsx +1 -0
- package/src/dropdown/stories/index.story.tsx +1 -0
- package/src/dropdown-menu/style.scss +1 -1
- package/src/external-link/index.tsx +1 -6
- package/src/external-link/stories/index.story.tsx +2 -1
- package/src/external-link/style.scss +30 -2
- package/src/form-file-upload/stories/index.story.tsx +1 -0
- package/src/form-toggle/stories/index.story.tsx +1 -0
- package/src/form-toggle/style.scss +38 -4
- package/src/form-token-field/README.md +2 -1
- package/src/form-token-field/index.tsx +39 -9
- package/src/form-token-field/stories/index.story.tsx +2 -0
- package/src/form-token-field/style.scss +12 -3
- package/src/form-token-field/test/index.tsx +70 -10
- package/src/form-token-field/token-input.tsx +1 -6
- package/src/form-token-field/types.ts +16 -2
- package/src/gradient-picker/stories/index.story.tsx +1 -0
- package/src/icon/stories/index.story.tsx +1 -0
- package/src/input-control/stories/index.story.tsx +1 -1
- package/src/item-group/stories/index.story.tsx +1 -1
- package/src/keyboard-shortcuts/stories/index.story.tsx +1 -0
- package/src/menu/popover.tsx +15 -8
- package/src/menu/styles.ts +26 -16
- package/src/menu/test/index.tsx +24 -34
- package/src/menu-group/stories/index.story.tsx +1 -0
- package/src/menu-item/stories/index.story.tsx +1 -0
- package/src/menu-items-choice/stories/index.story.tsx +1 -0
- package/src/mobile/link-settings/index.native.js +1 -1
- package/src/modal/index.tsx +1 -0
- package/src/modal/stories/index.story.tsx +1 -0
- package/src/navigable-container/container.tsx +120 -141
- package/src/navigable-container/test/navigable-menu.tsx +24 -0
- package/src/navigable-container/types.ts +1 -5
- package/src/navigation/stories/utils/more-examples.tsx +2 -1
- package/src/navigator/stories/index.story.tsx +1 -0
- package/src/notice/stories/index.story.tsx +1 -0
- package/src/notice/test/__snapshots__/index.tsx.snap +1 -0
- package/src/number-control/stories/index.story.tsx +1 -1
- package/src/palette-edit/index.tsx +1 -0
- package/src/panel/stories/index.story.tsx +1 -0
- package/src/popover/stories/index.story.tsx +1 -0
- package/src/progress-bar/stories/index.story.tsx +1 -0
- package/src/radio-control/index.tsx +2 -0
- package/src/radio-control/stories/index.story.tsx +1 -0
- package/src/radio-control/style.scss +21 -2
- package/src/radio-control/test/index.tsx +10 -0
- package/src/radio-control/types.ts +6 -0
- package/src/range-control/stories/index.story.tsx +1 -0
- package/src/resizable-box/stories/index.story.tsx +1 -0
- package/src/resizable-box/style.scss +4 -5
- package/src/sandbox/index.tsx +189 -9
- package/src/sandbox/stories/index.story.tsx +1 -0
- package/src/sandbox/test/index.tsx +65 -24
- package/src/sandbox/types.ts +11 -0
- package/src/scroll-lock/stories/index.story.tsx +1 -0
- package/src/search-control/stories/index.story.tsx +1 -0
- package/src/select-control/stories/index.story.tsx +1 -0
- package/src/shortcut/stories/index.story.tsx +1 -0
- package/src/slot-fill/stories/index.story.tsx +1 -0
- package/src/snackbar/stories/index.story.tsx +1 -0
- package/src/snackbar/style.scss +2 -2
- package/src/spinner/stories/index.story.tsx +1 -0
- package/src/tab-panel/style.scss +1 -1
- package/src/text-control/stories/index.story.tsx +1 -0
- package/src/text-highlight/stories/index.story.tsx +1 -0
- package/src/textarea-control/stories/index.story.tsx +4 -0
- package/src/textarea-control/styles/textarea-control-styles.ts +6 -0
- package/src/toggle-control/stories/index.story.tsx +1 -0
- package/src/toggle-control/style.scss +1 -1
- package/src/toggle-control/test/index.tsx +8 -2
- package/src/toggle-group-control/stories/index.story.tsx +1 -1
- package/src/toolbar/toolbar-group/index.tsx +2 -2
- package/src/tooltip/stories/index.story.tsx +1 -0
- package/src/tooltip/test/index.tsx +3 -2
- package/src/tree-grid/stories/index.story.tsx +1 -1
- package/src/tree-select/stories/index.story.tsx +1 -0
- package/src/truncate/stories/index.story.tsx +1 -1
- package/src/unit-control/stories/index.story.tsx +1 -1
- package/src/utils/breakpoint.js +1 -1
- package/src/utils/font.js +1 -1
- package/src/visually-hidden/component.tsx +1 -0
- package/src/visually-hidden/stories/index.story.tsx +2 -8
- package/build/card/context.cjs +0 -36
- package/build/card/context.cjs.map +0 -7
- package/build/date-time/time/index.cjs.map +0 -7
- package/build-module/card/context.mjs +0 -10
- package/build-module/card/context.mjs.map +0 -7
- package/build-module/date-time/time/index.mjs.map +0 -7
- package/build-types/card/context.d.ts +0 -3
- package/build-types/card/context.d.ts.map +0 -1
- package/build-types/date-time/date/index.d.ts.map +0 -1
- package/build-types/date-time/date/styles.d.ts.map +0 -1
- package/build-types/date-time/date/test/index.d.ts.map +0 -1
- package/build-types/date-time/date/test/use-lilius.d.ts.map +0 -1
- package/build-types/date-time/date/use-lilius/index.d.ts.map +0 -1
- package/build-types/date-time/time/index.d.ts.map +0 -1
- package/build-types/date-time/time/styles.d.ts.map +0 -1
- package/build-types/date-time/time/test/index.d.ts.map +0 -1
- package/build-types/date-time/time/time-input/index.d.ts.map +0 -1
- package/build-types/date-time/time/time-input/test/index.d.ts.map +0 -1
- package/build-types/date-time/time/timezone.d.ts.map +0 -1
- package/build-types/visually-hidden/test/index.d.ts +0 -2
- package/build-types/visually-hidden/test/index.d.ts.map +0 -1
- package/src/card/context.ts +0 -9
- package/src/visually-hidden/test/__snapshots__/index.tsx.snap +0 -12
- package/src/visually-hidden/test/index.tsx +0 -17
- /package/build-types/date-time/{date → date-picker}/index.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/styles.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/test/index.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/test/use-lilius.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/use-lilius/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/styles.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/test/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/time-input/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/time-input/test/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/timezone.d.ts +0 -0
- /package/src/date-time/{date → date-picker}/index.tsx +0 -0
- /package/src/date-time/{date → date-picker}/styles.ts +0 -0
- /package/src/date-time/{date → date-picker}/test/index.tsx +0 -0
- /package/src/date-time/{date → date-picker}/test/use-lilius.ts +0 -0
- /package/src/date-time/{date → date-picker}/use-lilius/index.ts +0 -0
- /package/src/date-time/{time → time-picker}/styles.ts +0 -0
- /package/src/date-time/{time → time-picker}/test/index.tsx +0 -0
- /package/src/date-time/{time → time-picker}/time-input/index.tsx +0 -0
- /package/src/date-time/{time → time-picker}/time-input/test/index.tsx +0 -0
- /package/src/date-time/{time → time-picker}/timezone.tsx +0 -0
|
@@ -17,6 +17,7 @@ import type { ComponentProps } from 'react';
|
|
|
17
17
|
* WordPress dependencies
|
|
18
18
|
*/
|
|
19
19
|
import { useState } from '@wordpress/element';
|
|
20
|
+
import { logged } from '@wordpress/deprecated';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Internal dependencies
|
|
@@ -122,6 +123,14 @@ function unescapeAndFormatSpaces( str: string ) {
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
describe( 'FormTokenField', () => {
|
|
126
|
+
afterEach( () => {
|
|
127
|
+
// `@wordpress/deprecated` caches each warning message after the first
|
|
128
|
+
// log; reset it so multiple tests can assert the same deprecation.
|
|
129
|
+
for ( const key in logged ) {
|
|
130
|
+
delete logged[ key ];
|
|
131
|
+
}
|
|
132
|
+
} );
|
|
133
|
+
|
|
125
134
|
describe( 'basic usage', () => {
|
|
126
135
|
it( "should add tokens with the input's value when pressing the enter key", async () => {
|
|
127
136
|
const user = userEvent.setup();
|
|
@@ -582,18 +591,17 @@ describe( 'FormTokenField', () => {
|
|
|
582
591
|
);
|
|
583
592
|
} );
|
|
584
593
|
|
|
585
|
-
it( 'should show
|
|
594
|
+
it( 'should show the default how-to text via the `help` prop by default', () => {
|
|
586
595
|
const instructionsTokenizeSpace =
|
|
587
596
|
'Separate with commas, spaces, or the Enter key.';
|
|
588
597
|
const instructionsDefault =
|
|
589
598
|
'Separate with commas or the Enter key.';
|
|
590
599
|
|
|
591
|
-
// The __experimentalShowHowTo prop is `true` by default
|
|
592
600
|
const { rerender } = render( <FormTokenFieldWithState /> );
|
|
593
601
|
|
|
594
602
|
expect( screen.getByText( instructionsDefault ) ).toBeVisible();
|
|
595
603
|
|
|
596
|
-
// The
|
|
604
|
+
// The default how-to text is used to aria-describedby the input.
|
|
597
605
|
expect(
|
|
598
606
|
screen.getByRole( 'combobox' )
|
|
599
607
|
).toHaveAccessibleDescription( instructionsDefault );
|
|
@@ -604,27 +612,79 @@ describe( 'FormTokenField', () => {
|
|
|
604
612
|
screen.getByText( instructionsTokenizeSpace )
|
|
605
613
|
).toBeVisible();
|
|
606
614
|
|
|
607
|
-
// The "show how to" text is used to aria-describedby the input
|
|
608
615
|
expect(
|
|
609
616
|
screen.getByRole( 'combobox' )
|
|
610
617
|
).toHaveAccessibleDescription( instructionsTokenizeSpace );
|
|
618
|
+
} );
|
|
611
619
|
|
|
612
|
-
|
|
620
|
+
it( 'should allow hiding the help text by passing an empty string', () => {
|
|
621
|
+
render( <FormTokenFieldWithState help="" /> );
|
|
622
|
+
|
|
623
|
+
expect(
|
|
624
|
+
screen.queryByText( 'Separate with commas or the Enter key.' )
|
|
625
|
+
).not.toBeInTheDocument();
|
|
626
|
+
expect(
|
|
627
|
+
screen.getByRole( 'combobox' )
|
|
628
|
+
).not.toHaveAccessibleDescription();
|
|
629
|
+
} );
|
|
630
|
+
|
|
631
|
+
it( 'should associate the `help` text with the input accessibly', () => {
|
|
632
|
+
render( <FormTokenFieldWithState help="Help text" /> );
|
|
633
|
+
expect(
|
|
634
|
+
screen.getByRole( 'combobox' )
|
|
635
|
+
).toHaveAccessibleDescription( 'Help text' );
|
|
636
|
+
// The default how-to text should no longer be rendered.
|
|
637
|
+
expect(
|
|
638
|
+
screen.queryByText( 'Separate with commas or the Enter key.' )
|
|
639
|
+
).not.toBeInTheDocument();
|
|
640
|
+
} );
|
|
641
|
+
|
|
642
|
+
it( 'should warn and hide the default text when `__experimentalShowHowTo` is `false`', () => {
|
|
643
|
+
render(
|
|
644
|
+
<FormTokenFieldWithState __experimentalShowHowTo={ false } />
|
|
645
|
+
);
|
|
646
|
+
|
|
647
|
+
expect( console ).toHaveWarnedWith(
|
|
648
|
+
'`__experimentalShowHowTo` prop in wp.components.FormTokenField is deprecated since version 7.1. Please use `help` prop instead. Note: The `help` prop now defaults to the previous how-to text. Pass an empty string to hide it.'
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
expect(
|
|
652
|
+
screen.queryByText( 'Separate with commas or the Enter key.' )
|
|
653
|
+
).not.toBeInTheDocument();
|
|
654
|
+
expect(
|
|
655
|
+
screen.getByRole( 'combobox' )
|
|
656
|
+
).not.toHaveAccessibleDescription();
|
|
657
|
+
} );
|
|
658
|
+
|
|
659
|
+
it( 'should warn and prefer `help` over `__experimentalShowHowTo` when both are provided', () => {
|
|
660
|
+
const { rerender } = render(
|
|
613
661
|
<FormTokenFieldWithState
|
|
614
|
-
tokenizeOnSpace
|
|
615
662
|
__experimentalShowHowTo={ false }
|
|
663
|
+
help="Help text"
|
|
616
664
|
/>
|
|
617
665
|
);
|
|
618
666
|
|
|
667
|
+
expect( console ).toHaveWarned();
|
|
619
668
|
expect(
|
|
620
|
-
screen.
|
|
621
|
-
).
|
|
669
|
+
screen.getByRole( 'combobox' )
|
|
670
|
+
).toHaveAccessibleDescription( 'Help text' );
|
|
622
671
|
expect(
|
|
623
|
-
screen.queryByText(
|
|
672
|
+
screen.queryByText( 'Separate with commas or the Enter key.' )
|
|
624
673
|
).not.toBeInTheDocument();
|
|
674
|
+
|
|
675
|
+
rerender(
|
|
676
|
+
<FormTokenFieldWithState
|
|
677
|
+
__experimentalShowHowTo
|
|
678
|
+
help="Help text"
|
|
679
|
+
/>
|
|
680
|
+
);
|
|
681
|
+
|
|
625
682
|
expect(
|
|
626
683
|
screen.getByRole( 'combobox' )
|
|
627
|
-
).
|
|
684
|
+
).toHaveAccessibleDescription( 'Help text' );
|
|
685
|
+
expect(
|
|
686
|
+
screen.queryByText( 'Separate with commas or the Enter key.' )
|
|
687
|
+
).not.toBeInTheDocument();
|
|
628
688
|
} );
|
|
629
689
|
|
|
630
690
|
it( "should use the value of the `placeholder` prop as the input's placeholder only when there are no tokens", async () => {
|
|
@@ -87,12 +87,7 @@ export function UnForwardedTokenInput(
|
|
|
87
87
|
? `components-form-token-suggestions-${ instanceId }-${ selectedSuggestionIndex }`
|
|
88
88
|
: undefined
|
|
89
89
|
}
|
|
90
|
-
aria-describedby={
|
|
91
|
-
`components-form-token-suggestions-howto-${ instanceId }`,
|
|
92
|
-
ariaDescribedBy,
|
|
93
|
-
]
|
|
94
|
-
.filter( Boolean )
|
|
95
|
-
.join( ' ' ) }
|
|
90
|
+
aria-describedby={ ariaDescribedBy }
|
|
96
91
|
/>
|
|
97
92
|
);
|
|
98
93
|
}
|
|
@@ -147,9 +147,12 @@ export interface FormTokenFieldProps
|
|
|
147
147
|
*/
|
|
148
148
|
__experimentalValidateInput?: ( token: string ) => boolean;
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* Use the `help` prop instead. The `help` prop now defaults to the previous
|
|
151
|
+
* how-to text; if you were passing `__experimentalShowHowTo={ false }` to
|
|
152
|
+
* hide it, pass an empty string to `help` instead.
|
|
151
153
|
*
|
|
152
|
-
* @
|
|
154
|
+
* @deprecated Use the `help` prop instead.
|
|
155
|
+
* @ignore
|
|
153
156
|
*/
|
|
154
157
|
__experimentalShowHowTo?: boolean;
|
|
155
158
|
/**
|
|
@@ -193,6 +196,17 @@ export interface FormTokenFieldProps
|
|
|
193
196
|
* @default false
|
|
194
197
|
*/
|
|
195
198
|
tokenizeOnBlur?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Additional description for the control.
|
|
201
|
+
*
|
|
202
|
+
* Only use for meaningful description or instructions for the control. An
|
|
203
|
+
* element containing the description will be programmatically associated to
|
|
204
|
+
* the `FormTokenField` via `aria-describedby`.
|
|
205
|
+
*
|
|
206
|
+
* Defaults to a how-to message (e.g. _Separate with commas or the Enter key._);
|
|
207
|
+
* pass an empty string to hide it.
|
|
208
|
+
*/
|
|
209
|
+
help?: ReactNode;
|
|
196
210
|
}
|
|
197
211
|
|
|
198
212
|
/**
|
|
@@ -15,6 +15,7 @@ import { useState } from '@wordpress/element';
|
|
|
15
15
|
import GradientPicker from '..';
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof GradientPicker > = {
|
|
18
|
+
tags: [ 'manifest' ],
|
|
18
19
|
title: 'Components/Selection & Input/Color/GradientPicker',
|
|
19
20
|
id: 'components-gradientpicker',
|
|
20
21
|
component: GradientPicker,
|
|
@@ -31,7 +31,7 @@ const meta: Meta< typeof InputControl > = {
|
|
|
31
31
|
type: { control: { type: 'text' } },
|
|
32
32
|
value: { control: { disable: true } },
|
|
33
33
|
},
|
|
34
|
-
tags: [ 'status-experimental' ],
|
|
34
|
+
tags: [ 'status-experimental', 'manifest' ],
|
|
35
35
|
args: {
|
|
36
36
|
onChange: fn(),
|
|
37
37
|
onValidate: fn(),
|
|
@@ -19,7 +19,7 @@ const meta: Meta< typeof ItemGroup > = {
|
|
|
19
19
|
as: { control: false },
|
|
20
20
|
children: { control: false },
|
|
21
21
|
},
|
|
22
|
-
tags: [ 'status-experimental' ],
|
|
22
|
+
tags: [ 'status-experimental', 'manifest' ],
|
|
23
23
|
parameters: {
|
|
24
24
|
controls: { expanded: true },
|
|
25
25
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -9,6 +9,7 @@ import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
|
9
9
|
import KeyboardShortcuts from '..';
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof KeyboardShortcuts > = {
|
|
12
|
+
tags: [ 'manifest' ],
|
|
12
13
|
component: KeyboardShortcuts,
|
|
13
14
|
title: 'Components/Utilities/KeyboardShortcuts',
|
|
14
15
|
id: 'components-keyboardshortcuts',
|
package/src/menu/popover.tsx
CHANGED
|
@@ -24,10 +24,7 @@ import { Context } from './context';
|
|
|
24
24
|
export const Popover = forwardRef<
|
|
25
25
|
HTMLDivElement,
|
|
26
26
|
WordPressComponentProps< PopoverProps, 'div', false >
|
|
27
|
-
>( function Popover(
|
|
28
|
-
{ gutter, children, shift, modal = true, ...otherProps },
|
|
29
|
-
ref
|
|
30
|
-
) {
|
|
27
|
+
>( function Popover( { gutter, shift, modal = true, ...otherProps }, ref ) {
|
|
31
28
|
const menuContext = useContext( Context );
|
|
32
29
|
|
|
33
30
|
// Extract the side from the applied placement — useful for animations.
|
|
@@ -70,6 +67,18 @@ export const Popover = forwardRef<
|
|
|
70
67
|
);
|
|
71
68
|
}
|
|
72
69
|
|
|
70
|
+
const renderMenu = useCallback(
|
|
71
|
+
( htmlProps: React.ComponentPropsWithRef< 'div' > ) => (
|
|
72
|
+
<Styled.MenuMotionRoot>
|
|
73
|
+
<Styled.MenuSurface
|
|
74
|
+
{ ...htmlProps }
|
|
75
|
+
variant={ menuContext.variant }
|
|
76
|
+
/>
|
|
77
|
+
</Styled.MenuMotionRoot>
|
|
78
|
+
),
|
|
79
|
+
[ menuContext.variant ]
|
|
80
|
+
);
|
|
81
|
+
|
|
73
82
|
return (
|
|
74
83
|
<Styled.Menu
|
|
75
84
|
{ ...otherProps }
|
|
@@ -88,9 +97,7 @@ export const Popover = forwardRef<
|
|
|
88
97
|
wrapperProps={ wrapperProps }
|
|
89
98
|
hideOnEscape={ hideOnEscape }
|
|
90
99
|
unmountOnHide
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{ children }
|
|
94
|
-
</Styled.Menu>
|
|
100
|
+
render={ renderMenu }
|
|
101
|
+
/>
|
|
95
102
|
);
|
|
96
103
|
} );
|
package/src/menu/styles.ts
CHANGED
|
@@ -32,12 +32,17 @@ const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VAR
|
|
|
32
32
|
|
|
33
33
|
const GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';
|
|
34
34
|
|
|
35
|
-
export const Menu = styled( Ariakit.Menu )
|
|
35
|
+
export const Menu = styled( Ariakit.Menu )`
|
|
36
36
|
position: relative;
|
|
37
37
|
/* Same as popover component */
|
|
38
38
|
/* TODO: is there a way to read the sass variable? */
|
|
39
39
|
z-index: 1000000;
|
|
40
40
|
|
|
41
|
+
/* Only visible in Windows High Contrast mode */
|
|
42
|
+
outline: 2px solid transparent !important;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const MenuSurface = styled.div< Pick< ContextProps, 'variant' > >`
|
|
41
46
|
display: grid;
|
|
42
47
|
grid-template-columns: ${ GRID_TEMPLATE_COLS };
|
|
43
48
|
grid-template-rows: auto;
|
|
@@ -59,11 +64,16 @@ export const Menu = styled( Ariakit.Menu )< Pick< ContextProps, 'variant' > >`
|
|
|
59
64
|
? TOOLBAR_VARIANT_BOX_SHADOW
|
|
60
65
|
: DEFAULT_BOX_SHADOW };
|
|
61
66
|
` }
|
|
67
|
+
`;
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Outer wrapper for menu motion. `Menu.Popover` uses Ariakit’s `render` prop so
|
|
71
|
+
* this element wraps the inner surface that receives all merged menu props
|
|
72
|
+
* (ref, role, `data-*`, children). Transitions mirror the pre-refactor `Menu`
|
|
73
|
+
* styles from `trunk`, driven by `data-enter` / `data-side` on the inner
|
|
74
|
+
* surface via `:has(> …)`.
|
|
75
|
+
*/
|
|
76
|
+
export const MenuMotionRoot = styled.div`
|
|
67
77
|
@media not ( prefers-reduced-motion ) {
|
|
68
78
|
transition-property: transform, opacity;
|
|
69
79
|
transition-duration: ${ DROPDOWN_MOTION_CSS.SLIDE_DURATION },
|
|
@@ -72,40 +82,40 @@ export const Menu = styled( Ariakit.Menu )< Pick< ContextProps, 'variant' > >`
|
|
|
72
82
|
${ DROPDOWN_MOTION_CSS.FADE_EASING };
|
|
73
83
|
will-change: transform, opacity;
|
|
74
84
|
|
|
75
|
-
&:not( [data-submenu] ) {
|
|
85
|
+
&:not( :has( > ${ MenuSurface }[data-submenu] ) ) {
|
|
76
86
|
/* Regardless of the side, fade in and out. */
|
|
77
87
|
opacity: 0;
|
|
78
|
-
|
|
88
|
+
&:has( > ${ MenuSurface }[data-enter] ) {
|
|
79
89
|
opacity: 1;
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
/* Slide in the direction the menu is opening. */
|
|
83
|
-
|
|
93
|
+
&:has( > ${ MenuSurface }[data-side='bottom'] ) {
|
|
84
94
|
transform: translateY(
|
|
85
95
|
-${ DROPDOWN_MOTION_CSS.SLIDE_DISTANCE }
|
|
86
96
|
);
|
|
87
97
|
}
|
|
88
|
-
|
|
98
|
+
&:has( > ${ MenuSurface }[data-side='top'] ) {
|
|
89
99
|
transform: translateY(
|
|
90
100
|
${ DROPDOWN_MOTION_CSS.SLIDE_DISTANCE }
|
|
91
101
|
);
|
|
92
102
|
}
|
|
93
|
-
|
|
103
|
+
&:has( > ${ MenuSurface }[data-side='left'] ) {
|
|
94
104
|
transform: translateX(
|
|
95
105
|
${ DROPDOWN_MOTION_CSS.SLIDE_DISTANCE }
|
|
96
106
|
);
|
|
97
107
|
}
|
|
98
|
-
|
|
108
|
+
&:has( > ${ MenuSurface }[data-side='right'] ) {
|
|
99
109
|
transform: translateX(
|
|
100
110
|
-${ DROPDOWN_MOTION_CSS.SLIDE_DISTANCE }
|
|
101
111
|
);
|
|
102
112
|
}
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
&:has( > ${ MenuSurface }[data-enter][data-side='bottom'] ),
|
|
114
|
+
&:has( > ${ MenuSurface }[data-enter][data-side='top'] ) {
|
|
105
115
|
transform: translateY( 0 );
|
|
106
116
|
}
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
&:has( > ${ MenuSurface }[data-enter][data-side='left'] ),
|
|
118
|
+
&:has( > ${ MenuSurface }[data-enter][data-side='right'] ) {
|
|
109
119
|
transform: translateX( 0 );
|
|
110
120
|
}
|
|
111
121
|
}
|
|
@@ -114,6 +124,7 @@ export const Menu = styled( Ariakit.Menu )< Pick< ContextProps, 'variant' > >`
|
|
|
114
124
|
|
|
115
125
|
const baseItem = css`
|
|
116
126
|
all: unset;
|
|
127
|
+
cursor: pointer;
|
|
117
128
|
|
|
118
129
|
position: relative;
|
|
119
130
|
min-height: ${ space( 8 ) };
|
|
@@ -157,7 +168,6 @@ const baseItem = css`
|
|
|
157
168
|
|
|
158
169
|
&[aria-disabled='true'] {
|
|
159
170
|
color: ${ COLORS.ui.textDisabled };
|
|
160
|
-
cursor: not-allowed;
|
|
161
171
|
}
|
|
162
172
|
|
|
163
173
|
/* Active item (including hover) */
|
package/src/menu/test/index.tsx
CHANGED
|
@@ -18,6 +18,14 @@ const delay = ( delayInMs: number ) => {
|
|
|
18
18
|
return new Promise( ( resolve ) => setTimeout( resolve, delayInMs ) );
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
const waitForFocusedMenu = () =>
|
|
22
|
+
waitFor( () => expect( screen.getByRole( 'menu' ) ).toHaveFocus() );
|
|
23
|
+
|
|
24
|
+
const waitForFocusedMenuItem = ( name: string ) =>
|
|
25
|
+
waitFor( () =>
|
|
26
|
+
expect( screen.getByRole( 'menuitem', { name } ) ).toHaveFocus()
|
|
27
|
+
);
|
|
28
|
+
|
|
21
29
|
// Open dropdown => open menu
|
|
22
30
|
// Submenu trigger item => open submenu
|
|
23
31
|
|
|
@@ -114,7 +122,7 @@ describe( 'Menu', () => {
|
|
|
114
122
|
await click( toggleButton );
|
|
115
123
|
|
|
116
124
|
// Menu open, focus is on the menu wrapper
|
|
117
|
-
|
|
125
|
+
await waitForFocusedMenu();
|
|
118
126
|
} );
|
|
119
127
|
|
|
120
128
|
it( 'should open and focus the first item when pressing the arrow down key on the trigger', async () => {
|
|
@@ -145,9 +153,7 @@ describe( 'Menu', () => {
|
|
|
145
153
|
|
|
146
154
|
// Menu open, focus is on the first focusable item
|
|
147
155
|
// (disabled items are still focusable and accessible)
|
|
148
|
-
|
|
149
|
-
screen.getByRole( 'menuitem', { name: 'First item' } )
|
|
150
|
-
).toHaveFocus();
|
|
156
|
+
await waitForFocusedMenuItem( 'First item' );
|
|
151
157
|
} );
|
|
152
158
|
|
|
153
159
|
it( 'should open and focus the first item when pressing the space key on the trigger', async () => {
|
|
@@ -178,9 +184,7 @@ describe( 'Menu', () => {
|
|
|
178
184
|
|
|
179
185
|
// Menu open, focus is on the first focusable item
|
|
180
186
|
// (disabled items are still focusable and accessible
|
|
181
|
-
|
|
182
|
-
screen.getByRole( 'menuitem', { name: 'First item' } )
|
|
183
|
-
).toHaveFocus();
|
|
187
|
+
await waitForFocusedMenuItem( 'First item' );
|
|
184
188
|
} );
|
|
185
189
|
|
|
186
190
|
it( 'should close when pressing the escape key', async () => {
|
|
@@ -201,7 +205,7 @@ describe( 'Menu', () => {
|
|
|
201
205
|
|
|
202
206
|
// Focuses menu on mouse click, focuses first item on keyboard press
|
|
203
207
|
// Can be changed with a custom useEffect
|
|
204
|
-
|
|
208
|
+
await waitForFocusedMenu();
|
|
205
209
|
|
|
206
210
|
// Pressing esc will close the menu and move focus to the toggle
|
|
207
211
|
await press.Escape();
|
|
@@ -349,9 +353,7 @@ describe( 'Menu', () => {
|
|
|
349
353
|
);
|
|
350
354
|
|
|
351
355
|
// The menu is focused automatically when `defaultOpen` is set.
|
|
352
|
-
await
|
|
353
|
-
expect( screen.getByRole( 'menu' ) ).toHaveFocus()
|
|
354
|
-
);
|
|
356
|
+
await waitForFocusedMenu();
|
|
355
357
|
|
|
356
358
|
// Arrow up/down selects menu items
|
|
357
359
|
// The selection wraps around from last to first and viceversa
|
|
@@ -391,18 +393,13 @@ describe( 'Menu', () => {
|
|
|
391
393
|
).toHaveFocus();
|
|
392
394
|
|
|
393
395
|
// Arrow right/left can be used to enter/leave submenus
|
|
396
|
+
// (focus crosses menu contexts, so wait for it to settle)
|
|
394
397
|
await press.ArrowRight();
|
|
395
|
-
|
|
396
|
-
screen.getByRole( 'menuitem', {
|
|
397
|
-
name: 'Submenu item 1',
|
|
398
|
-
} )
|
|
399
|
-
).toHaveFocus();
|
|
398
|
+
await waitForFocusedMenuItem( 'Submenu item 1' );
|
|
400
399
|
|
|
401
400
|
await press.ArrowDown();
|
|
402
401
|
expect(
|
|
403
|
-
screen.getByRole( 'menuitem', {
|
|
404
|
-
name: 'Submenu item 2',
|
|
405
|
-
} )
|
|
402
|
+
screen.getByRole( 'menuitem', { name: 'Submenu item 2' } )
|
|
406
403
|
).toHaveFocus();
|
|
407
404
|
|
|
408
405
|
await press.ArrowLeft();
|
|
@@ -414,11 +411,7 @@ describe( 'Menu', () => {
|
|
|
414
411
|
|
|
415
412
|
// Spacebar or enter key can also be used to enter a submenu
|
|
416
413
|
await press.Enter();
|
|
417
|
-
|
|
418
|
-
screen.getByRole( 'menuitem', {
|
|
419
|
-
name: 'Submenu item 1',
|
|
420
|
-
} )
|
|
421
|
-
).toHaveFocus();
|
|
414
|
+
await waitForFocusedMenuItem( 'Submenu item 1' );
|
|
422
415
|
|
|
423
416
|
await press.ArrowLeft();
|
|
424
417
|
expect(
|
|
@@ -428,11 +421,7 @@ describe( 'Menu', () => {
|
|
|
428
421
|
).toHaveFocus();
|
|
429
422
|
|
|
430
423
|
await press.Space();
|
|
431
|
-
|
|
432
|
-
screen.getByRole( 'menuitem', {
|
|
433
|
-
name: 'Submenu item 1',
|
|
434
|
-
} )
|
|
435
|
-
).toHaveFocus();
|
|
424
|
+
await waitForFocusedMenuItem( 'Submenu item 1' );
|
|
436
425
|
|
|
437
426
|
await press.ArrowLeft();
|
|
438
427
|
expect(
|
|
@@ -886,7 +875,7 @@ describe( 'Menu', () => {
|
|
|
886
875
|
);
|
|
887
876
|
|
|
888
877
|
// Menu open, focus is on the menu wrapper
|
|
889
|
-
|
|
878
|
+
await waitForFocusedMenu();
|
|
890
879
|
|
|
891
880
|
expect(
|
|
892
881
|
screen.queryByRole( 'button', {
|
|
@@ -916,18 +905,19 @@ describe( 'Menu', () => {
|
|
|
916
905
|
);
|
|
917
906
|
|
|
918
907
|
// Menu open, focus is on the menu wrapper
|
|
919
|
-
|
|
908
|
+
await waitForFocusedMenu();
|
|
920
909
|
|
|
921
910
|
// Menu is not modal, therefore the outer button is part of the
|
|
922
911
|
// accessibility tree and can be found.
|
|
923
912
|
const outerButton = screen.getByRole( 'button', {
|
|
924
913
|
name: 'Button outside of dropdown',
|
|
925
914
|
} );
|
|
915
|
+
expect( outerButton ).toBeVisible();
|
|
926
916
|
|
|
927
917
|
// The outer button can be focused by pressing tab. Doing so will cause
|
|
928
918
|
// the Menu to close.
|
|
929
919
|
await press.Tab();
|
|
930
|
-
expect( outerButton ).
|
|
920
|
+
expect( outerButton ).toBeVisible();
|
|
931
921
|
expect( screen.queryByRole( 'menu' ) ).not.toBeInTheDocument();
|
|
932
922
|
} );
|
|
933
923
|
} );
|
|
@@ -1068,7 +1058,7 @@ describe( 'Menu', () => {
|
|
|
1068
1058
|
name: 'Open dropdown',
|
|
1069
1059
|
} )
|
|
1070
1060
|
);
|
|
1071
|
-
|
|
1061
|
+
await waitForFocusedMenu();
|
|
1072
1062
|
|
|
1073
1063
|
// Type "tw", it should match and focus the item with content "Two"
|
|
1074
1064
|
await type( 'tw' );
|
|
@@ -1104,7 +1094,7 @@ describe( 'Menu', () => {
|
|
|
1104
1094
|
name: 'Open dropdown',
|
|
1105
1095
|
} )
|
|
1106
1096
|
);
|
|
1107
|
-
|
|
1097
|
+
await waitForFocusedMenu();
|
|
1108
1098
|
|
|
1109
1099
|
// Type a string that doesn't match any items. Focus shouldn't move.
|
|
1110
1100
|
await type( 'abc' );
|
|
@@ -16,6 +16,7 @@ import MenuItem from '../../menu-item';
|
|
|
16
16
|
import MenuItemsChoice from '../../menu-items-choice';
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof MenuGroup > = {
|
|
19
|
+
tags: [ 'manifest' ],
|
|
19
20
|
title: 'Components/Actions/MenuGroup',
|
|
20
21
|
component: MenuGroup,
|
|
21
22
|
id: 'components-menugroup',
|
|
@@ -15,6 +15,7 @@ import MenuItemsChoice from '..';
|
|
|
15
15
|
import MenuGroup from '../../menu-group';
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof MenuItemsChoice > = {
|
|
18
|
+
tags: [ 'manifest' ],
|
|
18
19
|
component: MenuItemsChoice,
|
|
19
20
|
title: 'Components/Actions/MenuItemsChoice',
|
|
20
21
|
id: 'components-menuitemschoice',
|
package/src/modal/index.tsx
CHANGED
|
@@ -121,6 +121,7 @@ function UnforwardedModal(
|
|
|
121
121
|
const onRequestCloseRef =
|
|
122
122
|
useRef< ModalProps[ 'onRequestClose' ] >( undefined );
|
|
123
123
|
useEffect( () => {
|
|
124
|
+
// eslint-disable-next-line react-compiler/react-compiler -- false positive, see https://github.com/facebook/react/issues/29196
|
|
124
125
|
onRequestCloseRef.current = onRequestClose;
|
|
125
126
|
}, [ onRequestClose ] );
|
|
126
127
|
|