@wordpress/components 23.3.5 → 23.5.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 -5
- 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/angle-picker-control/types.js.map +1 -0
- package/build/autocomplete/autocompleter-ui.js +41 -17
- 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/index.js +31 -33
- package/build/autocomplete/index.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/circular-option-picker/index.js +63 -14
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/circular-option-picker/types.js +6 -0
- package/build/circular-option-picker/types.js.map +1 -0
- package/build/color-palette/index.js +8 -3
- package/build/color-palette/index.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/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/higher-order/with-constrained-tabbing/index.js +9 -0
- package/build/higher-order/with-constrained-tabbing/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/mobile/global-styles-context/utils.native.js +2 -1
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/modal/index.js +41 -3
- package/build/modal/index.js.map +1 -1
- 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/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/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/context.js +2 -0
- package/build/tools-panel/context.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 +22 -14
- 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 +18 -4
- 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/context-system-provider.js +8 -4
- package/build/ui/context/context-system-provider.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/autocomplete/autocompleter-ui.js +40 -19
- 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/index.js +30 -32
- package/build-module/autocomplete/index.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-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/circular-option-picker/index.js +59 -16
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/circular-option-picker/types.js +2 -0
- package/build-module/color-palette/index.js +8 -3
- package/build-module/color-palette/index.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/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/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/higher-order/with-constrained-tabbing/index.js +9 -0
- package/build-module/higher-order/with-constrained-tabbing/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-module/menu-items-choice/types.js.map +1 -0
- package/build-module/mobile/global-styles-context/utils.native.js +2 -1
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/modal/index.js +41 -4
- package/build-module/modal/index.js.map +1 -1
- 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/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/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/context.js +2 -0
- package/build-module/tools-panel/context.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 +22 -14
- 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 +19 -4
- 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/context-system-provider.js +7 -4
- package/build-module/ui/context/context-system-provider.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 -0
- package/build-style/style.css +5 -0
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/build-types/border-box-control/stories/index.d.ts +1 -1
- 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/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/circular-option-picker/index.d.ts +56 -7
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.d.ts +14 -0
- package/build-types/circular-option-picker/stories/index.d.ts.map +1 -0
- package/build-types/circular-option-picker/types.d.ts +49 -0
- package/build-types/circular-option-picker/types.d.ts.map +1 -0
- 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/types.d.ts +8 -0
- package/build-types/color-palette/types.d.ts.map +1 -1
- 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/date-time/utils.d.ts +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- 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/h-stack/stories/e2e/index.d.ts +9 -0
- package/build-types/h-stack/stories/e2e/index.d.ts.map +1 -0
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts +10 -1
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts +3 -3
- package/build-types/input-control/utils.d.ts +1 -1
- 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/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.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/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/query-controls/terms.d.ts +1 -1
- package/build-types/range-control/utils.d.ts +4 -4
- 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/tab-panel/stories/index.d.ts +1 -0
- package/build-types/tab-panel/stories/index.d.ts.map +1 -1
- 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/context.d.ts.map +1 -1
- 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/test/index.d.ts +2 -0
- package/build-types/tools-panel/test/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 +5 -2
- 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 +2 -1
- 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 +3 -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.map +1 -1
- package/build-types/tools-panel/types.d.ts +49 -20
- 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/ui/context/context-connect.d.ts +7 -7
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -1
- 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/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/stories/e2e/index.d.ts +9 -0
- package/build-types/v-stack/stories/e2e/index.d.ts.map +1 -0
- package/package.json +21 -19
- 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.js +72 -34
- package/src/autocomplete/autocompleter-ui.native.js +1 -0
- package/src/autocomplete/index.js +36 -36
- 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/circular-option-picker/README.md +141 -0
- package/src/circular-option-picker/{index.js → index.tsx} +74 -14
- package/src/circular-option-picker/stories/index.tsx +134 -0
- package/src/circular-option-picker/types.ts +69 -0
- package/src/color-palette/README.md +7 -0
- package/src/color-palette/index.tsx +6 -1
- package/src/color-palette/test/__snapshots__/index.tsx.snap +1 -1
- package/src/color-palette/types.ts +8 -0
- 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/stories/index.js +1 -1
- package/src/date-time/time/index.tsx +1 -1
- package/src/date-time/utils.ts +1 -1
- 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/h-stack/stories/e2e/index.tsx +36 -0
- package/src/higher-order/with-constrained-tabbing/index.tsx +30 -0
- 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/mobile/global-styles-context/utils.native.js +1 -0
- package/src/modal/index.tsx +45 -1
- package/src/modal/style.scss +8 -0
- package/src/modal/types.ts +2 -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/{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/query-controls/terms.ts +1 -1
- package/src/range-control/utils.ts +4 -4
- package/src/resizable-box/resize-tooltip/utils.ts +14 -14
- package/src/snackbar/index.tsx +2 -2
- package/src/tab-panel/stories/index.tsx +41 -0
- package/src/tab-panel/test/index.tsx +794 -262
- package/src/toolbar/stories/{index.js → index.tsx} +39 -26
- 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/context.ts +2 -0
- package/src/tools-panel/stories/{index.js → index.tsx} +196 -95
- package/src/tools-panel/test/{index.js → index.tsx} +177 -67
- 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 +34 -13
- 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 +22 -4
- package/src/tools-panel/types.ts +51 -20
- 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__/index.tsx.snap +3 -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/{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/context-system-provider.js +7 -4
- 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/src/v-stack/stories/e2e/index.tsx +36 -0
- package/tsconfig.json +1 -7
- 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/higher-order/with-constrained-tabbing/index.js +0 -22
- 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
- package/src/tree-grid/test/__snapshots__/index.js.snap +0 -3
- /package/build/{base-field → angle-picker-control}/types.js +0 -0
- /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/base-field → build-module/box-control}/types.js.map +0 -0
- /package/build-module/{resizable-box/styles/resizable-box.styles.js.map → circular-option-picker/types.js.map} +0 -0
- /package/{build/resizable-box/styles/resizable-box.styles.js.map → build-module/combobox-control/types.js.map} +0 -0
- /package/build-types/{base-field → border-box-control}/test/index.d.ts +0 -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/resizable-box/resize-tooltip/styles/{resize-tooltip.styles.js → resize-tooltip.styles.ts} +0 -0
- /package/src/toolbar/test/{index.js → index.tsx} +0 -0
- /package/src/tree-grid/test/__snapshots__/{cell.js.snap → cell.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/{roving-tab-index.js → roving-tab-index.tsx} +0 -0
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { render, screen,
|
|
5
|
-
import
|
|
4
|
+
import { render, screen, within } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { ToolsPanel, ToolsPanelContext, ToolsPanelItem } from '../';
|
|
11
11
|
import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
|
|
12
|
+
import type {
|
|
13
|
+
ToolsPanelContext as ToolsPanelContextType,
|
|
14
|
+
ResetAllFilter,
|
|
15
|
+
} from '../types';
|
|
12
16
|
|
|
13
17
|
const { Fill: ToolsPanelItems, Slot } = createSlotFill( 'ToolsPanelSlot' );
|
|
14
18
|
const resetAll = jest.fn();
|
|
15
19
|
const noop = () => undefined;
|
|
16
20
|
|
|
21
|
+
type ControlValue = boolean | undefined;
|
|
22
|
+
|
|
17
23
|
// Default props for the tools panel.
|
|
18
24
|
const defaultProps = {
|
|
19
25
|
label: 'Panel header',
|
|
@@ -21,24 +27,24 @@ const defaultProps = {
|
|
|
21
27
|
};
|
|
22
28
|
|
|
23
29
|
// Default props for an enabled control to be rendered within panel.
|
|
30
|
+
let controlValue: ControlValue = true;
|
|
24
31
|
const controlProps = {
|
|
25
|
-
attributes: { value: true },
|
|
26
32
|
hasValue: jest.fn().mockImplementation( () => {
|
|
27
|
-
return !!
|
|
33
|
+
return !! controlValue;
|
|
28
34
|
} ),
|
|
29
35
|
label: 'Example',
|
|
30
36
|
onDeselect: jest.fn().mockImplementation( () => {
|
|
31
|
-
|
|
37
|
+
controlValue = undefined;
|
|
32
38
|
} ),
|
|
33
39
|
onSelect: jest.fn(),
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
// Default props without a value for an alternate control to be rendered within
|
|
37
43
|
// the panel.
|
|
44
|
+
let altControlValue: ControlValue = false;
|
|
38
45
|
const altControlProps = {
|
|
39
|
-
attributes: { value: false },
|
|
40
46
|
hasValue: jest.fn().mockImplementation( () => {
|
|
41
|
-
return !!
|
|
47
|
+
return !! altControlValue;
|
|
42
48
|
} ),
|
|
43
49
|
label: 'Alt',
|
|
44
50
|
onDeselect: jest.fn(),
|
|
@@ -46,24 +52,24 @@ const altControlProps = {
|
|
|
46
52
|
};
|
|
47
53
|
|
|
48
54
|
// Default props for wrapped or grouped panel items.
|
|
55
|
+
let nestedControlValue: ControlValue = true;
|
|
49
56
|
const nestedControlProps = {
|
|
50
|
-
attributes: { value: true },
|
|
51
57
|
hasValue: jest.fn().mockImplementation( () => {
|
|
52
|
-
return !!
|
|
58
|
+
return !! nestedControlValue;
|
|
53
59
|
} ),
|
|
54
60
|
label: 'Nested Control 1',
|
|
55
61
|
onDeselect: jest.fn().mockImplementation( () => {
|
|
56
|
-
|
|
62
|
+
nestedControlValue = undefined;
|
|
57
63
|
} ),
|
|
58
64
|
onSelect: jest.fn(),
|
|
59
65
|
isShownByDefault: true,
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
// Alternative props for wrapped or grouped panel items.
|
|
69
|
+
const altNestedControlValue: ControlValue = false;
|
|
63
70
|
const altNestedControlProps = {
|
|
64
|
-
attributes: { value: false },
|
|
65
71
|
hasValue: jest.fn().mockImplementation( () => {
|
|
66
|
-
return !!
|
|
72
|
+
return !! altNestedControlValue;
|
|
67
73
|
} ),
|
|
68
74
|
label: 'Nested Control 2',
|
|
69
75
|
onDeselect: jest.fn(),
|
|
@@ -90,7 +96,7 @@ const GroupedItems = ( {
|
|
|
90
96
|
|
|
91
97
|
// This context object is used to help simulate different scenarios in which
|
|
92
98
|
// `ToolsPanelItem` registration or deregistration requires testing.
|
|
93
|
-
const panelContext = {
|
|
99
|
+
const panelContext: ToolsPanelContextType = {
|
|
94
100
|
panelId: '1234',
|
|
95
101
|
menuItems: {
|
|
96
102
|
default: {},
|
|
@@ -101,6 +107,8 @@ const panelContext = {
|
|
|
101
107
|
shouldRenderPlaceholderItems: false,
|
|
102
108
|
registerPanelItem: jest.fn(),
|
|
103
109
|
deregisterPanelItem: jest.fn(),
|
|
110
|
+
registerResetAllFilter: jest.fn(),
|
|
111
|
+
deregisterResetAllFilter: jest.fn(),
|
|
104
112
|
flagItemCustomization: noop,
|
|
105
113
|
areAllOptionalControlsHidden: true,
|
|
106
114
|
};
|
|
@@ -117,7 +125,10 @@ const renderGroupedItemsInPanel = () => {
|
|
|
117
125
|
|
|
118
126
|
// Custom component rendering a panel item within a wrapping element. Also used
|
|
119
127
|
// to test panel item registration and rendering.
|
|
120
|
-
const WrappedItem = ( {
|
|
128
|
+
const WrappedItem = ( {
|
|
129
|
+
text,
|
|
130
|
+
...props
|
|
131
|
+
}: React.ComponentProps< typeof ToolsPanelItem > & { text: string } ) => {
|
|
121
132
|
return (
|
|
122
133
|
<div>
|
|
123
134
|
<span>Wrapper</span>
|
|
@@ -169,25 +180,25 @@ const getMenuButton = () => {
|
|
|
169
180
|
/**
|
|
170
181
|
* Helper to find the menu button and simulate a user click.
|
|
171
182
|
*
|
|
172
|
-
* @return {HTMLElement} The menuButton.
|
|
173
183
|
*/
|
|
174
184
|
const openDropdownMenu = async () => {
|
|
185
|
+
const user = userEvent.setup();
|
|
175
186
|
const menuButton = getMenuButton();
|
|
176
|
-
|
|
177
|
-
await act( () => Promise.resolve() );
|
|
187
|
+
await user.click( menuButton );
|
|
178
188
|
return menuButton;
|
|
179
189
|
};
|
|
180
190
|
|
|
181
191
|
// Opens dropdown then selects the menu item by label before simulating a click.
|
|
182
|
-
const selectMenuItem = async ( label ) => {
|
|
192
|
+
const selectMenuItem = async ( label: string ) => {
|
|
193
|
+
const user = userEvent.setup();
|
|
183
194
|
const menuItem = await screen.findByText( label );
|
|
184
|
-
|
|
195
|
+
await user.click( menuItem );
|
|
185
196
|
};
|
|
186
197
|
|
|
187
198
|
describe( 'ToolsPanel', () => {
|
|
188
199
|
afterEach( () => {
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
controlValue = true;
|
|
201
|
+
altControlValue = false;
|
|
191
202
|
} );
|
|
192
203
|
|
|
193
204
|
describe( 'basic rendering', () => {
|
|
@@ -229,10 +240,20 @@ describe( 'ToolsPanel', () => {
|
|
|
229
240
|
render(
|
|
230
241
|
<ToolsPanel { ...defaultProps }>
|
|
231
242
|
{ false && (
|
|
232
|
-
<ToolsPanelItem
|
|
243
|
+
<ToolsPanelItem
|
|
244
|
+
label="Not rendered 1"
|
|
245
|
+
hasValue={ () => false }
|
|
246
|
+
>
|
|
247
|
+
Should not show
|
|
248
|
+
</ToolsPanelItem>
|
|
233
249
|
) }
|
|
234
250
|
{ false && (
|
|
235
|
-
<ToolsPanelItem
|
|
251
|
+
<ToolsPanelItem
|
|
252
|
+
label="Not rendered 2"
|
|
253
|
+
hasValue={ () => false }
|
|
254
|
+
>
|
|
255
|
+
Not shown either
|
|
256
|
+
</ToolsPanelItem>
|
|
236
257
|
) }
|
|
237
258
|
<span>Visible but insignificant</span>
|
|
238
259
|
</ToolsPanel>
|
|
@@ -317,7 +338,11 @@ describe( 'ToolsPanel', () => {
|
|
|
317
338
|
} );
|
|
318
339
|
|
|
319
340
|
it( 'should render optional panel item when value is updated externally and panel has an ID', async () => {
|
|
320
|
-
const ToolsPanelOptional = ( {
|
|
341
|
+
const ToolsPanelOptional = ( {
|
|
342
|
+
toolsPanelItemValue,
|
|
343
|
+
}: {
|
|
344
|
+
toolsPanelItemValue?: number;
|
|
345
|
+
} ) => {
|
|
321
346
|
const itemProps = {
|
|
322
347
|
attributes: { value: toolsPanelItemValue },
|
|
323
348
|
hasValue: () => !! toolsPanelItemValue,
|
|
@@ -349,7 +374,11 @@ describe( 'ToolsPanel', () => {
|
|
|
349
374
|
|
|
350
375
|
it( 'should render optional item when value is updated externally and panelId is null', async () => {
|
|
351
376
|
// This test partially covers: https://github.com/WordPress/gutenberg/issues/47368
|
|
352
|
-
const ToolsPanelOptional = ( {
|
|
377
|
+
const ToolsPanelOptional = ( {
|
|
378
|
+
toolsPanelItemValue,
|
|
379
|
+
}: {
|
|
380
|
+
toolsPanelItemValue?: number;
|
|
381
|
+
} ) => {
|
|
353
382
|
const itemProps = {
|
|
354
383
|
attributes: { value: toolsPanelItemValue },
|
|
355
384
|
hasValue: () => !! toolsPanelItemValue,
|
|
@@ -452,10 +481,10 @@ describe( 'ToolsPanel', () => {
|
|
|
452
481
|
} );
|
|
453
482
|
|
|
454
483
|
it( 'should render default controls with conditional isShownByDefault', async () => {
|
|
484
|
+
const linkedControlValue = false;
|
|
455
485
|
const linkedControlProps = {
|
|
456
|
-
attributes: { value: false },
|
|
457
486
|
hasValue: jest.fn().mockImplementation( () => {
|
|
458
|
-
return !!
|
|
487
|
+
return !! linkedControlValue;
|
|
459
488
|
} ),
|
|
460
489
|
label: 'Linked',
|
|
461
490
|
onDeselect: jest.fn(),
|
|
@@ -472,7 +501,7 @@ describe( 'ToolsPanel', () => {
|
|
|
472
501
|
</ToolsPanelItem>
|
|
473
502
|
<ToolsPanelItem
|
|
474
503
|
{ ...linkedControlProps }
|
|
475
|
-
isShownByDefault={ !!
|
|
504
|
+
isShownByDefault={ !! altControlValue }
|
|
476
505
|
>
|
|
477
506
|
<div>Linked control</div>
|
|
478
507
|
</ToolsPanelItem>
|
|
@@ -495,13 +524,14 @@ describe( 'ToolsPanel', () => {
|
|
|
495
524
|
expect( menuGroups.length ).toEqual( 3 );
|
|
496
525
|
|
|
497
526
|
// The linked control should be in the second group, of optional controls.
|
|
498
|
-
|
|
499
|
-
|
|
527
|
+
expect(
|
|
528
|
+
within( menuGroups[ 1 ] ).getByText( 'Linked' )
|
|
529
|
+
).toBeInTheDocument();
|
|
500
530
|
|
|
501
531
|
// Simulate the main control having a value set which should
|
|
502
532
|
// trigger the linked control becoming a default control via the
|
|
503
533
|
// conditional `isShownByDefault` prop.
|
|
504
|
-
|
|
534
|
+
altControlValue = true;
|
|
505
535
|
|
|
506
536
|
rerender( <TestPanel /> );
|
|
507
537
|
|
|
@@ -526,17 +556,18 @@ describe( 'ToolsPanel', () => {
|
|
|
526
556
|
// Optional controls have an additional aria-label. This can be used
|
|
527
557
|
// to confirm the conditional default control has been removed from
|
|
528
558
|
// the optional menu item group.
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
559
|
+
expect(
|
|
560
|
+
screen.queryByRole( 'menuitemcheckbox', {
|
|
561
|
+
name: 'Show Linked',
|
|
562
|
+
} )
|
|
563
|
+
).not.toBeInTheDocument();
|
|
533
564
|
} );
|
|
534
565
|
|
|
535
566
|
it( 'should handle conditionally rendered default control', async () => {
|
|
567
|
+
const conditionalControlValue = false;
|
|
536
568
|
const conditionalControlProps = {
|
|
537
|
-
attributes: { value: false },
|
|
538
569
|
hasValue: jest.fn().mockImplementation( () => {
|
|
539
|
-
return !!
|
|
570
|
+
return !! conditionalControlValue;
|
|
540
571
|
} ),
|
|
541
572
|
label: 'Conditional',
|
|
542
573
|
onDeselect: jest.fn(),
|
|
@@ -551,7 +582,7 @@ describe( 'ToolsPanel', () => {
|
|
|
551
582
|
>
|
|
552
583
|
<div>Default control</div>
|
|
553
584
|
</ToolsPanelItem>
|
|
554
|
-
{ !!
|
|
585
|
+
{ !! altControlValue && (
|
|
555
586
|
<ToolsPanelItem
|
|
556
587
|
{ ...conditionalControlProps }
|
|
557
588
|
isShownByDefault={ true }
|
|
@@ -579,7 +610,7 @@ describe( 'ToolsPanel', () => {
|
|
|
579
610
|
|
|
580
611
|
// Simulate the main control having a value set which will now
|
|
581
612
|
// render the new default control into the ToolsPanel.
|
|
582
|
-
|
|
613
|
+
altControlValue = true;
|
|
583
614
|
|
|
584
615
|
rerender( <TestPanel /> );
|
|
585
616
|
|
|
@@ -614,7 +645,7 @@ describe( 'ToolsPanel', () => {
|
|
|
614
645
|
// themselves, while those for the old panelId deregister.
|
|
615
646
|
//
|
|
616
647
|
// See: https://github.com/WordPress/gutenberg/pull/36588
|
|
617
|
-
const context = { ...panelContext };
|
|
648
|
+
const context: ToolsPanelContextType = { ...panelContext };
|
|
618
649
|
const TestPanel = () => (
|
|
619
650
|
<ToolsPanelContext.Provider value={ context }>
|
|
620
651
|
<ToolsPanelItem { ...altControlProps } panelId="1234">
|
|
@@ -678,7 +709,10 @@ describe( 'ToolsPanel', () => {
|
|
|
678
709
|
// individual items should still render themselves in this case.
|
|
679
710
|
//
|
|
680
711
|
// See: https://github.com/WordPress/gutenberg/pull/37216
|
|
681
|
-
const context = {
|
|
712
|
+
const context: ToolsPanelContextType = {
|
|
713
|
+
...panelContext,
|
|
714
|
+
panelId: null,
|
|
715
|
+
};
|
|
682
716
|
const TestPanel = () => (
|
|
683
717
|
<ToolsPanelContext.Provider value={ context }>
|
|
684
718
|
<ToolsPanelItem { ...altControlProps } panelId="1234">
|
|
@@ -942,6 +976,8 @@ describe( 'ToolsPanel', () => {
|
|
|
942
976
|
shouldRenderPlaceholderItems: false,
|
|
943
977
|
registerPanelItem: noop,
|
|
944
978
|
deregisterPanelItem: noop,
|
|
979
|
+
registerResetAllFilter: noop,
|
|
980
|
+
deregisterResetAllFilter: noop,
|
|
945
981
|
flagItemCustomization: noop,
|
|
946
982
|
areAllOptionalControlsHidden: true,
|
|
947
983
|
};
|
|
@@ -981,7 +1017,12 @@ describe( 'ToolsPanel', () => {
|
|
|
981
1017
|
// test that no orphaned items appear registered in the panel menu.
|
|
982
1018
|
//
|
|
983
1019
|
// See: https://github.com/WordPress/gutenberg/pull/34085
|
|
984
|
-
const TestSlotFillPanel = ( {
|
|
1020
|
+
const TestSlotFillPanel = ( {
|
|
1021
|
+
panelId,
|
|
1022
|
+
}: Pick<
|
|
1023
|
+
React.ComponentProps< typeof ToolsPanelItem >,
|
|
1024
|
+
'panelId'
|
|
1025
|
+
> ) => (
|
|
985
1026
|
<SlotFillProvider>
|
|
986
1027
|
<ToolsPanelItems>
|
|
987
1028
|
<ToolsPanelItem { ...altControlProps } panelId="1234">
|
|
@@ -1004,37 +1045,38 @@ describe( 'ToolsPanel', () => {
|
|
|
1004
1045
|
|
|
1005
1046
|
// Only the item matching the panelId should have been registered
|
|
1006
1047
|
// and appear in the panel menu.
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1048
|
+
expect(
|
|
1049
|
+
screen.getByRole( 'menuitemcheckbox', {
|
|
1050
|
+
name: 'Show Alt',
|
|
1051
|
+
} )
|
|
1052
|
+
).toBeInTheDocument();
|
|
1053
|
+
expect(
|
|
1054
|
+
screen.queryByRole( 'menuitemcheckbox', {
|
|
1055
|
+
name: 'Hide and reset Example',
|
|
1056
|
+
} )
|
|
1057
|
+
).not.toBeInTheDocument();
|
|
1016
1058
|
|
|
1017
1059
|
// Re-render the panel with different panelID simulating a block
|
|
1018
1060
|
// selection change.
|
|
1019
1061
|
rerender( <TestSlotFillPanel panelId="9999" /> );
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1062
|
+
expect(
|
|
1063
|
+
screen.queryByRole( 'menuitemcheckbox', {
|
|
1064
|
+
name: 'Show Alt',
|
|
1065
|
+
} )
|
|
1066
|
+
).not.toBeInTheDocument();
|
|
1067
|
+
expect(
|
|
1068
|
+
screen.getByRole( 'menuitemcheckbox', {
|
|
1069
|
+
name: 'Hide and reset Example',
|
|
1070
|
+
} )
|
|
1071
|
+
).toBeInTheDocument();
|
|
1030
1072
|
} );
|
|
1031
1073
|
} );
|
|
1032
1074
|
|
|
1033
1075
|
describe( 'panel header icon toggle', () => {
|
|
1076
|
+
const defaultControlsValue = false;
|
|
1034
1077
|
const defaultControls = {
|
|
1035
|
-
attributes: { value: false },
|
|
1036
1078
|
hasValue: jest.fn().mockImplementation( () => {
|
|
1037
|
-
return !!
|
|
1079
|
+
return !! defaultControlsValue;
|
|
1038
1080
|
} ),
|
|
1039
1081
|
label: 'Default',
|
|
1040
1082
|
onDeselect: jest.fn(),
|
|
@@ -1042,10 +1084,10 @@ describe( 'ToolsPanel', () => {
|
|
|
1042
1084
|
isShownByDefault: true,
|
|
1043
1085
|
};
|
|
1044
1086
|
|
|
1087
|
+
const optionalControlsValue = false;
|
|
1045
1088
|
const optionalControls = {
|
|
1046
|
-
attributes: { value: false },
|
|
1047
1089
|
hasValue: jest.fn().mockImplementation( () => {
|
|
1048
|
-
return !!
|
|
1090
|
+
return !! optionalControlsValue;
|
|
1049
1091
|
} ),
|
|
1050
1092
|
label: 'Optional',
|
|
1051
1093
|
onDeselect: jest.fn(),
|
|
@@ -1107,6 +1149,69 @@ describe( 'ToolsPanel', () => {
|
|
|
1107
1149
|
// The dropdown toggle no longer has a description.
|
|
1108
1150
|
expect( optionsDisplayedIcon ).not.toHaveAccessibleDescription();
|
|
1109
1151
|
} );
|
|
1152
|
+
|
|
1153
|
+
it( 'should not call reset all for different panelIds', async () => {
|
|
1154
|
+
const resetItem = jest.fn();
|
|
1155
|
+
const resetItemB = jest.fn();
|
|
1156
|
+
|
|
1157
|
+
const children = (
|
|
1158
|
+
<>
|
|
1159
|
+
<ToolsPanelItem
|
|
1160
|
+
label="a"
|
|
1161
|
+
hasValue={ () => true }
|
|
1162
|
+
panelId="a"
|
|
1163
|
+
resetAllFilter={ resetItem }
|
|
1164
|
+
isShownByDefault
|
|
1165
|
+
>
|
|
1166
|
+
<div>Example control</div>
|
|
1167
|
+
</ToolsPanelItem>
|
|
1168
|
+
<ToolsPanelItem
|
|
1169
|
+
label="b"
|
|
1170
|
+
hasValue={ () => true }
|
|
1171
|
+
panelId="b"
|
|
1172
|
+
resetAllFilter={ resetItemB }
|
|
1173
|
+
isShownByDefault
|
|
1174
|
+
>
|
|
1175
|
+
<div>Alt control</div>
|
|
1176
|
+
</ToolsPanelItem>
|
|
1177
|
+
</>
|
|
1178
|
+
);
|
|
1179
|
+
|
|
1180
|
+
const resetAllCallback = (
|
|
1181
|
+
filters: ResetAllFilter[] | undefined
|
|
1182
|
+
) => filters?.forEach( ( f ) => f() );
|
|
1183
|
+
|
|
1184
|
+
const { rerender } = render(
|
|
1185
|
+
<ToolsPanel
|
|
1186
|
+
{ ...defaultProps }
|
|
1187
|
+
panelId="a"
|
|
1188
|
+
resetAll={ resetAllCallback }
|
|
1189
|
+
>
|
|
1190
|
+
{ children }
|
|
1191
|
+
</ToolsPanel>
|
|
1192
|
+
);
|
|
1193
|
+
|
|
1194
|
+
await openDropdownMenu();
|
|
1195
|
+
await selectMenuItem( 'Reset all' );
|
|
1196
|
+
expect( resetItem ).toHaveBeenCalled();
|
|
1197
|
+
expect( resetItemB ).not.toHaveBeenCalled();
|
|
1198
|
+
|
|
1199
|
+
resetItem.mockClear();
|
|
1200
|
+
|
|
1201
|
+
rerender(
|
|
1202
|
+
<ToolsPanel
|
|
1203
|
+
{ ...defaultProps }
|
|
1204
|
+
panelId="b"
|
|
1205
|
+
resetAll={ resetAllCallback }
|
|
1206
|
+
>
|
|
1207
|
+
{ children }
|
|
1208
|
+
</ToolsPanel>
|
|
1209
|
+
);
|
|
1210
|
+
|
|
1211
|
+
await selectMenuItem( 'Reset all' );
|
|
1212
|
+
expect( resetItem ).not.toHaveBeenCalled();
|
|
1213
|
+
expect( resetItemB ).toHaveBeenCalled();
|
|
1214
|
+
} );
|
|
1110
1215
|
} );
|
|
1111
1216
|
|
|
1112
1217
|
describe( 'reset all button', () => {
|
|
@@ -1115,9 +1220,10 @@ describe( 'ToolsPanel', () => {
|
|
|
1115
1220
|
await openDropdownMenu();
|
|
1116
1221
|
|
|
1117
1222
|
const resetAllItem = await screen.findByRole( 'menuitem', {
|
|
1118
|
-
|
|
1223
|
+
name: 'Reset all',
|
|
1119
1224
|
} );
|
|
1120
1225
|
expect( resetAllItem ).toBeInTheDocument();
|
|
1226
|
+
expect( resetAllItem ).toHaveAttribute( 'aria-disabled', 'false' );
|
|
1121
1227
|
|
|
1122
1228
|
await selectMenuItem( 'Reset all' );
|
|
1123
1229
|
|
|
@@ -1126,9 +1232,13 @@ describe( 'ToolsPanel', () => {
|
|
|
1126
1232
|
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
1127
1233
|
|
|
1128
1234
|
const disabledResetAllItem = await screen.findByRole( 'menuitem', {
|
|
1129
|
-
|
|
1235
|
+
name: 'Reset all',
|
|
1130
1236
|
} );
|
|
1131
1237
|
expect( disabledResetAllItem ).toBeInTheDocument();
|
|
1238
|
+
expect( disabledResetAllItem ).toHaveAttribute(
|
|
1239
|
+
'aria-disabled',
|
|
1240
|
+
'true'
|
|
1241
|
+
);
|
|
1132
1242
|
} );
|
|
1133
1243
|
} );
|
|
1134
1244
|
|
|
@@ -155,6 +155,14 @@ Flags that the items in this ToolsPanel will be contained within an inner
|
|
|
155
155
|
wrapper element allowing the panel to lay them out accordingly.
|
|
156
156
|
|
|
157
157
|
- Required: No
|
|
158
|
+
- Default: `false`
|
|
159
|
+
|
|
160
|
+
### `headingLevel`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
161
|
+
|
|
162
|
+
The heading level of the panel's header.
|
|
163
|
+
|
|
164
|
+
- Required: No
|
|
165
|
+
- Default: `2`
|
|
158
166
|
|
|
159
167
|
### `label`: `string`
|
|
160
168
|
|
|
@@ -163,7 +171,7 @@ panel's dropdown menu.
|
|
|
163
171
|
|
|
164
172
|
- Required: Yes
|
|
165
173
|
|
|
166
|
-
### `panelId`: `string`
|
|
174
|
+
### `panelId`: `string | null`
|
|
167
175
|
|
|
168
176
|
If a `panelId` is set, it is passed through the `ToolsPanelContext` and used
|
|
169
177
|
to restrict panel items. When a `panelId` is set, items can only register
|
|
@@ -172,10 +180,9 @@ exactly.
|
|
|
172
180
|
|
|
173
181
|
- Required: No
|
|
174
182
|
|
|
175
|
-
### `resetAll`: `() => void`
|
|
183
|
+
### `resetAll`: `( filters?: ResetAllFilter[] ) => void`
|
|
176
184
|
|
|
177
|
-
A function to call when the `Reset all` menu option is selected.
|
|
178
|
-
through to the panel's header component.
|
|
185
|
+
A function to call when the `Reset all` menu option is selected. As an argument, it receives an array containing the `resetAllFilter` callbacks of all the valid registered `ToolsPanelItems`.
|
|
179
186
|
|
|
180
187
|
- Required: Yes
|
|
181
188
|
|
|
@@ -185,3 +192,4 @@ Advises the `ToolsPanel` that all of its `ToolsPanelItem` children should render
|
|
|
185
192
|
placeholder content (instead of `null`) when they are toggled off and hidden.
|
|
186
193
|
|
|
187
194
|
- Required: No
|
|
195
|
+
- Default: `false`
|
|
@@ -13,7 +13,7 @@ import { Grid } from '../../grid';
|
|
|
13
13
|
import { contextConnect, WordPressComponentProps } from '../../ui/context';
|
|
14
14
|
import type { ToolsPanelProps } from '../types';
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const UnconnectedToolsPanel = (
|
|
17
17
|
props: WordPressComponentProps< ToolsPanelProps, 'div' >,
|
|
18
18
|
forwardedRef: ForwardedRef< any >
|
|
19
19
|
) => {
|
|
@@ -23,6 +23,7 @@ const ToolsPanel = (
|
|
|
23
23
|
panelContext,
|
|
24
24
|
resetAllItems,
|
|
25
25
|
toggleItem,
|
|
26
|
+
headingLevel,
|
|
26
27
|
...toolsPanelProps
|
|
27
28
|
} = useToolsPanel( props );
|
|
28
29
|
|
|
@@ -33,6 +34,7 @@ const ToolsPanel = (
|
|
|
33
34
|
label={ label }
|
|
34
35
|
resetAll={ resetAllItems }
|
|
35
36
|
toggleItem={ toggleItem }
|
|
37
|
+
headingLevel={ headingLevel }
|
|
36
38
|
/>
|
|
37
39
|
{ children }
|
|
38
40
|
</ToolsPanelContext.Provider>
|
|
@@ -40,6 +42,58 @@ const ToolsPanel = (
|
|
|
40
42
|
);
|
|
41
43
|
};
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The `ToolsPanel` is a container component that displays its children preceded
|
|
47
|
+
* by a header. The header includes a dropdown menu which is automatically
|
|
48
|
+
* generated from the panel's inner `ToolsPanelItems`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```jsx
|
|
52
|
+
* import { __ } from '@wordpress/i18n';
|
|
53
|
+
* import {
|
|
54
|
+
* __experimentalToolsPanel as ToolsPanel,
|
|
55
|
+
* __experimentalToolsPanelItem as ToolsPanelItem,
|
|
56
|
+
* __experimentalUnitControl as UnitControl
|
|
57
|
+
* } from '@wordpress/components';
|
|
58
|
+
*
|
|
59
|
+
* function Example() {
|
|
60
|
+
* const [ height, setHeight ] = useState();
|
|
61
|
+
* const [ width, setWidth ] = useState();
|
|
62
|
+
*
|
|
63
|
+
* const resetAll = () => {
|
|
64
|
+
* setHeight();
|
|
65
|
+
* setWidth();
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* return (
|
|
69
|
+
* <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>
|
|
70
|
+
* <ToolsPanelItem
|
|
71
|
+
* hasValue={ () => !! height }
|
|
72
|
+
* label={ __( 'Height' ) }
|
|
73
|
+
* onDeselect={ () => setHeight() }
|
|
74
|
+
* >
|
|
75
|
+
* <UnitControl
|
|
76
|
+
* label={ __( 'Height' ) }
|
|
77
|
+
* onChange={ setHeight }
|
|
78
|
+
* value={ height }
|
|
79
|
+
* />
|
|
80
|
+
* </ToolsPanelItem>
|
|
81
|
+
* <ToolsPanelItem
|
|
82
|
+
* hasValue={ () => !! width }
|
|
83
|
+
* label={ __( 'Width' ) }
|
|
84
|
+
* onDeselect={ () => setWidth() }
|
|
85
|
+
* >
|
|
86
|
+
* <UnitControl
|
|
87
|
+
* label={ __( 'Width' ) }
|
|
88
|
+
* onChange={ setWidth }
|
|
89
|
+
* value={ width }
|
|
90
|
+
* />
|
|
91
|
+
* </ToolsPanelItem>
|
|
92
|
+
* </ToolsPanel>
|
|
93
|
+
* );
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export const ToolsPanel = contextConnect( UnconnectedToolsPanel, 'ToolsPanel' );
|
|
44
98
|
|
|
45
|
-
export default
|
|
99
|
+
export default ToolsPanel;
|