@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
package/src/sandbox/index.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useRef,
|
|
7
7
|
useState,
|
|
8
8
|
useEffect,
|
|
9
|
+
useMemo,
|
|
9
10
|
} from '@wordpress/element';
|
|
10
11
|
import { useFocusableIframe, useMergeRefs } from '@wordpress/compose';
|
|
11
12
|
|
|
@@ -14,6 +15,8 @@ import { useFocusableIframe, useMergeRefs } from '@wordpress/compose';
|
|
|
14
15
|
*/
|
|
15
16
|
import type { SandBoxProps } from './types';
|
|
16
17
|
|
|
18
|
+
type SandBoxContentProps = Omit< SandBoxProps, 'allowSameOrigin' >;
|
|
19
|
+
|
|
17
20
|
const observeAndResizeJS = function () {
|
|
18
21
|
const { MutationObserver } = window;
|
|
19
22
|
|
|
@@ -115,17 +118,176 @@ const style = `
|
|
|
115
118
|
`;
|
|
116
119
|
|
|
117
120
|
/**
|
|
118
|
-
*
|
|
121
|
+
* Builds the full HTML document string for the sandbox iframe content.
|
|
122
|
+
*/
|
|
123
|
+
function buildSandBoxDocument( {
|
|
124
|
+
html,
|
|
125
|
+
title,
|
|
126
|
+
type,
|
|
127
|
+
styles,
|
|
128
|
+
scripts,
|
|
129
|
+
}: {
|
|
130
|
+
html: string;
|
|
131
|
+
title: string;
|
|
132
|
+
type?: string;
|
|
133
|
+
styles: string[];
|
|
134
|
+
scripts: string[];
|
|
135
|
+
} ): string {
|
|
136
|
+
const htmlDoc = (
|
|
137
|
+
<html lang={ document.documentElement.lang } className={ type }>
|
|
138
|
+
<head>
|
|
139
|
+
<title>{ title }</title>
|
|
140
|
+
<style dangerouslySetInnerHTML={ { __html: style } } />
|
|
141
|
+
{ styles.map( ( rules, i ) => (
|
|
142
|
+
<style
|
|
143
|
+
key={ i }
|
|
144
|
+
dangerouslySetInnerHTML={ { __html: rules } }
|
|
145
|
+
/>
|
|
146
|
+
) ) }
|
|
147
|
+
</head>
|
|
148
|
+
<body
|
|
149
|
+
data-resizable-iframe-connected="data-resizable-iframe-connected"
|
|
150
|
+
className={ type }
|
|
151
|
+
>
|
|
152
|
+
<div dangerouslySetInnerHTML={ { __html: html } } />
|
|
153
|
+
<script
|
|
154
|
+
type="text/javascript"
|
|
155
|
+
dangerouslySetInnerHTML={ {
|
|
156
|
+
__html: `(${ observeAndResizeJS.toString() })();`,
|
|
157
|
+
} }
|
|
158
|
+
/>
|
|
159
|
+
{ scripts.map( ( src ) => (
|
|
160
|
+
<script key={ src } src={ src } />
|
|
161
|
+
) ) }
|
|
162
|
+
</body>
|
|
163
|
+
</html>
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
return '<!DOCTYPE html>' + renderToString( htmlDoc );
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Isolated sandbox that uses the `srcdoc` attribute to render content
|
|
171
|
+
* without `allow-same-origin`. This is the default for user-controlled
|
|
172
|
+
* content (e.g., the HTML block) where same-origin access would be a
|
|
173
|
+
* security risk.
|
|
119
174
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
175
|
+
* Because `srcdoc` is a declarative attribute, the browser automatically
|
|
176
|
+
* re-renders the content when the iframe is moved in the DOM (e.g.,
|
|
177
|
+
* block reordering), so no `load` event listener is needed.
|
|
178
|
+
* The `message` listener is re-synced on every `load` so
|
|
179
|
+
* it follows the iframe if it's reparented into a different document.
|
|
180
|
+
*/
|
|
181
|
+
function IsolatedSandBox( {
|
|
182
|
+
html = '',
|
|
183
|
+
title = '',
|
|
184
|
+
type,
|
|
185
|
+
styles = [],
|
|
186
|
+
scripts = [],
|
|
187
|
+
onFocus,
|
|
188
|
+
tabIndex,
|
|
189
|
+
}: SandBoxContentProps ) {
|
|
190
|
+
const ref = useRef< HTMLIFrameElement >( null );
|
|
191
|
+
const [ width, setWidth ] = useState( 0 );
|
|
192
|
+
const [ height, setHeight ] = useState( 0 );
|
|
193
|
+
|
|
194
|
+
const srcDoc = useMemo(
|
|
195
|
+
() => buildSandBoxDocument( { html, title, type, styles, scripts } ),
|
|
196
|
+
[ html, title, type, styles, scripts ]
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
useEffect( () => {
|
|
200
|
+
const iframe = ref.current;
|
|
201
|
+
if ( ! iframe ) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function checkMessageForResize( event: MessageEvent ) {
|
|
206
|
+
// Verify that the mounted element is the source of the message.
|
|
207
|
+
// iframe.contentWindow is accessible cross-origin as a
|
|
208
|
+
// WindowProxy reference, so this check still works without
|
|
209
|
+
// allow-same-origin.
|
|
210
|
+
if ( ! iframe || iframe.contentWindow !== event.source ) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Attempt to parse the message data as JSON if passed as string.
|
|
215
|
+
let data = event.data || {};
|
|
216
|
+
|
|
217
|
+
if ( 'string' === typeof data ) {
|
|
218
|
+
try {
|
|
219
|
+
data = JSON.parse( data );
|
|
220
|
+
} catch {}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Update the state only if the message is formatted as we expect,
|
|
224
|
+
// i.e. as an object with a 'resize' action.
|
|
225
|
+
if ( 'resize' !== data.action ) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
setWidth( data.width );
|
|
230
|
+
setHeight( data.height );
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
let currentView: Window | null = null;
|
|
234
|
+
function syncListener() {
|
|
235
|
+
const view = iframe?.ownerDocument?.defaultView ?? null;
|
|
236
|
+
if ( view === currentView ) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
currentView?.removeEventListener(
|
|
241
|
+
'message',
|
|
242
|
+
checkMessageForResize
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
currentView = view;
|
|
246
|
+
currentView?.addEventListener( 'message', checkMessageForResize );
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
syncListener();
|
|
250
|
+
iframe.addEventListener( 'load', syncListener );
|
|
251
|
+
|
|
252
|
+
return () => {
|
|
253
|
+
iframe.removeEventListener( 'load', syncListener );
|
|
254
|
+
currentView?.removeEventListener(
|
|
255
|
+
'message',
|
|
256
|
+
checkMessageForResize
|
|
257
|
+
);
|
|
258
|
+
};
|
|
259
|
+
}, [] );
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<iframe
|
|
263
|
+
ref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }
|
|
264
|
+
title={ title }
|
|
265
|
+
tabIndex={ tabIndex }
|
|
266
|
+
className="components-sandbox"
|
|
267
|
+
sandbox="allow-scripts allow-presentation"
|
|
268
|
+
srcDoc={ srcDoc }
|
|
269
|
+
onFocus={ onFocus }
|
|
270
|
+
width={ Math.ceil( width ) }
|
|
271
|
+
height={ Math.ceil( height ) }
|
|
272
|
+
/>
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Same-origin sandbox that writes to `contentDocument` directly. This
|
|
278
|
+
* preserves the parent page's URL as the iframe's document URL, which
|
|
279
|
+
* provides a valid Referer header for nested iframes (required by
|
|
280
|
+
* providers like YouTube).
|
|
122
281
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
282
|
+
* Only used when `allowSameOrigin` is true — i.e., for server-fetched
|
|
283
|
+
* oEmbed previews that are not directly user-controlled.
|
|
284
|
+
*
|
|
285
|
+
* This implementation is intentionally kept close to the original
|
|
286
|
+
* pre-refactor code to preserve past bugfixes:
|
|
287
|
+
* - load listener for iframe re-initialization after DOM moves (#21916)
|
|
288
|
+
* - forceRerender guard to avoid unnecessary full rewrites (#20176)
|
|
127
289
|
*/
|
|
128
|
-
function
|
|
290
|
+
function SameOriginSandBox( {
|
|
129
291
|
html = '',
|
|
130
292
|
title = '',
|
|
131
293
|
type,
|
|
@@ -133,7 +295,7 @@ function SandBox( {
|
|
|
133
295
|
scripts = [],
|
|
134
296
|
onFocus,
|
|
135
297
|
tabIndex,
|
|
136
|
-
}:
|
|
298
|
+
}: SandBoxContentProps ) {
|
|
137
299
|
const ref = useRef< HTMLIFrameElement >( null );
|
|
138
300
|
const [ width, setWidth ] = useState( 0 );
|
|
139
301
|
const [ height, setHeight ] = useState( 0 );
|
|
@@ -292,4 +454,22 @@ function SandBox( {
|
|
|
292
454
|
);
|
|
293
455
|
}
|
|
294
456
|
|
|
457
|
+
/**
|
|
458
|
+
* This component provides an isolated environment for arbitrary HTML via iframes.
|
|
459
|
+
*
|
|
460
|
+
* ```jsx
|
|
461
|
+
* import { SandBox } from '@wordpress/components';
|
|
462
|
+
*
|
|
463
|
+
* const MySandBox = () => (
|
|
464
|
+
* <SandBox html="<p>Content</p>" title="SandBox" type="embed" />
|
|
465
|
+
* );
|
|
466
|
+
* ```
|
|
467
|
+
*/
|
|
468
|
+
function SandBox( { allowSameOrigin = false, ...contentProps }: SandBoxProps ) {
|
|
469
|
+
if ( allowSameOrigin ) {
|
|
470
|
+
return <SameOriginSandBox { ...contentProps } />;
|
|
471
|
+
}
|
|
472
|
+
return <IsolatedSandBox { ...contentProps } />;
|
|
473
|
+
}
|
|
474
|
+
|
|
295
475
|
export default SandBox;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { fireEvent, render, screen
|
|
4
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -16,10 +16,7 @@ import SandBox from '..';
|
|
|
16
16
|
describe( 'SandBox', () => {
|
|
17
17
|
const TestWrapper = () => {
|
|
18
18
|
const [ html, setHtml ] = useState(
|
|
19
|
-
|
|
20
|
-
// with iframes so we need to ignore it for the time being.
|
|
21
|
-
'<script type="text/javascript">window.MutationObserver = null;</script>' +
|
|
22
|
-
'<iframe title="Mock Iframe" src="https://super.embed"></iframe>'
|
|
19
|
+
'<iframe title="Mock Iframe" src="https://super.embed"></iframe>'
|
|
23
20
|
);
|
|
24
21
|
|
|
25
22
|
const updateHtml = () => {
|
|
@@ -38,34 +35,78 @@ describe( 'SandBox', () => {
|
|
|
38
35
|
);
|
|
39
36
|
};
|
|
40
37
|
|
|
41
|
-
it( 'should
|
|
38
|
+
it( 'should not include allow-same-origin by default', () => {
|
|
39
|
+
render( <SandBox html="<p>Hello</p>" title="Test" /> );
|
|
40
|
+
|
|
41
|
+
const iframe = screen.getByTitle< HTMLIFrameElement >( 'Test' );
|
|
42
|
+
|
|
43
|
+
expect( iframe ).toHaveAttribute(
|
|
44
|
+
'sandbox',
|
|
45
|
+
'allow-scripts allow-presentation'
|
|
46
|
+
);
|
|
47
|
+
expect( iframe.getAttribute( 'sandbox' ) ).not.toContain(
|
|
48
|
+
'allow-same-origin'
|
|
49
|
+
);
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
it( 'should set srcdoc with the provided html content', () => {
|
|
53
|
+
render( <SandBox html="<p>Hello</p>" title="Test Title" /> );
|
|
54
|
+
|
|
55
|
+
const iframe = screen.getByTitle< HTMLIFrameElement >( 'Test Title' );
|
|
56
|
+
const srcDoc = iframe.getAttribute( 'srcdoc' ) ?? '';
|
|
57
|
+
|
|
58
|
+
expect( srcDoc ).toContain( '<p>Hello</p>' );
|
|
59
|
+
expect( srcDoc ).toContain( '<title>Test Title</title>' );
|
|
60
|
+
} );
|
|
61
|
+
|
|
62
|
+
it( 'should include custom styles in srcdoc', () => {
|
|
63
|
+
render(
|
|
64
|
+
<SandBox
|
|
65
|
+
html="<p>Styled</p>"
|
|
66
|
+
title="Styled Test"
|
|
67
|
+
styles={ [ '.custom { color: red; }' ] }
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const iframe = screen.getByTitle< HTMLIFrameElement >( 'Styled Test' );
|
|
72
|
+
const srcDoc = iframe.getAttribute( 'srcdoc' ) ?? '';
|
|
73
|
+
|
|
74
|
+
expect( srcDoc ).toContain( '.custom { color: red; }' );
|
|
75
|
+
} );
|
|
76
|
+
|
|
77
|
+
it( 'should include script tags in srcdoc', () => {
|
|
78
|
+
render(
|
|
79
|
+
<SandBox
|
|
80
|
+
html="<p>Script</p>"
|
|
81
|
+
title="Script Test"
|
|
82
|
+
scripts={ [ 'https://example.com/embed.js' ] }
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const iframe = screen.getByTitle< HTMLIFrameElement >( 'Script Test' );
|
|
87
|
+
const srcDoc = iframe.getAttribute( 'srcdoc' ) ?? '';
|
|
88
|
+
|
|
89
|
+
expect( srcDoc ).toContain(
|
|
90
|
+
'<script src="https://example.com/embed.js">'
|
|
91
|
+
);
|
|
92
|
+
} );
|
|
93
|
+
|
|
94
|
+
it( 'should update srcdoc when html prop changes', () => {
|
|
42
95
|
render( <TestWrapper /> );
|
|
43
96
|
|
|
44
97
|
const iframe =
|
|
45
98
|
screen.getByTitle< HTMLIFrameElement >( 'SandBox Title' );
|
|
46
99
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let sandboxedIframe = within(
|
|
52
|
-
iframe.contentWindow.document.body
|
|
53
|
-
).getByTitle( 'Mock Iframe' );
|
|
54
|
-
|
|
55
|
-
expect( sandboxedIframe ).toHaveAttribute(
|
|
56
|
-
'src',
|
|
57
|
-
'https://super.embed'
|
|
100
|
+
expect( iframe ).toHaveAttribute(
|
|
101
|
+
'srcdoc',
|
|
102
|
+
expect.stringContaining( 'https://super.embed' )
|
|
58
103
|
);
|
|
59
104
|
|
|
60
105
|
fireEvent.click( screen.getByRole( 'button' ) );
|
|
61
106
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
expect( sandboxedIframe ).toHaveAttribute(
|
|
67
|
-
'src',
|
|
68
|
-
'https://another.super.embed'
|
|
107
|
+
expect( iframe ).toHaveAttribute(
|
|
108
|
+
'srcdoc',
|
|
109
|
+
expect.stringContaining( 'https://another.super.embed' )
|
|
69
110
|
);
|
|
70
111
|
} );
|
|
71
112
|
} );
|
package/src/sandbox/types.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export type SandBoxProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to include `allow-same-origin` in the iframe's sandbox
|
|
4
|
+
* attribute. When true, nested iframes (such as third-party embeds)
|
|
5
|
+
* can access their own origin's cookies and storage.
|
|
6
|
+
*
|
|
7
|
+
* Only enable this for content that is NOT directly user-controlled,
|
|
8
|
+
* such as server-fetched oEmbed previews.
|
|
9
|
+
*
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
allowSameOrigin?: boolean;
|
|
2
13
|
/**
|
|
3
14
|
* The HTML to render in the body of the iframe document.
|
|
4
15
|
*
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import SearchControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof SearchControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
title: 'Components/Selection & Input/Common/SearchControl',
|
|
18
19
|
id: 'components-searchcontrol',
|
|
19
20
|
component: SearchControl,
|
|
@@ -16,6 +16,7 @@ import SelectControl from '../';
|
|
|
16
16
|
import { InputControlPrefixWrapper } from '../../input-control/input-prefix-wrapper';
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof SelectControl > = {
|
|
19
|
+
tags: [ 'manifest' ],
|
|
19
20
|
title: 'Components/Selection & Input/Common/SelectControl',
|
|
20
21
|
id: 'components-selectcontrol',
|
|
21
22
|
component: SelectControl,
|
|
@@ -14,6 +14,7 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
14
14
|
import { Slot, Fill, Provider as SlotFillProvider } from '../';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof Slot > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
component: Slot,
|
|
18
19
|
title: 'Components/Utilities/SlotFill',
|
|
19
20
|
id: 'components-slotfill',
|
package/src/snackbar/style.scss
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
width: 100%;
|
|
17
17
|
max-width: var(--wpds-dimension-surface-width-lg);
|
|
18
18
|
box-sizing: border-box;
|
|
19
|
-
cursor:
|
|
19
|
+
cursor: var(--wpds-cursor-control);
|
|
20
20
|
|
|
21
21
|
// Re-enable pointer events, which are disabled by the
|
|
22
22
|
// .components-snackbar-list styles.
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
.components-snackbar__dismiss-button {
|
|
49
49
|
margin-left: $grid-unit-30;
|
|
50
|
-
cursor:
|
|
50
|
+
cursor: var(--wpds-cursor-control);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
package/src/tab-panel/style.scss
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
background: transparent;
|
|
19
19
|
border: none;
|
|
20
20
|
box-shadow: none;
|
|
21
|
-
cursor:
|
|
21
|
+
cursor: var(--wpds-cursor-control);
|
|
22
22
|
padding: 3px $grid-unit-20; // Use padding to offset the is-active border, this benefits Windows High Contrast mode
|
|
23
23
|
margin-left: 0;
|
|
24
24
|
font-weight: $font-weight-regular;
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TextControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TextControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
component: TextControl,
|
|
18
19
|
title: 'Components/Selection & Input/Common/TextControl',
|
|
19
20
|
id: 'components-textcontrol',
|
|
@@ -9,6 +9,7 @@ import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
|
9
9
|
import TextHighlight from '..';
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof TextHighlight > = {
|
|
12
|
+
tags: [ 'manifest' ],
|
|
12
13
|
component: TextHighlight,
|
|
13
14
|
title: 'Components/Typography/TextHighlight',
|
|
14
15
|
id: 'components-texthighlight',
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TextareaControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TextareaControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
component: TextareaControl,
|
|
18
19
|
title: 'Components/Selection & Input/Common/TextareaControl',
|
|
19
20
|
id: 'components-textareacontrol',
|
|
@@ -21,6 +22,9 @@ const meta: Meta< typeof TextareaControl > = {
|
|
|
21
22
|
onChange: { action: 'onChange' },
|
|
22
23
|
label: { control: { type: 'text' } },
|
|
23
24
|
help: { control: { type: 'text' } },
|
|
25
|
+
disabled: {
|
|
26
|
+
control: { type: 'boolean' },
|
|
27
|
+
},
|
|
24
28
|
value: { control: false },
|
|
25
29
|
},
|
|
26
30
|
parameters: {
|
|
@@ -62,6 +62,12 @@ export const StyledTextarea = styled.textarea`
|
|
|
62
62
|
${ inputStyleFocus }
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
&:disabled {
|
|
66
|
+
background: ${ COLORS.ui.backgroundDisabled };
|
|
67
|
+
border-color: ${ COLORS.ui.borderDisabled };
|
|
68
|
+
color: ${ COLORS.ui.textDisabled };
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
// Use opacity to work in various editor styles.
|
|
66
72
|
&::-webkit-input-placeholder {
|
|
67
73
|
color: ${ COLORS.ui.darkGrayPlaceholder };
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import ToggleControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof ToggleControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
title: 'Components/Selection & Input/Common/ToggleControl',
|
|
18
19
|
id: 'components-togglecontrol',
|
|
19
20
|
component: ToggleControl,
|
|
@@ -22,10 +22,16 @@ describe( 'ToggleControl', () => {
|
|
|
22
22
|
|
|
23
23
|
render( <ToggleControl label="My toggle" onChange={ onChange } /> );
|
|
24
24
|
|
|
25
|
-
screen
|
|
25
|
+
screen
|
|
26
|
+
.getByRole( 'checkbox' )
|
|
27
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
28
|
+
.click();
|
|
26
29
|
expect( onChange ).toHaveBeenLastCalledWith( true );
|
|
27
30
|
|
|
28
|
-
screen
|
|
31
|
+
screen
|
|
32
|
+
.getByRole( 'checkbox' )
|
|
33
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
34
|
+
.click();
|
|
29
35
|
expect( onChange ).toHaveBeenLastCalledWith( false );
|
|
30
36
|
} );
|
|
31
37
|
|
|
@@ -33,7 +33,7 @@ const meta: Meta< typeof ToggleGroupControl > = {
|
|
|
33
33
|
onChange: { action: 'onChange' },
|
|
34
34
|
value: { control: false },
|
|
35
35
|
},
|
|
36
|
-
tags: [ 'status-experimental' ],
|
|
36
|
+
tags: [ 'status-experimental', 'manifest' ],
|
|
37
37
|
parameters: {
|
|
38
38
|
controls: { expanded: true },
|
|
39
39
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -17,7 +17,7 @@ import ToolbarGroupCollapsed from './toolbar-group-collapsed';
|
|
|
17
17
|
import ToolbarContext from '../toolbar-context';
|
|
18
18
|
import type { ToolbarGroupProps, ToolbarGroupControls } from './types';
|
|
19
19
|
|
|
20
|
-
function isNestedArray< T
|
|
20
|
+
function isNestedArray< T >( arr: T | T[] ): arr is T[] {
|
|
21
21
|
return Array.isArray( arr ) && Array.isArray( arr[ 0 ] );
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -78,7 +78,7 @@ function ToolbarGroup( {
|
|
|
78
78
|
|
|
79
79
|
// Normalize controls to nested array of objects (sets of controls)
|
|
80
80
|
let controlSets: ToolbarGroupControls[][];
|
|
81
|
-
if ( isNestedArray( controls ) ) {
|
|
81
|
+
if ( isNestedArray< ToolbarGroupControls[] >( controls ) ) {
|
|
82
82
|
controlSets = controls;
|
|
83
83
|
} else {
|
|
84
84
|
controlSets = [ controls ];
|
|
@@ -286,7 +286,7 @@ describe( 'Tooltip', () => {
|
|
|
286
286
|
|
|
287
287
|
describe( 'delay', () => {
|
|
288
288
|
it( 'should respect custom delay prop when showing tooltip', async () => {
|
|
289
|
-
const ADDITIONAL_DELAY =
|
|
289
|
+
const ADDITIONAL_DELAY = 500;
|
|
290
290
|
|
|
291
291
|
render(
|
|
292
292
|
<Tooltip
|
|
@@ -304,7 +304,8 @@ describe( 'Tooltip', () => {
|
|
|
304
304
|
await hover( anchor );
|
|
305
305
|
expectTooltipToBeHidden();
|
|
306
306
|
|
|
307
|
-
// Advance time by default delay
|
|
307
|
+
// Advance time by default delay, which is still well before the
|
|
308
|
+
// custom delay even when CI is slow to resolve the hover event.
|
|
308
309
|
await sleep( TOOLTIP_DELAY );
|
|
309
310
|
|
|
310
311
|
// Tooltip hasn't appeared yet
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TreeSelect from '../';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TreeSelect > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
title: 'Components/Selection & Input/Common/TreeSelect',
|
|
18
19
|
id: 'components-treeselect',
|
|
19
20
|
component: TreeSelect,
|
|
@@ -16,7 +16,7 @@ const meta: Meta< typeof Truncate > = {
|
|
|
16
16
|
children: { control: { type: 'text' } },
|
|
17
17
|
as: { control: { type: 'text' } },
|
|
18
18
|
},
|
|
19
|
-
tags: [ 'status-experimental' ],
|
|
19
|
+
tags: [ 'status-experimental', 'manifest' ],
|
|
20
20
|
parameters: {
|
|
21
21
|
controls: {
|
|
22
22
|
expanded: true,
|
package/src/utils/breakpoint.js
CHANGED