@wordpress/components 29.0.0 → 29.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/CHANGELOG.md +39 -1
- package/LICENSE.md +1 -1
- package/build/badge/index.js +64 -0
- package/build/badge/index.js.map +1 -0
- package/build/badge/types.js +6 -0
- package/build/badge/types.js.map +1 -0
- package/build/box-control/index.js +5 -1
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-control.js +90 -29
- package/build/box-control/input-control.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/box-control/utils.js +50 -0
- package/build/box-control/utils.js.map +1 -1
- package/build/button-group/index.js +10 -0
- package/build/button-group/index.js.map +1 -1
- package/build/button-group/types.js.map +1 -1
- package/build/custom-select-control/index.js +3 -5
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control-v2/custom-select.js +2 -3
- package/build/custom-select-control-v2/custom-select.js.map +1 -1
- package/build/date-time/date/index.js +1 -0
- package/build/date-time/date/index.js.map +1 -1
- package/build/dimension-control/index.js +1 -0
- package/build/dimension-control/index.js.map +1 -1
- package/build/font-size-picker/styles.js +9 -9
- package/build/font-size-picker/styles.js.map +1 -1
- package/build/heading/hook.js +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/input-control/index.js +9 -0
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/types.js.map +1 -1
- package/build/menu/checkbox-item.js +2 -0
- package/build/menu/checkbox-item.js.map +1 -1
- package/build/menu/index.js +25 -94
- package/build/menu/index.js.map +1 -1
- package/build/menu/item.js +10 -1
- package/build/menu/item.js.map +1 -1
- package/build/menu/popover.js +89 -0
- package/build/menu/popover.js.map +1 -0
- package/build/menu/radio-item.js +2 -0
- package/build/menu/radio-item.js.map +1 -1
- package/build/menu/submenu-trigger-item.js +58 -0
- package/build/menu/submenu-trigger-item.js.map +1 -0
- package/build/menu/trigger-button.js +45 -0
- package/build/menu/trigger-button.js.map +1 -0
- package/build/menu/types.js.map +1 -1
- package/build/navigation/back-button/index.js +1 -0
- package/build/navigation/back-button/index.js.map +1 -1
- package/build/navigation/index.js +6 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/index.js +1 -0
- package/build/navigation/item/index.js.map +1 -1
- package/build/number-control/index.js +1 -0
- package/build/number-control/index.js.map +1 -1
- package/build/palette-edit/index.js +1 -0
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/radio-group/index.js +6 -0
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio.js +2 -3
- package/build/radio-group/radio.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +28 -28
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/select-control/index.js +9 -0
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/types.js.map +1 -1
- package/build/slot-fill/context.js +4 -3
- package/build/slot-fill/context.js.map +1 -1
- package/build/slot-fill/fill.js +10 -15
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/provider.js +41 -55
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +31 -23
- package/build/slot-fill/slot.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/tab-panel/index.js +2 -3
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +21 -4
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/text/hook.js +6 -6
- package/build/text/hook.js.map +1 -1
- package/build/text/styles.js +7 -7
- package/build/text/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +2 -3
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/tooltip/index.js +2 -3
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-select/index.js +10 -2
- package/build/tree-select/index.js.map +1 -1
- package/build/tree-select/types.js.map +1 -1
- package/build-module/badge/index.js +57 -0
- package/build-module/badge/index.js.map +1 -0
- package/build-module/badge/types.js +2 -0
- package/build-module/badge/types.js.map +1 -0
- package/build-module/box-control/index.js +5 -1
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-control.js +92 -31
- package/build-module/box-control/input-control.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/box-control/utils.js +47 -0
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button-group/index.js +10 -0
- package/build-module/button-group/index.js.map +1 -1
- package/build-module/button-group/types.js.map +1 -1
- package/build-module/custom-select-control/index.js +3 -5
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -2
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -0
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -0
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/font-size-picker/styles.js +9 -9
- package/build-module/font-size-picker/styles.js.map +1 -1
- package/build-module/heading/hook.js +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/input-control/index.js +9 -0
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/types.js.map +1 -1
- package/build-module/menu/checkbox-item.js +2 -0
- package/build-module/menu/checkbox-item.js.map +1 -1
- package/build-module/menu/index.js +28 -97
- package/build-module/menu/index.js.map +1 -1
- package/build-module/menu/item.js +10 -1
- package/build-module/menu/item.js.map +1 -1
- package/build-module/menu/popover.js +81 -0
- package/build-module/menu/popover.js.map +1 -0
- package/build-module/menu/radio-item.js +2 -0
- package/build-module/menu/radio-item.js.map +1 -1
- package/build-module/menu/submenu-trigger-item.js +50 -0
- package/build-module/menu/submenu-trigger-item.js.map +1 -0
- package/build-module/menu/trigger-button.js +37 -0
- package/build-module/menu/trigger-button.js.map +1 -0
- package/build-module/menu/types.js.map +1 -1
- package/build-module/navigation/back-button/index.js +1 -0
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/index.js +6 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/index.js +1 -0
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/number-control/index.js +1 -0
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/palette-edit/index.js +1 -0
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/radio-group/index.js +6 -0
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio.js +1 -2
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +28 -28
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/select-control/index.js +9 -0
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/types.js.map +1 -1
- package/build-module/slot-fill/context.js +5 -3
- package/build-module/slot-fill/context.js.map +1 -1
- package/build-module/slot-fill/fill.js +10 -15
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/provider.js +41 -55
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +32 -24
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/tab-panel/index.js +1 -2
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +21 -4
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/text/hook.js +6 -6
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/styles.js +7 -7
- package/build-module/text/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +1 -2
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/tooltip/index.js +1 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-select/index.js +10 -2
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/tree-select/types.js.map +1 -1
- package/build-style/style-rtl.css +60 -13
- package/build-style/style.css +60 -13
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +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/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/badge/index.d.ts +8 -0
- package/build-types/badge/index.d.ts.map +1 -0
- package/build-types/badge/stories/index.story.d.ts +17 -0
- package/build-types/badge/stories/index.story.d.ts.map +1 -0
- package/build-types/badge/test/index.d.ts +2 -0
- package/build-types/badge/test/index.d.ts.map +1 -0
- package/build-types/badge/types.d.ts +13 -0
- package/build-types/badge/types.d.ts.map +1 -0
- 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 +5 -5
- package/build-types/box-control/index.d.ts +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-control.d.ts +1 -1
- package/build-types/box-control/input-control.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +356 -11
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
- package/build-types/box-control/types.d.ts +17 -0
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +27 -1
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +7 -7
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +3 -1
- package/build-types/button-group/index.d.ts.map +1 -1
- package/build-types/button-group/stories/index.story.d.ts +6 -0
- package/build-types/button-group/stories/index.story.d.ts.map +1 -1
- package/build-types/button-group/types.d.ts +7 -0
- package/build-types/button-group/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts +3 -3
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -2
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +4 -4
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/drop-zone/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-picker.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/guide/stories/index.story.d.ts +1 -1
- package/build-types/guide/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -0
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +7 -7
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +11 -2
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/checkbox-item.d.ts.map +1 -1
- package/build-types/menu/index.d.ts +10 -1
- package/build-types/menu/index.d.ts.map +1 -1
- package/build-types/menu/item.d.ts.map +1 -1
- package/build-types/menu/popover.d.ts +3 -0
- package/build-types/menu/popover.d.ts.map +1 -0
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu/stories/index.story.d.ts +9 -9
- package/build-types/menu/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/submenu-trigger-item.d.ts +3 -0
- package/build-types/menu/submenu-trigger-item.d.ts.map +1 -0
- package/build-types/menu/trigger-button.d.ts +3 -0
- package/build-types/menu/trigger-button.d.ts.map +1 -0
- package/build-types/menu/types.d.ts +208 -57
- package/build-types/menu/types.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/back-button/index.d.ts.map +1 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/navigation/item/index.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts +6 -6
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +4 -4
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +1 -1
- 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/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.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/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -0
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +5 -5
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +1 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/context.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/slot-fill/types.d.ts +13 -11
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +4 -4
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +21 -4
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +10 -10
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +13 -13
- package/build-types/tabs/types.d.ts.map +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/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +3 -2
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/types.d.ts +5 -1
- package/build-types/tree-select/types.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/package.json +19 -19
- package/src/alignment-matrix-control/README.md +16 -15
- package/src/angle-picker-control/README.md +10 -9
- package/src/badge/README.md +24 -0
- package/src/badge/docs-manifest.json +5 -0
- package/src/badge/index.tsx +67 -0
- package/src/badge/stories/index.story.tsx +54 -0
- package/src/badge/styles.scss +49 -0
- package/src/badge/test/index.tsx +45 -0
- package/src/badge/types.ts +12 -0
- package/src/base-control/README.md +22 -21
- package/src/box-control/README.md +41 -24
- package/src/box-control/index.tsx +4 -0
- package/src/box-control/input-control.tsx +142 -40
- package/src/box-control/stories/index.story.tsx +12 -0
- package/src/box-control/types.ts +18 -0
- package/src/box-control/utils.ts +60 -0
- package/src/button/README.md +51 -50
- package/src/button/style.scss +9 -10
- package/src/button/test/index.tsx +9 -2
- package/src/button-group/README.md +4 -0
- package/src/button-group/index.tsx +11 -1
- package/src/button-group/stories/index.story.tsx +8 -1
- package/src/button-group/types.ts +7 -0
- package/src/custom-select-control/index.tsx +3 -3
- package/src/custom-select-control-v2/custom-select.tsx +1 -2
- package/src/custom-select-control-v2/stories/index.story.tsx +4 -0
- package/src/date-time/date/index.tsx +1 -0
- package/src/dimension-control/index.tsx +1 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/disabled/stories/index.story.tsx +1 -0
- package/src/drop-zone/stories/index.story.tsx +7 -1
- package/src/font-size-picker/styles.ts +1 -0
- package/src/form-file-upload/README.md +22 -21
- package/src/gradient-picker/README.md +36 -35
- package/src/heading/hook.ts +1 -1
- package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
- package/src/icon/README.md +9 -8
- package/src/input-control/README.md +1 -0
- package/src/input-control/index.tsx +10 -0
- package/src/input-control/stories/index.story.tsx +6 -1
- package/src/input-control/test/index.js +9 -3
- package/src/input-control/types.ts +11 -2
- package/src/menu/checkbox-item.tsx +2 -1
- package/src/menu/index.tsx +61 -165
- package/src/menu/item.tsx +17 -2
- package/src/menu/popover.tsx +103 -0
- package/src/menu/radio-item.tsx +2 -1
- package/src/menu/stories/index.story.tsx +533 -381
- package/src/menu/submenu-trigger-item.tsx +61 -0
- package/src/menu/test/index.tsx +266 -182
- package/src/menu/trigger-button.tsx +46 -0
- package/src/menu/types.ts +210 -63
- package/src/modal/stories/index.story.tsx +4 -1
- package/src/navigation/back-button/index.tsx +1 -0
- package/src/navigation/index.tsx +7 -0
- package/src/navigation/item/index.tsx +2 -0
- package/src/navigation/test/index.tsx +4 -0
- package/src/navigator/test/index.tsx +4 -0
- package/src/number-control/index.tsx +1 -0
- package/src/palette-edit/index.tsx +1 -0
- package/src/panel/stories/index.story.tsx +3 -3
- package/src/private-apis.ts +2 -0
- package/src/radio-group/index.tsx +12 -1
- package/src/radio-group/radio.tsx +1 -2
- package/src/range-control/styles/range-control-styles.ts +8 -4
- package/src/select-control/README.md +3 -0
- package/src/select-control/index.tsx +10 -0
- package/src/select-control/stories/index.story.tsx +2 -0
- package/src/select-control/test/select-control.tsx +7 -1
- package/src/select-control/types.ts +1 -0
- package/src/slot-fill/context.ts +5 -3
- package/src/slot-fill/fill.ts +10 -15
- package/src/slot-fill/provider.tsx +63 -64
- package/src/slot-fill/slot.tsx +40 -27
- package/src/slot-fill/types.ts +23 -11
- package/src/style.scss +1 -0
- package/src/tab-panel/index.tsx +1 -2
- package/src/tab-panel/stories/index.story.tsx +4 -0
- package/src/tabs/README.md +151 -187
- package/src/tabs/docs-manifest.json +22 -0
- package/src/tabs/index.tsx +21 -4
- package/src/tabs/stories/best-practices.mdx +99 -0
- package/src/tabs/stories/index.story.tsx +5 -0
- package/src/tabs/types.ts +13 -14
- package/src/text/hook.ts +2 -2
- package/src/text/styles.ts +1 -1
- package/src/text/test/__snapshots__/index.tsx.snap +3 -3
- package/src/text/test/index.tsx +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +2 -2
- package/src/toggle-group-control/test/index.tsx +7 -1
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +1 -2
- package/src/tooltip/index.tsx +1 -2
- package/src/tree-grid/stories/index.story.tsx +2 -0
- package/src/tree-select/README.md +144 -28
- package/src/tree-select/docs-manifest.json +5 -0
- package/src/tree-select/index.tsx +11 -2
- package/src/tree-select/stories/index.story.tsx +1 -0
- package/src/tree-select/types.ts +8 -1
- package/tsconfig.json +0 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/build/slot-fill/use-slot.js +0 -32
- package/build/slot-fill/use-slot.js.map +0 -1
- package/build-module/slot-fill/use-slot.js +0 -24
- package/build-module/slot-fill/use-slot.js.map +0 -1
- package/build-types/slot-fill/use-slot.d.ts +0 -10
- package/build-types/slot-fill/use-slot.d.ts.map +0 -1
- package/src/slot-fill/use-slot.ts +0 -27
|
@@ -8,6 +8,7 @@ import type { ForwardedRef } from 'react';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { forwardRef } from '@wordpress/element';
|
|
11
|
+
import deprecated from '@wordpress/deprecated';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
@@ -19,9 +20,16 @@ function UnforwardedButtonGroup(
|
|
|
19
20
|
props: WordPressComponentProps< ButtonGroupProps, 'div', false >,
|
|
20
21
|
ref: ForwardedRef< HTMLDivElement >
|
|
21
22
|
) {
|
|
22
|
-
const { className, ...restProps } = props;
|
|
23
|
+
const { className, __shouldNotWarnDeprecated, ...restProps } = props;
|
|
23
24
|
const classes = clsx( 'components-button-group', className );
|
|
24
25
|
|
|
26
|
+
if ( ! __shouldNotWarnDeprecated ) {
|
|
27
|
+
deprecated( 'wp.components.ButtonGroup', {
|
|
28
|
+
since: '6.8',
|
|
29
|
+
alternative: 'wp.components.__experimentalToggleGroupControl',
|
|
30
|
+
} );
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
return (
|
|
26
34
|
<div ref={ ref } role="group" className={ classes } { ...restProps } />
|
|
27
35
|
);
|
|
@@ -31,6 +39,8 @@ function UnforwardedButtonGroup(
|
|
|
31
39
|
* ButtonGroup can be used to group any related buttons together. To emphasize
|
|
32
40
|
* related buttons, a group should share a common container.
|
|
33
41
|
*
|
|
42
|
+
* @deprecated Use `ToggleGroupControl` instead.
|
|
43
|
+
*
|
|
34
44
|
* ```jsx
|
|
35
45
|
* import { Button, ButtonGroup } from '@wordpress/components';
|
|
36
46
|
*
|
|
@@ -9,8 +9,15 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
9
9
|
import ButtonGroup from '..';
|
|
10
10
|
import Button from '../../button';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* ButtonGroup can be used to group any related buttons together.
|
|
14
|
+
* To emphasize related buttons, a group should share a common container.
|
|
15
|
+
*
|
|
16
|
+
* This component is deprecated. Use `ToggleGroupControl` instead.
|
|
17
|
+
*/
|
|
12
18
|
const meta: Meta< typeof ButtonGroup > = {
|
|
13
|
-
title: 'Components/ButtonGroup',
|
|
19
|
+
title: 'Components (Deprecated)/ButtonGroup',
|
|
20
|
+
id: 'components-buttongroup',
|
|
14
21
|
component: ButtonGroup,
|
|
15
22
|
argTypes: {
|
|
16
23
|
children: { control: false },
|
|
@@ -8,4 +8,11 @@ export type ButtonGroupProps = {
|
|
|
8
8
|
* The children elements.
|
|
9
9
|
*/
|
|
10
10
|
children: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Do not throw a warning for component deprecation.
|
|
13
|
+
* For internal components of other components that already throw the warning.
|
|
14
|
+
*
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
__shouldNotWarnDeprecated?: boolean;
|
|
11
18
|
};
|
|
@@ -149,16 +149,16 @@ function CustomSelectControl< T extends CustomSelectOption >(
|
|
|
149
149
|
);
|
|
150
150
|
} );
|
|
151
151
|
|
|
152
|
-
const
|
|
152
|
+
const currentValue = Ariakit.useStoreState( store, 'value' );
|
|
153
153
|
|
|
154
154
|
const renderSelectedValueHint = () => {
|
|
155
155
|
const selectedOptionHint = options
|
|
156
156
|
?.map( applyOptionDeprecations )
|
|
157
|
-
?.find( ( { name } ) =>
|
|
157
|
+
?.find( ( { name } ) => currentValue === name )?.hint;
|
|
158
158
|
|
|
159
159
|
return (
|
|
160
160
|
<Styled.SelectedExperimentalHintWrapper>
|
|
161
|
-
{
|
|
161
|
+
{ currentValue }
|
|
162
162
|
{ selectedOptionHint && (
|
|
163
163
|
<Styled.SelectedExperimentalHintItem
|
|
164
164
|
// Keeping the classname for legacy reasons
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import * as Ariakit from '@ariakit/react';
|
|
5
|
-
import { useStoreState } from '@ariakit/react';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -63,7 +62,7 @@ const CustomSelectButton = ( {
|
|
|
63
62
|
CustomSelectStore,
|
|
64
63
|
'onChange'
|
|
65
64
|
> ) => {
|
|
66
|
-
const { value: currentValue } = useStoreState( store );
|
|
65
|
+
const { value: currentValue } = Ariakit.useStoreState( store );
|
|
67
66
|
|
|
68
67
|
const computedRenderSelectedValue = useMemo(
|
|
69
68
|
() => renderSelectedValue ?? defaultRenderSelectedValue,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
|
+
import { fn } from '@storybook/test';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -44,6 +45,9 @@ const meta: Meta< typeof CustomSelectControlV2 > = {
|
|
|
44
45
|
</div>
|
|
45
46
|
),
|
|
46
47
|
],
|
|
48
|
+
args: {
|
|
49
|
+
onChange: fn(),
|
|
50
|
+
},
|
|
47
51
|
};
|
|
48
52
|
export default meta;
|
|
49
53
|
|
|
@@ -113,6 +113,7 @@ export function DimensionControl( props: DimensionControlProps ) {
|
|
|
113
113
|
<ContextSystemProvider value={ CONTEXT_VALUE }>
|
|
114
114
|
<SelectControl
|
|
115
115
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
116
|
+
__shouldNotWarnDeprecated36pxSize
|
|
116
117
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
117
118
|
className={ clsx(
|
|
118
119
|
className,
|
|
@@ -63,7 +63,7 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.emotion-12 {
|
|
66
|
-
color: #1e1e1e;
|
|
66
|
+
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
67
67
|
line-height: 1.4;
|
|
68
68
|
margin: 0;
|
|
69
69
|
text-wrap: balance;
|
|
@@ -345,7 +345,7 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
.emotion-12 {
|
|
348
|
-
color: #1e1e1e;
|
|
348
|
+
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
349
349
|
line-height: 1.4;
|
|
350
350
|
margin: 0;
|
|
351
351
|
text-wrap: balance;
|
|
@@ -637,7 +637,7 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
637
637
|
}
|
|
638
638
|
|
|
639
639
|
.emotion-12 {
|
|
640
|
-
color: #1e1e1e;
|
|
640
|
+
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
641
641
|
line-height: 1.4;
|
|
642
642
|
margin: 0;
|
|
643
643
|
text-wrap: balance;
|
|
@@ -941,7 +941,7 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
941
941
|
}
|
|
942
942
|
|
|
943
943
|
.emotion-12 {
|
|
944
|
-
color: #1e1e1e;
|
|
944
|
+
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
945
945
|
line-height: 1.4;
|
|
946
946
|
margin: 0;
|
|
947
947
|
text-wrap: balance;
|
|
@@ -21,7 +21,13 @@ export default meta;
|
|
|
21
21
|
|
|
22
22
|
const Template: StoryFn< typeof DropZone > = ( props ) => {
|
|
23
23
|
return (
|
|
24
|
-
<div
|
|
24
|
+
<div
|
|
25
|
+
style={ {
|
|
26
|
+
background: 'lightgray',
|
|
27
|
+
padding: 32,
|
|
28
|
+
position: 'relative',
|
|
29
|
+
} }
|
|
30
|
+
>
|
|
25
31
|
Drop something here
|
|
26
32
|
<DropZone { ...props } />
|
|
27
33
|
</div>
|
|
@@ -19,60 +19,64 @@ const MyFormFileUpload = () => (
|
|
|
19
19
|
</FormFileUpload>
|
|
20
20
|
);
|
|
21
21
|
```
|
|
22
|
+
|
|
22
23
|
## Props
|
|
23
24
|
|
|
24
25
|
### `__next40pxDefaultSize`
|
|
25
26
|
|
|
26
|
-
Start opting into the larger default height that will become the default size in a future version.
|
|
27
|
-
|
|
28
27
|
- Type: `boolean`
|
|
29
28
|
- Required: No
|
|
30
29
|
- Default: `false`
|
|
31
30
|
|
|
31
|
+
Start opting into the larger default height that will become the default size in a future version.
|
|
32
|
+
|
|
32
33
|
### `accept`
|
|
33
34
|
|
|
35
|
+
- Type: `string`
|
|
36
|
+
- Required: No
|
|
37
|
+
|
|
34
38
|
A string passed to the `input` element that tells the browser which
|
|
35
39
|
[file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers)
|
|
36
40
|
can be uploaded by the user. e.g: `image/*,video/*`.
|
|
37
41
|
|
|
38
|
-
- Type: `string`
|
|
39
|
-
- Required: No
|
|
40
|
-
|
|
41
42
|
### `children`
|
|
42
43
|
|
|
43
|
-
Children are passed as children of `Button`.
|
|
44
|
-
|
|
45
44
|
- Type: `ReactNode`
|
|
46
45
|
- Required: No
|
|
47
46
|
|
|
47
|
+
Children are passed as children of `Button`.
|
|
48
|
+
|
|
48
49
|
### `icon`
|
|
49
50
|
|
|
51
|
+
- Type: `IconType`
|
|
52
|
+
- Required: No
|
|
53
|
+
|
|
50
54
|
The icon to render in the default button.
|
|
51
55
|
|
|
52
56
|
See the `Icon` component docs for more information.
|
|
53
57
|
|
|
54
|
-
- Type: `IconType`
|
|
55
|
-
- Required: No
|
|
56
|
-
|
|
57
58
|
### `multiple`
|
|
58
59
|
|
|
59
|
-
Whether to allow multiple selection of files or not.
|
|
60
|
-
|
|
61
60
|
- Type: `boolean`
|
|
62
61
|
- Required: No
|
|
63
62
|
- Default: `false`
|
|
64
63
|
|
|
64
|
+
Whether to allow multiple selection of files or not.
|
|
65
|
+
|
|
65
66
|
### `onChange`
|
|
66
67
|
|
|
68
|
+
- Type: `ChangeEventHandler<HTMLInputElement>`
|
|
69
|
+
- Required: Yes
|
|
70
|
+
|
|
67
71
|
Callback function passed directly to the `input` file element.
|
|
68
72
|
|
|
69
73
|
Select files will be available in `event.currentTarget.files`.
|
|
70
74
|
|
|
71
|
-
- Type: `ChangeEventHandler<HTMLInputElement>`
|
|
72
|
-
- Required: Yes
|
|
73
|
-
|
|
74
75
|
### `onClick`
|
|
75
76
|
|
|
77
|
+
- Type: `MouseEventHandler<HTMLInputElement>`
|
|
78
|
+
- Required: No
|
|
79
|
+
|
|
76
80
|
Callback function passed directly to the `input` file element.
|
|
77
81
|
|
|
78
82
|
This can be useful when you want to force a `change` event to fire when
|
|
@@ -89,17 +93,14 @@ an empty string in the `onClick` function.
|
|
|
89
93
|
</FormFileUpload>
|
|
90
94
|
```
|
|
91
95
|
|
|
92
|
-
- Type: `MouseEventHandler<HTMLInputElement>`
|
|
93
|
-
- Required: No
|
|
94
|
-
|
|
95
96
|
### `render`
|
|
96
97
|
|
|
98
|
+
- Type: `(arg: { openFileDialog: () => void; }) => ReactNode`
|
|
99
|
+
- Required: No
|
|
100
|
+
|
|
97
101
|
Optional callback function used to render the UI.
|
|
98
102
|
|
|
99
103
|
If passed, the component does not render the default UI (a button) and
|
|
100
104
|
calls this function to render it. The function receives an object with
|
|
101
105
|
property `openFileDialog`, a function that, when called, opens the browser
|
|
102
106
|
native file upload modal window.
|
|
103
|
-
|
|
104
|
-
- Type: `(arg: { openFileDialog: () => void; }) => ReactNode`
|
|
105
|
-
- Required: No
|
|
@@ -43,114 +43,115 @@ const MyGradientPicker = () => {
|
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
45
|
```
|
|
46
|
+
|
|
46
47
|
## Props
|
|
47
48
|
|
|
48
49
|
### `__experimentalIsRenderedInSidebar`
|
|
49
50
|
|
|
50
|
-
Whether this is rendered in the sidebar.
|
|
51
|
-
|
|
52
51
|
- Type: `boolean`
|
|
53
52
|
- Required: No
|
|
54
53
|
- Default: `false`
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
Whether this is rendered in the sidebar.
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
each with its own tab stop.
|
|
57
|
+
### `asButtons`
|
|
60
58
|
|
|
61
59
|
- Type: `boolean`
|
|
62
60
|
- Required: No
|
|
63
61
|
- Default: `false`
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
Whether the control should present as a set of buttons,
|
|
64
|
+
each with its own tab stop.
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
### `aria-label`
|
|
68
67
|
|
|
69
68
|
- Type: `string`
|
|
70
69
|
- Required: No
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
A label to identify the purpose of the control.
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
### `aria-labelledby`
|
|
75
74
|
|
|
76
75
|
- Type: `string`
|
|
77
76
|
- Required: No
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
An ID of an element to provide a label for the control.
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
### `className`
|
|
82
81
|
|
|
83
82
|
- Type: `string`
|
|
84
83
|
- Required: No
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
The class name added to the wrapper.
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
### `clearable`
|
|
89
88
|
|
|
90
89
|
- Type: `boolean`
|
|
91
90
|
- Required: No
|
|
92
91
|
- Default: `true`
|
|
93
92
|
|
|
94
|
-
|
|
93
|
+
Whether the palette should have a clearing button or not.
|
|
95
94
|
|
|
96
|
-
|
|
97
|
-
gradients from `gradients` will be shown.
|
|
95
|
+
### `disableCustomGradients`
|
|
98
96
|
|
|
99
97
|
- Type: `boolean`
|
|
100
98
|
- Required: No
|
|
101
99
|
- Default: `false`
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
If true, the gradient picker will not be displayed and only defined
|
|
102
|
+
gradients from `gradients` will be shown.
|
|
104
103
|
|
|
105
|
-
|
|
104
|
+
### `enableAlpha`
|
|
106
105
|
|
|
107
106
|
- Type: `boolean`
|
|
108
107
|
- Required: No
|
|
109
108
|
- Default: `true`
|
|
110
109
|
|
|
110
|
+
Whether to enable alpha transparency options in the picker.
|
|
111
|
+
|
|
111
112
|
### `gradients`
|
|
112
113
|
|
|
114
|
+
- Type: `GradientsProp`
|
|
115
|
+
- Required: No
|
|
116
|
+
- Default: `[]`
|
|
117
|
+
|
|
113
118
|
An array of objects as predefined gradients displayed above the gradient
|
|
114
119
|
selector. Alternatively, if there are multiple sets (or 'origins') of
|
|
115
120
|
gradients, you can pass an array of objects each with a `name` and a
|
|
116
121
|
`gradients` array which will in turn contain the predefined gradient objects.
|
|
117
122
|
|
|
118
|
-
- Type: `GradientsProp`
|
|
119
|
-
- Required: No
|
|
120
|
-
- Default: `[]`
|
|
121
|
-
|
|
122
123
|
### `headingLevel`
|
|
123
124
|
|
|
124
|
-
The heading level. Only applies in cases where gradients are provided
|
|
125
|
-
from multiple origins (i.e. when the array passed as the `gradients` prop
|
|
126
|
-
contains two or more items).
|
|
127
|
-
|
|
128
125
|
- Type: `1 | 2 | 3 | 4 | 5 | 6 | "1" | "2" | "3" | "4" | ...`
|
|
129
126
|
- Required: No
|
|
130
127
|
- Default: `2`
|
|
131
128
|
|
|
132
|
-
|
|
129
|
+
The heading level. Only applies in cases where gradients are provided
|
|
130
|
+
from multiple origins (i.e. when the array passed as the `gradients` prop
|
|
131
|
+
contains two or more items).
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
Only used when `asButtons` is not true.
|
|
133
|
+
### `loop`
|
|
136
134
|
|
|
137
135
|
- Type: `boolean`
|
|
138
136
|
- Required: No
|
|
139
137
|
- Default: `true`
|
|
140
138
|
|
|
141
|
-
|
|
139
|
+
Prevents keyboard interaction from wrapping around.
|
|
140
|
+
Only used when `asButtons` is not true.
|
|
142
141
|
|
|
143
|
-
|
|
144
|
-
the `currentGradient` as an argument.
|
|
142
|
+
### `onChange`
|
|
145
143
|
|
|
146
144
|
- Type: `(currentGradient: string) => void`
|
|
147
145
|
- Required: Yes
|
|
148
146
|
|
|
149
|
-
|
|
147
|
+
The function called when a new gradient has been defined. It is passed to
|
|
148
|
+
the `currentGradient` as an argument.
|
|
150
149
|
|
|
151
|
-
|
|
152
|
-
Optionally pass in a `null` value to specify no gradient is currently selected.
|
|
150
|
+
### `value`
|
|
153
151
|
|
|
154
152
|
- Type: `string`
|
|
155
153
|
- Required: No
|
|
156
154
|
- Default: `'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)'`
|
|
155
|
+
|
|
156
|
+
The current value of the gradient. Pass a css gradient string (See default value for example).
|
|
157
|
+
Optionally pass in a `null` value to specify no gradient is currently selected.
|
package/src/heading/hook.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`props should render correctly 1`] = `
|
|
4
4
|
.emotion-0 {
|
|
5
|
-
color: #1e1e1e;
|
|
5
|
+
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
6
6
|
line-height: 1.4;
|
|
7
7
|
margin: 0;
|
|
8
8
|
text-wrap: balance;
|
|
9
9
|
text-wrap: pretty;
|
|
10
|
-
color: #1e1e1e;
|
|
10
|
+
color: var(--wp-components-color-foreground, #1e1e1e);
|
|
11
11
|
font-size: calc(1.95 * 13px);
|
|
12
12
|
font-weight: 600;
|
|
13
13
|
display: block;
|
|
@@ -30,7 +30,7 @@ Snapshot Diff:
|
|
|
30
30
|
@@ -1,10 +1,10 @@
|
|
31
31
|
Array [
|
|
32
32
|
Object {
|
|
33
|
-
"color": "#1e1e1e",
|
|
33
|
+
"color": "var(--wp-components-color-foreground, #1e1e1e)",
|
|
34
34
|
"display": "block",
|
|
35
35
|
- "font-size": "calc(1.25 * 13px)",
|
|
36
36
|
+ "font-size": "calc(1.95 * 13px)",
|
|
@@ -49,7 +49,7 @@ Snapshot Diff:
|
|
|
49
49
|
@@ -1,10 +1,10 @@
|
|
50
50
|
Array [
|
|
51
51
|
Object {
|
|
52
|
-
"color": "#1e1e1e",
|
|
52
|
+
"color": "var(--wp-components-color-foreground, #1e1e1e)",
|
|
53
53
|
"display": "block",
|
|
54
54
|
- "font-size": "calc(1.25 * 13px)",
|
|
55
55
|
+ "font-size": "calc(1.95 * 13px)",
|
package/src/icon/README.md
CHANGED
|
@@ -11,10 +11,15 @@ import { wordpress } from '@wordpress/icons';
|
|
|
11
11
|
|
|
12
12
|
<Icon icon={ wordpress } />
|
|
13
13
|
```
|
|
14
|
+
|
|
14
15
|
## Props
|
|
15
16
|
|
|
16
17
|
### `icon`
|
|
17
18
|
|
|
19
|
+
- Type: `IconType`
|
|
20
|
+
- Required: No
|
|
21
|
+
- Default: `null`
|
|
22
|
+
|
|
18
23
|
The icon to render. In most cases, you should use an icon from
|
|
19
24
|
[the `@wordpress/icons` package](https://wordpress.github.io/gutenberg/?path=/story/icons-icon--library).
|
|
20
25
|
|
|
@@ -24,16 +29,12 @@ Other supported values are: component instances, functions,
|
|
|
24
29
|
|
|
25
30
|
The `size` value, as well as any other additional props, will be passed through.
|
|
26
31
|
|
|
27
|
-
- Type: `IconType`
|
|
28
|
-
- Required: No
|
|
29
|
-
- Default: `null`
|
|
30
|
-
|
|
31
32
|
### `size`
|
|
32
33
|
|
|
33
|
-
The size (width and height) of the icon.
|
|
34
|
-
|
|
35
|
-
Defaults to `20` when `icon` is a string (i.e. a Dashicon id), otherwise `24`.
|
|
36
|
-
|
|
37
34
|
- Type: `number`
|
|
38
35
|
- Required: No
|
|
39
36
|
- Default: `'string' === typeof icon ? 20 : 24`
|
|
37
|
+
|
|
38
|
+
The size (width and height) of the icon.
|
|
39
|
+
|
|
40
|
+
Defaults to `20` when `icon` is a string (i.e. a Dashicon id), otherwise `24`.
|
|
@@ -20,6 +20,7 @@ import { space } from '../utils/space';
|
|
|
20
20
|
import { useDraft } from './utils';
|
|
21
21
|
import BaseControl from '../base-control';
|
|
22
22
|
import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
|
|
23
|
+
import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
|
|
23
24
|
|
|
24
25
|
const noop = () => {};
|
|
25
26
|
|
|
@@ -36,6 +37,7 @@ export function UnforwardedInputControl(
|
|
|
36
37
|
) {
|
|
37
38
|
const {
|
|
38
39
|
__next40pxDefaultSize,
|
|
40
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
39
41
|
__unstableStateReducer: stateReducer = ( state ) => state,
|
|
40
42
|
__unstableInputWidth,
|
|
41
43
|
className,
|
|
@@ -68,6 +70,13 @@ export function UnforwardedInputControl(
|
|
|
68
70
|
|
|
69
71
|
const helpProp = !! help ? { 'aria-describedby': `${ id }__help` } : {};
|
|
70
72
|
|
|
73
|
+
maybeWarnDeprecated36pxSize( {
|
|
74
|
+
componentName: 'InputControl',
|
|
75
|
+
__next40pxDefaultSize,
|
|
76
|
+
size,
|
|
77
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
78
|
+
} );
|
|
79
|
+
|
|
71
80
|
return (
|
|
72
81
|
<BaseControl
|
|
73
82
|
className={ classes }
|
|
@@ -125,6 +134,7 @@ export function UnforwardedInputControl(
|
|
|
125
134
|
*
|
|
126
135
|
* return (
|
|
127
136
|
* <InputControl
|
|
137
|
+
* __next40pxDefaultSize
|
|
128
138
|
* value={ value }
|
|
129
139
|
* onChange={ ( nextValue ) => setValue( nextValue ?? '' ) }
|
|
130
140
|
* />
|
|
@@ -46,6 +46,7 @@ export const Default = Template.bind( {} );
|
|
|
46
46
|
Default.args = {
|
|
47
47
|
label: 'Value',
|
|
48
48
|
placeholder: 'Placeholder',
|
|
49
|
+
__next40pxDefaultSize: true,
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
export const WithHelpText = Template.bind( {} );
|
|
@@ -117,7 +118,6 @@ export const ShowPassword: StoryFn< typeof InputControl > = ( args ) => {
|
|
|
117
118
|
return (
|
|
118
119
|
<InputControl
|
|
119
120
|
type={ visible ? 'text' : 'password' }
|
|
120
|
-
label="Password"
|
|
121
121
|
suffix={
|
|
122
122
|
<InputControlSuffixWrapper variant="control">
|
|
123
123
|
<Button
|
|
@@ -132,3 +132,8 @@ export const ShowPassword: StoryFn< typeof InputControl > = ( args ) => {
|
|
|
132
132
|
/>
|
|
133
133
|
);
|
|
134
134
|
};
|
|
135
|
+
ShowPassword.args = {
|
|
136
|
+
...Default.args,
|
|
137
|
+
label: 'Password',
|
|
138
|
+
placeholder: undefined,
|
|
139
|
+
};
|
|
@@ -17,9 +17,15 @@ import BaseInputControl from '../';
|
|
|
17
17
|
const getInput = () => screen.getByTestId( 'input' );
|
|
18
18
|
|
|
19
19
|
describe( 'InputControl', () => {
|
|
20
|
-
const InputControl = ( props ) =>
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const InputControl = ( props ) => {
|
|
21
|
+
return (
|
|
22
|
+
<BaseInputControl
|
|
23
|
+
{ ...props }
|
|
24
|
+
__next40pxDefaultSize
|
|
25
|
+
data-testid="input"
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
23
29
|
|
|
24
30
|
describe( 'Basic rendering', () => {
|
|
25
31
|
it( 'should render', () => {
|
|
@@ -40,6 +40,13 @@ interface BaseProps {
|
|
|
40
40
|
* @default false
|
|
41
41
|
*/
|
|
42
42
|
__next40pxDefaultSize?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Do not throw a warning for the deprecated 36px default size.
|
|
45
|
+
* For internal components of other components that already throw the warning.
|
|
46
|
+
*
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
__shouldNotWarnDeprecated36pxSize?: boolean;
|
|
43
50
|
__unstableInputWidth?: CSSProperties[ 'width' ];
|
|
44
51
|
/**
|
|
45
52
|
* If true, the label will only be visible to screen readers.
|
|
@@ -129,7 +136,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
|
|
|
129
136
|
* If you want to apply standard padding in accordance with the size variant, wrap the element in
|
|
130
137
|
* the provided `<InputControlPrefixWrapper>` component.
|
|
131
138
|
*
|
|
132
|
-
*
|
|
139
|
+
* ```jsx
|
|
133
140
|
* import {
|
|
134
141
|
* __experimentalInputControl as InputControl,
|
|
135
142
|
* __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,
|
|
@@ -138,6 +145,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
|
|
|
138
145
|
* <InputControl
|
|
139
146
|
* prefix={<InputControlPrefixWrapper>@</InputControlPrefixWrapper>}
|
|
140
147
|
* />
|
|
148
|
+
* ```
|
|
141
149
|
*/
|
|
142
150
|
prefix?: ReactNode;
|
|
143
151
|
/**
|
|
@@ -147,7 +155,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
|
|
|
147
155
|
* If you want to apply standard padding in accordance with the size variant, wrap the element in
|
|
148
156
|
* the provided `<InputControlSuffixWrapper>` component.
|
|
149
157
|
*
|
|
150
|
-
*
|
|
158
|
+
* ```jsx
|
|
151
159
|
* import {
|
|
152
160
|
* __experimentalInputControl as InputControl,
|
|
153
161
|
* __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,
|
|
@@ -156,6 +164,7 @@ export interface InputBaseProps extends BaseProps, FlexProps {
|
|
|
156
164
|
* <InputControl
|
|
157
165
|
* suffix={<InputControlSuffixWrapper>%</InputControlSuffixWrapper>}
|
|
158
166
|
* />
|
|
167
|
+
* ```
|
|
159
168
|
*/
|
|
160
169
|
suffix?: ReactNode;
|
|
161
170
|
/**
|