@wordpress/components 23.3.1 → 23.4.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 +35 -0
- package/build/alignment-matrix-control/utils.js +4 -4
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +37 -29
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/angle-picker-control/index.js +44 -9
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/{base-field → angle-picker-control}/types.js +0 -0
- package/build/angle-picker-control/types.js.map +1 -0
- package/build/autocomplete/autocompleter-ui.native.js +1 -0
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/base-control/hooks.js +1 -1
- package/build/base-control/hooks.js.map +1 -1
- package/build/border-box-control/utils.js +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/box-control/all-input-control.js +2 -2
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +32 -3
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +5 -5
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/styles/box-control-icon-styles.js +28 -28
- package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +23 -23
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/box-control/styles/box-control-visualizer-styles.js +19 -19
- package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build/box-control/types.js +6 -0
- package/build/box-control/types.js.map +1 -0
- package/build/box-control/unit-control.js.map +1 -1
- package/build/box-control/utils.js +23 -23
- package/build/box-control/utils.js.map +1 -1
- package/build/color-palette/index.js +15 -7
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/utils.js +12 -4
- package/build/color-palette/utils.js.map +1 -1
- package/build/combobox-control/index.js +68 -12
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +2 -2
- package/build/combobox-control/styles.js.map +1 -1
- package/build/combobox-control/types.js +6 -0
- package/build/combobox-control/types.js.map +1 -0
- package/build/custom-gradient-picker/index.js +0 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-select-control/index.js +7 -0
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/time/index.js +1 -1
- package/build/date-time/time/index.js.map +1 -1
- package/build/date-time/utils.js +1 -1
- package/build/date-time/utils.js.map +1 -1
- package/build/draggable/index.js +2 -2
- package/build/draggable/index.js.map +1 -1
- package/build/focal-point-picker/utils.js +3 -3
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/font-size-picker/utils.js +2 -2
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/gradient-picker/index.js +9 -4
- package/build/gradient-picker/index.js.map +1 -1
- package/build/index.js +16 -10
- package/build/index.js.map +1 -1
- package/build/input-control/reducer/reducer.js +5 -5
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/utils.js +1 -1
- package/build/input-control/utils.js.map +1 -1
- package/build/menu-items-choice/index.js +40 -3
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/menu-items-choice/types.js +6 -0
- package/build/menu-items-choice/types.js.map +1 -0
- package/build/modal/index.js +41 -3
- package/build/modal/index.js.map +1 -1
- package/build/navigator/context.js +5 -1
- package/build/navigator/context.js.map +1 -1
- package/build/navigator/index.js +8 -0
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +11 -3
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +119 -11
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +18 -7
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-to-parent-button/component.js +75 -0
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -0
- package/build/navigator/navigator-to-parent-button/index.js +16 -0
- package/build/navigator/navigator-to-parent-button/index.js.map +1 -0
- package/build/navigator/use-navigator.js +6 -2
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/navigator/utils/router.js +57 -0
- package/build/navigator/utils/router.js.map +1 -0
- package/build/palette-edit/index.js +4 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/header.js +9 -0
- package/build/panel/header.js.map +1 -1
- package/build/panel/index.js +21 -3
- package/build/panel/index.js.map +1 -1
- package/build/panel/row.js +10 -4
- package/build/panel/row.js.map +1 -1
- package/build/panel/types.js +6 -0
- package/build/panel/types.js.map +1 -0
- package/build/popover/index.js +15 -3
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js +46 -0
- package/build/popover/overlay-middlewares.js.map +1 -0
- package/build/popover/utils.js +45 -6
- package/build/popover/utils.js.map +1 -1
- package/build/private-apis.js +35 -0
- package/build/private-apis.js.map +1 -0
- package/build/query-controls/terms.js +1 -1
- package/build/query-controls/terms.js.map +1 -1
- package/build/range-control/utils.js +4 -4
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +14 -14
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/select-control/index.js +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +38 -25
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/snackbar/index.js +2 -2
- package/build/snackbar/index.js.map +1 -1
- package/build/toolbar/toolbar/index.js +25 -14
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.js +5 -4
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build/toolbar/toolbar/types.js +6 -0
- package/build/toolbar/toolbar/types.js.map +1 -0
- package/build/toolbar/toolbar-button/index.js +2 -0
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/toolbar-button-container.js +1 -0
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js +2 -0
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/toolbar/toolbar-dropdown-menu/index.js +2 -0
- package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +2 -0
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-container.js +1 -0
- package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +2 -0
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +61 -5
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +8 -6
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +2 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js +2 -0
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +5 -4
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +24 -13
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tree-grid/cell.js +15 -4
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +81 -19
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/item.js +14 -3
- package/build/tree-grid/item.js.map +1 -1
- package/build/tree-grid/roving-tab-index-context.js +1 -1
- package/build/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +13 -6
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-grid/roving-tab-index.js +0 -3
- package/build/tree-grid/roving-tab-index.js.map +1 -1
- package/build/tree-grid/row.js +20 -18
- package/build/tree-grid/row.js.map +1 -1
- package/build/tree-grid/types.js +6 -0
- package/build/tree-grid/types.js.map +1 -0
- package/build/ui/context/context-connect.js +7 -7
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/ui/utils/get-valid-children.js +1 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/ui/utils/space.js +1 -1
- package/build/ui/utils/space.js.map +1 -1
- package/build/unit-control/index.js +2 -2
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/utils.js +20 -20
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/events.js +4 -4
- package/build/utils/events.js.map +1 -1
- package/build/utils/hooks/use-controlled-state.js +2 -2
- package/build/utils/hooks/use-controlled-state.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js +4 -4
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build/utils/hooks/use-latest-ref.js +1 -1
- package/build/utils/hooks/use-latest-ref.js.map +1 -1
- package/build/utils/unit-values.js +3 -3
- package/build/utils/unit-values.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +4 -4
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +37 -29
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +42 -8
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/{base-field → angle-picker-control}/types.js +0 -0
- package/build-module/{base-field → angle-picker-control}/types.js.map +0 -0
- package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/base-control/hooks.js +1 -1
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/border-box-control/utils.js +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/box-control/all-input-control.js +2 -2
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -1
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +31 -3
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +5 -5
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/styles/box-control-icon-styles.js +28 -28
- package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +23 -23
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-visualizer-styles.js +19 -19
- package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build-module/box-control/types.js +2 -0
- package/{build/base-field → build-module/box-control}/types.js.map +0 -0
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/box-control/utils.js +23 -23
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/color-palette/index.js +16 -8
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/utils.js +12 -4
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/combobox-control/index.js +68 -12
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +2 -2
- package/build-module/combobox-control/styles.js.map +1 -1
- package/build-module/combobox-control/types.js +2 -0
- package/build-module/{resizable-box/styles/resizable-box.styles.js.map → combobox-control/types.js.map} +0 -0
- package/build-module/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-select-control/index.js +5 -0
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -1
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/utils.js +1 -1
- package/build-module/date-time/utils.js.map +1 -1
- package/build-module/draggable/index.js +2 -2
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +3 -3
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/font-size-picker/utils.js +2 -2
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/gradient-picker/index.js +9 -4
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/index.js +5 -4
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +5 -5
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/utils.js +1 -1
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/menu-items-choice/index.js +40 -4
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/menu-items-choice/types.js +2 -0
- package/{build/resizable-box/styles/resizable-box.styles.js.map → build-module/menu-items-choice/types.js.map} +0 -0
- package/build-module/modal/index.js +41 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/context.js +5 -1
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/navigator/index.js +1 -0
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +11 -3
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +117 -12
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +20 -9
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js +61 -0
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -0
- package/build-module/navigator/navigator-to-parent-button/index.js +2 -0
- package/build-module/navigator/navigator-to-parent-button/index.js.map +1 -0
- package/build-module/navigator/use-navigator.js +6 -2
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/navigator/utils/router.js +51 -0
- package/build-module/navigator/utils/router.js.map +1 -0
- package/build-module/palette-edit/index.js +4 -1
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/header.js +9 -0
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +20 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/panel/row.js +9 -3
- package/build-module/panel/row.js.map +1 -1
- package/build-module/panel/types.js +2 -0
- package/build-module/panel/types.js.map +1 -0
- package/build-module/popover/index.js +14 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js +38 -0
- package/build-module/popover/overlay-middlewares.js.map +1 -0
- package/build-module/popover/utils.js +41 -5
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/private-apis.js +20 -0
- package/build-module/private-apis.js.map +1 -0
- package/build-module/query-controls/terms.js +1 -1
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/range-control/utils.js +4 -4
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +14 -14
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/select-control/index.js +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +38 -25
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/snackbar/index.js +2 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +25 -13
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.js +4 -3
- package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/toolbar/types.js +2 -0
- package/build-module/toolbar/toolbar/types.js.map +1 -0
- package/build-module/toolbar/toolbar-button/index.js +1 -0
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js +1 -0
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js +2 -0
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/toolbar/toolbar-dropdown-menu/index.js +1 -0
- package/build-module/toolbar/toolbar-dropdown-menu/index.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/toolbar/toolbar-group/toolbar-group-collapsed.js +1 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js +1 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +1 -0
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +59 -4
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +8 -6
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +2 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js +2 -0
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +3 -3
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +25 -13
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tree-grid/cell.js +16 -4
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/tree-grid/index.js +81 -21
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-grid/item.js +14 -2
- package/build-module/tree-grid/item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +11 -4
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index.js +0 -3
- package/build-module/tree-grid/roving-tab-index.js.map +1 -1
- package/build-module/tree-grid/row.js +22 -17
- package/build-module/tree-grid/row.js.map +1 -1
- package/build-module/tree-grid/types.js +2 -0
- package/build-module/tree-grid/types.js.map +1 -0
- package/build-module/ui/context/context-connect.js +7 -7
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js +1 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/ui/utils/space.js +1 -1
- package/build-module/ui/utils/space.js.map +1 -1
- package/build-module/unit-control/index.js +2 -2
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/utils.js +20 -20
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/events.js +4 -4
- package/build-module/utils/events.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-state.js +2 -2
- package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js +4 -4
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/utils/hooks/use-latest-ref.js +1 -1
- package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
- package/build-module/utils/unit-values.js +3 -3
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-style/style-rtl.css +5 -11
- package/build-style/style.css +5 -11
- package/build-types/alignment-matrix-control/utils.d.ts +4 -4
- package/build-types/angle-picker-control/angle-circle.d.ts +6 -0
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -0
- package/build-types/angle-picker-control/index.d.ts +29 -0
- package/build-types/angle-picker-control/index.d.ts.map +1 -0
- package/build-types/angle-picker-control/stories/index.d.ts +15 -0
- package/build-types/angle-picker-control/stories/index.d.ts.map +1 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +20 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -0
- package/build-types/angle-picker-control/types.d.ts +26 -0
- package/build-types/angle-picker-control/types.d.ts.map +1 -0
- package/build-types/base-control/hooks.d.ts +2 -2
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +3 -3
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +2 -2
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +3 -3
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +2 -2
- package/build-types/border-box-control/stories/index.d.ts +1 -1
- package/build-types/{base-field → border-box-control}/test/index.d.ts +0 -0
- package/build-types/border-box-control/test/index.d.ts.map +1 -0
- package/build-types/border-box-control/test/utils.d.ts +2 -0
- package/build-types/border-box-control/test/utils.d.ts.map +1 -0
- package/build-types/border-control/border-control/hook.d.ts +2 -2
- package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -2
- package/build-types/border-control/border-control-style-picker/hook.d.ts +2 -2
- package/build-types/box-control/all-input-control.d.ts +4 -0
- package/build-types/box-control/all-input-control.d.ts.map +1 -0
- package/build-types/box-control/axial-input-controls.d.ts +4 -0
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -0
- package/build-types/box-control/icon.d.ts +8 -0
- package/build-types/box-control/icon.d.ts.map +1 -0
- package/build-types/box-control/index.d.ts +31 -0
- package/build-types/box-control/index.d.ts.map +1 -0
- package/build-types/box-control/input-controls.d.ts +4 -0
- package/build-types/box-control/input-controls.d.ts.map +1 -0
- package/build-types/box-control/linked-button.d.ts +9 -0
- package/build-types/box-control/linked-button.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-icon-styles.d.ts +42 -0
- package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-styles.d.ts +42 -0
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +46 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +1 -0
- package/build-types/box-control/test/index.d.ts +2 -0
- package/build-types/box-control/test/index.d.ts.map +1 -0
- package/build-types/box-control/types.d.ts +99 -0
- package/build-types/box-control/types.d.ts.map +1 -0
- package/build-types/box-control/unit-control.d.ts +4 -0
- package/build-types/box-control/unit-control.d.ts.map +1 -0
- package/build-types/box-control/utils.d.ts +84 -0
- package/build-types/box-control/utils.d.ts.map +1 -0
- package/build-types/button/deprecated.d.ts +2 -2
- package/build-types/button/types.d.ts +3 -1
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +2 -2
- package/build-types/card/card-body/hook.d.ts +2 -2
- package/build-types/card/card-divider/hook.d.ts +2 -2
- package/build-types/card/card-footer/hook.d.ts +2 -2
- package/build-types/card/card-header/hook.d.ts +2 -2
- package/build-types/card/card-media/hook.d.ts +2 -2
- package/build-types/color-palette/index.d.ts +3 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +6 -2
- package/build-types/color-palette/stories/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-palette/types.d.ts +8 -0
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts +8 -5
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +7 -7
- package/build-types/combobox-control/index.d.ts +51 -0
- package/build-types/combobox-control/index.d.ts.map +1 -0
- package/build-types/combobox-control/stories/index.d.ts +18 -0
- package/build-types/combobox-control/stories/index.d.ts.map +1 -0
- package/build-types/combobox-control/styles.d.ts +8 -0
- package/build-types/combobox-control/styles.d.ts.map +1 -0
- package/build-types/combobox-control/test/index.d.ts +2 -0
- package/build-types/combobox-control/test/index.d.ts.map +1 -0
- package/build-types/combobox-control/types.d.ts +62 -0
- package/build-types/combobox-control/types.d.ts.map +1 -0
- package/build-types/custom-select-control/index.d.ts +1 -0
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/styles.d.ts +3 -3
- package/build-types/date-time/time/styles.d.ts +8 -8
- package/build-types/date-time/utils.d.ts +1 -1
- package/build-types/elevation/hook.d.ts +2 -2
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/flex/flex/hook.d.ts +2 -2
- package/build-types/flex/flex-block/hook.d.ts +2 -2
- package/build-types/flex/flex-item/hook.d.ts +2 -2
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -2
- package/build-types/focal-point-picker/utils.d.ts +3 -3
- package/build-types/font-size-picker/utils.d.ts +2 -2
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/grid/hook.d.ts +2 -2
- package/build-types/h-stack/component.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +2 -2
- package/build-types/heading/hook.d.ts +2 -2
- package/build-types/input-control/reducer/reducer.d.ts +3 -3
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -2
- package/build-types/input-control/utils.d.ts +1 -1
- package/build-types/item-group/item/hook.d.ts +2 -2
- package/build-types/item-group/item-group/hook.d.ts +2 -2
- package/build-types/menu-items-choice/index.d.ts +38 -0
- package/build-types/menu-items-choice/index.d.ts.map +1 -0
- package/build-types/menu-items-choice/stories/index.d.ts +12 -0
- package/build-types/menu-items-choice/stories/index.d.ts.map +1 -0
- package/build-types/menu-items-choice/types.d.ts +53 -0
- package/build-types/menu-items-choice/types.d.ts.map +1 -0
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +2 -0
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/navigator/context.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +1 -0
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +22 -3
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +24 -6
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +22 -3
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +22 -4
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +27 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +1 -0
- package/build-types/navigator/stories/index.d.ts +1 -0
- package/build-types/navigator/stories/index.d.ts.map +1 -1
- package/build-types/navigator/test/router.d.ts +2 -0
- package/build-types/navigator/test/router.d.ts.map +1 -0
- package/build-types/navigator/types.d.ts +25 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/navigator/utils/router.d.ts +10 -0
- package/build-types/navigator/utils/router.d.ts.map +1 -0
- package/build-types/number-control/index.d.ts +2 -2
- package/build-types/number-control/stories/index.d.ts +2 -2
- package/build-types/panel/header.d.ts +13 -0
- package/build-types/panel/header.d.ts.map +1 -0
- package/build-types/panel/index.d.ts +21 -0
- package/build-types/panel/index.d.ts.map +1 -0
- package/build-types/panel/row.d.ts +12 -0
- package/build-types/panel/row.d.ts.map +1 -0
- package/build-types/panel/test/header.d.ts +2 -0
- package/build-types/panel/test/header.d.ts.map +1 -0
- package/build-types/panel/test/index.d.ts +2 -0
- package/build-types/{base-field → panel}/test/index.d.ts.map +1 -1
- package/build-types/panel/test/row.d.ts +2 -0
- package/build-types/panel/test/row.d.ts.map +1 -0
- package/build-types/panel/types.d.ts +38 -0
- package/build-types/panel/types.d.ts.map +1 -0
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts +9 -0
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -0
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/popover/stories/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +3 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +12 -4
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/private-apis.d.ts +4 -0
- package/build-types/private-apis.d.ts.map +1 -0
- package/build-types/query-controls/terms.d.ts +1 -1
- package/build-types/range-control/index.d.ts +2 -2
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
- package/build-types/range-control/utils.d.ts +4 -4
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +5 -4
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +6 -6
- package/build-types/resizable-box/stories/index.d.ts +2 -2
- package/build-types/scrollable/hook.d.ts +2 -2
- package/build-types/search-control/index.d.ts +1 -1
- package/build-types/search-control/stories/index.d.ts +2 -2
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +3 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +2 -2
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/surface/hook.d.ts +2 -2
- package/build-types/text/hook.d.ts +2 -2
- package/build-types/text-control/index.d.ts +3 -3
- package/build-types/toolbar/index.d.ts +7 -0
- package/build-types/toolbar/index.d.ts.map +1 -0
- package/build-types/toolbar/stories/index.d.ts +14 -0
- package/build-types/toolbar/stories/index.d.ts.map +1 -0
- package/build-types/toolbar/test/index.d.ts +2 -0
- package/build-types/toolbar/test/index.d.ts.map +1 -0
- package/build-types/toolbar/test/toolbar-group.d.ts +2 -0
- package/build-types/toolbar/test/toolbar-group.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/index.d.ts +25 -0
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/toolbar-container.d.ts +5 -0
- package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/types.d.ts +15 -0
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-button/index.d.ts +12 -0
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +3 -0
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-context/index.d.ts +3 -0
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +3 -0
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/index.d.ts +39 -0
- package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +7 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +7 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-item/index.d.ts +7 -0
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -0
- package/build-types/tools-panel/stories/index.d.ts +17 -0
- package/build-types/tools-panel/stories/index.d.ts.map +1 -0
- package/build-types/tools-panel/tools-panel/component.d.ts +54 -2
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +4 -3
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -3
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +42 -15
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tree-grid/cell.d.ts +13 -0
- package/build-types/tree-grid/cell.d.ts.map +1 -0
- package/build-types/tree-grid/index.d.ts +70 -0
- package/build-types/tree-grid/index.d.ts.map +1 -0
- package/build-types/tree-grid/item.d.ts +12 -0
- package/build-types/tree-grid/item.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index-context.d.ts +10 -0
- package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index-item.d.ts +5 -0
- package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index.d.ts +10 -0
- package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -0
- package/build-types/tree-grid/row.d.ts +12 -0
- package/build-types/tree-grid/row.d.ts.map +1 -0
- package/build-types/tree-grid/stories/index.d.ts +13 -0
- package/build-types/tree-grid/stories/index.d.ts.map +1 -0
- package/build-types/tree-grid/test/cell.d.ts +2 -0
- package/build-types/tree-grid/test/cell.d.ts.map +1 -0
- package/build-types/tree-grid/test/index.d.ts +2 -0
- package/build-types/tree-grid/test/index.d.ts.map +1 -0
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts +2 -0
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +1 -0
- package/build-types/tree-grid/test/roving-tab-index.d.ts +2 -0
- package/build-types/tree-grid/test/roving-tab-index.d.ts.map +1 -0
- package/build-types/tree-grid/test/row.d.ts +2 -0
- package/build-types/tree-grid/test/row.d.ts.map +1 -0
- package/build-types/tree-grid/types.d.ts +109 -0
- package/build-types/tree-grid/types.d.ts.map +1 -0
- package/build-types/truncate/hook.d.ts +2 -2
- package/build-types/ui/context/context-connect.d.ts +7 -7
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -1
- package/build-types/ui/control-group/hook.d.ts +2 -2
- package/build-types/ui/control-label/hook.d.ts +2 -2
- package/build-types/ui/form-group/form-group.d.ts +2 -2
- package/build-types/ui/form-group/use-form-group.d.ts +2 -2
- package/build-types/ui/utils/get-valid-children.d.ts +1 -1
- package/build-types/ui/utils/space.d.ts +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -2
- package/build-types/unit-control/utils.d.ts +20 -20
- package/build-types/utils/events.d.ts +2 -2
- 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/hooks/use-controlled-value.d.ts +4 -4
- package/build-types/utils/hooks/use-latest-ref.d.ts +1 -1
- package/build-types/utils/unit-values.d.ts +3 -3
- package/build-types/v-stack/component.d.ts +2 -2
- package/build-types/v-stack/hook.d.ts +2 -2
- package/build-types/v-stack/stories/index.d.ts +2 -2
- package/package.json +20 -18
- package/src/alignment-matrix-control/utils.tsx +4 -4
- package/src/angle-picker-control/README.md +17 -14
- package/src/angle-picker-control/{angle-circle.js → angle-circle.tsx} +44 -12
- package/src/angle-picker-control/{index.js → index.tsx} +54 -10
- package/src/angle-picker-control/stories/index.tsx +57 -0
- package/src/angle-picker-control/styles/{angle-picker-control-styles.js → angle-picker-control-styles.tsx} +5 -1
- package/src/angle-picker-control/types.ts +29 -0
- package/src/autocomplete/autocompleter-ui.native.js +1 -0
- package/src/base-control/hooks.ts +1 -1
- package/src/border-box-control/test/{index.js → index.tsx} +76 -102
- package/src/border-box-control/test/{utils.js → utils.ts} +20 -0
- package/src/border-box-control/utils.ts +1 -1
- package/src/box-control/README.md +17 -26
- package/src/box-control/{all-input-control.js → all-input-control.tsx} +10 -6
- package/src/box-control/{axial-input-controls.js → axial-input-controls.tsx} +29 -24
- package/src/box-control/{icon.js → icon.tsx} +9 -4
- package/src/box-control/{index.js → index.tsx} +43 -8
- package/src/box-control/{input-controls.js → input-controls.tsx} +26 -16
- package/src/box-control/{linked-button.js → linked-button.tsx} +4 -1
- package/src/box-control/styles/{box-control-icon-styles.js → box-control-icon-styles.ts} +1 -1
- package/src/box-control/styles/{box-control-styles.js → box-control-styles.ts} +10 -2
- package/src/box-control/styles/{box-control-visualizer-styles.js → box-control-visualizer-styles.ts} +6 -2
- package/src/box-control/test/{index.js → index.tsx} +12 -9
- package/src/box-control/types.ts +121 -0
- package/src/box-control/{unit-control.js → unit-control.tsx} +9 -2
- package/src/box-control/{utils.js → utils.ts} +47 -38
- package/src/button/test/index.tsx +38 -30
- package/src/button/types.ts +5 -2
- package/src/color-palette/README.md +7 -0
- package/src/color-palette/index.tsx +19 -6
- package/src/color-palette/test/utils.ts +17 -1
- package/src/color-palette/types.ts +8 -0
- package/src/color-palette/utils.ts +12 -7
- package/src/combobox-control/README.md +8 -15
- package/src/combobox-control/{index.js → index.tsx} +91 -19
- package/src/combobox-control/stories/index.tsx +114 -0
- package/src/combobox-control/styles.ts +4 -1
- package/src/combobox-control/test/{index.js → index.tsx} +9 -7
- package/src/combobox-control/types.ts +69 -0
- package/src/custom-gradient-picker/index.js +0 -1
- package/src/custom-select-control/index.js +9 -0
- package/src/custom-select-control/stories/index.js +2 -2
- package/src/custom-select-control/test/index.js +2 -2
- package/src/date-time/time/index.tsx +1 -1
- package/src/date-time/utils.ts +1 -1
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/draggable/index.tsx +2 -2
- package/src/dropdown-menu/test/index.js +3 -11
- package/src/focal-point-picker/utils.ts +3 -3
- package/src/font-size-picker/utils.ts +2 -2
- package/src/gradient-picker/README.md +8 -0
- package/src/gradient-picker/index.js +6 -1
- package/src/index.js +5 -2
- package/src/input-control/reducer/reducer.ts +5 -5
- package/src/input-control/utils.ts +1 -1
- package/src/menu-items-choice/index.tsx +83 -0
- package/src/menu-items-choice/stories/index.tsx +79 -0
- package/src/menu-items-choice/types.ts +54 -0
- package/src/modal/index.tsx +45 -1
- package/src/modal/style.scss +8 -0
- package/src/modal/types.ts +2 -0
- package/src/navigator/context.ts +4 -0
- package/src/navigator/index.ts +1 -0
- package/src/navigator/navigator-back-button/README.md +1 -17
- package/src/navigator/navigator-back-button/hook.ts +10 -5
- package/src/navigator/navigator-button/README.md +1 -1
- package/src/navigator/navigator-provider/README.md +25 -4
- package/src/navigator/navigator-provider/component.tsx +170 -14
- package/src/navigator/navigator-screen/component.tsx +22 -11
- package/src/navigator/navigator-to-parent-button/README.md +15 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +65 -0
- package/src/navigator/navigator-to-parent-button/index.ts +1 -0
- package/src/navigator/stories/index.tsx +93 -3
- package/src/navigator/test/index.tsx +267 -23
- package/src/navigator/test/router.ts +122 -0
- package/src/navigator/types.ts +31 -12
- package/src/navigator/use-navigator.ts +4 -1
- package/src/navigator/utils/router.ts +49 -0
- package/src/palette-edit/index.js +4 -1
- package/src/panel/README.md +2 -2
- package/src/panel/header.tsx +20 -0
- package/src/panel/index.tsx +48 -0
- package/src/panel/row.tsx +37 -0
- package/src/panel/stories/index.js +22 -0
- package/src/panel/test/__snapshots__/{header.js.snap → header.tsx.snap} +0 -0
- package/src/panel/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/panel/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
- package/src/panel/test/{header.js → header.tsx} +1 -1
- package/src/panel/test/{index.js → index.tsx} +6 -4
- package/src/panel/test/{row.js → row.tsx} +4 -2
- package/src/panel/types.ts +38 -0
- package/src/popover/README.md +4 -1
- package/src/popover/index.tsx +17 -1
- package/src/popover/overlay-middlewares.tsx +29 -0
- package/src/popover/stories/index.tsx +7 -1
- package/src/popover/test/index.tsx +29 -21
- package/src/popover/types.ts +4 -2
- package/src/popover/utils.ts +39 -3
- package/src/private-apis.js +22 -0
- package/src/query-controls/terms.ts +1 -1
- package/src/range-control/utils.ts +4 -4
- package/src/resizable-box/resize-tooltip/styles/{resize-tooltip.styles.js → resize-tooltip.styles.ts} +0 -0
- package/src/resizable-box/resize-tooltip/utils.ts +14 -14
- package/src/select-control/README.md +3 -1
- package/src/select-control/index.tsx +3 -1
- package/src/select-control/style.scss +0 -10
- package/src/select-control/styles/select-control-styles.ts +36 -22
- package/src/select-control/types.ts +3 -1
- package/src/snackbar/index.tsx +2 -2
- package/src/toolbar/stories/{index.js → index.tsx} +39 -26
- package/src/toolbar/test/{index.js → index.tsx} +0 -0
- package/src/toolbar/test/{toolbar-group.js → toolbar-group.tsx} +2 -2
- package/src/toolbar/toolbar/README.md +7 -2
- package/src/toolbar/toolbar/{index.js → index.tsx} +33 -12
- package/src/toolbar/toolbar/{toolbar-container.js → toolbar-container.tsx} +9 -2
- package/src/toolbar/toolbar/types.ts +15 -0
- package/src/toolbar/toolbar-button/index.js +2 -0
- package/src/toolbar/toolbar-button/toolbar-button-container.js +2 -0
- package/src/toolbar/toolbar-context/index.js +2 -0
- package/src/toolbar/toolbar-dropdown-menu/index.js +2 -0
- package/src/toolbar/toolbar-group/index.js +2 -0
- package/src/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
- package/src/toolbar/toolbar-group/toolbar-group-container.js +2 -0
- package/src/toolbar/toolbar-item/index.js +2 -0
- package/src/tools-panel/stories/{index.js → index.tsx} +196 -95
- package/src/tools-panel/test/index.js +71 -6
- package/src/tools-panel/tools-panel/README.md +12 -4
- package/src/tools-panel/tools-panel/component.tsx +57 -3
- package/src/tools-panel/tools-panel/hook.ts +8 -7
- package/src/tools-panel/tools-panel-header/README.md +7 -0
- package/src/tools-panel/tools-panel-header/component.tsx +2 -1
- package/src/tools-panel/tools-panel-header/hook.ts +6 -4
- package/src/tools-panel/tools-panel-item/README.md +6 -4
- package/src/tools-panel/tools-panel-item/component.tsx +4 -4
- package/src/tools-panel/tools-panel-item/hook.ts +28 -16
- package/src/tools-panel/types.ts +43 -15
- package/src/tree-grid/README.md +18 -58
- package/src/tree-grid/cell.tsx +41 -0
- package/src/tree-grid/{index.js → index.tsx} +111 -35
- package/src/tree-grid/item.tsx +32 -0
- package/src/tree-grid/{roving-tab-index-context.js → roving-tab-index-context.ts} +9 -1
- package/src/tree-grid/roving-tab-index-item.tsx +50 -0
- package/src/tree-grid/{roving-tab-index.js → roving-tab-index.tsx} +7 -5
- package/src/tree-grid/row.tsx +47 -0
- package/src/tree-grid/stories/index.tsx +144 -0
- package/src/tree-grid/test/__snapshots__/{cell.js.snap → cell.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{roving-tab-index-item.js.snap → roving-tab-index-item.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{roving-tab-index.js.snap → roving-tab-index.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
- package/src/tree-grid/test/{cell.js → cell.tsx} +7 -4
- package/src/tree-grid/test/{index.js → index.tsx} +13 -5
- package/src/tree-grid/test/{roving-tab-index-item.js → roving-tab-index-item.tsx} +7 -4
- package/src/tree-grid/test/{roving-tab-index.js → roving-tab-index.tsx} +0 -0
- package/src/tree-grid/test/{row.js → row.tsx} +4 -4
- package/src/tree-grid/types.ts +116 -0
- package/src/ui/context/context-connect.ts +7 -7
- package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
- package/src/ui/utils/get-valid-children.ts +1 -1
- package/src/ui/utils/space.ts +1 -1
- package/src/unit-control/index.tsx +2 -2
- package/src/unit-control/utils.ts +20 -20
- package/src/utils/events.ts +4 -4
- package/src/utils/hooks/use-controlled-state.js +2 -2
- package/src/utils/hooks/use-controlled-value.ts +4 -4
- package/src/utils/hooks/use-latest-ref.ts +1 -1
- package/src/utils/unit-values.ts +3 -3
- package/tsconfig.json +6 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/build/base-field/hook.js +0 -54
- package/build/base-field/hook.js.map +0 -1
- package/build/base-field/index.js +0 -14
- package/build/base-field/index.js.map +0 -1
- package/build/base-field/styles.js +0 -33
- package/build/base-field/styles.js.map +0 -1
- package/build/resizable-box/styles/resizable-box.styles.js +0 -2
- package/build-module/base-field/hook.js +0 -37
- package/build-module/base-field/hook.js.map +0 -1
- package/build-module/base-field/index.js +0 -2
- package/build-module/base-field/index.js.map +0 -1
- package/build-module/base-field/styles.js +0 -18
- package/build-module/base-field/styles.js.map +0 -1
- package/build-module/resizable-box/styles/resizable-box.styles.js +0 -2
- package/build-types/base-field/hook.d.ts +0 -270
- package/build-types/base-field/hook.d.ts.map +0 -1
- package/build-types/base-field/index.d.ts +0 -2
- package/build-types/base-field/index.d.ts.map +0 -1
- package/build-types/base-field/styles.d.ts +0 -6
- package/build-types/base-field/styles.d.ts.map +0 -1
- package/build-types/base-field/types.d.ts +0 -29
- package/build-types/base-field/types.d.ts.map +0 -1
- package/build-types/resizable-box/styles/resizable-box.styles.d.ts +0 -1
- package/build-types/resizable-box/styles/resizable-box.styles.d.ts.map +0 -1
- package/src/angle-picker-control/stories/index.js +0 -29
- package/src/base-field/README.md +0 -66
- package/src/base-field/hook.ts +0 -51
- package/src/base-field/index.ts +0 -1
- package/src/base-field/styles.ts +0 -86
- package/src/base-field/test/__snapshots__/index.tsx.snap +0 -141
- package/src/base-field/test/index.tsx +0 -84
- package/src/base-field/types.ts +0 -29
- package/src/combobox-control/stories/index.js +0 -339
- package/src/menu-items-choice/index.js +0 -43
- package/src/panel/header.js +0 -10
- package/src/panel/index.js +0 -26
- package/src/panel/row.js +0 -20
- package/src/resizable-box/styles/resizable-box.styles.js +0 -0
- package/src/tools-panel/stories/utils/tools-panel-with-item-group-slot.js +0 -246
- package/src/tree-grid/cell.js +0 -24
- package/src/tree-grid/item.js +0 -20
- package/src/tree-grid/roving-tab-index-item.js +0 -33
- package/src/tree-grid/row.js +0 -31
- package/src/tree-grid/stories/index.js +0 -106
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
|
-
import { act } from 'react-test-renderer';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Internal dependencies
|
|
10
9
|
*/
|
|
11
|
-
import { BorderBoxControl } from '
|
|
12
|
-
|
|
13
|
-
jest.useFakeTimers();
|
|
10
|
+
import { BorderBoxControl } from '..';
|
|
14
11
|
|
|
15
12
|
const colors = [
|
|
16
13
|
{ name: 'Gray', color: '#f6f7f7' },
|
|
@@ -98,7 +95,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
98
95
|
|
|
99
96
|
const widthInput = screen.getByRole( 'spinbutton', {
|
|
100
97
|
name: 'Border width',
|
|
101
|
-
} );
|
|
98
|
+
} ) as HTMLInputElement;
|
|
102
99
|
|
|
103
100
|
expect( widthInput.value ).toBe( '1' );
|
|
104
101
|
} );
|
|
@@ -110,23 +107,37 @@ describe( 'BorderBoxControl', () => {
|
|
|
110
107
|
|
|
111
108
|
const widthInput = screen.getByRole( 'spinbutton', {
|
|
112
109
|
name: 'Border width',
|
|
113
|
-
} );
|
|
110
|
+
} ) as HTMLInputElement;
|
|
114
111
|
|
|
115
112
|
expect( widthInput.value ).toBe( '1' );
|
|
116
113
|
} );
|
|
117
114
|
|
|
118
115
|
it( 'should render placeholder and omit unit select when border values are mixed', async () => {
|
|
119
|
-
const user = userEvent.setup(
|
|
120
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
121
|
-
} );
|
|
116
|
+
const user = userEvent.setup();
|
|
122
117
|
|
|
123
118
|
render( <BorderBoxControl { ...props } value={ mixedBorders } /> );
|
|
124
119
|
|
|
120
|
+
// There are 4 inputs when in unlinked mode (top/right/bottom/left)
|
|
121
|
+
expect(
|
|
122
|
+
screen.getAllByRole( 'spinbutton', {
|
|
123
|
+
name: 'Border width',
|
|
124
|
+
} )
|
|
125
|
+
).toHaveLength( 4 );
|
|
126
|
+
|
|
125
127
|
// First render of control with mixed values should show split view.
|
|
126
128
|
await user.click(
|
|
127
129
|
screen.getByRole( 'button', { name: 'Link sides' } )
|
|
128
130
|
);
|
|
129
131
|
|
|
132
|
+
// In linked mode, there is only one input
|
|
133
|
+
await waitFor( () =>
|
|
134
|
+
expect(
|
|
135
|
+
screen.getByRole( 'spinbutton', {
|
|
136
|
+
name: 'Border width',
|
|
137
|
+
} )
|
|
138
|
+
).toBeVisible()
|
|
139
|
+
);
|
|
140
|
+
|
|
130
141
|
const widthInput = screen.getByRole( 'spinbutton', {
|
|
131
142
|
name: 'Border width',
|
|
132
143
|
} );
|
|
@@ -139,9 +150,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
139
150
|
} );
|
|
140
151
|
|
|
141
152
|
it( 'should render shared border width and unit select when switching to linked view', async () => {
|
|
142
|
-
const user = userEvent.setup(
|
|
143
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
144
|
-
} );
|
|
153
|
+
const user = userEvent.setup();
|
|
145
154
|
|
|
146
155
|
// Render control with mixed border values but consistent widths.
|
|
147
156
|
render(
|
|
@@ -171,7 +180,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
171
180
|
|
|
172
181
|
const linkedInput = screen.getByRole( 'spinbutton', {
|
|
173
182
|
name: 'Border width',
|
|
174
|
-
} );
|
|
183
|
+
} ) as HTMLInputElement;
|
|
175
184
|
const unitSelect = screen.getByRole( 'combobox', {
|
|
176
185
|
name: 'Select unit',
|
|
177
186
|
} );
|
|
@@ -181,31 +190,30 @@ describe( 'BorderBoxControl', () => {
|
|
|
181
190
|
} );
|
|
182
191
|
|
|
183
192
|
it( 'should omit style options when requested', async () => {
|
|
184
|
-
const user = userEvent.setup(
|
|
185
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
186
|
-
} );
|
|
193
|
+
const user = userEvent.setup();
|
|
187
194
|
|
|
188
195
|
render( <BorderBoxControl { ...props } enableStyle={ false } /> );
|
|
189
196
|
|
|
190
197
|
const colorButton = screen.getByLabelText( colorPickerRegex );
|
|
191
198
|
await user.click( colorButton );
|
|
192
|
-
await act( () => Promise.resolve() );
|
|
193
199
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
name: 'Dotted',
|
|
203
|
-
} );
|
|
200
|
+
// Wait for the custom color picker in the dropdown to appear
|
|
201
|
+
await waitFor( () =>
|
|
202
|
+
expect(
|
|
203
|
+
screen.getByRole( 'button', {
|
|
204
|
+
name: 'Custom color picker.',
|
|
205
|
+
} )
|
|
206
|
+
).toBeVisible()
|
|
207
|
+
);
|
|
204
208
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
expect(
|
|
208
|
-
expect(
|
|
209
|
+
// Make sure that none of the border style buttons (and the section
|
|
210
|
+
// title) are rendered to screen.
|
|
211
|
+
expect( screen.queryByText( 'Style' ) ).not.toBeInTheDocument();
|
|
212
|
+
expect(
|
|
213
|
+
screen.queryByRole( 'button', {
|
|
214
|
+
name: /(Solid)|(Dashed)|(Dotted)/,
|
|
215
|
+
} )
|
|
216
|
+
).not.toBeInTheDocument();
|
|
209
217
|
} );
|
|
210
218
|
} );
|
|
211
219
|
|
|
@@ -237,7 +245,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
237
245
|
|
|
238
246
|
const widthInputs = screen.getAllByRole( 'spinbutton', {
|
|
239
247
|
name: 'Border width',
|
|
240
|
-
} );
|
|
248
|
+
} ) as HTMLInputElement[];
|
|
241
249
|
|
|
242
250
|
expect( widthInputs[ 0 ].value ).toBe( '1' ); // Top.
|
|
243
251
|
expect( widthInputs[ 1 ].value ).toBe( '0.75' ); // Left.
|
|
@@ -246,9 +254,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
246
254
|
} );
|
|
247
255
|
|
|
248
256
|
it( 'should render split view correctly when starting with flat border', async () => {
|
|
249
|
-
const user = userEvent.setup(
|
|
250
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
251
|
-
} );
|
|
257
|
+
const user = userEvent.setup();
|
|
252
258
|
|
|
253
259
|
render(
|
|
254
260
|
<BorderBoxControl { ...props } value={ defaultBorders } />
|
|
@@ -260,60 +266,44 @@ describe( 'BorderBoxControl', () => {
|
|
|
260
266
|
|
|
261
267
|
const widthInputs = screen.getAllByRole( 'spinbutton', {
|
|
262
268
|
name: 'Border width',
|
|
263
|
-
} );
|
|
269
|
+
} ) as HTMLInputElement[];
|
|
264
270
|
expect( widthInputs[ 0 ].value ).toBe( '1' ); // Top.
|
|
265
271
|
expect( widthInputs[ 1 ].value ).toBe( '1' ); // Left.
|
|
266
272
|
expect( widthInputs[ 2 ].value ).toBe( '1' ); // Right.
|
|
267
273
|
expect( widthInputs[ 3 ].value ).toBe( '1' ); // Bottom.
|
|
268
274
|
} );
|
|
269
275
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
273
|
-
} );
|
|
276
|
+
// We're expecting to have 4 color buttons by default.
|
|
277
|
+
const colorButtonIndexes = [ ...Array( 4 ).keys() ];
|
|
274
278
|
|
|
275
|
-
|
|
279
|
+
it.each( colorButtonIndexes )(
|
|
280
|
+
'should omit style options when color button %s is pressed',
|
|
281
|
+
async ( colorButtonIndex ) => {
|
|
282
|
+
const user = userEvent.setup();
|
|
276
283
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const colorButtons = screen.getAllByLabelText( colorPickerRegex );
|
|
282
|
-
|
|
283
|
-
function assertStyleOptionsMissing() {
|
|
284
|
-
const styleLabel = screen.queryByText( 'Style' );
|
|
285
|
-
const solidButton = screen.queryByRole( 'button', {
|
|
286
|
-
name: 'Solid',
|
|
287
|
-
} );
|
|
288
|
-
const dashedButton = screen.queryByRole( 'button', {
|
|
289
|
-
name: 'Dashed',
|
|
290
|
-
} );
|
|
291
|
-
const dottedButton = screen.queryByRole( 'button', {
|
|
292
|
-
name: 'Dotted',
|
|
293
|
-
} );
|
|
294
|
-
|
|
295
|
-
expect( styleLabel ).not.toBeInTheDocument();
|
|
296
|
-
expect( solidButton ).not.toBeInTheDocument();
|
|
297
|
-
expect( dashedButton ).not.toBeInTheDocument();
|
|
298
|
-
expect( dottedButton ).not.toBeInTheDocument();
|
|
299
|
-
}
|
|
284
|
+
render(
|
|
285
|
+
<BorderBoxControl { ...props } enableStyle={ false } />
|
|
286
|
+
);
|
|
300
287
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
288
|
+
await user.click(
|
|
289
|
+
screen.getByRole( 'button', { name: 'Unlink sides' } )
|
|
290
|
+
);
|
|
304
291
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
await user.click( colorButtons[ 1 ] );
|
|
292
|
+
const colorButtons =
|
|
293
|
+
screen.getAllByLabelText( colorPickerRegex );
|
|
308
294
|
|
|
309
|
-
|
|
310
|
-
assertStyleOptionsMissing();
|
|
311
|
-
await user.click( colorButtons[ 2 ] );
|
|
295
|
+
await user.click( colorButtons[ colorButtonIndex ] );
|
|
312
296
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
297
|
+
// Make sure that none of the border style buttons (and the section
|
|
298
|
+
// title) are rendered to screen.
|
|
299
|
+
expect( screen.queryByText( 'Style' ) ).not.toBeInTheDocument();
|
|
300
|
+
expect(
|
|
301
|
+
screen.queryByRole( 'button', {
|
|
302
|
+
name: /(Solid)|(Dashed)|(Dotted)/,
|
|
303
|
+
} )
|
|
304
|
+
).not.toBeInTheDocument();
|
|
305
|
+
}
|
|
306
|
+
);
|
|
317
307
|
} );
|
|
318
308
|
|
|
319
309
|
describe( 'onChange handling', () => {
|
|
@@ -324,9 +314,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
324
314
|
|
|
325
315
|
describe( 'Linked value change handling', () => {
|
|
326
316
|
it( 'should set undefined when new border is empty', async () => {
|
|
327
|
-
const user = userEvent.setup(
|
|
328
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
329
|
-
} );
|
|
317
|
+
const user = userEvent.setup();
|
|
330
318
|
|
|
331
319
|
render(
|
|
332
320
|
<BorderBoxControl { ...props } value={ { width: '1px' } } />
|
|
@@ -340,9 +328,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
340
328
|
} );
|
|
341
329
|
|
|
342
330
|
it( 'should update with complete flat border', async () => {
|
|
343
|
-
const user = userEvent.setup(
|
|
344
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
345
|
-
} );
|
|
331
|
+
const user = userEvent.setup();
|
|
346
332
|
|
|
347
333
|
render(
|
|
348
334
|
<BorderBoxControl { ...props } value={ defaultBorder } />
|
|
@@ -361,9 +347,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
361
347
|
} );
|
|
362
348
|
|
|
363
349
|
it( 'should maintain mixed values if not explicitly set via linked control', async () => {
|
|
364
|
-
const user = userEvent.setup(
|
|
365
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
366
|
-
} );
|
|
350
|
+
const user = userEvent.setup();
|
|
367
351
|
|
|
368
352
|
render(
|
|
369
353
|
<BorderBoxControl
|
|
@@ -396,9 +380,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
396
380
|
} );
|
|
397
381
|
|
|
398
382
|
it( 'should update with consistent split borders', async () => {
|
|
399
|
-
const user = userEvent.setup(
|
|
400
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
401
|
-
} );
|
|
383
|
+
const user = userEvent.setup();
|
|
402
384
|
|
|
403
385
|
render(
|
|
404
386
|
<BorderBoxControl { ...props } value={ defaultBorders } />
|
|
@@ -417,9 +399,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
417
399
|
} );
|
|
418
400
|
|
|
419
401
|
it( 'should set undefined borders when change results in empty borders', async () => {
|
|
420
|
-
const user = userEvent.setup(
|
|
421
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
422
|
-
} );
|
|
402
|
+
const user = userEvent.setup();
|
|
423
403
|
|
|
424
404
|
render(
|
|
425
405
|
<BorderBoxControl
|
|
@@ -441,9 +421,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
441
421
|
} );
|
|
442
422
|
|
|
443
423
|
it( 'should set flat border when change results in consistent split borders', async () => {
|
|
444
|
-
const user = userEvent.setup(
|
|
445
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
446
|
-
} );
|
|
424
|
+
const user = userEvent.setup();
|
|
447
425
|
|
|
448
426
|
render(
|
|
449
427
|
<BorderBoxControl
|
|
@@ -476,9 +454,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
476
454
|
|
|
477
455
|
describe( 'Split value change handling', () => {
|
|
478
456
|
it( 'should set split borders when the updated borders are mixed', async () => {
|
|
479
|
-
const user = userEvent.setup(
|
|
480
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
481
|
-
} );
|
|
457
|
+
const user = userEvent.setup();
|
|
482
458
|
|
|
483
459
|
const borders = {
|
|
484
460
|
top: { ...defaultBorder, width: '1px' },
|
|
@@ -502,9 +478,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
502
478
|
} );
|
|
503
479
|
|
|
504
480
|
it( 'should set flat border when updated borders are consistent', async () => {
|
|
505
|
-
const user = userEvent.setup(
|
|
506
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
507
|
-
} );
|
|
481
|
+
const user = userEvent.setup();
|
|
508
482
|
|
|
509
483
|
const borders = {
|
|
510
484
|
top: { ...defaultBorder, width: '4px' },
|
|
@@ -47,11 +47,15 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
47
47
|
describe( 'isEmptyBorder', () => {
|
|
48
48
|
it( 'should determine a undefined, null, and {} to be empty', () => {
|
|
49
49
|
expect( isEmptyBorder( undefined ) ).toBe( true );
|
|
50
|
+
// Checking for extra resilience, even if not a valid type.
|
|
51
|
+
// @ts-expect-error
|
|
50
52
|
expect( isEmptyBorder( null ) ).toBe( true );
|
|
51
53
|
expect( isEmptyBorder( {} ) ).toBe( true );
|
|
52
54
|
} );
|
|
53
55
|
|
|
54
56
|
it( 'should determine object missing all border props to be empty', () => {
|
|
57
|
+
// Checking for extra resilience, even if not a valid type.
|
|
58
|
+
// @ts-expect-error
|
|
55
59
|
expect( isEmptyBorder( nonBorder ) ).toBe( true );
|
|
56
60
|
} );
|
|
57
61
|
|
|
@@ -110,11 +114,15 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
110
114
|
describe( 'isCompleteBorder', () => {
|
|
111
115
|
it( 'should determine a undefined, null, and {} to be incomplete', () => {
|
|
112
116
|
expect( isCompleteBorder( undefined ) ).toBe( false );
|
|
117
|
+
// Checking for extra resilience, even if not a valid type.
|
|
118
|
+
// @ts-expect-error
|
|
113
119
|
expect( isCompleteBorder( null ) ).toBe( false );
|
|
114
120
|
expect( isCompleteBorder( {} ) ).toBe( false );
|
|
115
121
|
} );
|
|
116
122
|
|
|
117
123
|
it( 'should determine objects missing border props to be incomplete', () => {
|
|
124
|
+
// Checking for extra resilience, even if not a valid type.
|
|
125
|
+
// @ts-expect-error
|
|
118
126
|
expect( isCompleteBorder( nonBorder ) ).toBe( false );
|
|
119
127
|
expect( isCompleteBorder( partialBorder ) ).toBe( false );
|
|
120
128
|
expect( isCompleteBorder( partialWithExtraProp ) ).toBe( false );
|
|
@@ -149,6 +157,8 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
149
157
|
it( 'should determine undefined, non-border or empty object as not being mixed', () => {
|
|
150
158
|
expect( hasMixedBorders( undefined ) ).toBe( false );
|
|
151
159
|
expect( hasMixedBorders( {} ) ).toBe( false );
|
|
160
|
+
// Checking for extra resilience, even if not a valid type.
|
|
161
|
+
// @ts-expect-error
|
|
152
162
|
expect( hasMixedBorders( nonBorder ) ).toBe( false );
|
|
153
163
|
} );
|
|
154
164
|
|
|
@@ -168,11 +178,15 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
168
178
|
describe( 'getSplitBorders', () => {
|
|
169
179
|
it( 'should return undefined when no border provided', () => {
|
|
170
180
|
expect( getSplitBorders( undefined ) ).toEqual( undefined );
|
|
181
|
+
// Checking for extra resilience, even if not a valid type.
|
|
182
|
+
// @ts-expect-error
|
|
171
183
|
expect( getSplitBorders( null ) ).toEqual( undefined );
|
|
172
184
|
} );
|
|
173
185
|
|
|
174
186
|
it( 'should return undefined when supplied border is empty', () => {
|
|
175
187
|
expect( getSplitBorders( {} ) ).toEqual( undefined );
|
|
188
|
+
// Checking for extra resilience, even if not a valid type.
|
|
189
|
+
// @ts-expect-error
|
|
176
190
|
expect( getSplitBorders( nonBorder ) ).toEqual( undefined );
|
|
177
191
|
} );
|
|
178
192
|
|
|
@@ -193,6 +207,8 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
193
207
|
} );
|
|
194
208
|
|
|
195
209
|
it( 'should only return differences for border related properties', () => {
|
|
210
|
+
// Checking for extra resilience, even if not a valid type.
|
|
211
|
+
// @ts-expect-error
|
|
196
212
|
const diff = getBorderDiff( nonBorder, { caffeine: 'coffee' } );
|
|
197
213
|
expect( diff ).toEqual( {} );
|
|
198
214
|
} );
|
|
@@ -201,6 +217,8 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
201
217
|
const diff = getBorderDiff( completeBorder, {
|
|
202
218
|
...completeBorder,
|
|
203
219
|
color: '#21759b',
|
|
220
|
+
// Checking for extra resilience, even if not a valid type.
|
|
221
|
+
// @ts-expect-error
|
|
204
222
|
caffeine: 'cola',
|
|
205
223
|
} );
|
|
206
224
|
expect( diff ).toEqual( { color: '#21759b' } );
|
|
@@ -298,6 +316,8 @@ describe( 'BorderBoxControl Utils', () => {
|
|
|
298
316
|
it( 'should return undefined when no border provided', () => {
|
|
299
317
|
expect( getShorthandBorderStyle( undefined ) ).toEqual( undefined );
|
|
300
318
|
expect( getShorthandBorderStyle( {} ) ).toEqual( undefined );
|
|
319
|
+
// Checking for extra resilience, even if not a valid type.
|
|
320
|
+
// @ts-expect-error
|
|
301
321
|
expect( getShorthandBorderStyle( nonBorder ) ).toEqual( undefined );
|
|
302
322
|
} );
|
|
303
323
|
|
|
@@ -171,7 +171,7 @@ export const getMostCommonUnit = (
|
|
|
171
171
|
* Finds the mode value out of the array passed favouring the first value
|
|
172
172
|
* as a tiebreaker.
|
|
173
173
|
*
|
|
174
|
-
* @param
|
|
174
|
+
* @param values Values to determine the mode from.
|
|
175
175
|
*
|
|
176
176
|
* @return The mode value.
|
|
177
177
|
*/
|
|
@@ -30,82 +30,73 @@ const Example = () => {
|
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Props
|
|
33
|
-
### allowReset
|
|
33
|
+
### `allowReset`: `boolean`
|
|
34
34
|
|
|
35
35
|
If this property is true, a button to reset the box control is rendered.
|
|
36
36
|
|
|
37
|
-
- Type: `Boolean`
|
|
38
37
|
- Required: No
|
|
39
38
|
- Default: `true`
|
|
40
39
|
|
|
41
|
-
### splitOnAxis
|
|
40
|
+
### `splitOnAxis`: `boolean`
|
|
42
41
|
|
|
43
42
|
If this property is true, when the box control is unlinked, vertical and horizontal controls can be used instead of updating individual sides.
|
|
44
43
|
|
|
45
|
-
- Type: `Boolean`
|
|
46
44
|
- Required: No
|
|
47
45
|
- Default: `false`
|
|
48
46
|
|
|
49
|
-
### inputProps
|
|
47
|
+
### `inputProps`: `object`
|
|
50
48
|
|
|
51
|
-
Props for the internal [
|
|
49
|
+
Props for the internal [UnitControl](../unit-control) components.
|
|
52
50
|
|
|
53
|
-
- Type: `Object`
|
|
54
51
|
- Required: No
|
|
52
|
+
- Default: `{ min: 0 }`
|
|
55
53
|
|
|
56
|
-
### label
|
|
54
|
+
### `label`: `string`
|
|
57
55
|
|
|
58
|
-
Heading label for
|
|
56
|
+
Heading label for the control.
|
|
59
57
|
|
|
60
|
-
- Type: `String`
|
|
61
58
|
- Required: No
|
|
62
|
-
- Default: `Box Control`
|
|
59
|
+
- Default: `__( 'Box Control' )`
|
|
63
60
|
|
|
64
|
-
### onChange
|
|
61
|
+
### `onChange`: `(next: BoxControlValue) => void`
|
|
65
62
|
|
|
66
63
|
A callback function when an input value changes.
|
|
67
64
|
|
|
68
|
-
- Type: `Function`
|
|
69
65
|
- Required: Yes
|
|
70
66
|
|
|
71
|
-
### resetValues
|
|
67
|
+
### `resetValues`: `object`
|
|
72
68
|
|
|
73
69
|
The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.
|
|
74
70
|
|
|
75
|
-
- Type: `Object`
|
|
76
71
|
- Required: No
|
|
72
|
+
- Default: `{ top: undefined, right: undefined, bottom: undefined, left: undefined }`
|
|
77
73
|
|
|
78
|
-
### sides
|
|
74
|
+
### `sides`: `string[]`
|
|
79
75
|
|
|
80
|
-
Collection of sides to allow control of. If omitted or empty, all sides will be available.
|
|
76
|
+
Collection of sides to allow control of. If omitted or empty, all sides will be available. Allowed values are "top", "right", "bottom", "left", "vertical", and "horizontal".
|
|
81
77
|
|
|
82
|
-
- Type: `Array<Object>`
|
|
83
78
|
- Required: No
|
|
84
79
|
|
|
85
|
-
### units
|
|
80
|
+
### `units`: `WPUnitControlUnit[]`
|
|
86
81
|
|
|
87
82
|
Collection of available units which are compatible with [UnitControl](../unit-control).
|
|
88
83
|
|
|
89
|
-
- Type: `Array<Object>`
|
|
90
84
|
- Required: No
|
|
91
85
|
|
|
92
|
-
### values
|
|
86
|
+
### `values`: `object`
|
|
93
87
|
|
|
94
88
|
The `top`, `right`, `bottom`, and `left` box dimension values.
|
|
95
89
|
|
|
96
|
-
- Type: `Object`
|
|
97
90
|
- Required: No
|
|
98
91
|
|
|
99
|
-
### onMouseOver
|
|
92
|
+
### `onMouseOver`: `function`
|
|
100
93
|
|
|
101
94
|
A handler for onMouseOver events.
|
|
102
95
|
|
|
103
|
-
- Type: `Function`
|
|
104
96
|
- Required: No
|
|
105
97
|
|
|
106
|
-
### onMouseOut
|
|
98
|
+
### `onMouseOut`: `function`
|
|
107
99
|
|
|
108
100
|
A handler for onMouseOut events.
|
|
109
101
|
|
|
110
|
-
- Type: `Function`
|
|
111
102
|
- Required: No
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
+
import type { UnitControlProps } from '../unit-control/types';
|
|
5
|
+
import type { BoxControlInputControlProps } from './types';
|
|
4
6
|
import UnitControl from './unit-control';
|
|
5
7
|
import {
|
|
6
8
|
LABELS,
|
|
@@ -22,18 +24,20 @@ export default function AllInputControl( {
|
|
|
22
24
|
selectedUnits,
|
|
23
25
|
setSelectedUnits,
|
|
24
26
|
...props
|
|
25
|
-
} ) {
|
|
27
|
+
}: BoxControlInputControlProps ) {
|
|
26
28
|
const allValue = getAllValue( values, selectedUnits, sides );
|
|
27
29
|
const hasValues = isValuesDefined( values );
|
|
28
30
|
const isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );
|
|
29
|
-
const allPlaceholder = isMixed ? LABELS.mixed :
|
|
31
|
+
const allPlaceholder = isMixed ? LABELS.mixed : undefined;
|
|
30
32
|
|
|
31
|
-
const handleOnFocus
|
|
33
|
+
const handleOnFocus: React.FocusEventHandler< HTMLInputElement > = (
|
|
34
|
+
event
|
|
35
|
+
) => {
|
|
32
36
|
onFocus( event, { side: 'all' } );
|
|
33
37
|
};
|
|
34
38
|
|
|
35
|
-
const handleOnChange = ( next ) => {
|
|
36
|
-
const isNumeric = ! isNaN( parseFloat( next ) );
|
|
39
|
+
const handleOnChange: UnitControlProps[ 'onChange' ] = ( next ) => {
|
|
40
|
+
const isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );
|
|
37
41
|
const nextValue = isNumeric ? next : undefined;
|
|
38
42
|
const nextValues = applyValueToSides( values, nextValue, sides );
|
|
39
43
|
|
|
@@ -42,7 +46,7 @@ export default function AllInputControl( {
|
|
|
42
46
|
|
|
43
47
|
// Set selected unit so it can be used as fallback by unlinked controls
|
|
44
48
|
// when individual sides do not have a value containing a unit.
|
|
45
|
-
const handleOnUnitChange = ( unit ) => {
|
|
49
|
+
const handleOnUnitChange: UnitControlProps[ 'onUnitChange' ] = ( unit ) => {
|
|
46
50
|
const newUnits = applyValueToSides( selectedUnits, unit, sides );
|
|
47
51
|
setSelectedUnits( newUnits );
|
|
48
52
|
};
|
|
@@ -5,8 +5,10 @@ import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
|
5
5
|
import UnitControl from './unit-control';
|
|
6
6
|
import { LABELS } from './utils';
|
|
7
7
|
import { Layout } from './styles/box-control-styles';
|
|
8
|
+
import type { BoxControlInputControlProps } from './types';
|
|
8
9
|
|
|
9
|
-
const groupedSides = [ 'vertical', 'horizontal' ];
|
|
10
|
+
const groupedSides = [ 'vertical', 'horizontal' ] as const;
|
|
11
|
+
type GroupedSide = typeof groupedSides[ number ];
|
|
10
12
|
|
|
11
13
|
export default function AxialInputControls( {
|
|
12
14
|
onChange,
|
|
@@ -18,15 +20,17 @@ export default function AxialInputControls( {
|
|
|
18
20
|
setSelectedUnits,
|
|
19
21
|
sides,
|
|
20
22
|
...props
|
|
21
|
-
} ) {
|
|
22
|
-
const createHandleOnFocus =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
}: BoxControlInputControlProps ) {
|
|
24
|
+
const createHandleOnFocus =
|
|
25
|
+
( side: GroupedSide ) =>
|
|
26
|
+
( event: React.FocusEvent< HTMLInputElement > ) => {
|
|
27
|
+
if ( ! onFocus ) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
onFocus( event, { side } );
|
|
31
|
+
};
|
|
28
32
|
|
|
29
|
-
const createHandleOnHoverOn = ( side ) => () => {
|
|
33
|
+
const createHandleOnHoverOn = ( side: GroupedSide ) => () => {
|
|
30
34
|
if ( ! onHoverOn ) {
|
|
31
35
|
return;
|
|
32
36
|
}
|
|
@@ -44,7 +48,7 @@ export default function AxialInputControls( {
|
|
|
44
48
|
}
|
|
45
49
|
};
|
|
46
50
|
|
|
47
|
-
const createHandleOnHoverOff = ( side ) => () => {
|
|
51
|
+
const createHandleOnHoverOff = ( side: GroupedSide ) => () => {
|
|
48
52
|
if ( ! onHoverOff ) {
|
|
49
53
|
return;
|
|
50
54
|
}
|
|
@@ -62,12 +66,12 @@ export default function AxialInputControls( {
|
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
68
|
|
|
65
|
-
const createHandleOnChange = ( side ) => ( next ) => {
|
|
69
|
+
const createHandleOnChange = ( side: GroupedSide ) => ( next?: string ) => {
|
|
66
70
|
if ( ! onChange ) {
|
|
67
71
|
return;
|
|
68
72
|
}
|
|
69
73
|
const nextValues = { ...values };
|
|
70
|
-
const isNumeric = ! isNaN( parseFloat( next ) );
|
|
74
|
+
const isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );
|
|
71
75
|
const nextValue = isNumeric ? next : undefined;
|
|
72
76
|
|
|
73
77
|
if ( side === 'vertical' ) {
|
|
@@ -83,21 +87,22 @@ export default function AxialInputControls( {
|
|
|
83
87
|
onChange( nextValues );
|
|
84
88
|
};
|
|
85
89
|
|
|
86
|
-
const createHandleOnUnitChange =
|
|
87
|
-
|
|
90
|
+
const createHandleOnUnitChange =
|
|
91
|
+
( side: GroupedSide ) => ( next?: string ) => {
|
|
92
|
+
const newUnits = { ...selectedUnits };
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
if ( side === 'vertical' ) {
|
|
95
|
+
newUnits.top = next;
|
|
96
|
+
newUnits.bottom = next;
|
|
97
|
+
}
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
if ( side === 'horizontal' ) {
|
|
100
|
+
newUnits.left = next;
|
|
101
|
+
newUnits.right = next;
|
|
102
|
+
}
|
|
98
103
|
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
setSelectedUnits( newUnits );
|
|
105
|
+
};
|
|
101
106
|
|
|
102
107
|
// Filter sides if custom configuration provided, maintaining default order.
|
|
103
108
|
const filteredSides = sides?.length
|