@wordpress/components 28.14.1-next.cd6172eb0.0 → 29.0.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 +16 -9
- package/build/alignment-matrix-control/icon.js +1 -0
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +1 -0
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/animation/index.js +0 -6
- package/build/animation/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +1 -0
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +1 -0
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +1 -0
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +1 -0
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/utils.js +1 -0
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +1 -0
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-style-picker/component.js +1 -0
- package/build/border-control/border-control-style-picker/component.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-control.js +161 -0
- package/build/box-control/input-control.js.map +1 -0
- package/build/box-control/types.js.map +1 -1
- package/build/box-control/utils.js +51 -48
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.native.js +1 -0
- package/build/button/index.native.js.map +1 -1
- package/build/button/types.js.map +1 -1
- package/build/color-indicator/index.native.js +1 -0
- package/build/color-indicator/index.native.js.map +1 -1
- package/build/color-palette/index.js +1 -0
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +1 -0
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-palette/utils.js +1 -0
- package/build/color-palette/utils.js.map +1 -1
- package/build/combobox-control/index.js +1 -0
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/legacy/index.js +1 -0
- package/build/composite/legacy/index.js.map +1 -1
- package/build/context/context-connect.js +1 -0
- package/build/context/context-connect.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
- package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +1 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +1 -0
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +1 -0
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control/index.js +3 -2
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +1 -0
- package/build/dashicon/index.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/date-time/date/use-lilius/index.js +1 -0
- package/build/date-time/date/use-lilius/index.js.map +1 -1
- package/build/date-time/time/index.js +1 -0
- package/build/date-time/time/index.js.map +1 -1
- package/build/dimension-control/index.js +1 -0
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/sizes.js +1 -0
- package/build/dimension-control/sizes.js.map +1 -1
- package/build/draggable/index.js +1 -0
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/index.native.js +1 -0
- package/build/draggable/index.native.js.map +1 -1
- package/build/dropdown-menu/index.js +1 -0
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +1 -0
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js +1 -0
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +1 -0
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/duotone-picker/utils.js +1 -0
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/external-link/index.js +1 -0
- package/build/external-link/index.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +1 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/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 +1 -0
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +1 -0
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/font-size-picker/utils.js +1 -0
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-token-field/index.js +1 -0
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +1 -0
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/gradient-picker/index.js +1 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/index.js +1 -0
- package/build/guide/index.js.map +1 -1
- package/build/guide/page-control.js +1 -0
- package/build/guide/page-control.js.map +1 -1
- package/build/h-stack/hook.js +1 -0
- package/build/h-stack/hook.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +1 -0
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +1 -0
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +1 -0
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/higher-order/with-notices/index.js +1 -0
- package/build/higher-order/with-notices/index.js.map +1 -1
- package/build/index.js +0 -6
- package/build/index.js.map +1 -1
- package/build/keyboard-shortcuts/index.js +1 -0
- package/build/keyboard-shortcuts/index.js.map +1 -1
- package/build/menu/styles.js +16 -16
- package/build/menu/styles.js.map +1 -1
- package/build/menu-items-choice/index.js +1 -0
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +1 -0
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js +1 -0
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js +1 -0
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/mobile/picker/index.android.js +1 -0
- package/build/mobile/picker/index.android.js.map +1 -1
- package/build/mobile/picker/index.ios.js +1 -0
- package/build/mobile/picker/index.ios.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +1 -0
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/navigable-container/container.js +1 -0
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigation/group/index.js +1 -0
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +1 -0
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js +1 -0
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +12 -12
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/navigator/component.js +1 -0
- package/build/navigator/navigator/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +1 -0
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/utils/router.js +1 -0
- package/build/navigator/utils/router.js.map +1 -1
- package/build/notice/index.js +1 -0
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +1 -0
- package/build/notice/list.js.map +1 -1
- package/build/notice/list.native.js +1 -0
- package/build/notice/list.native.js.map +1 -1
- package/build/palette-edit/index.js +1 -0
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/actions.native.js +1 -0
- package/build/panel/actions.native.js.map +1 -1
- package/build/query-controls/index.js +1 -0
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/terms.js +1 -0
- package/build/query-controls/terms.js.map +1 -1
- package/build/radio-control/index.js +1 -0
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js +1 -0
- package/build/radio-control/index.native.js.map +1 -1
- package/build/range-control/mark.js +0 -1
- package/build/range-control/mark.js.map +1 -1
- package/build/range-control/rail.js +1 -0
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +33 -45
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/index.js +1 -0
- package/build/resizable-box/index.js.map +1 -1
- package/build/sandbox/index.js +1 -0
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +1 -0
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.native.js +1 -0
- package/build/search-control/index.native.js.map +1 -1
- package/build/select-control/index.js +1 -0
- package/build/select-control/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/provider.js +1 -0
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +1 -0
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/index.js +1 -0
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +1 -0
- package/build/snackbar/list.js.map +1 -1
- package/build/tab-panel/index.js +1 -0
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +1 -0
- package/build/tabs/index.js.map +1 -1
- package/build/text/utils.js +1 -0
- package/build/text/utils.js.map +1 -1
- package/build/theme/color-algorithms.js +1 -0
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +1 -0
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +1 -0
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +1 -0
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tree-grid/cell.js +4 -1
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +1 -0
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/types.js.map +1 -1
- package/build/tree-select/index.js +1 -0
- package/build/tree-select/index.js.map +1 -1
- package/build/unit-control/index.js +1 -0
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/index.native.js +1 -0
- package/build/unit-control/index.native.js.map +1 -1
- package/build/unit-control/unit-select-control.js +1 -0
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/unit-control/utils.js +1 -0
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/colors-values.js +3 -0
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +0 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/get-valid-children.js +1 -0
- package/build/utils/get-valid-children.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +1 -0
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build/utils/hooks/use-cx.js +1 -0
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/utils/math.js +1 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/rtl.js +1 -0
- package/build/utils/rtl.js.map +1 -1
- package/build/utils/values.js +1 -0
- package/build/utils/values.js.map +1 -1
- package/build/z-stack/component.js +1 -0
- package/build/z-stack/component.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +1 -0
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +1 -0
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/animation/index.js +1 -1
- package/build-module/animation/index.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/autocomplete/autocompleter-ui.native.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +1 -0
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +1 -0
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/utils.js +1 -0
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +1 -0
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-style-picker/component.js +1 -0
- package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
- package/build-module/box-control/index.js +15 -15
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-control.js +153 -0
- package/build-module/box-control/input-control.js.map +1 -0
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/box-control/utils.js +48 -46
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.native.js +1 -0
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/button/types.js.map +1 -1
- package/build-module/color-indicator/index.native.js +1 -0
- package/build-module/color-indicator/index.native.js.map +1 -1
- package/build-module/color-palette/index.js +1 -0
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +1 -0
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-palette/utils.js +1 -0
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/combobox-control/index.js +1 -0
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/composite/legacy/index.js +1 -0
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/context/context-connect.js +1 -0
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +1 -0
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +1 -0
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js +3 -2
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +1 -0
- package/build-module/dashicon/index.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/date-time/date/use-lilius/index.js +1 -0
- package/build-module/date-time/date/use-lilius/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -0
- package/build-module/date-time/time/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/dimension-control/sizes.js +1 -0
- package/build-module/dimension-control/sizes.js.map +1 -1
- package/build-module/draggable/index.js +1 -0
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/index.native.js +1 -0
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -0
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +1 -0
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +1 -0
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +1 -0
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/duotone-picker/utils.js +1 -0
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/external-link/index.js +1 -0
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +1 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/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 +1 -0
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +1 -0
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/font-size-picker/utils.js +1 -0
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-token-field/index.js +1 -0
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +1 -0
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/index.js +1 -0
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js +1 -0
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/h-stack/hook.js +1 -0
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +1 -0
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +1 -0
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +1 -0
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/higher-order/with-notices/index.js +1 -0
- package/build-module/higher-order/with-notices/index.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +1 -0
- package/build-module/keyboard-shortcuts/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/menu-items-choice/index.js +1 -0
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +1 -0
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js +1 -0
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/mobile/picker/index.android.js +1 -0
- package/build-module/mobile/picker/index.android.js.map +1 -1
- package/build-module/mobile/picker/index.ios.js +1 -0
- package/build-module/mobile/picker/index.ios.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +1 -0
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/navigable-container/container.js +1 -0
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigation/group/index.js +1 -0
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +1 -0
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -0
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +12 -12
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/navigator/component.js +1 -0
- package/build-module/navigator/navigator/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +1 -0
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/utils/router.js +1 -0
- package/build-module/navigator/utils/router.js.map +1 -1
- package/build-module/notice/index.js +1 -0
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +1 -0
- package/build-module/notice/list.js.map +1 -1
- package/build-module/notice/list.native.js +1 -0
- package/build-module/notice/list.native.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/panel/actions.native.js +1 -0
- package/build-module/panel/actions.native.js.map +1 -1
- package/build-module/query-controls/index.js +1 -0
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/terms.js +1 -0
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/radio-control/index.js +1 -0
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +1 -0
- package/build-module/radio-control/index.native.js.map +1 -1
- package/build-module/range-control/mark.js +0 -1
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +1 -0
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +33 -45
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/index.js +1 -0
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/sandbox/index.js +1 -0
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -0
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.native.js +1 -0
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/select-control/index.js +1 -0
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/provider.js +1 -0
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +1 -0
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +1 -0
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +1 -0
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/tab-panel/index.js +1 -0
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +1 -0
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/text/utils.js +1 -0
- package/build-module/text/utils.js.map +1 -1
- package/build-module/theme/color-algorithms.js +1 -0
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -0
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +1 -0
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -0
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tree-grid/cell.js +4 -1
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/tree-grid/index.js +1 -0
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-grid/types.js.map +1 -1
- package/build-module/tree-select/index.js +1 -0
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/unit-control/index.js +1 -0
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +1 -0
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +1 -0
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/unit-control/utils.js +1 -0
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/colors-values.js +3 -0
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +0 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/get-valid-children.js +1 -0
- package/build-module/utils/get-valid-children.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build-module/utils/hooks/use-cx.js +1 -0
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/utils/math.js +1 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/rtl.js +1 -0
- package/build-module/utils/rtl.js.map +1 -1
- package/build-module/utils/values.js +1 -0
- package/build-module/utils/values.js.map +1 -1
- package/build-module/z-stack/component.js +1 -0
- package/build-module/z-stack/component.js.map +1 -1
- package/build-style/style-rtl.css +3 -3
- package/build-style/style.css +3 -3
- package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
- package/build-types/animation/index.d.ts +1 -1
- package/build-types/animation/index.d.ts.map +1 -1
- package/build-types/base-control/hooks.d.ts +4 -4
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
- package/build-types/border-control/border-control/hook.d.ts +83 -83
- package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-control.d.ts +3 -0
- package/build-types/box-control/input-control.d.ts.map +1 -0
- package/build-types/box-control/stories/index.story.d.ts +816 -816
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +9 -1
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +23 -15
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +18 -0
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button/types.d.ts +6 -4
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +83 -83
- package/build-types/card/card-body/hook.d.ts +83 -83
- package/build-types/card/card-divider/hook.d.ts +84 -84
- package/build-types/card/card-footer/hook.d.ts +83 -83
- package/build-types/card/card-header/hook.d.ts +83 -83
- package/build-types/card/card-media/hook.d.ts +83 -83
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/context/constants.d.ts.map +1 -1
- package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
- package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/date/styles.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/date-time/time/styles.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +83 -83
- package/build-types/flex/flex/hook.d.ts +83 -83
- package/build-types/flex/flex-block/hook.d.ts +83 -83
- package/build-types/flex/flex-item/hook.d.ts +83 -83
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +83 -83
- package/build-types/h-stack/hook.d.ts +83 -83
- package/build-types/heading/hook.d.ts +82 -82
- package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
- package/build-types/higher-order/with-filters/index.d.ts +4 -4
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +83 -83
- package/build-types/item-group/item-group/hook.d.ts +83 -83
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
- package/build-types/navigator/navigator-button/hook.d.ts +92 -92
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts.map +1 -1
- package/build-types/range-control/mark.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +83 -83
- package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +83 -83
- package/build-types/spinner/styles.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +83 -83
- package/build-types/text/hook.d.ts +83 -83
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
- package/build-types/tree-grid/cell.d.ts.map +1 -1
- package/build-types/tree-grid/types.d.ts +1 -1
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +83 -83
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +3 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
- package/build-types/utils/rtl.d.ts +1 -1
- package/build-types/utils/rtl.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +83 -83
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
- package/src/angle-picker-control/stories/index.story.tsx +2 -2
- package/src/animation/index.tsx +0 -1
- package/src/base-control/stories/index.story.tsx +1 -1
- package/src/border-box-control/stories/index.story.tsx +1 -1
- package/src/border-control/stories/index.story.tsx +1 -1
- package/src/box-control/index.tsx +24 -14
- package/src/box-control/input-control.tsx +197 -0
- package/src/box-control/stories/index.story.tsx +1 -1
- package/src/box-control/types.ts +9 -1
- package/src/box-control/utils.ts +62 -60
- package/src/button/README.md +108 -219
- package/src/button/docs-manifest.json +5 -0
- package/src/button/stories/best-practices.mdx +31 -0
- package/src/button/stories/index.story.tsx +18 -0
- package/src/button/types.ts +6 -4
- package/src/button-group/stories/index.story.tsx +1 -1
- package/src/card/stories/index.story.tsx +2 -2
- package/src/checkbox-control/stories/index.story.tsx +1 -1
- package/src/circular-option-picker/stories/index.story.tsx +2 -2
- package/src/color-palette/stories/index.story.tsx +3 -3
- package/src/color-picker/stories/index.story.tsx +2 -2
- package/src/combobox-control/stories/index.story.tsx +1 -1
- package/src/composite/stories/index.story.tsx +3 -3
- package/src/confirm-dialog/stories/index.story.tsx +1 -1
- package/src/custom-select-control/index.tsx +2 -2
- package/src/custom-select-control/stories/index.story.tsx +2 -2
- package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
- package/src/date-time/stories/date-time.story.tsx +4 -1
- package/src/date-time/stories/date.story.tsx +4 -1
- package/src/date-time/stories/time.story.tsx +4 -1
- package/src/dimension-control/stories/index.story.tsx +1 -1
- package/src/disabled/stories/index.story.tsx +3 -3
- package/src/divider/stories/index.story.tsx +1 -1
- package/src/draggable/stories/index.story.tsx +2 -2
- package/src/dropdown/stories/index.story.tsx +7 -7
- package/src/dropdown-menu/index.tsx +3 -1
- package/src/dropdown-menu/stories/index.story.tsx +3 -3
- package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
- package/src/flex/stories/index.story.tsx +1 -1
- package/src/font-size-picker/stories/index.story.tsx +1 -1
- package/src/form-file-upload/stories/index.story.tsx +3 -3
- package/src/form-token-field/stories/index.story.tsx +2 -2
- package/src/gradient-picker/stories/index.story.tsx +1 -1
- package/src/grid/stories/index.story.tsx +1 -1
- package/src/h-stack/stories/index.story.tsx +2 -2
- package/src/index.ts +1 -5
- package/src/input-control/stories/index.story.tsx +4 -4
- package/src/item-group/stories/index.story.tsx +2 -2
- package/src/menu/stories/index.story.tsx +2 -2
- package/src/menu/styles.ts +1 -1
- package/src/menu-group/stories/index.story.tsx +1 -1
- package/src/menu-item/stories/index.story.tsx +1 -1
- package/src/menu-items-choice/stories/index.story.tsx +1 -1
- package/src/modal/stories/index.story.tsx +2 -2
- package/src/modal/test/index.tsx +2 -1
- package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
- package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
- package/src/navigation/stories/index.story.tsx +4 -4
- package/src/navigation/styles/navigation-styles.tsx +3 -2
- package/src/navigator/stories/index.story.tsx +3 -3
- package/src/number-control/stories/index.story.tsx +1 -1
- package/src/panel/stories/index.story.tsx +1 -1
- package/src/placeholder/stories/index.story.tsx +3 -3
- package/src/popover/stories/index.story.tsx +11 -9
- package/src/query-controls/stories/index.story.tsx +6 -6
- package/src/radio-control/stories/index.story.tsx +1 -1
- package/src/radio-group/stories/index.story.tsx +3 -3
- package/src/range-control/mark.tsx +0 -1
- package/src/range-control/stories/index.story.tsx +7 -7
- package/src/range-control/styles/range-control-styles.ts +18 -19
- package/src/resizable-box/stories/index.story.tsx +1 -1
- package/src/responsive-wrapper/stories/index.story.tsx +1 -1
- package/src/sandbox/stories/index.story.tsx +1 -1
- package/src/scrollable/stories/index.story.tsx +2 -1
- package/src/search-control/stories/index.story.tsx +1 -1
- package/src/select-control/stories/index.story.tsx +1 -1
- package/src/slot-fill/stories/index.story.tsx +2 -2
- package/src/snackbar/stories/index.story.tsx +4 -4
- package/src/snackbar/stories/list.story.tsx +2 -2
- package/src/surface/stories/index.story.tsx +1 -1
- package/src/text-control/stories/index.story.tsx +1 -1
- package/src/textarea-control/stories/index.story.tsx +1 -1
- package/src/theme/stories/index.story.tsx +1 -1
- package/src/toggle-control/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +22 -22
- package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
- package/src/toolbar/stories/index.story.tsx +1 -1
- package/src/tools-panel/stories/index.story.tsx +3 -3
- package/src/tools-panel/test/index.tsx +0 -17
- package/src/tooltip/stories/index.story.tsx +1 -1
- package/src/tree-grid/cell.tsx +5 -1
- package/src/tree-grid/stories/index.story.tsx +1 -1
- package/src/tree-grid/types.ts +1 -1
- package/src/tree-select/stories/index.story.tsx +1 -1
- package/src/unit-control/stories/index.story.tsx +4 -4
- package/src/utils/colors-values.js +3 -0
- package/src/utils/config-values.js +0 -1
- package/src/view/stories/index.story.tsx +1 -1
- package/src/visually-hidden/stories/index.story.tsx +1 -1
- package/src/z-stack/stories/index.story.tsx +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/box-control/all-input-control.js +0 -91
- package/build/box-control/all-input-control.js.map +0 -1
- package/build/box-control/axial-input-controls.js +0 -125
- package/build/box-control/axial-input-controls.js.map +0 -1
- package/build/box-control/input-controls.js +0 -133
- package/build/box-control/input-controls.js.map +0 -1
- package/build-module/box-control/all-input-control.js +0 -84
- package/build-module/box-control/all-input-control.js.map +0 -1
- package/build-module/box-control/axial-input-controls.js +0 -116
- package/build-module/box-control/axial-input-controls.js.map +0 -1
- package/build-module/box-control/input-controls.js +0 -124
- package/build-module/box-control/input-controls.js.map +0 -1
- package/build-types/box-control/all-input-control.d.ts +0 -3
- package/build-types/box-control/all-input-control.d.ts.map +0 -1
- package/build-types/box-control/axial-input-controls.d.ts +0 -3
- package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
- package/build-types/box-control/input-controls.d.ts +0 -3
- package/build-types/box-control/input-controls.d.ts.map +0 -1
- package/src/box-control/all-input-control.tsx +0 -110
- package/src/box-control/axial-input-controls.tsx +0 -165
- package/src/box-control/input-controls.tsx +0 -167
|
@@ -9,13 +9,10 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import { BaseControl } from '../base-control';
|
|
12
|
-
import
|
|
13
|
-
import InputControls from './input-controls';
|
|
14
|
-
import AxialInputControls from './axial-input-controls';
|
|
12
|
+
import InputControl from './input-control';
|
|
15
13
|
import LinkedButton from './linked-button';
|
|
16
14
|
import { Grid } from '../grid';
|
|
17
15
|
import {
|
|
18
|
-
FlexedBoxControlIcon,
|
|
19
16
|
InputWrapper,
|
|
20
17
|
ResetButton,
|
|
21
18
|
LinkedButtonWrapper,
|
|
@@ -24,8 +21,9 @@ import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
|
24
21
|
import {
|
|
25
22
|
DEFAULT_VALUES,
|
|
26
23
|
getInitialSide,
|
|
27
|
-
|
|
24
|
+
isValueMixed,
|
|
28
25
|
isValuesDefined,
|
|
26
|
+
getAllowedSides,
|
|
29
27
|
} from './utils';
|
|
30
28
|
import { useControlledState } from '../utils/hooks';
|
|
31
29
|
import type {
|
|
@@ -97,7 +95,7 @@ function BoxControl( {
|
|
|
97
95
|
|
|
98
96
|
const [ isDirty, setIsDirty ] = useState( hasInitialValue );
|
|
99
97
|
const [ isLinked, setIsLinked ] = useState(
|
|
100
|
-
! hasInitialValue || !
|
|
98
|
+
! hasInitialValue || ! isValueMixed( inputValues ) || hasOneSide
|
|
101
99
|
);
|
|
102
100
|
|
|
103
101
|
const [ side, setSide ] = useState< BoxControlIconProps[ 'side' ] >(
|
|
@@ -162,6 +160,7 @@ function BoxControl( {
|
|
|
162
160
|
__next40pxDefaultSize,
|
|
163
161
|
size: undefined,
|
|
164
162
|
} );
|
|
163
|
+
const sidesToRender = getAllowedSides( sides );
|
|
165
164
|
|
|
166
165
|
return (
|
|
167
166
|
<Grid
|
|
@@ -176,8 +175,7 @@ function BoxControl( {
|
|
|
176
175
|
</BaseControl.VisualLabel>
|
|
177
176
|
{ isLinked && (
|
|
178
177
|
<InputWrapper>
|
|
179
|
-
<
|
|
180
|
-
<AllInputControl { ...inputControlProps } />
|
|
178
|
+
<InputControl side="all" { ...inputControlProps } />
|
|
181
179
|
</InputWrapper>
|
|
182
180
|
) }
|
|
183
181
|
{ ! hasOneSide && (
|
|
@@ -189,12 +187,24 @@ function BoxControl( {
|
|
|
189
187
|
</LinkedButtonWrapper>
|
|
190
188
|
) }
|
|
191
189
|
|
|
192
|
-
{ ! isLinked &&
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
{ ! isLinked &&
|
|
191
|
+
splitOnAxis &&
|
|
192
|
+
[ 'vertical', 'horizontal' ].map( ( axis ) => (
|
|
193
|
+
<InputControl
|
|
194
|
+
key={ axis }
|
|
195
|
+
side={ axis as 'horizontal' | 'vertical' }
|
|
196
|
+
{ ...inputControlProps }
|
|
197
|
+
/>
|
|
198
|
+
) ) }
|
|
199
|
+
{ ! isLinked &&
|
|
200
|
+
! splitOnAxis &&
|
|
201
|
+
Array.from( sidesToRender ).map( ( axis ) => (
|
|
202
|
+
<InputControl
|
|
203
|
+
key={ axis }
|
|
204
|
+
side={ axis }
|
|
205
|
+
{ ...inputControlProps }
|
|
206
|
+
/>
|
|
207
|
+
) ) }
|
|
198
208
|
{ allowReset && (
|
|
199
209
|
<ResetButton
|
|
200
210
|
className="component-box-control__reset-button"
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import Tooltip from '../tooltip';
|
|
11
|
+
import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
12
|
+
import {
|
|
13
|
+
CUSTOM_VALUE_SETTINGS,
|
|
14
|
+
getAllowedSides,
|
|
15
|
+
getMergedValue,
|
|
16
|
+
isValueMixed,
|
|
17
|
+
isValuesDefined,
|
|
18
|
+
LABELS,
|
|
19
|
+
} from './utils';
|
|
20
|
+
import {
|
|
21
|
+
FlexedBoxControlIcon,
|
|
22
|
+
FlexedRangeControl,
|
|
23
|
+
InputWrapper,
|
|
24
|
+
StyledUnitControl,
|
|
25
|
+
} from './styles/box-control-styles';
|
|
26
|
+
import type { BoxControlInputControlProps, BoxControlValue } from './types';
|
|
27
|
+
|
|
28
|
+
const noop = () => {};
|
|
29
|
+
|
|
30
|
+
function getSidesToModify(
|
|
31
|
+
side: BoxControlInputControlProps[ 'side' ],
|
|
32
|
+
sides: BoxControlInputControlProps[ 'sides' ],
|
|
33
|
+
isAlt?: boolean
|
|
34
|
+
) {
|
|
35
|
+
const allowedSides = getAllowedSides( sides );
|
|
36
|
+
|
|
37
|
+
let modifiedSides: ( keyof BoxControlValue )[] = [];
|
|
38
|
+
switch ( side ) {
|
|
39
|
+
case 'all':
|
|
40
|
+
modifiedSides = [ 'top', 'bottom', 'left', 'right' ];
|
|
41
|
+
break;
|
|
42
|
+
case 'horizontal':
|
|
43
|
+
modifiedSides = [ 'left', 'right' ];
|
|
44
|
+
break;
|
|
45
|
+
case 'vertical':
|
|
46
|
+
modifiedSides = [ 'top', 'bottom' ];
|
|
47
|
+
break;
|
|
48
|
+
default:
|
|
49
|
+
modifiedSides = [ side ];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if ( isAlt ) {
|
|
53
|
+
switch ( side ) {
|
|
54
|
+
case 'top':
|
|
55
|
+
modifiedSides.push( 'bottom' );
|
|
56
|
+
break;
|
|
57
|
+
case 'bottom':
|
|
58
|
+
modifiedSides.push( 'top' );
|
|
59
|
+
break;
|
|
60
|
+
case 'left':
|
|
61
|
+
modifiedSides.push( 'left' );
|
|
62
|
+
break;
|
|
63
|
+
case 'right':
|
|
64
|
+
modifiedSides.push( 'right' );
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return modifiedSides.filter( ( s ) => allowedSides.has( s ) );
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default function BoxInputControl( {
|
|
73
|
+
__next40pxDefaultSize,
|
|
74
|
+
onChange = noop,
|
|
75
|
+
onFocus = noop,
|
|
76
|
+
values,
|
|
77
|
+
selectedUnits,
|
|
78
|
+
setSelectedUnits,
|
|
79
|
+
sides,
|
|
80
|
+
side,
|
|
81
|
+
...props
|
|
82
|
+
}: BoxControlInputControlProps ) {
|
|
83
|
+
const defaultValuesToModify = getSidesToModify( side, sides );
|
|
84
|
+
|
|
85
|
+
const handleOnFocus = ( event: React.FocusEvent< HTMLInputElement > ) => {
|
|
86
|
+
onFocus( event, { side } );
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const handleOnChange = ( nextValues: BoxControlValue ) => {
|
|
90
|
+
onChange( nextValues );
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const handleOnValueChange = (
|
|
94
|
+
next?: string,
|
|
95
|
+
extra?: { event: React.SyntheticEvent< Element, Event > }
|
|
96
|
+
) => {
|
|
97
|
+
const nextValues = { ...values };
|
|
98
|
+
const isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );
|
|
99
|
+
const nextValue = isNumeric ? next : undefined;
|
|
100
|
+
const modifiedSides = getSidesToModify(
|
|
101
|
+
side,
|
|
102
|
+
sides,
|
|
103
|
+
/**
|
|
104
|
+
* Supports changing pair sides. For example, holding the ALT key
|
|
105
|
+
* when changing the TOP will also update BOTTOM.
|
|
106
|
+
*/
|
|
107
|
+
// @ts-expect-error - TODO: event.altKey is only present when the change event was
|
|
108
|
+
// triggered by a keyboard event. Should this feature be implemented differently so
|
|
109
|
+
// it also works with drag events?
|
|
110
|
+
!! extra?.event.altKey
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
modifiedSides.forEach( ( modifiedSide ) => {
|
|
114
|
+
nextValues[ modifiedSide ] = nextValue;
|
|
115
|
+
} );
|
|
116
|
+
|
|
117
|
+
handleOnChange( nextValues );
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const handleOnUnitChange = ( next?: string ) => {
|
|
121
|
+
const newUnits = { ...selectedUnits };
|
|
122
|
+
defaultValuesToModify.forEach( ( modifiedSide ) => {
|
|
123
|
+
newUnits[ modifiedSide ] = next;
|
|
124
|
+
} );
|
|
125
|
+
setSelectedUnits( newUnits );
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const mergedValue = getMergedValue( values, defaultValuesToModify );
|
|
129
|
+
const hasValues = isValuesDefined( values );
|
|
130
|
+
const isMixed =
|
|
131
|
+
hasValues &&
|
|
132
|
+
defaultValuesToModify.length > 1 &&
|
|
133
|
+
isValueMixed( values, defaultValuesToModify );
|
|
134
|
+
const [ parsedQuantity, parsedUnit ] =
|
|
135
|
+
parseQuantityAndUnitFromRawValue( mergedValue );
|
|
136
|
+
const computedUnit = hasValues
|
|
137
|
+
? parsedUnit
|
|
138
|
+
: selectedUnits[ defaultValuesToModify[ 0 ] ];
|
|
139
|
+
const generatedId = useInstanceId( BoxInputControl, 'box-control-input' );
|
|
140
|
+
const inputId = [ generatedId, side ].join( '-' );
|
|
141
|
+
const isMixedUnit =
|
|
142
|
+
defaultValuesToModify.length > 1 &&
|
|
143
|
+
mergedValue === undefined &&
|
|
144
|
+
defaultValuesToModify.some(
|
|
145
|
+
( s ) => selectedUnits[ s ] !== computedUnit
|
|
146
|
+
);
|
|
147
|
+
const usedValue =
|
|
148
|
+
mergedValue === undefined && computedUnit ? computedUnit : mergedValue;
|
|
149
|
+
const mixedPlaceholder = isMixed || isMixedUnit ? __( 'Mixed' ) : undefined;
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<InputWrapper key={ `box-control-${ side }` } expanded>
|
|
153
|
+
<FlexedBoxControlIcon side={ side } sides={ sides } />
|
|
154
|
+
<Tooltip placement="top-end" text={ LABELS[ side ] }>
|
|
155
|
+
<StyledUnitControl
|
|
156
|
+
{ ...props }
|
|
157
|
+
__shouldNotWarnDeprecated36pxSize
|
|
158
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
159
|
+
className="component-box-control__unit-control"
|
|
160
|
+
id={ inputId }
|
|
161
|
+
isPressEnterToChange
|
|
162
|
+
disableUnits={ isMixed || isMixedUnit }
|
|
163
|
+
value={ usedValue }
|
|
164
|
+
onChange={ handleOnValueChange }
|
|
165
|
+
onUnitChange={ handleOnUnitChange }
|
|
166
|
+
onFocus={ handleOnFocus }
|
|
167
|
+
label={ LABELS[ side ] }
|
|
168
|
+
placeholder={ mixedPlaceholder }
|
|
169
|
+
hideLabelFromVision
|
|
170
|
+
/>
|
|
171
|
+
</Tooltip>
|
|
172
|
+
|
|
173
|
+
<FlexedRangeControl
|
|
174
|
+
__nextHasNoMarginBottom
|
|
175
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
176
|
+
__shouldNotWarnDeprecated36pxSize
|
|
177
|
+
aria-controls={ inputId }
|
|
178
|
+
label={ LABELS[ side ] }
|
|
179
|
+
hideLabelFromVision
|
|
180
|
+
onChange={ ( newValue ) => {
|
|
181
|
+
handleOnValueChange(
|
|
182
|
+
newValue !== undefined
|
|
183
|
+
? [ newValue, computedUnit ].join( '' )
|
|
184
|
+
: undefined
|
|
185
|
+
);
|
|
186
|
+
} }
|
|
187
|
+
min={ 0 }
|
|
188
|
+
max={ CUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]?.max ?? 10 }
|
|
189
|
+
step={
|
|
190
|
+
CUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]?.step ?? 0.1
|
|
191
|
+
}
|
|
192
|
+
value={ parsedQuantity ?? 0 }
|
|
193
|
+
withInputField={ false }
|
|
194
|
+
/>
|
|
195
|
+
</InputWrapper>
|
|
196
|
+
);
|
|
197
|
+
}
|
package/src/box-control/types.ts
CHANGED
|
@@ -110,8 +110,16 @@ export type BoxControlInputControlProps = UnitControlPassthroughProps & {
|
|
|
110
110
|
) => void;
|
|
111
111
|
selectedUnits: BoxControlValue;
|
|
112
112
|
setSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;
|
|
113
|
-
sides: BoxControlProps[ 'sides' ];
|
|
114
113
|
values: BoxControlValue;
|
|
114
|
+
/**
|
|
115
|
+
* Collection of sides to allow control of. If omitted or empty, all sides will be available.
|
|
116
|
+
*/
|
|
117
|
+
sides: BoxControlProps[ 'sides' ];
|
|
118
|
+
/**
|
|
119
|
+
* Side represents the current side being rendered by the input.
|
|
120
|
+
* It can be a concrete side like: left, right, top, bottom or a combined one like: horizontal, vertical.
|
|
121
|
+
*/
|
|
122
|
+
side: keyof typeof LABELS;
|
|
115
123
|
};
|
|
116
124
|
|
|
117
125
|
export type BoxControlIconProps = {
|
package/src/box-control/utils.ts
CHANGED
|
@@ -6,12 +6,13 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
10
9
|
import type {
|
|
10
|
+
BoxControlInputControlProps,
|
|
11
11
|
BoxControlProps,
|
|
12
12
|
BoxControlValue,
|
|
13
13
|
CustomValueUnits,
|
|
14
14
|
} from './types';
|
|
15
|
+
import deprecated from '@wordpress/deprecated';
|
|
15
16
|
|
|
16
17
|
export const CUSTOM_VALUE_SETTINGS: CustomValueUnits = {
|
|
17
18
|
px: { max: 300, step: 1 },
|
|
@@ -50,7 +51,6 @@ export const LABELS = {
|
|
|
50
51
|
bottom: __( 'Bottom side' ),
|
|
51
52
|
left: __( 'Left side' ),
|
|
52
53
|
right: __( 'Right side' ),
|
|
53
|
-
mixed: __( 'Mixed' ),
|
|
54
54
|
vertical: __( 'Top and bottom sides' ),
|
|
55
55
|
horizontal: __( 'Left and right sides' ),
|
|
56
56
|
};
|
|
@@ -82,56 +82,46 @@ function mode< T >( arr: T[] ) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Gets the
|
|
85
|
+
* Gets the merged input value and unit from values data.
|
|
86
86
|
*
|
|
87
87
|
* @param values Box values.
|
|
88
|
-
* @param selectedUnits Box units.
|
|
89
88
|
* @param availableSides Available box sides to evaluate.
|
|
90
89
|
*
|
|
91
90
|
* @return A value + unit for the 'all' input.
|
|
92
91
|
*/
|
|
93
|
-
export function
|
|
92
|
+
export function getMergedValue(
|
|
94
93
|
values: BoxControlValue = {},
|
|
95
|
-
selectedUnits?: BoxControlValue,
|
|
96
94
|
availableSides: BoxControlProps[ 'sides' ] = ALL_SIDES
|
|
97
95
|
) {
|
|
98
96
|
const sides = normalizeSides( availableSides );
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
( value ) => value[ 1 ]
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
const commonQuantity = allParsedQuantities.every(
|
|
110
|
-
( v ) => v === allParsedQuantities[ 0 ]
|
|
111
|
-
)
|
|
112
|
-
? allParsedQuantities[ 0 ]
|
|
113
|
-
: '';
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The typeof === 'number' check is important. On reset actions, the incoming value
|
|
117
|
-
* may be null or an empty string.
|
|
118
|
-
*
|
|
119
|
-
* Also, the value may also be zero (0), which is considered a valid unit value.
|
|
120
|
-
*
|
|
121
|
-
* typeof === 'number' is more specific for these cases, rather than relying on a
|
|
122
|
-
* simple truthy check.
|
|
123
|
-
*/
|
|
124
|
-
let commonUnit;
|
|
125
|
-
if ( typeof commonQuantity === 'number' ) {
|
|
126
|
-
commonUnit = mode( allParsedUnits );
|
|
127
|
-
} else {
|
|
128
|
-
// Set meaningful unit selection if no commonQuantity and user has previously
|
|
129
|
-
// selected units without assigning values while controls were unlinked.
|
|
130
|
-
commonUnit =
|
|
131
|
-
getAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );
|
|
97
|
+
if (
|
|
98
|
+
sides.every(
|
|
99
|
+
( side: keyof BoxControlValue ) =>
|
|
100
|
+
values[ side ] === values[ sides[ 0 ] ]
|
|
101
|
+
)
|
|
102
|
+
) {
|
|
103
|
+
return values[ sides[ 0 ] ];
|
|
132
104
|
}
|
|
133
105
|
|
|
134
|
-
return
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Checks if the values are mixed.
|
|
111
|
+
*
|
|
112
|
+
* @param values Box values.
|
|
113
|
+
* @param availableSides Available box sides to evaluate.
|
|
114
|
+
* @return Whether the values are mixed.
|
|
115
|
+
*/
|
|
116
|
+
export function isValueMixed(
|
|
117
|
+
values: BoxControlValue = {},
|
|
118
|
+
availableSides: BoxControlProps[ 'sides' ] = ALL_SIDES
|
|
119
|
+
) {
|
|
120
|
+
const sides = normalizeSides( availableSides );
|
|
121
|
+
return sides.some(
|
|
122
|
+
( side: keyof BoxControlValue ) =>
|
|
123
|
+
values[ side ] !== values[ sides[ 0 ] ]
|
|
124
|
+
);
|
|
135
125
|
}
|
|
136
126
|
|
|
137
127
|
/**
|
|
@@ -150,26 +140,6 @@ export function getAllUnitFallback( selectedUnits?: BoxControlValue ) {
|
|
|
150
140
|
return mode( filteredUnits );
|
|
151
141
|
}
|
|
152
142
|
|
|
153
|
-
/**
|
|
154
|
-
* Checks to determine if values are mixed.
|
|
155
|
-
*
|
|
156
|
-
* @param values Box values.
|
|
157
|
-
* @param selectedUnits Box units.
|
|
158
|
-
* @param sides Available box sides to evaluate.
|
|
159
|
-
*
|
|
160
|
-
* @return Whether values are mixed.
|
|
161
|
-
*/
|
|
162
|
-
export function isValuesMixed(
|
|
163
|
-
values: BoxControlValue = {},
|
|
164
|
-
selectedUnits?: BoxControlValue,
|
|
165
|
-
sides: BoxControlProps[ 'sides' ] = ALL_SIDES
|
|
166
|
-
) {
|
|
167
|
-
const allValue = getAllValue( values, selectedUnits, sides );
|
|
168
|
-
const isMixed = isNaN( parseFloat( allValue ) );
|
|
169
|
-
|
|
170
|
-
return isMixed;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
143
|
/**
|
|
174
144
|
* Checks to determine if values are defined.
|
|
175
145
|
*
|
|
@@ -239,6 +209,8 @@ export function normalizeSides( sides: BoxControlProps[ 'sides' ] ) {
|
|
|
239
209
|
* Applies a value to an object representing top, right, bottom and left sides
|
|
240
210
|
* while taking into account any custom side configuration.
|
|
241
211
|
*
|
|
212
|
+
* @deprecated
|
|
213
|
+
*
|
|
242
214
|
* @param currentValues The current values for each side.
|
|
243
215
|
* @param newValue The value to apply to the sides object.
|
|
244
216
|
* @param sides Array defining valid sides.
|
|
@@ -250,6 +222,10 @@ export function applyValueToSides(
|
|
|
250
222
|
newValue?: string,
|
|
251
223
|
sides?: BoxControlProps[ 'sides' ]
|
|
252
224
|
): BoxControlValue {
|
|
225
|
+
deprecated( 'applyValueToSides', {
|
|
226
|
+
since: '6.8',
|
|
227
|
+
version: '7.0',
|
|
228
|
+
} );
|
|
253
229
|
const newValues = { ...currentValues };
|
|
254
230
|
|
|
255
231
|
if ( sides?.length ) {
|
|
@@ -270,3 +246,29 @@ export function applyValueToSides(
|
|
|
270
246
|
|
|
271
247
|
return newValues;
|
|
272
248
|
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Return the allowed sides based on the sides configuration.
|
|
252
|
+
*
|
|
253
|
+
* @param sides Sides configuration.
|
|
254
|
+
* @return Allowed sides.
|
|
255
|
+
*/
|
|
256
|
+
export function getAllowedSides(
|
|
257
|
+
sides: BoxControlInputControlProps[ 'sides' ]
|
|
258
|
+
) {
|
|
259
|
+
const allowedSides: Set< keyof BoxControlValue > = new Set(
|
|
260
|
+
! sides ? ALL_SIDES : []
|
|
261
|
+
);
|
|
262
|
+
sides?.forEach( ( allowedSide ) => {
|
|
263
|
+
if ( allowedSide === 'vertical' ) {
|
|
264
|
+
allowedSides.add( 'top' );
|
|
265
|
+
allowedSides.add( 'bottom' );
|
|
266
|
+
} else if ( allowedSide === 'horizontal' ) {
|
|
267
|
+
allowedSides.add( 'right' );
|
|
268
|
+
allowedSides.add( 'left' );
|
|
269
|
+
} else {
|
|
270
|
+
allowedSides.add( allowedSide );
|
|
271
|
+
}
|
|
272
|
+
} );
|
|
273
|
+
return allowedSides;
|
|
274
|
+
}
|