@wordpress/components 28.12.0 → 28.13.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 +45 -1
- package/CONTRIBUTING.md +16 -16
- package/build/autocomplete/autocompleter-ui.js +1 -0
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +1 -0
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +2 -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 -1
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +3 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/types.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 +13 -13
- 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/circular-option-picker/circular-option-picker-actions.js +1 -0
- package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +1 -0
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/color-palette/index.js +2 -0
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-copy-button.js +6 -4
- package/build/color-picker/color-copy-button.js.map +1 -1
- package/build/color-picker/component.js +1 -0
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/styles.js +21 -28
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +17 -12
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/hover.js +1 -1
- package/build/composite/hover.js.map +1 -1
- package/build/composite/typeahead.js +1 -1
- package/build/composite/typeahead.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/dashicon/types.js.map +1 -1
- package/build/dimension-control/index.js +7 -0
- package/build/dimension-control/index.js.map +1 -1
- package/build/disabled/index.js +8 -1
- package/build/disabled/index.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +2 -0
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build/font-size-picker/index.js +7 -0
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-file-upload/index.js +3 -1
- package/build/form-file-upload/index.js.map +1 -1
- package/build/gradient-picker/index.js +34 -32
- package/build/gradient-picker/index.js.map +1 -1
- package/build/gradient-picker/types.js.map +1 -1
- package/build/icon/index.js +9 -0
- package/build/icon/index.js.map +1 -1
- package/build/menu/styles.js +16 -16
- package/build/menu/styles.js.map +1 -1
- package/build/modal/index.js +2 -2
- package/build/modal/index.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/range-control/index.js +11 -0
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/types.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +14 -31
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +11 -9
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +1 -8
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/fill.js +7 -24
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/index.js +5 -10
- package/build/slot-fill/index.js.map +1 -1
- package/build/slot-fill/provider.js +2 -2
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +37 -77
- package/build/slot-fill/slot.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/text-control/index.js +7 -0
- package/build/text-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +9 -0
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js +1 -0
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/toggle-group-control/types.js.map +1 -1
- package/build/utils/deprecated-36px-size.js +3 -2
- package/build/utils/deprecated-36px-size.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +1 -0
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -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 -1
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +3 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/types.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 +13 -13
- 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/circular-option-picker/circular-option-picker-actions.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/color-palette/index.js +2 -0
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +6 -4
- package/build-module/color-picker/color-copy-button.js.map +1 -1
- package/build-module/color-picker/component.js +1 -0
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/styles.js +20 -27
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +18 -13
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/composite/hover.js +1 -1
- package/build-module/composite/hover.js.map +1 -1
- package/build-module/composite/typeahead.js +1 -1
- package/build-module/composite/typeahead.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/dashicon/types.js.map +1 -1
- package/build-module/dimension-control/index.js +7 -0
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/disabled/index.js +8 -1
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +2 -0
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build-module/font-size-picker/index.js +7 -0
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-file-upload/index.js +3 -1
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +34 -32
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/gradient-picker/types.js.map +1 -1
- package/build-module/icon/index.js +9 -0
- package/build-module/icon/index.js.map +1 -1
- package/build-module/menu/styles.js +16 -16
- package/build-module/menu/styles.js.map +1 -1
- package/build-module/modal/index.js +2 -2
- package/build-module/modal/index.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/index.js +11 -0
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/types.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +15 -32
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +11 -9
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +2 -9
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +7 -24
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/index.js +5 -8
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/provider.js +2 -3
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +38 -78
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/text-control/index.js +7 -0
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +9 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -0
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build-module/toggle-group-control/types.js.map +1 -1
- package/build-module/utils/deprecated-36px-size.js +3 -2
- package/build-module/utils/deprecated-36px-size.js.map +1 -1
- package/build-style/style-rtl.css +3 -10
- package/build-style/style.css +3 -10
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -0
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts +10 -5
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +7 -0
- package/build-types/border-control/types.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 +13 -13
- package/build-types/box-control/input-controls.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +2 -1
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +2 -0
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts +1 -0
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/typeahead.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +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.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/dashicon/types.d.ts +1 -1
- package/build-types/dashicon/types.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
- package/build-types/date-time/stories/date.story.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +1 -0
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +8 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -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-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts +32 -32
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/types.d.ts +1 -5
- package/build-types/gradient-picker/types.d.ts.map +1 -1
- package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/index.d.ts +23 -7
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +7 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +3 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +7 -0
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts +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/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts +3 -7
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +5 -12
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/slot-fill/types.d.ts +15 -18
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/slot-fill/use-slot.d.ts +1 -1
- package/build-types/slot-fill/use-slot.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +1 -0
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -0
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -0
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toggle-group-control/types.d.ts +7 -0
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/build-types/utils/deprecated-36px-size.d.ts +2 -1
- package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/autocomplete/autocompleter-ui.tsx +1 -0
- package/src/base-control/stories/index.story.tsx +2 -1
- package/src/border-box-control/border-box-control/component.tsx +1 -0
- package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
- package/src/border-control/border-control/component.tsx +1 -0
- package/src/border-control/border-control/hook.ts +2 -0
- package/src/border-control/types.ts +7 -0
- package/src/box-control/README.md +79 -60
- package/src/box-control/all-input-control.tsx +1 -0
- package/src/box-control/axial-input-controls.tsx +1 -0
- package/src/box-control/docs-manifest.json +5 -0
- package/src/box-control/index.tsx +13 -13
- package/src/box-control/input-controls.tsx +1 -0
- package/src/box-control/types.ts +2 -0
- package/src/checkbox-control/stories/index.story.tsx +2 -1
- package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
- package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
- package/src/circular-option-picker/stories/index.story.tsx +2 -1
- package/src/circular-option-picker/style.scss +2 -2
- package/src/color-indicator/stories/index.story.tsx +2 -1
- package/src/color-palette/index.tsx +5 -1
- package/src/color-palette/stories/index.story.tsx +2 -1
- package/src/color-picker/color-copy-button.tsx +8 -10
- package/src/color-picker/component.tsx +1 -0
- package/src/color-picker/stories/index.story.tsx +2 -1
- package/src/color-picker/styles.ts +0 -13
- package/src/combobox-control/README.md +1 -0
- package/src/combobox-control/index.tsx +19 -13
- package/src/combobox-control/stories/index.story.tsx +3 -1
- package/src/combobox-control/style.scss +0 -6
- package/src/combobox-control/test/index.tsx +7 -1
- package/src/composite/hover.tsx +1 -1
- package/src/composite/typeahead.tsx +3 -1
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
- package/src/custom-gradient-picker/stories/index.story.tsx +2 -1
- package/src/custom-gradient-picker/style.scss +1 -1
- package/src/custom-select-control/stories/index.story.tsx +2 -1
- package/src/custom-select-control-v2/stories/index.story.tsx +2 -1
- package/src/dashicon/types.ts +0 -2
- package/src/date-time/stories/date-time.story.tsx +2 -1
- package/src/date-time/stories/date.story.tsx +2 -1
- package/src/date-time/stories/time.story.tsx +2 -1
- package/src/dimension-control/README.md +1 -0
- package/src/dimension-control/index.tsx +8 -0
- package/src/dimension-control/stories/index.story.tsx +1 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +24 -24
- package/src/dimension-control/test/index.test.js +7 -1
- package/src/disabled/README.md +9 -7
- package/src/disabled/index.tsx +8 -1
- package/src/disabled/stories/index.story.tsx +1 -0
- package/src/drop-zone/stories/index.story.tsx +2 -1
- package/src/dropdown-menu/stories/index.story.tsx +2 -1
- package/src/duotone-picker/duotone-picker.tsx +2 -0
- package/src/font-size-picker/README.md +1 -0
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +1 -0
- package/src/font-size-picker/index.tsx +8 -0
- package/src/font-size-picker/stories/index.story.tsx +1 -0
- package/src/font-size-picker/test/index.tsx +5 -1
- package/src/form-file-upload/index.tsx +9 -3
- package/src/form-file-upload/stories/index.story.tsx +2 -1
- package/src/form-token-field/stories/index.story.tsx +2 -1
- package/src/gradient-picker/README.md +107 -69
- package/src/gradient-picker/docs-manifest.json +5 -0
- package/src/gradient-picker/index.tsx +34 -32
- package/src/gradient-picker/stories/index.story.tsx +2 -1
- package/src/gradient-picker/types.ts +3 -5
- package/src/h-stack/stories/index.story.tsx +2 -1
- package/src/higher-order/with-constrained-tabbing/README.md +13 -3
- package/src/higher-order/with-focus-return/README.md +9 -2
- package/src/icon/README.md +22 -65
- package/src/icon/docs-manifest.json +5 -0
- package/src/icon/index.tsx +28 -13
- package/src/icon/stories/index.story.tsx +50 -8
- package/src/input-control/stories/index.story.tsx +2 -1
- package/src/menu/styles.ts +1 -1
- package/src/menu-group/stories/index.story.tsx +2 -1
- package/src/menu-item/stories/index.story.tsx +2 -1
- package/src/menu-items-choice/stories/index.story.tsx +2 -1
- package/src/modal/index.tsx +2 -2
- package/src/modal/stories/index.story.tsx +1 -1
- package/src/number-control/stories/index.story.tsx +2 -1
- package/src/placeholder/stories/index.story.tsx +1 -0
- package/src/private-apis.ts +0 -2
- package/src/radio-control/stories/index.story.tsx +2 -1
- package/src/range-control/README.md +4 -3
- package/src/range-control/index.tsx +11 -0
- package/src/range-control/stories/index.story.tsx +9 -1
- package/src/range-control/test/index.tsx +7 -1
- package/src/range-control/types.ts +7 -0
- package/src/responsive-wrapper/stories/index.story.tsx +2 -1
- package/src/search-control/stories/index.story.tsx +2 -1
- package/src/select-control/stories/index.story.tsx +2 -1
- package/src/slot-fill/README.md +26 -15
- package/src/slot-fill/bubbles-virtually/fill.tsx +18 -28
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +26 -16
- package/src/slot-fill/bubbles-virtually/slot.tsx +13 -9
- package/src/slot-fill/bubbles-virtually/use-slot.ts +3 -26
- package/src/slot-fill/fill.ts +7 -22
- package/src/slot-fill/index.tsx +5 -7
- package/src/slot-fill/provider.tsx +8 -17
- package/src/slot-fill/slot.tsx +48 -85
- package/src/slot-fill/types.ts +14 -51
- package/src/text-control/README.md +1 -0
- package/src/text-control/index.tsx +8 -0
- package/src/text-control/stories/index.story.tsx +3 -1
- package/src/text-control/test/text-control.tsx +7 -1
- package/src/textarea-control/stories/index.story.tsx +2 -1
- package/src/toggle-control/stories/index.story.tsx +2 -1
- package/src/toggle-group-control/stories/index.story.tsx +3 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -12
- package/src/toggle-group-control/test/index.tsx +7 -1
- package/src/toggle-group-control/toggle-group-control/README.md +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +10 -0
- package/src/toggle-group-control/toggle-group-control-option/README.md +1 -1
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -0
- package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
- package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
- package/src/toggle-group-control/types.ts +7 -0
- package/src/tools-panel/stories/index.story.tsx +3 -0
- package/src/tree-select/stories/index.story.tsx +2 -1
- package/src/unit-control/stories/index.story.tsx +2 -1
- package/src/utils/deprecated-36px-size.ts +3 -0
- package/src/v-stack/stories/index.story.tsx +2 -1
- package/tsconfig.tsbuildinfo +1 -1
package/src/slot-fill/slot.tsx
CHANGED
|
@@ -7,8 +7,11 @@ import type { ReactElement, ReactNode, Key } from 'react';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
+
useContext,
|
|
11
|
+
useEffect,
|
|
12
|
+
useReducer,
|
|
13
|
+
useRef,
|
|
10
14
|
Children,
|
|
11
|
-
Component,
|
|
12
15
|
cloneElement,
|
|
13
16
|
isEmptyElement,
|
|
14
17
|
} from '@wordpress/element';
|
|
@@ -17,7 +20,7 @@ import {
|
|
|
17
20
|
* Internal dependencies
|
|
18
21
|
*/
|
|
19
22
|
import SlotFillContext from './context';
|
|
20
|
-
import type {
|
|
23
|
+
import type { SlotComponentProps } from './types';
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* Whether the argument is a function.
|
|
@@ -29,90 +32,50 @@ function isFunction( maybeFunc: any ): maybeFunc is Function {
|
|
|
29
32
|
return typeof maybeFunc === 'function';
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
super.forceUpdate();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
render() {
|
|
70
|
-
const { children, name, fillProps = {}, getFills } = this.props;
|
|
71
|
-
const fills: ReactNode[] = ( getFills( name, this ) ?? [] )
|
|
72
|
-
.map( ( fill ) => {
|
|
73
|
-
const fillChildren = isFunction( fill.children )
|
|
74
|
-
? fill.children( fillProps )
|
|
75
|
-
: fill.children;
|
|
76
|
-
return Children.map( fillChildren, ( child, childIndex ) => {
|
|
77
|
-
if ( ! child || typeof child === 'string' ) {
|
|
78
|
-
return child;
|
|
79
|
-
}
|
|
80
|
-
let childKey: Key = childIndex;
|
|
81
|
-
if (
|
|
82
|
-
typeof child === 'object' &&
|
|
83
|
-
'key' in child &&
|
|
84
|
-
child?.key
|
|
85
|
-
) {
|
|
86
|
-
childKey = child.key;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return cloneElement( child as ReactElement, {
|
|
90
|
-
key: childKey,
|
|
91
|
-
} );
|
|
35
|
+
function Slot( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) {
|
|
36
|
+
const registry = useContext( SlotFillContext );
|
|
37
|
+
const [ , rerender ] = useReducer( () => [], [] );
|
|
38
|
+
const ref = useRef( { rerender } );
|
|
39
|
+
|
|
40
|
+
const { name, children, fillProps = {} } = props;
|
|
41
|
+
|
|
42
|
+
useEffect( () => {
|
|
43
|
+
const refValue = ref.current;
|
|
44
|
+
registry.registerSlot( name, refValue );
|
|
45
|
+
return () => registry.unregisterSlot( name, refValue );
|
|
46
|
+
}, [ registry, name ] );
|
|
47
|
+
|
|
48
|
+
const fills: ReactNode[] = ( registry.getFills( name, ref.current ) ?? [] )
|
|
49
|
+
.map( ( fill ) => {
|
|
50
|
+
const fillChildren = isFunction( fill.children )
|
|
51
|
+
? fill.children( fillProps )
|
|
52
|
+
: fill.children;
|
|
53
|
+
return Children.map( fillChildren, ( child, childIndex ) => {
|
|
54
|
+
if ( ! child || typeof child === 'string' ) {
|
|
55
|
+
return child;
|
|
56
|
+
}
|
|
57
|
+
let childKey: Key = childIndex;
|
|
58
|
+
if (
|
|
59
|
+
typeof child === 'object' &&
|
|
60
|
+
'key' in child &&
|
|
61
|
+
child?.key
|
|
62
|
+
) {
|
|
63
|
+
childKey = child.key;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return cloneElement( child as ReactElement, {
|
|
67
|
+
key: childKey,
|
|
92
68
|
} );
|
|
93
|
-
} )
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
69
|
+
} );
|
|
70
|
+
} )
|
|
71
|
+
.filter(
|
|
72
|
+
// In some cases fills are rendered only when some conditions apply.
|
|
73
|
+
// This ensures that we only use non-empty fills when rendering, i.e.,
|
|
74
|
+
// it allows us to render wrappers only when the fills are actually present.
|
|
75
|
+
( element ) => ! isEmptyElement( element )
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return <>{ isFunction( children ) ? children( fills ) : fills }</>;
|
|
103
79
|
}
|
|
104
80
|
|
|
105
|
-
const Slot = ( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) => (
|
|
106
|
-
<SlotFillContext.Consumer>
|
|
107
|
-
{ ( { registerSlot, unregisterSlot, getFills } ) => (
|
|
108
|
-
<SlotComponent
|
|
109
|
-
{ ...props }
|
|
110
|
-
registerSlot={ registerSlot }
|
|
111
|
-
unregisterSlot={ unregisterSlot }
|
|
112
|
-
getFills={ getFills }
|
|
113
|
-
/>
|
|
114
|
-
) }
|
|
115
|
-
</SlotFillContext.Consumer>
|
|
116
|
-
);
|
|
117
|
-
|
|
118
81
|
export default Slot;
|
package/src/slot-fill/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { ReactNode, RefObject } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -108,38 +108,17 @@ export type SlotFillProviderProps = {
|
|
|
108
108
|
passthrough?: boolean;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
export type
|
|
112
|
-
export type
|
|
113
|
-
rerender: () => void;
|
|
114
|
-
} >;
|
|
111
|
+
export type SlotRef = RefObject< HTMLElement >;
|
|
112
|
+
export type Rerenderable = { rerender: () => void };
|
|
115
113
|
|
|
116
114
|
export type SlotFillBubblesVirtuallyContext = {
|
|
117
|
-
slots: ObservableMap<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
fills: ObservableMap< SlotKey, SlotFillBubblesVirtuallyFillRef[] >;
|
|
125
|
-
registerSlot: (
|
|
126
|
-
name: SlotKey,
|
|
127
|
-
ref: SlotFillBubblesVirtuallySlotRef,
|
|
128
|
-
fillProps: FillProps
|
|
129
|
-
) => void;
|
|
130
|
-
unregisterSlot: (
|
|
131
|
-
name: SlotKey,
|
|
132
|
-
ref: SlotFillBubblesVirtuallySlotRef
|
|
133
|
-
) => void;
|
|
134
|
-
updateSlot: ( name: SlotKey, fillProps: FillProps ) => void;
|
|
135
|
-
registerFill: (
|
|
136
|
-
name: SlotKey,
|
|
137
|
-
ref: SlotFillBubblesVirtuallyFillRef
|
|
138
|
-
) => void;
|
|
139
|
-
unregisterFill: (
|
|
140
|
-
name: SlotKey,
|
|
141
|
-
ref: SlotFillBubblesVirtuallyFillRef
|
|
142
|
-
) => void;
|
|
115
|
+
slots: ObservableMap< SlotKey, { ref: SlotRef; fillProps: FillProps } >;
|
|
116
|
+
fills: ObservableMap< SlotKey, Rerenderable[] >;
|
|
117
|
+
registerSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;
|
|
118
|
+
unregisterSlot: ( name: SlotKey, ref: SlotRef ) => void;
|
|
119
|
+
updateSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;
|
|
120
|
+
registerFill: ( name: SlotKey, ref: Rerenderable ) => void;
|
|
121
|
+
unregisterFill: ( name: SlotKey, ref: Rerenderable ) => void;
|
|
143
122
|
|
|
144
123
|
/**
|
|
145
124
|
* This helps the provider know if it's using the default context value or not.
|
|
@@ -148,30 +127,14 @@ export type SlotFillBubblesVirtuallyContext = {
|
|
|
148
127
|
};
|
|
149
128
|
|
|
150
129
|
export type BaseSlotFillContext = {
|
|
151
|
-
registerSlot: (
|
|
152
|
-
|
|
153
|
-
slot: Component< BaseSlotComponentProps >
|
|
154
|
-
) => void;
|
|
155
|
-
unregisterSlot: (
|
|
156
|
-
name: SlotKey,
|
|
157
|
-
slot: Component< BaseSlotComponentProps >
|
|
158
|
-
) => void;
|
|
130
|
+
registerSlot: ( name: SlotKey, slot: Rerenderable ) => void;
|
|
131
|
+
unregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;
|
|
159
132
|
registerFill: ( name: SlotKey, instance: FillComponentProps ) => void;
|
|
160
133
|
unregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;
|
|
161
|
-
getSlot: (
|
|
162
|
-
name: SlotKey
|
|
163
|
-
) => Component< BaseSlotComponentProps > | undefined;
|
|
134
|
+
getSlot: ( name: SlotKey ) => Rerenderable | undefined;
|
|
164
135
|
getFills: (
|
|
165
136
|
name: SlotKey,
|
|
166
|
-
slotInstance:
|
|
137
|
+
slotInstance: Rerenderable
|
|
167
138
|
) => FillComponentProps[];
|
|
168
139
|
subscribe: ( listener: () => void ) => () => void;
|
|
169
140
|
};
|
|
170
|
-
|
|
171
|
-
export type BaseSlotComponentProps = Pick<
|
|
172
|
-
BaseSlotFillContext,
|
|
173
|
-
'registerSlot' | 'unregisterSlot' | 'getFills'
|
|
174
|
-
> &
|
|
175
|
-
Omit< SlotComponentProps, 'bubblesVirtually' > & {
|
|
176
|
-
children?: ( fills: ReactNode ) => ReactNode;
|
|
177
|
-
};
|
|
@@ -16,6 +16,7 @@ import { forwardRef } from '@wordpress/element';
|
|
|
16
16
|
import BaseControl from '../base-control';
|
|
17
17
|
import type { WordPressComponentProps } from '../context';
|
|
18
18
|
import type { TextControlProps } from './types';
|
|
19
|
+
import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
|
|
19
20
|
|
|
20
21
|
function UnforwardedTextControl(
|
|
21
22
|
props: WordPressComponentProps< TextControlProps, 'input', false >,
|
|
@@ -38,6 +39,12 @@ function UnforwardedTextControl(
|
|
|
38
39
|
const onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>
|
|
39
40
|
onChange( event.target.value );
|
|
40
41
|
|
|
42
|
+
maybeWarnDeprecated36pxSize( {
|
|
43
|
+
componentName: 'TextControl',
|
|
44
|
+
size: undefined,
|
|
45
|
+
__next40pxDefaultSize,
|
|
46
|
+
} );
|
|
47
|
+
|
|
41
48
|
return (
|
|
42
49
|
<BaseControl
|
|
43
50
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
@@ -77,6 +84,7 @@ function UnforwardedTextControl(
|
|
|
77
84
|
* return (
|
|
78
85
|
* <TextControl
|
|
79
86
|
* __nextHasNoMarginBottom
|
|
87
|
+
* __next40pxDefaultSize
|
|
80
88
|
* label="Additional CSS Class"
|
|
81
89
|
* value={ className }
|
|
82
90
|
* onChange={ ( value ) => setClassName( value ) }
|
|
@@ -15,7 +15,8 @@ import TextControl from '..';
|
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TextControl > = {
|
|
17
17
|
component: TextControl,
|
|
18
|
-
title: 'Components/TextControl',
|
|
18
|
+
title: 'Components/Selection & Input/Common/TextControl',
|
|
19
|
+
id: 'components-textcontrol',
|
|
19
20
|
argTypes: {
|
|
20
21
|
help: { control: { type: 'text' } },
|
|
21
22
|
label: { control: { type: 'text' } },
|
|
@@ -54,6 +55,7 @@ export const Default: StoryFn< typeof TextControl > = DefaultTemplate.bind(
|
|
|
54
55
|
);
|
|
55
56
|
Default.args = {
|
|
56
57
|
__nextHasNoMarginBottom: true,
|
|
58
|
+
__next40pxDefaultSize: true,
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
export const WithLabelAndHelpText: StoryFn< typeof TextControl > =
|
|
@@ -9,7 +9,13 @@ import { render, screen } from '@testing-library/react';
|
|
|
9
9
|
import _TextControl from '..';
|
|
10
10
|
|
|
11
11
|
const TextControl = ( props: React.ComponentProps< typeof _TextControl > ) => {
|
|
12
|
-
return
|
|
12
|
+
return (
|
|
13
|
+
<_TextControl
|
|
14
|
+
{ ...props }
|
|
15
|
+
__nextHasNoMarginBottom
|
|
16
|
+
__next40pxDefaultSize
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
const noop = () => {};
|
|
@@ -15,7 +15,8 @@ import TextareaControl from '..';
|
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TextareaControl > = {
|
|
17
17
|
component: TextareaControl,
|
|
18
|
-
title: 'Components/TextareaControl',
|
|
18
|
+
title: 'Components/Selection & Input/Common/TextareaControl',
|
|
19
|
+
id: 'components-textareacontrol',
|
|
19
20
|
argTypes: {
|
|
20
21
|
onChange: { action: 'onChange' },
|
|
21
22
|
label: { control: { type: 'text' } },
|
|
@@ -14,7 +14,8 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import ToggleControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof ToggleControl > = {
|
|
17
|
-
title: 'Components/ToggleControl',
|
|
17
|
+
title: 'Components/Selection & Input/Common/ToggleControl',
|
|
18
|
+
id: 'components-togglecontrol',
|
|
18
19
|
component: ToggleControl,
|
|
19
20
|
argTypes: {
|
|
20
21
|
checked: { control: { type: null } },
|
|
@@ -27,7 +27,8 @@ const meta: Meta< typeof ToggleGroupControl > = {
|
|
|
27
27
|
component: ToggleGroupControl,
|
|
28
28
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
29
29
|
subcomponents: { ToggleGroupControlOption, ToggleGroupControlOptionIcon },
|
|
30
|
-
title: 'Components (Experimental)/ToggleGroupControl',
|
|
30
|
+
title: 'Components (Experimental)/Selection & Input/ToggleGroupControl',
|
|
31
|
+
id: 'components-experimental-togglegroupcontrol',
|
|
31
32
|
argTypes: {
|
|
32
33
|
help: { control: { type: 'text' } },
|
|
33
34
|
onChange: { action: 'onChange' },
|
|
@@ -50,6 +51,7 @@ const Template: StoryFn< typeof ToggleGroupControl > = ( {
|
|
|
50
51
|
return (
|
|
51
52
|
<ToggleGroupControl
|
|
52
53
|
__nextHasNoMarginBottom
|
|
54
|
+
__next40pxDefaultSize
|
|
53
55
|
{ ...props }
|
|
54
56
|
onChange={ ( ...changeArgs ) => {
|
|
55
57
|
setValue( ...changeArgs );
|
|
@@ -44,8 +44,8 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
44
44
|
display: inline-flex;
|
|
45
45
|
min-width: 0;
|
|
46
46
|
position: relative;
|
|
47
|
-
min-height:
|
|
48
|
-
padding:
|
|
47
|
+
min-height: 40px;
|
|
48
|
+
padding: 3px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.emotion-8:hover {
|
|
@@ -159,7 +159,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
159
159
|
width: 100%;
|
|
160
160
|
z-index: 2;
|
|
161
161
|
color: #1e1e1e;
|
|
162
|
-
height:
|
|
162
|
+
height: 32px;
|
|
163
163
|
aspect-ratio: 1;
|
|
164
164
|
padding-left: 0;
|
|
165
165
|
padding-right: 0;
|
|
@@ -236,7 +236,7 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
236
236
|
width: 100%;
|
|
237
237
|
z-index: 2;
|
|
238
238
|
color: #1e1e1e;
|
|
239
|
-
height:
|
|
239
|
+
height: 32px;
|
|
240
240
|
aspect-ratio: 1;
|
|
241
241
|
padding-left: 0;
|
|
242
242
|
padding-right: 0;
|
|
@@ -409,8 +409,8 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
409
409
|
display: inline-flex;
|
|
410
410
|
min-width: 0;
|
|
411
411
|
position: relative;
|
|
412
|
-
min-height:
|
|
413
|
-
padding:
|
|
412
|
+
min-height: 40px;
|
|
413
|
+
padding: 3px;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
.emotion-8:hover {
|
|
@@ -678,8 +678,8 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
678
678
|
display: inline-flex;
|
|
679
679
|
min-width: 0;
|
|
680
680
|
position: relative;
|
|
681
|
-
min-height:
|
|
682
|
-
padding:
|
|
681
|
+
min-height: 40px;
|
|
682
|
+
padding: 3px;
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
.emotion-8:hover {
|
|
@@ -793,7 +793,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
793
793
|
width: 100%;
|
|
794
794
|
z-index: 2;
|
|
795
795
|
color: #1e1e1e;
|
|
796
|
-
height:
|
|
796
|
+
height: 32px;
|
|
797
797
|
aspect-ratio: 1;
|
|
798
798
|
padding-left: 0;
|
|
799
799
|
padding-right: 0;
|
|
@@ -870,7 +870,7 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
870
870
|
width: 100%;
|
|
871
871
|
z-index: 2;
|
|
872
872
|
color: #1e1e1e;
|
|
873
|
-
height:
|
|
873
|
+
height: 32px;
|
|
874
874
|
aspect-ratio: 1;
|
|
875
875
|
padding-left: 0;
|
|
876
876
|
padding-right: 0;
|
|
@@ -1037,8 +1037,8 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
1037
1037
|
display: inline-flex;
|
|
1038
1038
|
min-width: 0;
|
|
1039
1039
|
position: relative;
|
|
1040
|
-
min-height:
|
|
1041
|
-
padding:
|
|
1040
|
+
min-height: 40px;
|
|
1041
|
+
padding: 3px;
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
1044
|
.emotion-8:hover {
|
|
@@ -28,7 +28,13 @@ const hoverOutside = async () => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const ToggleGroupControl = ( props: ToggleGroupControlProps ) => {
|
|
31
|
-
return
|
|
31
|
+
return (
|
|
32
|
+
<_ToggleGroupControl
|
|
33
|
+
{ ...props }
|
|
34
|
+
__nextHasNoMarginBottom
|
|
35
|
+
__next40pxDefaultSize
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
const ControlledToggleGroupControl = ( {
|
|
@@ -25,6 +25,7 @@ function Example() {
|
|
|
25
25
|
value="vertical"
|
|
26
26
|
isBlock
|
|
27
27
|
__nextHasNoMarginBottom
|
|
28
|
+
__next40pxDefaultSize
|
|
28
29
|
>
|
|
29
30
|
<ToggleGroupControlOption value="horizontal" label="Horizontal" />
|
|
30
31
|
<ToggleGroupControlOption value="vertical" label="Vertical" />
|
|
@@ -100,4 +101,4 @@ Start opting into the larger default height that will become the default size in
|
|
|
100
101
|
Start opting into the new margin-free styles that will become the default in a future version.
|
|
101
102
|
|
|
102
103
|
- Required: No
|
|
103
|
-
- Default: `false`
|
|
104
|
+
- Default: `false`
|
|
@@ -23,6 +23,7 @@ import { ToggleGroupControlAsButtonGroup } from './as-button-group';
|
|
|
23
23
|
import { useTrackElementOffsetRect } from '../../utils/element-rect';
|
|
24
24
|
import { useMergeRefs } from '@wordpress/compose';
|
|
25
25
|
import { useAnimatedOffsetRect } from '../../utils/hooks/use-animated-offset-rect';
|
|
26
|
+
import { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';
|
|
26
27
|
|
|
27
28
|
function UnconnectedToggleGroupControl(
|
|
28
29
|
props: WordPressComponentProps< ToggleGroupControlProps, 'div', false >,
|
|
@@ -31,6 +32,7 @@ function UnconnectedToggleGroupControl(
|
|
|
31
32
|
const {
|
|
32
33
|
__nextHasNoMarginBottom = false,
|
|
33
34
|
__next40pxDefaultSize = false,
|
|
35
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
34
36
|
className,
|
|
35
37
|
isAdaptiveWidth = false,
|
|
36
38
|
isBlock = false,
|
|
@@ -81,6 +83,13 @@ function UnconnectedToggleGroupControl(
|
|
|
81
83
|
? ToggleGroupControlAsButtonGroup
|
|
82
84
|
: ToggleGroupControlAsRadioGroup;
|
|
83
85
|
|
|
86
|
+
maybeWarnDeprecated36pxSize( {
|
|
87
|
+
componentName: 'ToggleGroupControl',
|
|
88
|
+
size,
|
|
89
|
+
__next40pxDefaultSize,
|
|
90
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
91
|
+
} );
|
|
92
|
+
|
|
84
93
|
return (
|
|
85
94
|
<BaseControl
|
|
86
95
|
help={ help }
|
|
@@ -135,6 +144,7 @@ function UnconnectedToggleGroupControl(
|
|
|
135
144
|
* value="vertical"
|
|
136
145
|
* isBlock
|
|
137
146
|
* __nextHasNoMarginBottom
|
|
147
|
+
* __next40pxDefaultSize
|
|
138
148
|
* >
|
|
139
149
|
* <ToggleGroupControlOption value="horizontal" label="Horizontal" />
|
|
140
150
|
* <ToggleGroupControlOption value="vertical" label="Vertical" />
|
|
@@ -6,7 +6,6 @@ This feature is still experimental. “Experimental” means this is an early im
|
|
|
6
6
|
|
|
7
7
|
`ToggleGroupControlOption` is a form component and is meant to be used as a child of [`ToggleGroupControl`](/packages/components/src/toggle-group-control/toggle-group-control/README.md).
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
## Usage
|
|
11
10
|
|
|
12
11
|
```js
|
|
@@ -22,6 +21,7 @@ function Example() {
|
|
|
22
21
|
value="vertical"
|
|
23
22
|
isBlock
|
|
24
23
|
__nextHasNoMarginBottom
|
|
24
|
+
__next40pxDefaultSize
|
|
25
25
|
>
|
|
26
26
|
<ToggleGroupControlOption
|
|
27
27
|
value="horizontal"
|
|
@@ -53,6 +53,7 @@ function UnforwardedToggleGroupControlOption(
|
|
|
53
53
|
* value="vertical"
|
|
54
54
|
* isBlock
|
|
55
55
|
* __nextHasNoMarginBottom
|
|
56
|
+
* __next40pxDefaultSize
|
|
56
57
|
* >
|
|
57
58
|
* <ToggleGroupControlOption value="horizontal" label="Horizontal" />
|
|
58
59
|
* <ToggleGroupControlOption value="vertical" label="Vertical" />
|
|
@@ -17,7 +17,7 @@ import { formatLowercase, formatUppercase } from '@wordpress/icons';
|
|
|
17
17
|
|
|
18
18
|
function Example() {
|
|
19
19
|
return (
|
|
20
|
-
<ToggleGroupControl __nextHasNoMarginBottom>
|
|
20
|
+
<ToggleGroupControl __nextHasNoMarginBottom __next40pxDefaultSize>
|
|
21
21
|
<ToggleGroupControlOptionIcon
|
|
22
22
|
value="uppercase"
|
|
23
23
|
icon={ formatUppercase }
|
|
@@ -52,7 +52,7 @@ function UnforwardedToggleGroupControlOptionIcon(
|
|
|
52
52
|
*
|
|
53
53
|
* function Example() {
|
|
54
54
|
* return (
|
|
55
|
-
* <ToggleGroupControl __nextHasNoMarginBottom>
|
|
55
|
+
* <ToggleGroupControl __nextHasNoMarginBottom __next40pxDefaultSize>
|
|
56
56
|
* <ToggleGroupControlOptionIcon
|
|
57
57
|
* value="uppercase"
|
|
58
58
|
* label="Uppercase"
|
|
@@ -128,6 +128,13 @@ export type ToggleGroupControlProps = Pick<
|
|
|
128
128
|
* @default false
|
|
129
129
|
*/
|
|
130
130
|
__next40pxDefaultSize?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Do not throw a warning for the deprecated 36px default size.
|
|
133
|
+
* For internal components of other components that already throw the warning.
|
|
134
|
+
*
|
|
135
|
+
* @ignore
|
|
136
|
+
*/
|
|
137
|
+
__shouldNotWarnDeprecated36pxSize?: boolean;
|
|
131
138
|
};
|
|
132
139
|
|
|
133
140
|
export type ToggleGroupControlContextProps = {
|
|
@@ -110,6 +110,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
|
|
|
110
110
|
>
|
|
111
111
|
<ToggleGroupControl
|
|
112
112
|
__nextHasNoMarginBottom
|
|
113
|
+
__next40pxDefaultSize
|
|
113
114
|
label="Scale"
|
|
114
115
|
value={ scale }
|
|
115
116
|
onChange={ ( next ) => setScale( next ) }
|
|
@@ -457,6 +458,7 @@ export const WithConditionalDefaultControl: StoryFn< typeof ToolsPanel > = ( {
|
|
|
457
458
|
>
|
|
458
459
|
<ToggleGroupControl
|
|
459
460
|
__nextHasNoMarginBottom
|
|
461
|
+
__next40pxDefaultSize
|
|
460
462
|
label="Scale"
|
|
461
463
|
value={ scale }
|
|
462
464
|
onChange={ ( next ) =>
|
|
@@ -559,6 +561,7 @@ export const WithConditionallyRenderedControl: StoryFn<
|
|
|
559
561
|
>
|
|
560
562
|
<ToggleGroupControl
|
|
561
563
|
__nextHasNoMarginBottom
|
|
564
|
+
__next40pxDefaultSize
|
|
562
565
|
label="Scale"
|
|
563
566
|
value={ scale }
|
|
564
567
|
onChange={ ( next ) =>
|
|
@@ -14,7 +14,8 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TreeSelect from '../';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TreeSelect > = {
|
|
17
|
-
title: 'Components/TreeSelect',
|
|
17
|
+
title: 'Components/Selection & Input/Common/TreeSelect',
|
|
18
|
+
id: 'components-treeselect',
|
|
18
19
|
component: TreeSelect,
|
|
19
20
|
argTypes: {
|
|
20
21
|
help: { control: { type: 'text' } },
|
|
@@ -16,7 +16,8 @@ import { CSS_UNITS } from '../utils';
|
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof UnitControl > = {
|
|
18
18
|
component: UnitControl,
|
|
19
|
-
title: 'Components (Experimental)/UnitControl',
|
|
19
|
+
title: 'Components (Experimental)/Selection & Input/UnitControl',
|
|
20
|
+
id: 'components-experimental-unitcontrol',
|
|
20
21
|
argTypes: {
|
|
21
22
|
__unstableInputWidth: { control: { type: 'text' } },
|
|
22
23
|
__unstableStateReducer: { control: { type: null } },
|
|
@@ -7,12 +7,15 @@ export function maybeWarnDeprecated36pxSize( {
|
|
|
7
7
|
componentName,
|
|
8
8
|
__next40pxDefaultSize,
|
|
9
9
|
size,
|
|
10
|
+
__shouldNotWarnDeprecated36pxSize,
|
|
10
11
|
}: {
|
|
11
12
|
componentName: string;
|
|
12
13
|
__next40pxDefaultSize: boolean | undefined;
|
|
13
14
|
size: string | undefined;
|
|
15
|
+
__shouldNotWarnDeprecated36pxSize?: boolean;
|
|
14
16
|
} ) {
|
|
15
17
|
if (
|
|
18
|
+
__shouldNotWarnDeprecated36pxSize ||
|
|
16
19
|
__next40pxDefaultSize ||
|
|
17
20
|
( size !== undefined && size !== 'default' )
|
|
18
21
|
) {
|
|
@@ -25,7 +25,8 @@ const ALIGNMENTS = {
|
|
|
25
25
|
|
|
26
26
|
const meta: Meta< typeof VStack > = {
|
|
27
27
|
component: VStack,
|
|
28
|
-
title: 'Components (Experimental)/VStack',
|
|
28
|
+
title: 'Components (Experimental)/Layout/VStack',
|
|
29
|
+
id: 'components-experimental-vstack',
|
|
29
30
|
argTypes: {
|
|
30
31
|
alignment: {
|
|
31
32
|
control: { type: 'select' },
|