@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,50 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
4
5
|
import styled from '@emotion/styled';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
8
9
|
*/
|
|
9
10
|
import { useState } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
10
15
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from '
|
|
16
|
+
ToggleGroupControl,
|
|
17
|
+
ToggleGroupControlOption,
|
|
18
|
+
} from '../../toggle-group-control';
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Internal dependencies
|
|
17
22
|
*/
|
|
18
|
-
import { ToolsPanel, ToolsPanelItem } from '
|
|
23
|
+
import { ToolsPanel, ToolsPanelItem } from '..';
|
|
19
24
|
import Panel from '../../panel';
|
|
20
25
|
import UnitControl from '../../unit-control';
|
|
21
26
|
import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
const meta: ComponentMeta< typeof ToolsPanel > = {
|
|
24
29
|
title: 'Components (Experimental)/ToolsPanel',
|
|
25
30
|
component: ToolsPanel,
|
|
31
|
+
subcomponents: {
|
|
32
|
+
ToolsPanelItem,
|
|
33
|
+
},
|
|
34
|
+
argTypes: {
|
|
35
|
+
as: { control: { type: null } },
|
|
36
|
+
children: { control: { type: null } },
|
|
37
|
+
panelId: { control: { type: null } },
|
|
38
|
+
resetAll: { action: 'resetAll' },
|
|
39
|
+
},
|
|
40
|
+
parameters: {
|
|
41
|
+
actions: { argTypesRegex: '^on.*' },
|
|
42
|
+
controls: {
|
|
43
|
+
expanded: true,
|
|
44
|
+
},
|
|
45
|
+
docs: { source: { state: 'open' } },
|
|
46
|
+
},
|
|
26
47
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
48
|
+
export default meta;
|
|
49
|
+
|
|
50
|
+
export const Default: ComponentStory< typeof ToolsPanel > = ( {
|
|
51
|
+
resetAll: resetAllProp,
|
|
52
|
+
...props
|
|
53
|
+
} ) => {
|
|
54
|
+
const [ height, setHeight ] = useState< string | undefined >();
|
|
55
|
+
const [ minHeight, setMinHeight ] = useState< string | undefined >();
|
|
56
|
+
const [ width, setWidth ] = useState< string | undefined >();
|
|
57
|
+
const [ scale, setScale ] = useState< React.ReactText | undefined >();
|
|
58
|
+
|
|
59
|
+
const resetAll: typeof resetAllProp = ( filters ) => {
|
|
35
60
|
setHeight( undefined );
|
|
36
61
|
setWidth( undefined );
|
|
37
62
|
setMinHeight( undefined );
|
|
38
63
|
setScale( undefined );
|
|
64
|
+
resetAllProp( filters );
|
|
39
65
|
};
|
|
40
66
|
|
|
41
67
|
return (
|
|
42
68
|
<PanelWrapperView>
|
|
43
69
|
<Panel>
|
|
44
|
-
<ToolsPanel
|
|
45
|
-
label="Tools Panel (default example)"
|
|
46
|
-
resetAll={ resetAll }
|
|
47
|
-
>
|
|
70
|
+
<ToolsPanel { ...props } resetAll={ resetAll }>
|
|
48
71
|
<SingleColumnItem
|
|
49
72
|
hasValue={ () => !! width }
|
|
50
73
|
label="Width"
|
|
@@ -112,23 +135,27 @@ export const _default = () => {
|
|
|
112
135
|
</PanelWrapperView>
|
|
113
136
|
);
|
|
114
137
|
};
|
|
138
|
+
Default.args = {
|
|
139
|
+
label: 'Tools Panel (default example)',
|
|
140
|
+
};
|
|
115
141
|
|
|
116
|
-
export const WithNonToolsPanelItems = (
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
export const WithNonToolsPanelItems: ComponentStory< typeof ToolsPanel > = ( {
|
|
143
|
+
resetAll: resetAllProp,
|
|
144
|
+
...props
|
|
145
|
+
} ) => {
|
|
146
|
+
const [ height, setHeight ] = useState< string | undefined >();
|
|
147
|
+
const [ width, setWidth ] = useState< string | undefined >();
|
|
119
148
|
|
|
120
|
-
const resetAll = () => {
|
|
149
|
+
const resetAll: typeof resetAllProp = ( filters ) => {
|
|
121
150
|
setHeight( undefined );
|
|
122
151
|
setWidth( undefined );
|
|
152
|
+
resetAllProp( filters );
|
|
123
153
|
};
|
|
124
154
|
|
|
125
155
|
return (
|
|
126
156
|
<PanelWrapperView>
|
|
127
157
|
<Panel>
|
|
128
|
-
<ToolsPanel
|
|
129
|
-
label="ToolsPanel (with non-menu items)"
|
|
130
|
-
resetAll={ resetAll }
|
|
131
|
-
>
|
|
158
|
+
<ToolsPanel { ...props } resetAll={ resetAll }>
|
|
132
159
|
<IntroText>
|
|
133
160
|
This text illustrates not all items must be wrapped in a
|
|
134
161
|
ToolsPanelItem and represented in the panel menu.
|
|
@@ -162,81 +189,127 @@ export const WithNonToolsPanelItems = () => {
|
|
|
162
189
|
</PanelWrapperView>
|
|
163
190
|
);
|
|
164
191
|
};
|
|
192
|
+
WithNonToolsPanelItems.args = {
|
|
193
|
+
...Default.args,
|
|
194
|
+
label: 'ToolsPanel (with non-menu items)',
|
|
195
|
+
};
|
|
165
196
|
|
|
166
|
-
export const WithOptionalItemsPlusIcon
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const [
|
|
170
|
-
|
|
171
|
-
|
|
197
|
+
export const WithOptionalItemsPlusIcon: ComponentStory<
|
|
198
|
+
typeof ToolsPanel
|
|
199
|
+
> = ( { resetAll: resetAllProp, ...props } ) => {
|
|
200
|
+
const [
|
|
201
|
+
isFirstToolsPanelItemShownByDefault,
|
|
202
|
+
setIsFirstToolsPanelItemShownByDefault,
|
|
203
|
+
] = useState( false );
|
|
204
|
+
const [ height, setHeight ] = useState< string | undefined >();
|
|
205
|
+
const [ width, setWidth ] = useState< string | undefined >();
|
|
206
|
+
const [ minWidth, setMinWidth ] = useState< string | undefined >();
|
|
207
|
+
|
|
208
|
+
const resetAll: typeof resetAllProp = ( filters ) => {
|
|
172
209
|
setHeight( undefined );
|
|
173
210
|
setWidth( undefined );
|
|
174
211
|
setMinWidth( undefined );
|
|
212
|
+
resetAllProp( filters );
|
|
175
213
|
};
|
|
176
214
|
|
|
177
215
|
return (
|
|
178
|
-
|
|
179
|
-
<
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
216
|
+
<>
|
|
217
|
+
<PanelWrapperView>
|
|
218
|
+
<Panel>
|
|
219
|
+
<ToolsPanel
|
|
220
|
+
{ ...props }
|
|
221
|
+
resetAll={ resetAll }
|
|
222
|
+
// `key` property here is used as a hack to force `ToolsPanel` to re-render
|
|
223
|
+
// See https://github.com/WordPress/gutenberg/pull/38262/files#r793422991
|
|
224
|
+
key={
|
|
225
|
+
isFirstToolsPanelItemShownByDefault
|
|
226
|
+
? 'true'
|
|
227
|
+
: 'false'
|
|
228
|
+
}
|
|
190
229
|
>
|
|
191
|
-
<
|
|
230
|
+
<SingleColumnItem
|
|
231
|
+
hasValue={ () => !! minWidth }
|
|
192
232
|
label="Minimum width"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
233
|
+
onDeselect={ () => setMinWidth( undefined ) }
|
|
234
|
+
isShownByDefault={
|
|
235
|
+
isFirstToolsPanelItemShownByDefault
|
|
236
|
+
}
|
|
237
|
+
>
|
|
238
|
+
<UnitControl
|
|
239
|
+
label="Minimum width"
|
|
240
|
+
value={ minWidth }
|
|
241
|
+
onChange={ ( next ) => setMinWidth( next ) }
|
|
242
|
+
/>
|
|
243
|
+
</SingleColumnItem>
|
|
244
|
+
<SingleColumnItem
|
|
245
|
+
hasValue={ () => !! width }
|
|
204
246
|
label="Width"
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
247
|
+
onDeselect={ () => setWidth( undefined ) }
|
|
248
|
+
isShownByDefault={ false }
|
|
249
|
+
>
|
|
250
|
+
<UnitControl
|
|
251
|
+
label="Width"
|
|
252
|
+
value={ width }
|
|
253
|
+
onChange={ ( next ) => setWidth( next ) }
|
|
254
|
+
/>
|
|
255
|
+
</SingleColumnItem>
|
|
256
|
+
<SingleColumnItem
|
|
257
|
+
hasValue={ () => !! height }
|
|
216
258
|
label="Height"
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
259
|
+
onDeselect={ () => setHeight( undefined ) }
|
|
260
|
+
isShownByDefault={ false }
|
|
261
|
+
>
|
|
262
|
+
<UnitControl
|
|
263
|
+
label="Height"
|
|
264
|
+
value={ height }
|
|
265
|
+
onChange={ ( next ) => setHeight( next ) }
|
|
266
|
+
/>
|
|
267
|
+
</SingleColumnItem>
|
|
268
|
+
</ToolsPanel>
|
|
269
|
+
</Panel>
|
|
270
|
+
</PanelWrapperView>
|
|
271
|
+
|
|
272
|
+
<button
|
|
273
|
+
onClick={ () =>
|
|
274
|
+
setIsFirstToolsPanelItemShownByDefault(
|
|
275
|
+
! isFirstToolsPanelItemShownByDefault
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
aria-pressed={
|
|
279
|
+
isFirstToolsPanelItemShownByDefault ? 'true' : 'false'
|
|
280
|
+
}
|
|
281
|
+
style={ {
|
|
282
|
+
marginTop: '2rem',
|
|
283
|
+
} }
|
|
284
|
+
>
|
|
285
|
+
{ isFirstToolsPanelItemShownByDefault
|
|
286
|
+
? 'Make first PanelItem hidden by default'
|
|
287
|
+
: 'Make first PanelItem shown by default' }
|
|
288
|
+
</button>
|
|
289
|
+
</>
|
|
224
290
|
);
|
|
225
291
|
};
|
|
226
292
|
|
|
227
293
|
WithOptionalItemsPlusIcon.args = {
|
|
228
|
-
|
|
294
|
+
...Default.args,
|
|
295
|
+
label: 'Tools Panel (optional items only)',
|
|
229
296
|
};
|
|
230
297
|
|
|
231
298
|
const { Fill: ToolsPanelItems, Slot } = createSlotFill( 'ToolsPanelSlot' );
|
|
232
|
-
const panelId = 'unique-tools-panel-id';
|
|
233
299
|
|
|
234
|
-
export const WithSlotFillItems = (
|
|
235
|
-
|
|
300
|
+
export const WithSlotFillItems: ComponentStory< typeof ToolsPanel > = ( {
|
|
301
|
+
resetAll: resetAllProp,
|
|
302
|
+
panelId,
|
|
303
|
+
...props
|
|
304
|
+
} ) => {
|
|
305
|
+
const [ attributes, setAttributes ] = useState< {
|
|
306
|
+
width?: string;
|
|
307
|
+
height?: string;
|
|
308
|
+
} >( {} );
|
|
236
309
|
const { width, height } = attributes;
|
|
237
310
|
|
|
238
|
-
const resetAll = ( resetFilters = [] ) => {
|
|
239
|
-
let newAttributes = {};
|
|
311
|
+
const resetAll: typeof resetAllProp = ( resetFilters = [] ) => {
|
|
312
|
+
let newAttributes: typeof attributes = {};
|
|
240
313
|
|
|
241
314
|
resetFilters.forEach( ( resetFilter ) => {
|
|
242
315
|
newAttributes = {
|
|
@@ -246,9 +319,10 @@ export const WithSlotFillItems = () => {
|
|
|
246
319
|
} );
|
|
247
320
|
|
|
248
321
|
setAttributes( newAttributes );
|
|
322
|
+
resetAllProp( resetFilters );
|
|
249
323
|
};
|
|
250
324
|
|
|
251
|
-
const updateAttribute = ( name, value ) => {
|
|
325
|
+
const updateAttribute = ( name: string, value?: any ) => {
|
|
252
326
|
setAttributes( {
|
|
253
327
|
...attributes,
|
|
254
328
|
[ name ]: value,
|
|
@@ -304,7 +378,7 @@ export const WithSlotFillItems = () => {
|
|
|
304
378
|
<PanelWrapperView>
|
|
305
379
|
<Panel>
|
|
306
380
|
<ToolsPanel
|
|
307
|
-
|
|
381
|
+
{ ...props }
|
|
308
382
|
resetAll={ resetAll }
|
|
309
383
|
panelId={ panelId }
|
|
310
384
|
>
|
|
@@ -315,13 +389,23 @@ export const WithSlotFillItems = () => {
|
|
|
315
389
|
</SlotFillProvider>
|
|
316
390
|
);
|
|
317
391
|
};
|
|
392
|
+
WithSlotFillItems.args = {
|
|
393
|
+
...Default.args,
|
|
394
|
+
label: 'Tools Panel With SlotFill Items',
|
|
395
|
+
panelId: 'unique-tools-panel-id',
|
|
396
|
+
};
|
|
318
397
|
|
|
319
|
-
export const WithConditionalDefaultControl
|
|
320
|
-
|
|
398
|
+
export const WithConditionalDefaultControl: ComponentStory<
|
|
399
|
+
typeof ToolsPanel
|
|
400
|
+
> = ( { resetAll: resetAllProp, panelId, ...props } ) => {
|
|
401
|
+
const [ attributes, setAttributes ] = useState< {
|
|
402
|
+
height?: string;
|
|
403
|
+
scale?: React.ReactText;
|
|
404
|
+
} >( {} );
|
|
321
405
|
const { height, scale } = attributes;
|
|
322
406
|
|
|
323
|
-
const resetAll = ( resetFilters = [] ) => {
|
|
324
|
-
let newAttributes = {};
|
|
407
|
+
const resetAll: typeof resetAllProp = ( resetFilters = [] ) => {
|
|
408
|
+
let newAttributes: typeof attributes = {};
|
|
325
409
|
|
|
326
410
|
resetFilters.forEach( ( resetFilter ) => {
|
|
327
411
|
newAttributes = {
|
|
@@ -331,9 +415,11 @@ export const WithConditionalDefaultControl = () => {
|
|
|
331
415
|
} );
|
|
332
416
|
|
|
333
417
|
setAttributes( newAttributes );
|
|
418
|
+
|
|
419
|
+
resetAllProp( resetFilters );
|
|
334
420
|
};
|
|
335
421
|
|
|
336
|
-
const updateAttribute = ( name, value ) => {
|
|
422
|
+
const updateAttribute = ( name: string, value?: any ) => {
|
|
337
423
|
setAttributes( {
|
|
338
424
|
...attributes,
|
|
339
425
|
[ name ]: value,
|
|
@@ -388,7 +474,7 @@ export const WithConditionalDefaultControl = () => {
|
|
|
388
474
|
<PanelWrapperView>
|
|
389
475
|
<Panel>
|
|
390
476
|
<ToolsPanel
|
|
391
|
-
|
|
477
|
+
{ ...props }
|
|
392
478
|
resetAll={ resetAll }
|
|
393
479
|
panelId={ panelId }
|
|
394
480
|
>
|
|
@@ -399,13 +485,23 @@ export const WithConditionalDefaultControl = () => {
|
|
|
399
485
|
</SlotFillProvider>
|
|
400
486
|
);
|
|
401
487
|
};
|
|
488
|
+
WithConditionalDefaultControl.args = {
|
|
489
|
+
...Default.args,
|
|
490
|
+
label: 'Tools Panel With Conditional Default via SlotFill',
|
|
491
|
+
panelId: 'unique-tools-panel-id',
|
|
492
|
+
};
|
|
402
493
|
|
|
403
|
-
export const WithConditionallyRenderedControl
|
|
404
|
-
|
|
494
|
+
export const WithConditionallyRenderedControl: ComponentStory<
|
|
495
|
+
typeof ToolsPanel
|
|
496
|
+
> = ( { resetAll: resetAllProp, panelId, ...props } ) => {
|
|
497
|
+
const [ attributes, setAttributes ] = useState< {
|
|
498
|
+
height?: string;
|
|
499
|
+
scale?: React.ReactText;
|
|
500
|
+
} >( {} );
|
|
405
501
|
const { height, scale } = attributes;
|
|
406
502
|
|
|
407
|
-
const resetAll = ( resetFilters = [] ) => {
|
|
408
|
-
let newAttributes = {};
|
|
503
|
+
const resetAll: typeof resetAllProp = ( resetFilters = [] ) => {
|
|
504
|
+
let newAttributes: typeof attributes = {};
|
|
409
505
|
|
|
410
506
|
resetFilters.forEach( ( resetFilter ) => {
|
|
411
507
|
newAttributes = {
|
|
@@ -415,9 +511,11 @@ export const WithConditionallyRenderedControl = () => {
|
|
|
415
511
|
} );
|
|
416
512
|
|
|
417
513
|
setAttributes( newAttributes );
|
|
514
|
+
|
|
515
|
+
resetAllProp( resetFilters );
|
|
418
516
|
};
|
|
419
517
|
|
|
420
|
-
const updateAttribute = ( name, value ) => {
|
|
518
|
+
const updateAttribute = ( name: string, value?: any ) => {
|
|
421
519
|
setAttributes( {
|
|
422
520
|
...attributes,
|
|
423
521
|
[ name ]: value,
|
|
@@ -485,7 +583,7 @@ export const WithConditionallyRenderedControl = () => {
|
|
|
485
583
|
<PanelWrapperView>
|
|
486
584
|
<Panel>
|
|
487
585
|
<ToolsPanel
|
|
488
|
-
|
|
586
|
+
{ ...props }
|
|
489
587
|
resetAll={ resetAll }
|
|
490
588
|
panelId={ panelId }
|
|
491
589
|
>
|
|
@@ -496,8 +594,11 @@ export const WithConditionallyRenderedControl = () => {
|
|
|
496
594
|
</SlotFillProvider>
|
|
497
595
|
);
|
|
498
596
|
};
|
|
499
|
-
|
|
500
|
-
|
|
597
|
+
WithConditionallyRenderedControl.args = {
|
|
598
|
+
...Default.args,
|
|
599
|
+
label: 'Tools Panel With Conditionally Rendered Item via SlotFill',
|
|
600
|
+
panelId: 'unique-tools-panel-id',
|
|
601
|
+
};
|
|
501
602
|
|
|
502
603
|
const PanelWrapperView = styled.div`
|
|
503
604
|
font-size: 13px;
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
@@ -169,19 +169,19 @@ const getMenuButton = () => {
|
|
|
169
169
|
/**
|
|
170
170
|
* Helper to find the menu button and simulate a user click.
|
|
171
171
|
*
|
|
172
|
-
* @return {HTMLElement} The menuButton.
|
|
173
172
|
*/
|
|
174
173
|
const openDropdownMenu = async () => {
|
|
174
|
+
const user = userEvent.setup();
|
|
175
175
|
const menuButton = getMenuButton();
|
|
176
|
-
|
|
177
|
-
await act( () => Promise.resolve() );
|
|
176
|
+
await user.click( menuButton );
|
|
178
177
|
return menuButton;
|
|
179
178
|
};
|
|
180
179
|
|
|
181
180
|
// Opens dropdown then selects the menu item by label before simulating a click.
|
|
182
181
|
const selectMenuItem = async ( label ) => {
|
|
182
|
+
const user = userEvent.setup();
|
|
183
183
|
const menuItem = await screen.findByText( label );
|
|
184
|
-
|
|
184
|
+
await user.click( menuItem );
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
describe( 'ToolsPanel', () => {
|
|
@@ -316,6 +316,71 @@ describe( 'ToolsPanel', () => {
|
|
|
316
316
|
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
317
317
|
} );
|
|
318
318
|
|
|
319
|
+
it( 'should render optional panel item when value is updated externally and panel has an ID', async () => {
|
|
320
|
+
const ToolsPanelOptional = ( { toolsPanelItemValue } ) => {
|
|
321
|
+
const itemProps = {
|
|
322
|
+
attributes: { value: toolsPanelItemValue },
|
|
323
|
+
hasValue: () => !! toolsPanelItemValue,
|
|
324
|
+
label: 'Alt',
|
|
325
|
+
onDeselect: jest.fn(),
|
|
326
|
+
onSelect: jest.fn(),
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
return (
|
|
330
|
+
<ToolsPanel { ...defaultProps }>
|
|
331
|
+
<ToolsPanelItem { ...itemProps }>
|
|
332
|
+
<div>Optional control</div>
|
|
333
|
+
</ToolsPanelItem>
|
|
334
|
+
</ToolsPanel>
|
|
335
|
+
);
|
|
336
|
+
};
|
|
337
|
+
const { rerender } = render( <ToolsPanelOptional /> );
|
|
338
|
+
|
|
339
|
+
const control = screen.queryByText( 'Optional control' );
|
|
340
|
+
|
|
341
|
+
expect( control ).not.toBeInTheDocument();
|
|
342
|
+
|
|
343
|
+
rerender( <ToolsPanelOptional toolsPanelItemValue={ 100 } /> );
|
|
344
|
+
|
|
345
|
+
const controlRerendered = screen.getByText( 'Optional control' );
|
|
346
|
+
|
|
347
|
+
expect( controlRerendered ).toBeInTheDocument();
|
|
348
|
+
} );
|
|
349
|
+
|
|
350
|
+
it( 'should render optional item when value is updated externally and panelId is null', async () => {
|
|
351
|
+
// This test partially covers: https://github.com/WordPress/gutenberg/issues/47368
|
|
352
|
+
const ToolsPanelOptional = ( { toolsPanelItemValue } ) => {
|
|
353
|
+
const itemProps = {
|
|
354
|
+
attributes: { value: toolsPanelItemValue },
|
|
355
|
+
hasValue: () => !! toolsPanelItemValue,
|
|
356
|
+
label: 'Alt',
|
|
357
|
+
onDeselect: jest.fn(),
|
|
358
|
+
onSelect: jest.fn(),
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
// The null panelId below simulates the panel prop when there
|
|
362
|
+
// are multiple blocks selected.
|
|
363
|
+
return (
|
|
364
|
+
<ToolsPanel { ...defaultProps } panelId={ null }>
|
|
365
|
+
<ToolsPanelItem { ...itemProps }>
|
|
366
|
+
<div>Optional control</div>
|
|
367
|
+
</ToolsPanelItem>
|
|
368
|
+
</ToolsPanel>
|
|
369
|
+
);
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const { rerender } = render( <ToolsPanelOptional /> );
|
|
373
|
+
const control = screen.queryByText( 'Optional control' );
|
|
374
|
+
|
|
375
|
+
expect( control ).not.toBeInTheDocument();
|
|
376
|
+
|
|
377
|
+
rerender( <ToolsPanelOptional toolsPanelItemValue={ 99 } /> );
|
|
378
|
+
|
|
379
|
+
const controlRerendered = screen.getByText( 'Optional control' );
|
|
380
|
+
|
|
381
|
+
expect( controlRerendered ).toBeInTheDocument();
|
|
382
|
+
} );
|
|
383
|
+
|
|
319
384
|
it( 'should continue to render shown by default item after it is toggled off via menu item', async () => {
|
|
320
385
|
render(
|
|
321
386
|
<ToolsPanel { ...defaultProps }>
|
|
@@ -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;
|