@wordpress/components 28.13.0 → 28.14.1-next.cd6172eb0.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 +43 -1
- package/build/angle-picker-control/index.js +1 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/autocomplete/index.js +0 -1
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-control/border-control/component.js +2 -0
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/box-control/all-input-control.js +1 -0
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +1 -0
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/index.js +9 -2
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +1 -0
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/clipboard-button/index.js +5 -3
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.native.js +0 -1
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/input-with-slider.js +2 -2
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/composite/item.js +0 -9
- package/build/composite/item.js.map +1 -1
- package/build/context/context-connect.js +0 -1
- package/build/context/context-connect.js.map +1 -1
- package/build/custom-gradient-picker/index.js +2 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/types.js.map +1 -1
- package/build/custom-select-control/index.js +8 -0
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control/types.js.map +1 -1
- package/build/drop-zone/index.js +19 -13
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/types.js.map +1 -1
- package/build/dropdown-menu/index.js +1 -0
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js +9 -14
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/external-link/index.js +0 -1
- package/build/external-link/index.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +1 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/index.js +1 -0
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-file-upload/index.js +11 -1
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-file-upload/types.js.map +1 -1
- package/build/form-token-field/index.js +6 -1
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +2 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/gradient-picker/types.js.map +1 -1
- package/build/menu/checkbox-item.js +5 -9
- package/build/menu/checkbox-item.js.map +1 -1
- package/build/menu/group-label.js +4 -1
- package/build/menu/group-label.js.map +1 -1
- package/build/menu/group.js +4 -1
- package/build/menu/group.js.map +1 -1
- package/build/menu/item-help-text.js +5 -0
- package/build/menu/item-help-text.js.map +1 -1
- package/build/menu/item-label.js +5 -0
- package/build/menu/item-label.js.map +1 -1
- package/build/menu/item.js +4 -8
- package/build/menu/item.js.map +1 -1
- package/build/menu/radio-item.js +5 -9
- package/build/menu/radio-item.js.map +1 -1
- package/build/menu/separator.js +5 -2
- package/build/menu/separator.js.map +1 -1
- package/build/modal/aria-helper.js +0 -1
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +0 -1
- package/build/modal/index.js.map +1 -1
- package/build/number-control/index.js +8 -0
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/types.js.map +1 -1
- package/build/range-control/index.js +2 -1
- package/build/range-control/index.js.map +1 -1
- package/build/resizable-box/index.js +9 -1
- package/build/resizable-box/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +8 -12
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +4 -10
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/style-provider/index.js +0 -1
- package/build/style-provider/index.js.map +1 -1
- package/build/tabs/tab.js +0 -17
- package/build/tabs/tab.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +2 -0
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +2 -0
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/unit-control/index.js +10 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/types.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/index.js +0 -1
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +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/component.js +2 -0
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/box-control/all-input-control.js +1 -0
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -0
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/index.js +9 -2
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +1 -0
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/clipboard-button/index.js +5 -3
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +0 -1
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +2 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/composite/item.js +0 -9
- package/build-module/composite/item.js.map +1 -1
- package/build-module/context/context-connect.js +0 -1
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +2 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/types.js.map +1 -1
- package/build-module/custom-select-control/index.js +8 -0
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control/types.js.map +1 -1
- package/build-module/drop-zone/index.js +19 -13
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/types.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -0
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +10 -15
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/external-link/index.js +0 -1
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +1 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -0
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-file-upload/index.js +13 -2
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-file-upload/types.js.map +1 -1
- package/build-module/form-token-field/index.js +6 -1
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +2 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/gradient-picker/types.js.map +1 -1
- package/build-module/menu/checkbox-item.js +5 -9
- package/build-module/menu/checkbox-item.js.map +1 -1
- package/build-module/menu/group-label.js +4 -1
- package/build-module/menu/group-label.js.map +1 -1
- package/build-module/menu/group.js +4 -1
- package/build-module/menu/group.js.map +1 -1
- package/build-module/menu/item-help-text.js +6 -1
- package/build-module/menu/item-help-text.js.map +1 -1
- package/build-module/menu/item-label.js +6 -1
- package/build-module/menu/item-label.js.map +1 -1
- package/build-module/menu/item.js +4 -8
- package/build-module/menu/item.js.map +1 -1
- package/build-module/menu/radio-item.js +5 -9
- package/build-module/menu/radio-item.js.map +1 -1
- package/build-module/menu/separator.js +5 -2
- package/build-module/menu/separator.js.map +1 -1
- package/build-module/modal/aria-helper.js +0 -1
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +0 -1
- package/build-module/modal/index.js.map +1 -1
- package/build-module/number-control/index.js +8 -0
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/types.js.map +1 -1
- package/build-module/range-control/index.js +2 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/resizable-box/index.js +9 -1
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/style-provider/index.js +0 -1
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/tabs/tab.js +0 -15
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +2 -0
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +2 -0
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/unit-control/index.js +10 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/types.js.map +1 -1
- package/build-style/style-rtl.css +9 -5
- package/build-style/style.css +9 -5
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/box-control/all-input-control.d.ts.map +1 -1
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +1 -0
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-controls.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +42 -6
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +14 -2
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/clipboard-button/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -2
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/composite/item.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/types.d.ts +6 -0
- package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/types.d.ts +7 -0
- package/build-types/custom-select-control/types.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +8 -4
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/drop-zone/types.d.ts +5 -0
- package/build-types/drop-zone/types.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts +2 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +10 -8
- package/build-types/form-file-upload/types.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/gradient-picker/index.d.ts +1 -1
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/gradient-picker/types.d.ts +6 -0
- package/build-types/gradient-picker/types.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts +2 -2
- package/build-types/menu/checkbox-item.d.ts.map +1 -1
- package/build-types/menu/group-label.d.ts.map +1 -1
- package/build-types/menu/group.d.ts.map +1 -1
- package/build-types/menu/index.d.ts.map +1 -1
- package/build-types/menu/item-help-text.d.ts.map +1 -1
- package/build-types/menu/item-label.d.ts.map +1 -1
- package/build-types/menu/item.d.ts.map +1 -1
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu/separator.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +2 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +2 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +7 -0
- package/build-types/number-control/types.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts +4 -3
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +3 -0
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +3 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +7 -0
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/angle-picker-control/index.tsx +1 -1
- package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
- package/src/border-control/border-control/component.tsx +2 -0
- package/src/box-control/README.md +1 -0
- package/src/box-control/all-input-control.tsx +1 -0
- package/src/box-control/axial-input-controls.tsx +1 -0
- package/src/box-control/index.tsx +10 -2
- package/src/box-control/input-controls.tsx +1 -0
- package/src/box-control/stories/index.story.tsx +1 -0
- package/src/box-control/test/index.tsx +33 -26
- package/src/box-control/types.ts +71 -56
- package/src/clipboard-button/index.tsx +5 -3
- package/src/color-picker/input-with-slider.tsx +1 -1
- package/src/composite/item.tsx +1 -19
- package/src/custom-gradient-picker/index.tsx +2 -0
- package/src/custom-gradient-picker/types.ts +6 -0
- package/src/custom-select-control/README.md +2 -0
- package/src/custom-select-control/index.tsx +9 -0
- package/src/custom-select-control/stories/index.story.tsx +1 -0
- package/src/custom-select-control/test/index.tsx +13 -9
- package/src/custom-select-control/types.ts +7 -0
- package/src/drop-zone/index.tsx +21 -24
- package/src/drop-zone/types.ts +5 -0
- package/src/dropdown-menu/index.tsx +1 -0
- package/src/dropdown-menu/style.scss +1 -1
- package/src/duotone-picker/color-list-picker/index.tsx +8 -8
- package/src/duotone-picker/color-list-picker/style.scss +0 -6
- package/src/font-size-picker/font-size-picker-select.tsx +1 -0
- package/src/font-size-picker/index.tsx +1 -0
- package/src/form-file-upload/README.md +58 -48
- package/src/form-file-upload/docs-manifest.json +5 -0
- package/src/form-file-upload/index.tsx +12 -1
- package/src/form-file-upload/stories/index.story.tsx +1 -0
- package/src/form-file-upload/test/index.tsx +5 -1
- package/src/form-file-upload/types.ts +10 -8
- package/src/form-token-field/README.md +1 -0
- package/src/form-token-field/index.tsx +7 -0
- package/src/form-token-field/stories/index.story.tsx +2 -0
- package/src/form-token-field/test/index.tsx +5 -1
- package/src/gradient-picker/README.md +8 -0
- package/src/gradient-picker/index.tsx +2 -0
- package/src/gradient-picker/types.ts +6 -0
- package/src/menu/checkbox-item.tsx +9 -7
- package/src/menu/group-label.tsx +8 -1
- package/src/menu/group.tsx +8 -1
- package/src/menu/item-help-text.tsx +10 -1
- package/src/menu/item-label.tsx +10 -1
- package/src/menu/item.tsx +8 -6
- package/src/menu/radio-item.tsx +9 -7
- package/src/menu/separator.tsx +9 -2
- package/src/menu-items-choice/style.scss +1 -0
- package/src/number-control/README.md +2 -1
- package/src/number-control/index.tsx +9 -0
- package/src/number-control/stories/index.story.tsx +1 -0
- package/src/number-control/test/index.tsx +5 -1
- package/src/number-control/types.ts +7 -0
- package/src/range-control/index.tsx +1 -0
- package/src/resizable-box/index.tsx +10 -0
- package/src/resizable-box/style.scss +8 -0
- package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
- package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
- package/src/slot-fill/types.ts +4 -3
- package/src/tabs/tab.tsx +0 -18
- package/src/tabs/test/index.tsx +1492 -947
- package/src/toolbar/toolbar-button/index.tsx +2 -0
- package/src/tools-panel/stories/index.story.tsx +12 -0
- package/src/tools-panel/tools-panel/README.md +4 -0
- package/src/tools-panel/tools-panel/component.tsx +2 -0
- package/src/unit-control/README.md +3 -3
- package/src/unit-control/index.tsx +11 -1
- package/src/unit-control/stories/index.story.tsx +1 -0
- package/src/unit-control/test/index.tsx +5 -1
- package/src/unit-control/types.ts +7 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/menu/use-temporary-focus-visible-fix.js +0 -27
- package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
- package/build-module/menu/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-types/menu/use-temporary-focus-visible-fix.d.ts +0 -8
- package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
- package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
|
@@ -108,6 +108,7 @@ export default function BoxInputControls( {
|
|
|
108
108
|
<Tooltip placement="top-end" text={ LABELS[ side ] }>
|
|
109
109
|
<StyledUnitControl
|
|
110
110
|
{ ...props }
|
|
111
|
+
__shouldNotWarnDeprecated36pxSize
|
|
111
112
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
112
113
|
className="component-box-control__unit-control"
|
|
113
114
|
id={ inputId }
|
|
@@ -49,6 +49,7 @@ const TemplateControlled: StoryFn< typeof BoxControl > = ( props ) => {
|
|
|
49
49
|
export const Default = TemplateUncontrolled.bind( {} );
|
|
50
50
|
Default.args = {
|
|
51
51
|
label: 'Label',
|
|
52
|
+
__next40pxDefaultSize: true,
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
export const Controlled = TemplateControlled.bind( {} );
|
|
@@ -15,11 +15,14 @@ import { useState } from '@wordpress/element';
|
|
|
15
15
|
import BoxControl from '..';
|
|
16
16
|
import type { BoxControlProps, BoxControlValue } from '../types';
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const ControlledBoxControl = (
|
|
19
|
+
extraProps: Omit< BoxControlProps, 'onChange' >
|
|
20
|
+
) => {
|
|
19
21
|
const [ state, setState ] = useState< BoxControlValue >();
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
24
|
<BoxControl
|
|
25
|
+
__next40pxDefaultSize
|
|
23
26
|
values={ state }
|
|
24
27
|
onChange={ ( next ) => setState( next ) }
|
|
25
28
|
{ ...extraProps }
|
|
@@ -27,10 +30,17 @@ const Example = ( extraProps: Omit< BoxControlProps, 'onChange' > ) => {
|
|
|
27
30
|
);
|
|
28
31
|
};
|
|
29
32
|
|
|
33
|
+
const UncontrolledBoxControl = ( {
|
|
34
|
+
onChange = () => {},
|
|
35
|
+
...props
|
|
36
|
+
}: Omit< BoxControlProps, 'onChange' > & {
|
|
37
|
+
onChange?: BoxControlProps[ 'onChange' ];
|
|
38
|
+
} ) => <BoxControl __next40pxDefaultSize onChange={ onChange } { ...props } />;
|
|
39
|
+
|
|
30
40
|
describe( 'BoxControl', () => {
|
|
31
41
|
describe( 'Basic rendering', () => {
|
|
32
42
|
it( 'should render a box control input', () => {
|
|
33
|
-
render( <
|
|
43
|
+
render( <UncontrolledBoxControl /> );
|
|
34
44
|
|
|
35
45
|
expect(
|
|
36
46
|
screen.getByRole( 'group', { name: 'Box Control' } )
|
|
@@ -43,7 +53,7 @@ describe( 'BoxControl', () => {
|
|
|
43
53
|
it( 'should update values when interacting with input', async () => {
|
|
44
54
|
const user = userEvent.setup();
|
|
45
55
|
|
|
46
|
-
render( <
|
|
56
|
+
render( <UncontrolledBoxControl /> );
|
|
47
57
|
|
|
48
58
|
const input = screen.getByRole( 'textbox', { name: 'All sides' } );
|
|
49
59
|
|
|
@@ -54,7 +64,7 @@ describe( 'BoxControl', () => {
|
|
|
54
64
|
} );
|
|
55
65
|
|
|
56
66
|
it( 'should update input values when interacting with slider', () => {
|
|
57
|
-
render( <
|
|
67
|
+
render( <UncontrolledBoxControl /> );
|
|
58
68
|
|
|
59
69
|
const slider = screen.getByRole( 'slider' );
|
|
60
70
|
|
|
@@ -68,7 +78,7 @@ describe( 'BoxControl', () => {
|
|
|
68
78
|
|
|
69
79
|
it( 'should update slider values when interacting with input', async () => {
|
|
70
80
|
const user = userEvent.setup();
|
|
71
|
-
render( <
|
|
81
|
+
render( <UncontrolledBoxControl /> );
|
|
72
82
|
|
|
73
83
|
const input = screen.getByRole( 'textbox', {
|
|
74
84
|
name: 'All sides',
|
|
@@ -82,7 +92,7 @@ describe( 'BoxControl', () => {
|
|
|
82
92
|
} );
|
|
83
93
|
|
|
84
94
|
it( 'should render the number input with a default min value of 0', () => {
|
|
85
|
-
render( <
|
|
95
|
+
render( <UncontrolledBoxControl /> );
|
|
86
96
|
|
|
87
97
|
const input = screen.getByRole( 'textbox', { name: 'All sides' } );
|
|
88
98
|
|
|
@@ -91,10 +101,7 @@ describe( 'BoxControl', () => {
|
|
|
91
101
|
|
|
92
102
|
it( 'should pass down `inputProps` to the underlying number input', () => {
|
|
93
103
|
render(
|
|
94
|
-
<
|
|
95
|
-
onChange={ () => {} }
|
|
96
|
-
inputProps={ { min: 10, max: 50 } }
|
|
97
|
-
/>
|
|
104
|
+
<UncontrolledBoxControl inputProps={ { min: 10, max: 50 } } />
|
|
98
105
|
);
|
|
99
106
|
|
|
100
107
|
const input = screen.getByRole( 'textbox', { name: 'All sides' } );
|
|
@@ -108,7 +115,7 @@ describe( 'BoxControl', () => {
|
|
|
108
115
|
it( 'should reset values when clicking Reset', async () => {
|
|
109
116
|
const user = userEvent.setup();
|
|
110
117
|
|
|
111
|
-
render( <
|
|
118
|
+
render( <UncontrolledBoxControl /> );
|
|
112
119
|
|
|
113
120
|
const input = screen.getByRole( 'textbox', {
|
|
114
121
|
name: 'All sides',
|
|
@@ -127,7 +134,7 @@ describe( 'BoxControl', () => {
|
|
|
127
134
|
it( 'should reset values when clicking Reset, if controlled', async () => {
|
|
128
135
|
const user = userEvent.setup();
|
|
129
136
|
|
|
130
|
-
render( <
|
|
137
|
+
render( <ControlledBoxControl /> );
|
|
131
138
|
|
|
132
139
|
const input = screen.getByRole( 'textbox', {
|
|
133
140
|
name: 'All sides',
|
|
@@ -146,7 +153,7 @@ describe( 'BoxControl', () => {
|
|
|
146
153
|
it( 'should reset values when clicking Reset, if controlled <-> uncontrolled state changes', async () => {
|
|
147
154
|
const user = userEvent.setup();
|
|
148
155
|
|
|
149
|
-
render( <
|
|
156
|
+
render( <ControlledBoxControl /> );
|
|
150
157
|
|
|
151
158
|
const input = screen.getByRole( 'textbox', {
|
|
152
159
|
name: 'All sides',
|
|
@@ -166,7 +173,9 @@ describe( 'BoxControl', () => {
|
|
|
166
173
|
const user = userEvent.setup();
|
|
167
174
|
const spyChange = jest.fn();
|
|
168
175
|
|
|
169
|
-
render(
|
|
176
|
+
render(
|
|
177
|
+
<UncontrolledBoxControl onChange={ ( v ) => spyChange( v ) } />
|
|
178
|
+
);
|
|
170
179
|
|
|
171
180
|
const input = screen.getByRole( 'textbox', {
|
|
172
181
|
name: 'All sides',
|
|
@@ -196,7 +205,7 @@ describe( 'BoxControl', () => {
|
|
|
196
205
|
it( 'should update a single side value when unlinked', async () => {
|
|
197
206
|
const user = userEvent.setup();
|
|
198
207
|
|
|
199
|
-
render( <
|
|
208
|
+
render( <ControlledBoxControl /> );
|
|
200
209
|
|
|
201
210
|
await user.click(
|
|
202
211
|
screen.getByRole( 'button', { name: 'Unlink sides' } )
|
|
@@ -224,7 +233,7 @@ describe( 'BoxControl', () => {
|
|
|
224
233
|
it( 'should update a single side value when using slider unlinked', async () => {
|
|
225
234
|
const user = userEvent.setup();
|
|
226
235
|
|
|
227
|
-
render( <
|
|
236
|
+
render( <ControlledBoxControl /> );
|
|
228
237
|
|
|
229
238
|
await user.click(
|
|
230
239
|
screen.getByRole( 'button', { name: 'Unlink sides' } )
|
|
@@ -252,7 +261,7 @@ describe( 'BoxControl', () => {
|
|
|
252
261
|
it( 'should update a whole axis when value is changed when unlinked', async () => {
|
|
253
262
|
const user = userEvent.setup();
|
|
254
263
|
|
|
255
|
-
render( <
|
|
264
|
+
render( <ControlledBoxControl splitOnAxis /> );
|
|
256
265
|
|
|
257
266
|
await user.click(
|
|
258
267
|
screen.getByRole( 'button', { name: 'Unlink sides' } )
|
|
@@ -276,7 +285,7 @@ describe( 'BoxControl', () => {
|
|
|
276
285
|
it( 'should update a whole axis using a slider when value is changed when unlinked', async () => {
|
|
277
286
|
const user = userEvent.setup();
|
|
278
287
|
|
|
279
|
-
render( <
|
|
288
|
+
render( <ControlledBoxControl splitOnAxis /> );
|
|
280
289
|
|
|
281
290
|
await user.click(
|
|
282
291
|
screen.getByRole( 'button', { name: 'Unlink sides' } )
|
|
@@ -300,7 +309,7 @@ describe( 'BoxControl', () => {
|
|
|
300
309
|
it( 'should show "Mixed" label when sides have different values but are linked', async () => {
|
|
301
310
|
const user = userEvent.setup();
|
|
302
311
|
|
|
303
|
-
render( <
|
|
312
|
+
render( <ControlledBoxControl /> );
|
|
304
313
|
|
|
305
314
|
const unlinkButton = screen.getByRole( 'button', {
|
|
306
315
|
name: 'Unlink sides',
|
|
@@ -330,7 +339,7 @@ describe( 'BoxControl', () => {
|
|
|
330
339
|
const user = userEvent.setup();
|
|
331
340
|
|
|
332
341
|
// Render control.
|
|
333
|
-
render( <
|
|
342
|
+
render( <UncontrolledBoxControl /> );
|
|
334
343
|
|
|
335
344
|
// Make unit selection on all input control.
|
|
336
345
|
await user.selectOptions(
|
|
@@ -362,7 +371,7 @@ describe( 'BoxControl', () => {
|
|
|
362
371
|
const user = userEvent.setup();
|
|
363
372
|
|
|
364
373
|
// Render control.
|
|
365
|
-
const { rerender } = render( <
|
|
374
|
+
const { rerender } = render( <UncontrolledBoxControl /> );
|
|
366
375
|
|
|
367
376
|
// Make unit selection on all input control.
|
|
368
377
|
await user.selectOptions(
|
|
@@ -390,9 +399,7 @@ describe( 'BoxControl', () => {
|
|
|
390
399
|
} );
|
|
391
400
|
|
|
392
401
|
// Rerender with individual side value & confirm unit is selected.
|
|
393
|
-
rerender(
|
|
394
|
-
<BoxControl values={ { top: '2.5em' } } onChange={ () => {} } />
|
|
395
|
-
);
|
|
402
|
+
rerender( <UncontrolledBoxControl values={ { top: '2.5em' } } /> );
|
|
396
403
|
|
|
397
404
|
const rerenderedControls = screen.getAllByRole( 'combobox', {
|
|
398
405
|
name: 'Select unit',
|
|
@@ -414,7 +421,7 @@ describe( 'BoxControl', () => {
|
|
|
414
421
|
const user = userEvent.setup();
|
|
415
422
|
const onChangeSpy = jest.fn();
|
|
416
423
|
|
|
417
|
-
render( <
|
|
424
|
+
render( <UncontrolledBoxControl onChange={ onChangeSpy } /> );
|
|
418
425
|
|
|
419
426
|
const valueInput = screen.getByRole( 'textbox', {
|
|
420
427
|
name: 'All sides',
|
|
@@ -443,7 +450,7 @@ describe( 'BoxControl', () => {
|
|
|
443
450
|
const user = userEvent.setup();
|
|
444
451
|
const setState = jest.fn();
|
|
445
452
|
|
|
446
|
-
render( <
|
|
453
|
+
render( <UncontrolledBoxControl onChange={ setState } /> );
|
|
447
454
|
|
|
448
455
|
await user.selectOptions(
|
|
449
456
|
screen.getByRole( 'combobox', {
|
package/src/box-control/types.ts
CHANGED
|
@@ -17,70 +17,85 @@ export type CustomValueUnits = {
|
|
|
17
17
|
|
|
18
18
|
type UnitControlPassthroughProps = Omit<
|
|
19
19
|
UnitControlProps,
|
|
20
|
-
'label' | 'onChange' | 'onFocus' | '
|
|
20
|
+
'label' | 'onChange' | 'onFocus' | 'units'
|
|
21
21
|
>;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
UnitControlProps,
|
|
25
|
-
'onMouseOver' | 'onMouseOut' | 'units'
|
|
26
|
-
> & {
|
|
27
|
-
/**
|
|
28
|
-
* If this property is true, a button to reset the box control is rendered.
|
|
29
|
-
*
|
|
30
|
-
* @default true
|
|
31
|
-
*/
|
|
32
|
-
allowReset?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* The id to use as a base for the unique HTML id attribute of the control.
|
|
35
|
-
*/
|
|
36
|
-
id?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Props for the internal `UnitControl` components.
|
|
39
|
-
*
|
|
40
|
-
* @default { min: 0 }
|
|
41
|
-
*/
|
|
42
|
-
inputProps?: UnitControlPassthroughProps;
|
|
43
|
-
/**
|
|
44
|
-
* Heading label for the control.
|
|
45
|
-
*
|
|
46
|
-
* @default __( 'Box Control' )
|
|
47
|
-
*/
|
|
48
|
-
label?: string;
|
|
23
|
+
type DeprecatedBoxControlProps = {
|
|
49
24
|
/**
|
|
50
|
-
*
|
|
25
|
+
* @deprecated Pass to the `inputProps` prop instead.
|
|
26
|
+
* @ignore
|
|
51
27
|
*/
|
|
52
|
-
|
|
28
|
+
onMouseOver?: UnitControlProps[ 'onMouseOver' ];
|
|
53
29
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @default { top: undefined, right: undefined, bottom: undefined, left: undefined }
|
|
30
|
+
* @deprecated Pass to the `inputProps` prop instead.
|
|
31
|
+
* @ignore
|
|
57
32
|
*/
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Collection of sides to allow control of. If omitted or empty, all sides will be available.
|
|
61
|
-
*
|
|
62
|
-
* Allowed values are "top", "right", "bottom", "left", "vertical", and "horizontal".
|
|
63
|
-
*/
|
|
64
|
-
sides?: readonly ( keyof BoxControlValue | 'horizontal' | 'vertical' )[];
|
|
65
|
-
/**
|
|
66
|
-
* If this property is true, when the box control is unlinked, vertical and horizontal controls
|
|
67
|
-
* can be used instead of updating individual sides.
|
|
68
|
-
*
|
|
69
|
-
* @default false
|
|
70
|
-
*/
|
|
71
|
-
splitOnAxis?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.
|
|
74
|
-
*/
|
|
75
|
-
values?: BoxControlValue;
|
|
76
|
-
/**
|
|
77
|
-
* Start opting into the larger default height that will become the default size in a future version.
|
|
78
|
-
*
|
|
79
|
-
* @default false
|
|
80
|
-
*/
|
|
81
|
-
__next40pxDefaultSize?: boolean;
|
|
33
|
+
onMouseOut?: UnitControlProps[ 'onMouseOut' ];
|
|
82
34
|
};
|
|
83
35
|
|
|
36
|
+
export type BoxControlProps = Pick< UnitControlProps, 'units' > &
|
|
37
|
+
DeprecatedBoxControlProps & {
|
|
38
|
+
/**
|
|
39
|
+
* If this property is true, a button to reset the box control is rendered.
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
allowReset?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The id to use as a base for the unique HTML id attribute of the control.
|
|
46
|
+
*/
|
|
47
|
+
id?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Props for the internal `UnitControl` components.
|
|
50
|
+
*
|
|
51
|
+
* @default { min: 0 }
|
|
52
|
+
*/
|
|
53
|
+
inputProps?: UnitControlPassthroughProps;
|
|
54
|
+
/**
|
|
55
|
+
* Heading label for the control.
|
|
56
|
+
*
|
|
57
|
+
* @default __( 'Box Control' )
|
|
58
|
+
*/
|
|
59
|
+
label?: string;
|
|
60
|
+
/**
|
|
61
|
+
* A callback function when an input value changes.
|
|
62
|
+
*/
|
|
63
|
+
onChange: ( next: BoxControlValue ) => void;
|
|
64
|
+
/**
|
|
65
|
+
* The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.
|
|
66
|
+
*
|
|
67
|
+
* @default { top: undefined, right: undefined, bottom: undefined, left: undefined }
|
|
68
|
+
*/
|
|
69
|
+
resetValues?: BoxControlValue;
|
|
70
|
+
/**
|
|
71
|
+
* Collection of sides to allow control of. If omitted or empty, all sides will be available.
|
|
72
|
+
*
|
|
73
|
+
* Allowed values are "top", "right", "bottom", "left", "vertical", and "horizontal".
|
|
74
|
+
*/
|
|
75
|
+
sides?: readonly (
|
|
76
|
+
| keyof BoxControlValue
|
|
77
|
+
| 'horizontal'
|
|
78
|
+
| 'vertical'
|
|
79
|
+
)[];
|
|
80
|
+
/**
|
|
81
|
+
* If this property is true, when the box control is unlinked, vertical and horizontal controls
|
|
82
|
+
* can be used instead of updating individual sides.
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
splitOnAxis?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.
|
|
89
|
+
*/
|
|
90
|
+
values?: BoxControlValue;
|
|
91
|
+
/**
|
|
92
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
__next40pxDefaultSize?: boolean;
|
|
97
|
+
};
|
|
98
|
+
|
|
84
99
|
export type BoxControlInputControlProps = UnitControlPassthroughProps & {
|
|
85
100
|
onChange?: ( nextValues: BoxControlValue ) => void;
|
|
86
101
|
onFocus?: (
|
|
@@ -45,9 +45,11 @@ export default function ClipboardButton( {
|
|
|
45
45
|
} );
|
|
46
46
|
|
|
47
47
|
useEffect( () => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
return () => {
|
|
49
|
+
if ( timeoutIdRef.current ) {
|
|
50
|
+
clearTimeout( timeoutIdRef.current );
|
|
51
|
+
}
|
|
52
|
+
};
|
|
51
53
|
}, [] );
|
|
52
54
|
|
|
53
55
|
const classes = clsx( 'components-clipboard-button', className );
|
|
@@ -31,6 +31,7 @@ export const InputWithSlider = ( {
|
|
|
31
31
|
return (
|
|
32
32
|
<HStack spacing={ 4 }>
|
|
33
33
|
<NumberControlWrapper
|
|
34
|
+
__next40pxDefaultSize
|
|
34
35
|
min={ min }
|
|
35
36
|
max={ max }
|
|
36
37
|
label={ label }
|
|
@@ -45,7 +46,6 @@ export const InputWithSlider = ( {
|
|
|
45
46
|
</InputControlPrefixWrapper>
|
|
46
47
|
}
|
|
47
48
|
spinControls="none"
|
|
48
|
-
size="__unstable-large"
|
|
49
49
|
/>
|
|
50
50
|
<RangeControl
|
|
51
51
|
__nextHasNoMarginBottom
|
package/src/composite/item.tsx
CHANGED
|
@@ -26,23 +26,5 @@ export const CompositeItem = forwardRef<
|
|
|
26
26
|
// obfuscated to discourage its use outside of the component's internals.
|
|
27
27
|
const store = ( props.store ?? context.store ) as Ariakit.CompositeStore;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
// where none of the items are tabbable. In this case, we force all items to
|
|
31
|
-
// be tabbable, so that as soon as an item received focus, it becomes active
|
|
32
|
-
// and Composite goes back to working as expected.
|
|
33
|
-
const tabbable = Ariakit.useStoreState( store, ( state ) => {
|
|
34
|
-
return (
|
|
35
|
-
state?.activeId !== null &&
|
|
36
|
-
! store?.item( state?.activeId )?.element?.isConnected
|
|
37
|
-
);
|
|
38
|
-
} );
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Ariakit.CompositeItem
|
|
42
|
-
store={ store }
|
|
43
|
-
tabbable={ tabbable }
|
|
44
|
-
{ ...props }
|
|
45
|
-
ref={ ref }
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
29
|
+
return <Ariakit.CompositeItem store={ store } { ...props } ref={ ref } />;
|
|
48
30
|
} );
|
|
@@ -140,6 +140,7 @@ const GradientTypePicker = ( {
|
|
|
140
140
|
export function CustomGradientPicker( {
|
|
141
141
|
value,
|
|
142
142
|
onChange,
|
|
143
|
+
enableAlpha = true,
|
|
143
144
|
__experimentalIsRenderedInSidebar = false,
|
|
144
145
|
}: CustomGradientPickerProps ) {
|
|
145
146
|
const { gradientAST, hasGradient } = getGradientAstWithDefault( value );
|
|
@@ -167,6 +168,7 @@ export function CustomGradientPicker( {
|
|
|
167
168
|
__experimentalIsRenderedInSidebar={
|
|
168
169
|
__experimentalIsRenderedInSidebar
|
|
169
170
|
}
|
|
171
|
+
disableAlpha={ ! enableAlpha }
|
|
170
172
|
background={ background }
|
|
171
173
|
hasGradient={ hasGradient }
|
|
172
174
|
value={ controlPoints }
|
|
@@ -26,6 +26,12 @@ export type CustomGradientPickerProps = {
|
|
|
26
26
|
* the `currentGradient` as an argument.
|
|
27
27
|
*/
|
|
28
28
|
onChange: ( currentGradient: string ) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to enable alpha transparency options in the picker.
|
|
31
|
+
*
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
enableAlpha?: boolean;
|
|
29
35
|
/**
|
|
30
36
|
* Whether this is rendered in the sidebar.
|
|
31
37
|
*
|
|
@@ -41,6 +41,7 @@ function MyCustomSelectControl() {
|
|
|
41
41
|
const [ , setFontSize ] = useState();
|
|
42
42
|
return (
|
|
43
43
|
<CustomSelectControl
|
|
44
|
+
__next40pxDefaultSize
|
|
44
45
|
label="Font Size"
|
|
45
46
|
options={ options }
|
|
46
47
|
onChange={ ( { selectedItem } ) => setFontSize( selectedItem ) }
|
|
@@ -52,6 +53,7 @@ function MyControlledCustomSelectControl() {
|
|
|
52
53
|
const [ fontSize, setFontSize ] = useState( options[ 0 ] );
|
|
53
54
|
return (
|
|
54
55
|
<CustomSelectControl
|
|
56
|
+
__next40pxDefaultSize
|
|
55
57
|
label="Font Size"
|
|
56
58
|
options={ options }
|
|
57
59
|
onChange={ ( { selectedItem } ) => setFontSize( selectedItem ) }
|
|
@@ -18,6 +18,7 @@ import CustomSelectItem from '../custom-select-control-v2/item';
|
|
|
18
18
|
import * as Styled from '../custom-select-control-v2/styles';
|
|
19
19
|
import type { CustomSelectProps, CustomSelectOption } from './types';
|
|
20
20
|
import { VisuallyHidden } from '../visually-hidden';
|
|
21
|
+
import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
|
|
21
22
|
|
|
22
23
|
function useDeprecatedProps< T extends CustomSelectOption >( {
|
|
23
24
|
__experimentalShowSelectedHint,
|
|
@@ -56,6 +57,7 @@ function CustomSelectControl< T extends CustomSelectOption >(
|
|
|
56
57
|
) {
|
|
57
58
|
const {
|
|
58
59
|
__next40pxDefaultSize = false,
|
|
60
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
59
61
|
describedBy,
|
|
60
62
|
options,
|
|
61
63
|
onChange,
|
|
@@ -66,6 +68,13 @@ function CustomSelectControl< T extends CustomSelectOption >(
|
|
|
66
68
|
...restProps
|
|
67
69
|
} = useDeprecatedProps( props );
|
|
68
70
|
|
|
71
|
+
maybeWarnDeprecated36pxSize( {
|
|
72
|
+
componentName: 'CustomSelectControl',
|
|
73
|
+
__next40pxDefaultSize,
|
|
74
|
+
size,
|
|
75
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
76
|
+
} );
|
|
77
|
+
|
|
69
78
|
const descriptionId = useInstanceId(
|
|
70
79
|
CustomSelectControl,
|
|
71
80
|
'custom-select-control__description'
|
|
@@ -13,7 +13,11 @@ import { useState } from '@wordpress/element';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import _CustomSelectControl from '..';
|
|
17
|
+
|
|
18
|
+
const UncontrolledCustomSelectControl = (
|
|
19
|
+
props: React.ComponentProps< typeof _CustomSelectControl >
|
|
20
|
+
) => <_CustomSelectControl __next40pxDefaultSize { ...props } />;
|
|
17
21
|
|
|
18
22
|
const customClassName = 'amber-skies';
|
|
19
23
|
const customStyles = {
|
|
@@ -716,7 +720,7 @@ describe( 'Type checking', () => {
|
|
|
716
720
|
|
|
717
721
|
const onChange = (): void => {};
|
|
718
722
|
|
|
719
|
-
<
|
|
723
|
+
<_CustomSelectControl
|
|
720
724
|
label="Label"
|
|
721
725
|
options={ options }
|
|
722
726
|
value={ {
|
|
@@ -726,7 +730,7 @@ describe( 'Type checking', () => {
|
|
|
726
730
|
onChange={ onChange }
|
|
727
731
|
/>;
|
|
728
732
|
|
|
729
|
-
<
|
|
733
|
+
<_CustomSelectControl
|
|
730
734
|
label="Label"
|
|
731
735
|
options={ options }
|
|
732
736
|
value={ {
|
|
@@ -736,7 +740,7 @@ describe( 'Type checking', () => {
|
|
|
736
740
|
onChange={ onChange }
|
|
737
741
|
/>;
|
|
738
742
|
|
|
739
|
-
<
|
|
743
|
+
<_CustomSelectControl
|
|
740
744
|
label="Label"
|
|
741
745
|
options={ options }
|
|
742
746
|
value={ {
|
|
@@ -748,7 +752,7 @@ describe( 'Type checking', () => {
|
|
|
748
752
|
onChange={ onChange }
|
|
749
753
|
/>;
|
|
750
754
|
|
|
751
|
-
<
|
|
755
|
+
<_CustomSelectControl
|
|
752
756
|
label="Label"
|
|
753
757
|
options={ options }
|
|
754
758
|
value={ {
|
|
@@ -764,7 +768,7 @@ describe( 'Type checking', () => {
|
|
|
764
768
|
}
|
|
765
769
|
/>;
|
|
766
770
|
|
|
767
|
-
<
|
|
771
|
+
<_CustomSelectControl
|
|
768
772
|
label="Label"
|
|
769
773
|
options={ optionsReadOnly }
|
|
770
774
|
value={ {
|
|
@@ -774,7 +778,7 @@ describe( 'Type checking', () => {
|
|
|
774
778
|
onChange={ onChange }
|
|
775
779
|
/>;
|
|
776
780
|
|
|
777
|
-
<
|
|
781
|
+
<_CustomSelectControl
|
|
778
782
|
label="Label"
|
|
779
783
|
options={ optionsReadOnly }
|
|
780
784
|
value={ {
|
|
@@ -785,7 +789,7 @@ describe( 'Type checking', () => {
|
|
|
785
789
|
onChange={ onChange }
|
|
786
790
|
/>;
|
|
787
791
|
|
|
788
|
-
<
|
|
792
|
+
<_CustomSelectControl
|
|
789
793
|
label="Label"
|
|
790
794
|
options={ optionsReadOnly }
|
|
791
795
|
value={ {
|
|
@@ -797,7 +801,7 @@ describe( 'Type checking', () => {
|
|
|
797
801
|
onChange={ onChange }
|
|
798
802
|
/>;
|
|
799
803
|
|
|
800
|
-
<
|
|
804
|
+
<_CustomSelectControl
|
|
801
805
|
label="Label"
|
|
802
806
|
options={ optionsReadOnly }
|
|
803
807
|
value={ {
|
|
@@ -120,4 +120,11 @@ export type CustomSelectProps< T extends CustomSelectOption > = {
|
|
|
120
120
|
* @default false
|
|
121
121
|
*/
|
|
122
122
|
__next40pxDefaultSize?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Do not throw a warning for the deprecated 36px default size.
|
|
125
|
+
* For internal components of other components that already throw the warning.
|
|
126
|
+
*
|
|
127
|
+
* @ignore
|
|
128
|
+
*/
|
|
129
|
+
__shouldNotWarnDeprecated36pxSize?: boolean;
|
|
123
130
|
};
|