@wordpress/components 26.0.4 → 27.1.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/.stylelintrc.js +2 -2
- package/CHANGELOG.md +45 -0
- package/CONTRIBUTING.md +72 -0
- package/build/autocomplete/index.js +3 -8
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/index.native.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/button/index.js +2 -2
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js.map +1 -1
- package/build/color-picker/component.js +10 -1
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/styles.js +8 -9
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +4 -9
- package/build/combobox-control/index.js.map +1 -1
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-select-control/index.js +2 -15
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control-v2/custom-select-item.js +32 -0
- package/build/custom-select-control-v2/custom-select-item.js.map +1 -0
- package/build/custom-select-control-v2/custom-select.js +91 -0
- package/build/custom-select-control-v2/custom-select.js.map +1 -0
- package/build/custom-select-control-v2/default-component/index.js +41 -0
- package/build/custom-select-control-v2/default-component/index.js.map +1 -0
- package/build/custom-select-control-v2/index.js +13 -82
- package/build/custom-select-control-v2/index.js.map +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +123 -0
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -0
- package/build/custom-select-control-v2/styles.js +73 -50
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/custom-select-control-v2/types.js.map +1 -1
- package/build/draggable/index.native.js +2 -2
- package/build/draggable/index.native.js.map +1 -1
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/flex/flex/hook.js +1 -1
- package/build/flex/flex/hook.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +0 -1
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/form-token-field/index.js +3 -8
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +5 -12
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/h-stack/hook.js +6 -1
- package/build/h-stack/hook.js.map +1 -1
- package/build/mobile/bottom-sheet/button.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js +4 -13
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/modal/index.js +2 -10
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/progress-bar/styles.js +5 -5
- package/build/progress-bar/styles.js.map +1 -1
- package/build/query-controls/index.native.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/search-control/index.native.js.map +1 -1
- package/build/snackbar/index.js +3 -2
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +2 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/snackbar/types.js.map +1 -1
- package/build/tabs/index.js +7 -7
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/utils/hooks/index.js +0 -7
- package/build/utils/hooks/index.js.map +1 -1
- package/build/utils/with-ignore-ime-events.js +34 -0
- package/build/utils/with-ignore-ime-events.js.map +1 -0
- package/build-module/autocomplete/index.js +3 -8
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/index.native.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/button/index.js +2 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/color-picker/component.js +11 -2
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -9
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +4 -9
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-select-control/index.js +2 -15
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select-item.js +26 -0
- package/build-module/custom-select-control-v2/custom-select-item.js.map +1 -0
- package/build-module/custom-select-control-v2/custom-select.js +82 -0
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -0
- package/build-module/custom-select-control-v2/default-component/index.js +30 -0
- package/build-module/custom-select-control-v2/default-component/index.js.map +1 -0
- package/build-module/custom-select-control-v2/index.js +2 -74
- package/build-module/custom-select-control-v2/index.js.map +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +111 -0
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -0
- package/build-module/custom-select-control-v2/styles.js +73 -42
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/custom-select-control-v2/types.js.map +1 -1
- package/build-module/draggable/index.native.js +2 -2
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/flex/flex/hook.js +1 -1
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +0 -1
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-token-field/index.js +3 -8
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +5 -12
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/h-stack/hook.js +6 -1
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +6 -15
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/modal/index.js +3 -10
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/progress-bar/styles.js +5 -5
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/query-controls/index.native.js.map +1 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/snackbar/index.js +3 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +2 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/snackbar/types.js.map +1 -1
- package/build-module/tabs/index.js +7 -7
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/utils/hooks/index.js +0 -1
- package/build-module/utils/hooks/index.js.map +1 -1
- package/build-module/utils/with-ignore-ime-events.js +28 -0
- package/build-module/utils/with-ignore-ime-events.js.map +1 -0
- package/build-style/style-rtl.css +10 -2
- package/build-style/style.css +10 -2
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/animate/stories/index.story.d.ts +7 -7
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-control/stories/index.story.d.ts +6 -6
- package/build-types/box-control/stories/index.story.d.ts +6 -6
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/index.story.d.ts +7 -7
- package/build-types/card/stories/index.story.d.ts +2 -2
- package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
- package/build-types/color-palette/stories/index.story.d.ts +3 -3
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select-item.d.ts +9 -0
- package/build-types/custom-select-control-v2/custom-select-item.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/custom-select.d.ts +6 -0
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/default-component/index.d.ts +6 -0
- package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/index.d.ts +5 -6
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts +5 -0
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts +2 -0
- package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/default.story.d.ts +30 -0
- package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +12 -0
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/styles.d.ts +31 -6
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/types.d.ts +136 -14
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +2 -2
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +3 -3
- package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
- package/build-types/flex/flex/hook.d.ts +2 -3
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
- package/build-types/guide/stories/index.story.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +2 -4
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/input-control/stories/index.story.d.ts +6 -6
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts +6 -6
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +4 -4
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +1 -1
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +1 -1
- package/build-types/search-control/stories/index.story.d.ts +2 -2
- package/build-types/select-control/stories/index.story.d.ts +2 -2
- package/build-types/shortcut/stories/index.story.d.ts +1 -1
- package/build-types/snackbar/index.d.ts +5 -2
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/snackbar/test/index.d.ts +2 -0
- package/build-types/snackbar/test/index.d.ts.map +1 -0
- package/build-types/snackbar/test/list.d.ts +2 -0
- package/build-types/snackbar/test/list.d.ts.map +1 -0
- package/build-types/snackbar/types.d.ts +18 -2
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +4 -4
- package/build-types/tabs/index.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts +9 -9
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/theme/stories/index.story.d.ts +1 -1
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +1 -1
- package/build-types/utils/hooks/index.d.ts +0 -1
- package/build-types/utils/with-ignore-ime-events.d.ts +15 -0
- package/build-types/utils/with-ignore-ime-events.d.ts.map +1 -0
- package/build-types/v-stack/hook.d.ts +2 -4
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/package.json +19 -20
- package/src/alignment-matrix-control/test/index.tsx +3 -1
- package/src/autocomplete/index.tsx +3 -10
- package/src/base-control/index.native.js +1 -1
- package/src/base-control/test/index.tsx +1 -1
- package/src/border-box-control/border-box-control/component.tsx +1 -1
- package/src/border-box-control/border-box-control-split-controls/component.tsx +4 -4
- package/src/border-control/border-control-dropdown/component.tsx +1 -1
- package/src/button/index.native.js +1 -1
- package/src/button/index.tsx +1 -1
- package/src/button/style.scss +1 -3
- package/src/circular-option-picker/test/index.tsx +6 -5
- package/src/color-picker/component.tsx +22 -11
- package/src/color-picker/styles.ts +1 -15
- package/src/combobox-control/index.tsx +33 -41
- package/src/combobox-control/test/index.tsx +1 -1
- package/src/composite/legacy/test/index.tsx +18 -2
- package/src/confirm-dialog/component.tsx +1 -1
- package/src/confirm-dialog/test/index.tsx +5 -21
- package/src/custom-select-control/README.md +0 -10
- package/src/custom-select-control/index.js +3 -22
- package/src/custom-select-control/stories/index.story.js +0 -1
- package/src/custom-select-control/test/index.js +17 -17
- package/src/custom-select-control-v2/README.md +97 -7
- package/src/custom-select-control-v2/custom-select-item.tsx +29 -0
- package/src/custom-select-control-v2/custom-select.tsx +122 -0
- package/src/custom-select-control-v2/default-component/index.tsx +27 -0
- package/src/custom-select-control-v2/index.tsx +2 -102
- package/src/custom-select-control-v2/legacy-component/index.tsx +133 -0
- package/src/custom-select-control-v2/legacy-component/test/index.tsx +457 -0
- package/src/custom-select-control-v2/stories/{index.story.tsx → default.story.tsx} +27 -33
- package/src/custom-select-control-v2/stories/legacy.story.tsx +87 -0
- package/src/custom-select-control-v2/styles.ts +82 -38
- package/src/custom-select-control-v2/test/index.tsx +207 -17
- package/src/custom-select-control-v2/types.ts +147 -20
- package/src/disabled/test/index.tsx +1 -1
- package/src/draggable/index.native.js +2 -2
- package/src/draggable/test/index.native.js +6 -2
- package/src/dropdown-menu/index.native.js +2 -2
- package/src/dropdown-menu-v2/stories/index.story.tsx +1 -0
- package/src/dropdown-menu-v2/test/index.tsx +4 -1
- package/src/flex/flex/hook.ts +1 -1
- package/src/font-size-picker/font-size-picker-select.tsx +0 -1
- package/src/font-size-picker/index.native.js +2 -2
- package/src/form-token-field/index.tsx +4 -11
- package/src/form-token-field/suggestions-list.tsx +5 -17
- package/src/h-stack/hook.tsx +2 -1
- package/src/h-stack/test/index.tsx +10 -0
- package/src/item-group/test/index.js +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +10 -15
- package/src/mobile/bottom-sheet/button.native.js +1 -5
- package/src/mobile/bottom-sheet/index.native.js +2 -2
- package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -2
- package/src/mobile/bottom-sheet-select-control/index.native.js +1 -1
- package/src/mobile/bottom-sheet-text-control/index.native.js +1 -1
- package/src/mobile/gradient/index.native.js +1 -1
- package/src/mobile/image/index.native.js +8 -23
- package/src/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +1 -1
- package/src/mobile/media-edit/index.native.js +1 -1
- package/src/modal/index.tsx +2 -12
- package/src/modal/style.scss +1 -0
- package/src/modal/test/index.tsx +1 -1
- package/src/navigation/stories/utils/hide-if-empty.tsx +2 -6
- package/src/palette-edit/index.tsx +2 -2
- package/src/popover/test/index.tsx +1 -4
- package/src/progress-bar/stories/index.story.tsx +1 -0
- package/src/progress-bar/styles.ts +2 -2
- package/src/query-controls/index.native.js +2 -2
- package/src/radio-group/stories/index.story.tsx +1 -0
- package/src/range-control/index.tsx +3 -3
- package/src/range-control/test/index.tsx +2 -2
- package/src/search-control/index.native.js +1 -1
- package/src/snackbar/index.tsx +5 -2
- package/src/snackbar/list.tsx +6 -1
- package/src/snackbar/stories/list.story.tsx +0 -3
- package/src/snackbar/test/index.tsx +267 -0
- package/src/snackbar/test/list.tsx +46 -0
- package/src/snackbar/types.ts +31 -3
- package/src/tab-panel/test/index.tsx +8 -1
- package/src/tabs/README.md +18 -18
- package/src/tabs/index.tsx +7 -7
- package/src/tabs/stories/index.story.tsx +2 -1
- package/src/tabs/test/index.tsx +66 -36
- package/src/tabs/types.ts +1 -1
- package/src/theme/stories/index.story.tsx +1 -0
- package/src/toggle-group-control/test/index.tsx +5 -1
- package/src/toolbar/toolbar-group/style.scss +1 -0
- package/src/tools-panel/stories/index.story.tsx +8 -8
- package/src/tools-panel/test/index.tsx +10 -28
- package/src/tooltip/style.scss +2 -1
- package/src/tooltip/test/index.native.js +3 -3
- package/src/tooltip/test/index.tsx +5 -0
- package/src/tree-grid/test/index.tsx +1 -1
- package/src/utils/hooks/index.js +0 -1
- package/src/utils/with-ignore-ime-events.ts +32 -0
- package/src/v-stack/test/index.tsx +10 -0
- package/tsconfig.json +0 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/custom-select-control/styles.js +0 -27
- package/build/custom-select-control/styles.js.map +0 -1
- package/build/utils/hooks/use-latest-ref.js +0 -33
- package/build/utils/hooks/use-latest-ref.js.map +0 -1
- package/build-module/custom-select-control/styles.js +0 -18
- package/build-module/custom-select-control/styles.js.map +0 -1
- package/build-module/utils/hooks/use-latest-ref.js +0 -27
- package/build-module/utils/hooks/use-latest-ref.js.map +0 -1
- package/build-types/custom-select-control/styles.d.ts +0 -11
- package/build-types/custom-select-control/styles.d.ts.map +0 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +0 -20
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +0 -1
- package/build-types/utils/hooks/use-latest-ref.d.ts +0 -15
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +0 -1
- package/src/custom-select-control/styles.ts +0 -28
- package/src/utils/hooks/test/use-latest-ref.js +0 -119
- package/src/utils/hooks/use-latest-ref.ts +0 -29
|
@@ -2,5 +2,4 @@ export { default as useControlledState } from "./use-controlled-state";
|
|
|
2
2
|
export { default as useUpdateEffect } from "./use-update-effect";
|
|
3
3
|
export { useControlledValue } from "./use-controlled-value";
|
|
4
4
|
export { useCx } from "./use-cx";
|
|
5
|
-
export { useLatestRef } from "./use-latest-ref";
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* A higher-order function that wraps a keydown event handler to ensure it is not an IME event.
|
|
4
|
+
*
|
|
5
|
+
* In CJK languages, an IME (Input Method Editor) is used to input complex characters.
|
|
6
|
+
* During an IME composition, keydown events (e.g. Enter or Escape) can be fired
|
|
7
|
+
* which are intended to control the IME and not the application.
|
|
8
|
+
* These events should be ignored by any application logic.
|
|
9
|
+
*
|
|
10
|
+
* @param keydownHandler The keydown event handler to execute after ensuring it was not an IME event.
|
|
11
|
+
*
|
|
12
|
+
* @return A wrapped version of the given event handler that ignores IME events.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withIgnoreIMEEvents<E extends React.KeyboardEvent | KeyboardEvent>(keydownHandler: (event: E) => void): (event: E) => void;
|
|
15
|
+
//# sourceMappingURL=with-ignore-ime-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-ignore-ime-events.d.ts","sourceRoot":"","sources":["../../src/utils/with-ignore-ime-events.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAClC,CAAC,SAAS,KAAK,CAAC,aAAa,GAAG,aAAa,EAC3C,cAAc,EAAE,CAAE,KAAK,EAAE,CAAC,KAAM,IAAI,WACtB,CAAC,UAgBjB"}
|
|
@@ -6,13 +6,11 @@ import type { WordPressComponentProps } from '../context';
|
|
|
6
6
|
import type { VStackProps } from './types';
|
|
7
7
|
export declare function useVStack(props: WordPressComponentProps<VStackProps, 'div'>): {
|
|
8
8
|
className: string;
|
|
9
|
-
isColumn: boolean;
|
|
10
|
-
children: import("react").ReactNode;
|
|
11
|
-
isReversed?: boolean | undefined;
|
|
12
9
|
id?: string | undefined;
|
|
13
10
|
prefix?: string | undefined;
|
|
14
11
|
slot?: string | undefined;
|
|
15
12
|
role?: import("react").AriaRole | undefined;
|
|
13
|
+
children: import("react").ReactNode;
|
|
16
14
|
style?: import("react").CSSProperties | undefined;
|
|
17
15
|
title?: string | undefined;
|
|
18
16
|
color?: string | undefined;
|
|
@@ -231,6 +229,7 @@ export declare function useVStack(props: WordPressComponentProps<VStackProps, 'd
|
|
|
231
229
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
232
230
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
233
231
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
as?: keyof JSX.IntrinsicElements | undefined;
|
|
234
233
|
key?: import("react").Key | null | undefined;
|
|
235
234
|
defaultChecked?: boolean | undefined;
|
|
236
235
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
@@ -264,6 +263,5 @@ export declare function useVStack(props: WordPressComponentProps<VStackProps, 'd
|
|
|
264
263
|
unselectable?: "on" | "off" | undefined;
|
|
265
264
|
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
266
265
|
is?: string | undefined;
|
|
267
|
-
as?: keyof JSX.IntrinsicElements | undefined;
|
|
268
266
|
};
|
|
269
267
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/v-stack/hook.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,SAAS,CACxB,KAAK,EAAE,uBAAuB,CAAE,WAAW,EAAE,KAAK,CAAE
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/v-stack/hook.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,SAAS,CACxB,KAAK,EAAE,uBAAuB,CAAE,WAAW,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpD"}
|
|
@@ -6,7 +6,7 @@ import type { Meta } from '@storybook/react';
|
|
|
6
6
|
import { VStack } from '..';
|
|
7
7
|
declare const meta: Meta<typeof VStack>;
|
|
8
8
|
export default meta;
|
|
9
|
-
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-
|
|
9
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, Omit<import("../../h-stack/types").Props, "spacing" | "alignment"> & {
|
|
10
10
|
alignment?: "top" | "bottom" | "left" | "center" | "right" | "start" | "end" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "baseline" | "stretch" | "flex-end" | "flex-start" | "self-end" | "self-start" | "edge" | "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
|
|
11
11
|
spacing?: import("csstype").Property.Width<string | number> | undefined;
|
|
12
12
|
} & import("react").RefAttributes<any> & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "direction" | "expanded" | "spacing" | "as" | "wrap" | "justify" | keyof import("react").RefAttributes<any> | "isReversed" | "alignment"> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.1.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -42,29 +42,28 @@
|
|
|
42
42
|
"@types/gradient-parser": "0.1.3",
|
|
43
43
|
"@types/highlight-words-core": "1.2.1",
|
|
44
44
|
"@use-gesture/react": "^10.2.24",
|
|
45
|
-
"@wordpress/a11y": "^3.
|
|
46
|
-
"@wordpress/compose": "^6.
|
|
47
|
-
"@wordpress/date": "^4.
|
|
48
|
-
"@wordpress/deprecated": "^3.
|
|
49
|
-
"@wordpress/dom": "^3.
|
|
50
|
-
"@wordpress/element": "^5.
|
|
51
|
-
"@wordpress/escape-html": "^2.
|
|
52
|
-
"@wordpress/hooks": "^3.
|
|
53
|
-
"@wordpress/html-entities": "^3.
|
|
54
|
-
"@wordpress/i18n": "^4.
|
|
55
|
-
"@wordpress/icons": "^9.
|
|
56
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
57
|
-
"@wordpress/keycodes": "^3.
|
|
58
|
-
"@wordpress/primitives": "^3.
|
|
59
|
-
"@wordpress/private-apis": "^0.
|
|
60
|
-
"@wordpress/rich-text": "^6.
|
|
61
|
-
"@wordpress/warning": "^2.
|
|
45
|
+
"@wordpress/a11y": "^3.53.0",
|
|
46
|
+
"@wordpress/compose": "^6.30.0",
|
|
47
|
+
"@wordpress/date": "^4.53.0",
|
|
48
|
+
"@wordpress/deprecated": "^3.53.0",
|
|
49
|
+
"@wordpress/dom": "^3.53.0",
|
|
50
|
+
"@wordpress/element": "^5.30.0",
|
|
51
|
+
"@wordpress/escape-html": "^2.53.0",
|
|
52
|
+
"@wordpress/hooks": "^3.53.0",
|
|
53
|
+
"@wordpress/html-entities": "^3.53.0",
|
|
54
|
+
"@wordpress/i18n": "^4.53.0",
|
|
55
|
+
"@wordpress/icons": "^9.44.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^4.53.0",
|
|
57
|
+
"@wordpress/keycodes": "^3.53.0",
|
|
58
|
+
"@wordpress/primitives": "^3.51.0",
|
|
59
|
+
"@wordpress/private-apis": "^0.35.0",
|
|
60
|
+
"@wordpress/rich-text": "^6.30.0",
|
|
61
|
+
"@wordpress/warning": "^2.53.0",
|
|
62
62
|
"change-case": "^4.1.2",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"colord": "^2.7.0",
|
|
65
65
|
"date-fns": "^2.28.0",
|
|
66
66
|
"deepmerge": "^4.3.0",
|
|
67
|
-
"dom-scroll-into-view": "^1.2.1",
|
|
68
67
|
"downshift": "^6.0.15",
|
|
69
68
|
"fast-deep-equal": "^3.1.3",
|
|
70
69
|
"framer-motion": "^10.13.0",
|
|
@@ -87,5 +86,5 @@
|
|
|
87
86
|
"publishConfig": {
|
|
88
87
|
"access": "public"
|
|
89
88
|
},
|
|
90
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "ac3c3e465a083081a86a4da6ee6fb817b41e5130"
|
|
91
90
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { render, screen, waitFor, within } from '@testing-library/react';
|
|
5
|
-
import { press, click } from '@ariakit/test';
|
|
5
|
+
import { press, click, sleep } from '@ariakit/test';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -39,6 +39,7 @@ describe( 'AlignmentMatrixControl', () => {
|
|
|
39
39
|
it( 'should be centered by default', async () => {
|
|
40
40
|
await renderAndInitCompositeStore( <AlignmentMatrixControl /> );
|
|
41
41
|
|
|
42
|
+
await sleep();
|
|
42
43
|
await press.Tab();
|
|
43
44
|
|
|
44
45
|
expect( getCell( 'center center' ) ).toHaveFocus();
|
|
@@ -109,6 +110,7 @@ describe( 'AlignmentMatrixControl', () => {
|
|
|
109
110
|
<AlignmentMatrixControl onChange={ spy } />
|
|
110
111
|
);
|
|
111
112
|
|
|
113
|
+
await sleep();
|
|
112
114
|
await press.Tab();
|
|
113
115
|
await press[ keyRef ]();
|
|
114
116
|
|
|
@@ -30,6 +30,7 @@ import { isAppleOS } from '@wordpress/keycodes';
|
|
|
30
30
|
*/
|
|
31
31
|
import { getAutoCompleterUI } from './autocompleter-ui';
|
|
32
32
|
import { escapeRegExp } from '../utils/strings';
|
|
33
|
+
import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
|
|
33
34
|
import type {
|
|
34
35
|
AutocompleteProps,
|
|
35
36
|
AutocompleterUIProps,
|
|
@@ -183,15 +184,7 @@ export function useAutocomplete( {
|
|
|
183
184
|
return;
|
|
184
185
|
}
|
|
185
186
|
|
|
186
|
-
if (
|
|
187
|
-
event.defaultPrevented ||
|
|
188
|
-
// Ignore keydowns from IMEs
|
|
189
|
-
event.isComposing ||
|
|
190
|
-
// Workaround for Mac Safari where the final Enter/Backspace of an IME composition
|
|
191
|
-
// is `isComposing=false`, even though it's technically still part of the composition.
|
|
192
|
-
// These can only be detected by keyCode.
|
|
193
|
-
event.keyCode === 229
|
|
194
|
-
) {
|
|
187
|
+
if ( event.defaultPrevented ) {
|
|
195
188
|
return;
|
|
196
189
|
}
|
|
197
190
|
|
|
@@ -390,7 +383,7 @@ export function useAutocomplete( {
|
|
|
390
383
|
return {
|
|
391
384
|
listBoxId,
|
|
392
385
|
activeId,
|
|
393
|
-
onKeyDown: handleKeyDown,
|
|
386
|
+
onKeyDown: withIgnoreIMEEvents( handleKeyDown ),
|
|
394
387
|
popover: hasSelection && AutocompleterUI && (
|
|
395
388
|
<AutocompleterUI
|
|
396
389
|
className={ className }
|
|
@@ -5,7 +5,7 @@ import { Text, View } from 'react-native';
|
|
|
5
5
|
|
|
6
6
|
export default function BaseControl( { label, help, children } ) {
|
|
7
7
|
return (
|
|
8
|
-
<View accessible
|
|
8
|
+
<View accessible accessibilityLabel={ label }>
|
|
9
9
|
{ label && <Text>{ label }</Text> }
|
|
10
10
|
{ children }
|
|
11
11
|
{ help && <Text>{ help }</Text> }
|
|
@@ -14,7 +14,7 @@ const MyBaseControl = ( props: Omit< BaseControlProps, 'children' > ) => {
|
|
|
14
14
|
const { baseControlProps, controlProps } = useBaseControlProps( props );
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<BaseControl { ...baseControlProps } __nextHasNoMarginBottom
|
|
17
|
+
<BaseControl { ...baseControlProps } __nextHasNoMarginBottom>
|
|
18
18
|
<textarea { ...controlProps } />
|
|
19
19
|
</BaseControl>
|
|
20
20
|
);
|
|
@@ -111,7 +111,7 @@ const UnconnectedBorderBoxControl = (
|
|
|
111
111
|
__unstablePopoverProps={ popoverProps }
|
|
112
112
|
shouldSanitizeBorder={ false } // This component will handle that.
|
|
113
113
|
value={ linkedValue }
|
|
114
|
-
withSlider
|
|
114
|
+
withSlider
|
|
115
115
|
width={
|
|
116
116
|
size === '__unstable-large' ? '116px' : '110px'
|
|
117
117
|
}
|
|
@@ -76,7 +76,7 @@ const BorderBoxControlSplitControls = (
|
|
|
76
76
|
<BorderBoxControlVisualizer value={ value } size={ size } />
|
|
77
77
|
<BorderControl
|
|
78
78
|
className={ centeredClassName }
|
|
79
|
-
hideLabelFromVision
|
|
79
|
+
hideLabelFromVision
|
|
80
80
|
label={ __( 'Top border' ) }
|
|
81
81
|
onChange={ ( newBorder ) => onChange( newBorder, 'top' ) }
|
|
82
82
|
__unstablePopoverProps={ popoverProps }
|
|
@@ -84,7 +84,7 @@ const BorderBoxControlSplitControls = (
|
|
|
84
84
|
{ ...sharedBorderControlProps }
|
|
85
85
|
/>
|
|
86
86
|
<BorderControl
|
|
87
|
-
hideLabelFromVision
|
|
87
|
+
hideLabelFromVision
|
|
88
88
|
label={ __( 'Left border' ) }
|
|
89
89
|
onChange={ ( newBorder ) => onChange( newBorder, 'left' ) }
|
|
90
90
|
__unstablePopoverProps={ popoverProps }
|
|
@@ -93,7 +93,7 @@ const BorderBoxControlSplitControls = (
|
|
|
93
93
|
/>
|
|
94
94
|
<BorderControl
|
|
95
95
|
className={ rightAlignedClassName }
|
|
96
|
-
hideLabelFromVision
|
|
96
|
+
hideLabelFromVision
|
|
97
97
|
label={ __( 'Right border' ) }
|
|
98
98
|
onChange={ ( newBorder ) => onChange( newBorder, 'right' ) }
|
|
99
99
|
__unstablePopoverProps={ popoverProps }
|
|
@@ -102,7 +102,7 @@ const BorderBoxControlSplitControls = (
|
|
|
102
102
|
/>
|
|
103
103
|
<BorderControl
|
|
104
104
|
className={ centeredClassName }
|
|
105
|
-
hideLabelFromVision
|
|
105
|
+
hideLabelFromVision
|
|
106
106
|
label={ __( 'Bottom border' ) }
|
|
107
107
|
onChange={ ( newBorder ) => onChange( newBorder, 'bottom' ) }
|
|
108
108
|
__unstablePopoverProps={ popoverProps }
|
|
@@ -179,7 +179,7 @@ const BorderControlDropdown = (
|
|
|
179
179
|
aria-label={ toggleAriaLabel }
|
|
180
180
|
tooltipPosition={ dropdownPosition }
|
|
181
181
|
label={ __( 'Border color and style picker' ) }
|
|
182
|
-
showTooltip
|
|
182
|
+
showTooltip
|
|
183
183
|
__next40pxDefaultSize={ size === '__unstable-large' ? true : false }
|
|
184
184
|
>
|
|
185
185
|
<span className={ indicatorWrapperClassName }>
|
package/src/button/index.tsx
CHANGED
|
@@ -223,10 +223,10 @@ export function UnforwardedButton(
|
|
|
223
223
|
<Icon icon={ icon } size={ iconSize } />
|
|
224
224
|
) }
|
|
225
225
|
{ text && <>{ text }</> }
|
|
226
|
+
{ children }
|
|
226
227
|
{ icon && iconPosition === 'right' && (
|
|
227
228
|
<Icon icon={ icon } size={ iconSize } />
|
|
228
229
|
) }
|
|
229
|
-
{ children }
|
|
230
230
|
</>
|
|
231
231
|
);
|
|
232
232
|
|
package/src/button/style.scss
CHANGED
|
@@ -84,9 +84,7 @@
|
|
|
84
84
|
outline: none;
|
|
85
85
|
|
|
86
86
|
&:focus:enabled {
|
|
87
|
-
box-shadow:
|
|
88
|
-
0 0 0 $border-width $components-color-background,
|
|
89
|
-
0 0 0 3px $components-color-accent;
|
|
87
|
+
box-shadow: inset 0 0 0 1px $components-color-background, 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { render, screen } from '@testing-library/react';
|
|
5
|
-
import { press } from '@ariakit/test';
|
|
5
|
+
import { press, sleep } from '@ariakit/test';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -59,9 +59,7 @@ describe( 'CircularOptionPicker', () => {
|
|
|
59
59
|
|
|
60
60
|
describe( 'when `asButtons` is true', () => {
|
|
61
61
|
it( 'should render as buttons', async () => {
|
|
62
|
-
render(
|
|
63
|
-
<CircularOptionPicker { ...DEFAULT_PROPS } asButtons={ true } />
|
|
64
|
-
);
|
|
62
|
+
render( <CircularOptionPicker { ...DEFAULT_PROPS } asButtons /> );
|
|
65
63
|
|
|
66
64
|
expect( screen.queryByRole( 'listbox' ) ).not.toBeInTheDocument();
|
|
67
65
|
expect( screen.queryByRole( 'option' ) ).not.toBeInTheDocument();
|
|
@@ -78,6 +76,7 @@ describe( 'CircularOptionPicker', () => {
|
|
|
78
76
|
/>
|
|
79
77
|
);
|
|
80
78
|
|
|
79
|
+
await sleep();
|
|
81
80
|
await press.Tab();
|
|
82
81
|
expect( getOption( 'Option One' ) ).toHaveFocus();
|
|
83
82
|
await press.ArrowRight();
|
|
@@ -93,10 +92,11 @@ describe( 'CircularOptionPicker', () => {
|
|
|
93
92
|
<CircularOptionPicker
|
|
94
93
|
{ ...DEFAULT_PROPS }
|
|
95
94
|
options={ MULTIPLE_OPTIONS }
|
|
96
|
-
loop
|
|
95
|
+
loop
|
|
97
96
|
/>
|
|
98
97
|
);
|
|
99
98
|
|
|
99
|
+
await sleep();
|
|
100
100
|
await press.Tab();
|
|
101
101
|
expect( getOption( 'Option One' ) ).toHaveFocus();
|
|
102
102
|
await press.ArrowRight();
|
|
@@ -116,6 +116,7 @@ describe( 'CircularOptionPicker', () => {
|
|
|
116
116
|
/>
|
|
117
117
|
);
|
|
118
118
|
|
|
119
|
+
await sleep();
|
|
119
120
|
await press.Tab();
|
|
120
121
|
expect( getOption( 'Option One' ) ).toHaveFocus();
|
|
121
122
|
await press.ArrowRight();
|
|
@@ -16,7 +16,11 @@ import { __ } from '@wordpress/i18n';
|
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
useContextSystem,
|
|
21
|
+
contextConnect,
|
|
22
|
+
ContextSystemProvider,
|
|
23
|
+
} from '../context';
|
|
20
24
|
import {
|
|
21
25
|
ColorfulWrapper,
|
|
22
26
|
SelectControl,
|
|
@@ -39,6 +43,9 @@ const options = [
|
|
|
39
43
|
{ label: 'Hex', value: 'hex' as const },
|
|
40
44
|
];
|
|
41
45
|
|
|
46
|
+
// `isBorderless` is still experimental and not a public prop for InputControl yet.
|
|
47
|
+
const BORDERLESS_SELECT_CONTROL_CONTEXT = { InputBase: { isBorderless: true } };
|
|
48
|
+
|
|
42
49
|
const UnconnectedColorPicker = (
|
|
43
50
|
props: ColorPickerProps,
|
|
44
51
|
forwardedRef: ForwardedRef< any >
|
|
@@ -107,16 +114,20 @@ const UnconnectedColorPicker = (
|
|
|
107
114
|
/>
|
|
108
115
|
<AuxiliaryColorArtefactWrapper>
|
|
109
116
|
<AuxiliaryColorArtefactHStackHeader justify="space-between">
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
<ContextSystemProvider
|
|
118
|
+
value={ BORDERLESS_SELECT_CONTROL_CONTEXT }
|
|
119
|
+
>
|
|
120
|
+
<SelectControl
|
|
121
|
+
__nextHasNoMarginBottom
|
|
122
|
+
options={ options }
|
|
123
|
+
value={ colorType }
|
|
124
|
+
onChange={ ( nextColorType ) =>
|
|
125
|
+
setColorType( nextColorType as ColorType )
|
|
126
|
+
}
|
|
127
|
+
label={ __( 'Color format' ) }
|
|
128
|
+
hideLabelFromVision
|
|
129
|
+
/>
|
|
130
|
+
</ContextSystemProvider>
|
|
120
131
|
<ColorCopyButton
|
|
121
132
|
color={ safeColordColor }
|
|
122
133
|
colorType={ copyFormat || colorType }
|
|
@@ -14,29 +14,15 @@ import { boxSizingReset } from '../utils';
|
|
|
14
14
|
import Button from '../button';
|
|
15
15
|
import { Flex } from '../flex';
|
|
16
16
|
import { HStack } from '../h-stack';
|
|
17
|
-
import {
|
|
18
|
-
BackdropUI,
|
|
19
|
-
Container as InputControlContainer,
|
|
20
|
-
} from '../input-control/styles/input-control-styles';
|
|
21
17
|
import CONFIG from '../utils/config-values';
|
|
22
18
|
|
|
23
19
|
export const NumberControlWrapper = styled( NumberControl )`
|
|
24
|
-
${
|
|
25
|
-
width: ${ space( 24 ) };
|
|
26
|
-
}
|
|
20
|
+
width: ${ space( 24 ) };
|
|
27
21
|
`;
|
|
28
22
|
|
|
29
23
|
export const SelectControl = styled( InnerSelectControl )`
|
|
30
24
|
margin-left: ${ space( -2 ) };
|
|
31
25
|
width: 5em;
|
|
32
|
-
/*
|
|
33
|
-
* Remove border, but preserve focus styles
|
|
34
|
-
* TODO: this override should be removed,
|
|
35
|
-
* see https://github.com/WordPress/gutenberg/pull/50609
|
|
36
|
-
*/
|
|
37
|
-
select:not( :focus ) ~ ${ BackdropUI }${ BackdropUI }${ BackdropUI } {
|
|
38
|
-
border-color: transparent;
|
|
39
|
-
}
|
|
40
26
|
`;
|
|
41
27
|
|
|
42
28
|
export const RangeControl = styled( InnerRangeControl )`
|
|
@@ -33,6 +33,7 @@ import { normalizeTextString } from '../utils/strings';
|
|
|
33
33
|
import type { ComboboxControlOption, ComboboxControlProps } from './types';
|
|
34
34
|
import type { TokenInputProps } from '../form-token-field/types';
|
|
35
35
|
import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
|
|
36
|
+
import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
|
|
36
37
|
|
|
37
38
|
const noop = () => {};
|
|
38
39
|
|
|
@@ -186,51 +187,42 @@ function ComboboxControl( props: ComboboxControlProps ) {
|
|
|
186
187
|
setIsExpanded( true );
|
|
187
188
|
};
|
|
188
189
|
|
|
189
|
-
const onKeyDown: React.KeyboardEventHandler< HTMLDivElement > =
|
|
190
|
-
event
|
|
191
|
-
|
|
192
|
-
let preventDefault = false;
|
|
190
|
+
const onKeyDown: React.KeyboardEventHandler< HTMLDivElement > =
|
|
191
|
+
withIgnoreIMEEvents( ( event ) => {
|
|
192
|
+
let preventDefault = false;
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
event.nativeEvent.isComposing ||
|
|
198
|
-
// Workaround for Mac Safari where the final Enter/Backspace of an IME composition
|
|
199
|
-
// is `isComposing=false`, even though it's technically still part of the composition.
|
|
200
|
-
// These can only be detected by keyCode.
|
|
201
|
-
event.keyCode === 229
|
|
202
|
-
) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
194
|
+
if ( event.defaultPrevented ) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
205
197
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
198
|
+
switch ( event.code ) {
|
|
199
|
+
case 'Enter':
|
|
200
|
+
if ( selectedSuggestion ) {
|
|
201
|
+
onSuggestionSelected( selectedSuggestion );
|
|
202
|
+
preventDefault = true;
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case 'ArrowUp':
|
|
206
|
+
handleArrowNavigation( -1 );
|
|
210
207
|
preventDefault = true;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
preventDefault = true;
|
|
225
|
-
break;
|
|
226
|
-
default:
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
208
|
+
break;
|
|
209
|
+
case 'ArrowDown':
|
|
210
|
+
handleArrowNavigation( 1 );
|
|
211
|
+
preventDefault = true;
|
|
212
|
+
break;
|
|
213
|
+
case 'Escape':
|
|
214
|
+
setIsExpanded( false );
|
|
215
|
+
setSelectedSuggestion( null );
|
|
216
|
+
preventDefault = true;
|
|
217
|
+
break;
|
|
218
|
+
default:
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
229
221
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
222
|
+
if ( preventDefault ) {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
}
|
|
225
|
+
} );
|
|
234
226
|
|
|
235
227
|
const onBlur = () => {
|
|
236
228
|
setInputHasFocus( false );
|