@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
|
@@ -71,7 +71,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
|
|
|
71
71
|
hasValue={ () => !! width }
|
|
72
72
|
label="Width"
|
|
73
73
|
onDeselect={ () => setWidth( undefined ) }
|
|
74
|
-
isShownByDefault
|
|
74
|
+
isShownByDefault
|
|
75
75
|
>
|
|
76
76
|
<UnitControl
|
|
77
77
|
label="Width"
|
|
@@ -83,7 +83,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
|
|
|
83
83
|
hasValue={ () => !! height }
|
|
84
84
|
label="Height"
|
|
85
85
|
onDeselect={ () => setHeight( undefined ) }
|
|
86
|
-
isShownByDefault
|
|
86
|
+
isShownByDefault
|
|
87
87
|
>
|
|
88
88
|
<UnitControl
|
|
89
89
|
label="Height"
|
|
@@ -95,7 +95,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
|
|
|
95
95
|
hasValue={ () => !! minHeight }
|
|
96
96
|
label="Minimum height"
|
|
97
97
|
onDeselect={ () => setMinHeight( undefined ) }
|
|
98
|
-
isShownByDefault
|
|
98
|
+
isShownByDefault
|
|
99
99
|
>
|
|
100
100
|
<UnitControl
|
|
101
101
|
label="Minimum height"
|
|
@@ -163,7 +163,7 @@ export const WithNonToolsPanelItems: StoryFn< typeof ToolsPanel > = ( {
|
|
|
163
163
|
hasValue={ () => !! width }
|
|
164
164
|
label="Width"
|
|
165
165
|
onDeselect={ () => setWidth( undefined ) }
|
|
166
|
-
isShownByDefault
|
|
166
|
+
isShownByDefault
|
|
167
167
|
>
|
|
168
168
|
<UnitControl
|
|
169
169
|
label="Width"
|
|
@@ -175,7 +175,7 @@ export const WithNonToolsPanelItems: StoryFn< typeof ToolsPanel > = ( {
|
|
|
175
175
|
hasValue={ () => !! height }
|
|
176
176
|
label="Height"
|
|
177
177
|
onDeselect={ () => setHeight( undefined ) }
|
|
178
|
-
isShownByDefault
|
|
178
|
+
isShownByDefault
|
|
179
179
|
>
|
|
180
180
|
<UnitControl
|
|
181
181
|
label="Height"
|
|
@@ -437,7 +437,7 @@ export const WithConditionalDefaultControl: StoryFn< typeof ToolsPanel > = ( {
|
|
|
437
437
|
onDeselect={ () => updateAttribute( 'height', undefined ) }
|
|
438
438
|
resetAllFilter={ () => ( { height: undefined } ) }
|
|
439
439
|
panelId={ panelId }
|
|
440
|
-
isShownByDefault
|
|
440
|
+
isShownByDefault
|
|
441
441
|
>
|
|
442
442
|
<UnitControl
|
|
443
443
|
label="Injected Height"
|
|
@@ -536,7 +536,7 @@ export const WithConditionallyRenderedControl: StoryFn<
|
|
|
536
536
|
} }
|
|
537
537
|
resetAllFilter={ () => ( { height: undefined } ) }
|
|
538
538
|
panelId={ panelId }
|
|
539
|
-
isShownByDefault
|
|
539
|
+
isShownByDefault
|
|
540
540
|
>
|
|
541
541
|
<UnitControl
|
|
542
542
|
label="Injected Height"
|
|
@@ -555,7 +555,7 @@ export const WithConditionallyRenderedControl: StoryFn<
|
|
|
555
555
|
}
|
|
556
556
|
resetAllFilter={ () => ( { scale: undefined } ) }
|
|
557
557
|
panelId={ panelId }
|
|
558
|
-
isShownByDefault
|
|
558
|
+
isShownByDefault
|
|
559
559
|
>
|
|
560
560
|
<ToggleGroupControl
|
|
561
561
|
__nextHasNoMarginBottom
|
|
@@ -222,10 +222,7 @@ describe( 'ToolsPanel', () => {
|
|
|
222
222
|
<ToolsPanelItem { ...controlProps }>
|
|
223
223
|
<div>Example control</div>
|
|
224
224
|
</ToolsPanelItem>
|
|
225
|
-
<ToolsPanelItem
|
|
226
|
-
{ ...altControlProps }
|
|
227
|
-
isShownByDefault={ true }
|
|
228
|
-
>
|
|
225
|
+
<ToolsPanelItem { ...altControlProps } isShownByDefault>
|
|
229
226
|
<div>Alt control</div>
|
|
230
227
|
</ToolsPanelItem>
|
|
231
228
|
</ToolsPanel>
|
|
@@ -413,10 +410,7 @@ describe( 'ToolsPanel', () => {
|
|
|
413
410
|
it( 'should continue to render shown by default item after it is toggled off via menu item', async () => {
|
|
414
411
|
render(
|
|
415
412
|
<ToolsPanel { ...defaultProps }>
|
|
416
|
-
<ToolsPanelItem
|
|
417
|
-
{ ...controlProps }
|
|
418
|
-
isShownByDefault={ true }
|
|
419
|
-
>
|
|
413
|
+
<ToolsPanelItem { ...controlProps } isShownByDefault>
|
|
420
414
|
<div>Default control</div>
|
|
421
415
|
</ToolsPanelItem>
|
|
422
416
|
</ToolsPanel>
|
|
@@ -440,10 +434,7 @@ describe( 'ToolsPanel', () => {
|
|
|
440
434
|
it( 'should render appropriate menu groups', async () => {
|
|
441
435
|
render(
|
|
442
436
|
<ToolsPanel { ...defaultProps }>
|
|
443
|
-
<ToolsPanelItem
|
|
444
|
-
{ ...controlProps }
|
|
445
|
-
isShownByDefault={ true }
|
|
446
|
-
>
|
|
437
|
+
<ToolsPanelItem { ...controlProps } isShownByDefault>
|
|
447
438
|
<div>Default control</div>
|
|
448
439
|
</ToolsPanelItem>
|
|
449
440
|
<ToolsPanelItem { ...altControlProps }>
|
|
@@ -461,10 +452,7 @@ describe( 'ToolsPanel', () => {
|
|
|
461
452
|
|
|
462
453
|
it( 'should not render contents of items when in placeholder state', () => {
|
|
463
454
|
render(
|
|
464
|
-
<ToolsPanel
|
|
465
|
-
{ ...defaultProps }
|
|
466
|
-
shouldRenderPlaceholderItems={ true }
|
|
467
|
-
>
|
|
455
|
+
<ToolsPanel { ...defaultProps } shouldRenderPlaceholderItems>
|
|
468
456
|
<ToolsPanelItem { ...altControlProps }>
|
|
469
457
|
<div>Optional control</div>
|
|
470
458
|
</ToolsPanelItem>
|
|
@@ -493,10 +481,7 @@ describe( 'ToolsPanel', () => {
|
|
|
493
481
|
|
|
494
482
|
const TestPanel = () => (
|
|
495
483
|
<ToolsPanel { ...defaultProps }>
|
|
496
|
-
<ToolsPanelItem
|
|
497
|
-
{ ...altControlProps }
|
|
498
|
-
isShownByDefault={ true }
|
|
499
|
-
>
|
|
484
|
+
<ToolsPanelItem { ...altControlProps } isShownByDefault>
|
|
500
485
|
<div>Default control</div>
|
|
501
486
|
</ToolsPanelItem>
|
|
502
487
|
<ToolsPanelItem
|
|
@@ -568,16 +553,13 @@ describe( 'ToolsPanel', () => {
|
|
|
568
553
|
|
|
569
554
|
const TestPanel = () => (
|
|
570
555
|
<ToolsPanel { ...defaultProps }>
|
|
571
|
-
<ToolsPanelItem
|
|
572
|
-
{ ...altControlProps }
|
|
573
|
-
isShownByDefault={ true }
|
|
574
|
-
>
|
|
556
|
+
<ToolsPanelItem { ...altControlProps } isShownByDefault>
|
|
575
557
|
<div>Default control</div>
|
|
576
558
|
</ToolsPanelItem>
|
|
577
559
|
{ !! altControlValue && (
|
|
578
560
|
<ToolsPanelItem
|
|
579
561
|
{ ...conditionalControlProps }
|
|
580
|
-
isShownByDefault
|
|
562
|
+
isShownByDefault
|
|
581
563
|
>
|
|
582
564
|
<div>Conditional control</div>
|
|
583
565
|
</ToolsPanelItem>
|
|
@@ -1340,7 +1322,7 @@ describe( 'ToolsPanel', () => {
|
|
|
1340
1322
|
{ ...altControlProps }
|
|
1341
1323
|
label="Item 3"
|
|
1342
1324
|
data-testid="item-3"
|
|
1343
|
-
isShownByDefault
|
|
1325
|
+
isShownByDefault
|
|
1344
1326
|
>
|
|
1345
1327
|
<div>Item 3</div>
|
|
1346
1328
|
</ToolsPanelItem>
|
|
@@ -1352,8 +1334,8 @@ describe( 'ToolsPanel', () => {
|
|
|
1352
1334
|
</ToolsPanelItems>
|
|
1353
1335
|
<ToolsPanel
|
|
1354
1336
|
{ ...defaultProps }
|
|
1355
|
-
hasInnerWrapper
|
|
1356
|
-
shouldRenderPlaceholderItems
|
|
1337
|
+
hasInnerWrapper
|
|
1338
|
+
shouldRenderPlaceholderItems
|
|
1357
1339
|
__experimentalFirstVisibleItemClass="first"
|
|
1358
1340
|
__experimentalLastVisibleItemClass="last"
|
|
1359
1341
|
>
|
package/src/tooltip/style.scss
CHANGED
|
@@ -44,7 +44,7 @@ afterAll( () => {
|
|
|
44
44
|
it( 'displays the message', () => {
|
|
45
45
|
const screen = render(
|
|
46
46
|
<TooltipSlot>
|
|
47
|
-
<Tooltip visible
|
|
47
|
+
<Tooltip visible text="A helpful message">
|
|
48
48
|
<Text>I need help</Text>
|
|
49
49
|
</Tooltip>
|
|
50
50
|
</TooltipSlot>
|
|
@@ -56,7 +56,7 @@ it( 'displays the message', () => {
|
|
|
56
56
|
it( 'dismisses when the screen is tapped', () => {
|
|
57
57
|
const screen = render(
|
|
58
58
|
<TooltipSlot>
|
|
59
|
-
<Tooltip visible
|
|
59
|
+
<Tooltip visible text="A helpful message">
|
|
60
60
|
<Text>I need help</Text>
|
|
61
61
|
</Tooltip>
|
|
62
62
|
</TooltipSlot>
|
|
@@ -72,7 +72,7 @@ it( 'dismisses when the screen is tapped', () => {
|
|
|
72
72
|
it( 'dismisses when the keyboard closes', () => {
|
|
73
73
|
const screen = render(
|
|
74
74
|
<TooltipSlot>
|
|
75
|
-
<Tooltip visible
|
|
75
|
+
<Tooltip visible text="A helpful message">
|
|
76
76
|
<Text>I need help</Text>
|
|
77
77
|
</Tooltip>
|
|
78
78
|
</TooltipSlot>
|
|
@@ -67,6 +67,7 @@ describe( 'Tooltip', () => {
|
|
|
67
67
|
screen.getByRole( 'button', { name: 'Second button' } )
|
|
68
68
|
).toBeVisible();
|
|
69
69
|
|
|
70
|
+
await sleep();
|
|
70
71
|
await press.Tab();
|
|
71
72
|
|
|
72
73
|
expectTooltipToBeHidden();
|
|
@@ -134,6 +135,7 @@ describe( 'Tooltip', () => {
|
|
|
134
135
|
);
|
|
135
136
|
|
|
136
137
|
// Focus the anchor, tooltip should show
|
|
138
|
+
await sleep();
|
|
137
139
|
await press.Tab();
|
|
138
140
|
expect(
|
|
139
141
|
screen.getByRole( 'button', { name: 'Tooltip anchor' } )
|
|
@@ -141,6 +143,7 @@ describe( 'Tooltip', () => {
|
|
|
141
143
|
await waitExpectTooltipToShow();
|
|
142
144
|
|
|
143
145
|
// Focus the other button, tooltip should hide
|
|
146
|
+
await sleep();
|
|
144
147
|
await press.Tab();
|
|
145
148
|
expect(
|
|
146
149
|
screen.getByRole( 'button', { name: 'Focus me' } )
|
|
@@ -166,11 +169,13 @@ describe( 'Tooltip', () => {
|
|
|
166
169
|
expect( anchor ).toHaveAttribute( 'aria-disabled', 'true' );
|
|
167
170
|
|
|
168
171
|
// Focus anchor, tooltip should show
|
|
172
|
+
await sleep();
|
|
169
173
|
await press.Tab();
|
|
170
174
|
expect( anchor ).toHaveFocus();
|
|
171
175
|
await waitExpectTooltipToShow();
|
|
172
176
|
|
|
173
177
|
// Focus another button, tooltip should hide
|
|
178
|
+
await sleep();
|
|
174
179
|
await press.Tab();
|
|
175
180
|
expect(
|
|
176
181
|
screen.getByRole( 'button', {
|
package/src/utils/hooks/index.js
CHANGED
|
@@ -2,4 +2,3 @@ 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';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A higher-order function that wraps a keydown event handler to ensure it is not an IME event.
|
|
3
|
+
*
|
|
4
|
+
* In CJK languages, an IME (Input Method Editor) is used to input complex characters.
|
|
5
|
+
* During an IME composition, keydown events (e.g. Enter or Escape) can be fired
|
|
6
|
+
* which are intended to control the IME and not the application.
|
|
7
|
+
* These events should be ignored by any application logic.
|
|
8
|
+
*
|
|
9
|
+
* @param keydownHandler The keydown event handler to execute after ensuring it was not an IME event.
|
|
10
|
+
*
|
|
11
|
+
* @return A wrapped version of the given event handler that ignores IME events.
|
|
12
|
+
*/
|
|
13
|
+
export function withIgnoreIMEEvents<
|
|
14
|
+
E extends React.KeyboardEvent | KeyboardEvent,
|
|
15
|
+
>( keydownHandler: ( event: E ) => void ) {
|
|
16
|
+
return ( event: E ) => {
|
|
17
|
+
const { isComposing } =
|
|
18
|
+
'nativeEvent' in event ? event.nativeEvent : event;
|
|
19
|
+
|
|
20
|
+
if (
|
|
21
|
+
isComposing ||
|
|
22
|
+
// Workaround for Mac Safari where the final Enter/Backspace of an IME composition
|
|
23
|
+
// is `isComposing=false`, even though it's technically still part of the composition.
|
|
24
|
+
// These can only be detected by keyCode.
|
|
25
|
+
event.keyCode === 229
|
|
26
|
+
) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
keydownHandler( event );
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -39,4 +39,14 @@ describe( 'props', () => {
|
|
|
39
39
|
);
|
|
40
40
|
expect( container ).toMatchSnapshot();
|
|
41
41
|
} );
|
|
42
|
+
|
|
43
|
+
test( 'should not pass through invalid props to the `as` component', () => {
|
|
44
|
+
const AsComponent = ( props: JSX.IntrinsicElements[ 'div' ] ) => {
|
|
45
|
+
return <div { ...props } />;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
render( <VStack as={ AsComponent }>foobar</VStack> );
|
|
49
|
+
|
|
50
|
+
expect( console ).not.toHaveErrored();
|
|
51
|
+
} );
|
|
42
52
|
} );
|