@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
|
@@ -7,6 +7,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
10
|
+
import type { BoxControlProps, BoxControlValue } from './types';
|
|
10
11
|
|
|
11
12
|
export const LABELS = {
|
|
12
13
|
all: __( 'All' ),
|
|
@@ -26,16 +27,16 @@ export const DEFAULT_VALUES = {
|
|
|
26
27
|
left: undefined,
|
|
27
28
|
};
|
|
28
29
|
|
|
29
|
-
export const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];
|
|
30
|
+
export const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ] as const;
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Gets an items with the most occurrence within an array
|
|
33
34
|
* https://stackoverflow.com/a/20762713
|
|
34
35
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @return
|
|
36
|
+
* @param arr Array of items to check.
|
|
37
|
+
* @return The item with the most occurrences.
|
|
37
38
|
*/
|
|
38
|
-
function mode( arr ) {
|
|
39
|
+
function mode< T >( arr: T[] ) {
|
|
39
40
|
return arr
|
|
40
41
|
.sort(
|
|
41
42
|
( a, b ) =>
|
|
@@ -48,16 +49,16 @@ function mode( arr ) {
|
|
|
48
49
|
/**
|
|
49
50
|
* Gets the 'all' input value and unit from values data.
|
|
50
51
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
52
|
+
* @param values Box values.
|
|
53
|
+
* @param selectedUnits Box units.
|
|
54
|
+
* @param availableSides Available box sides to evaluate.
|
|
54
55
|
*
|
|
55
|
-
* @return
|
|
56
|
+
* @return A value + unit for the 'all' input.
|
|
56
57
|
*/
|
|
57
58
|
export function getAllValue(
|
|
58
|
-
values = {},
|
|
59
|
-
selectedUnits,
|
|
60
|
-
availableSides = ALL_SIDES
|
|
59
|
+
values: BoxControlValue = {},
|
|
60
|
+
selectedUnits?: BoxControlValue,
|
|
61
|
+
availableSides: BoxControlProps[ 'sides' ] = ALL_SIDES
|
|
61
62
|
) {
|
|
62
63
|
const sides = normalizeSides( availableSides );
|
|
63
64
|
const parsedQuantitiesAndUnits = sides.map( ( side ) =>
|
|
@@ -101,10 +102,10 @@ export function getAllValue(
|
|
|
101
102
|
/**
|
|
102
103
|
* Determine the most common unit selection to use as a fallback option.
|
|
103
104
|
*
|
|
104
|
-
* @param
|
|
105
|
-
* @return
|
|
105
|
+
* @param selectedUnits Current unit selections for individual sides.
|
|
106
|
+
* @return Most common unit selection.
|
|
106
107
|
*/
|
|
107
|
-
export function getAllUnitFallback( selectedUnits ) {
|
|
108
|
+
export function getAllUnitFallback( selectedUnits?: BoxControlValue ) {
|
|
108
109
|
if ( ! selectedUnits || typeof selectedUnits !== 'object' ) {
|
|
109
110
|
return undefined;
|
|
110
111
|
}
|
|
@@ -117,13 +118,17 @@ export function getAllUnitFallback( selectedUnits ) {
|
|
|
117
118
|
/**
|
|
118
119
|
* Checks to determine if values are mixed.
|
|
119
120
|
*
|
|
120
|
-
* @param
|
|
121
|
-
* @param
|
|
122
|
-
* @param
|
|
121
|
+
* @param values Box values.
|
|
122
|
+
* @param selectedUnits Box units.
|
|
123
|
+
* @param sides Available box sides to evaluate.
|
|
123
124
|
*
|
|
124
|
-
* @return
|
|
125
|
+
* @return Whether values are mixed.
|
|
125
126
|
*/
|
|
126
|
-
export function isValuesMixed(
|
|
127
|
+
export function isValuesMixed(
|
|
128
|
+
values: BoxControlValue = {},
|
|
129
|
+
selectedUnits?: BoxControlValue,
|
|
130
|
+
sides: BoxControlProps[ 'sides' ] = ALL_SIDES
|
|
131
|
+
) {
|
|
127
132
|
const allValue = getAllValue( values, selectedUnits, sides );
|
|
128
133
|
const isMixed = isNaN( parseFloat( allValue ) );
|
|
129
134
|
|
|
@@ -133,11 +138,11 @@ export function isValuesMixed( values = {}, selectedUnits, sides = ALL_SIDES ) {
|
|
|
133
138
|
/**
|
|
134
139
|
* Checks to determine if values are defined.
|
|
135
140
|
*
|
|
136
|
-
* @param
|
|
141
|
+
* @param values Box values.
|
|
137
142
|
*
|
|
138
|
-
* @return
|
|
143
|
+
* @return Whether values are mixed.
|
|
139
144
|
*/
|
|
140
|
-
export function isValuesDefined( values ) {
|
|
145
|
+
export function isValuesDefined( values?: BoxControlValue ) {
|
|
141
146
|
return (
|
|
142
147
|
values !== undefined &&
|
|
143
148
|
Object.values( values ).filter(
|
|
@@ -153,12 +158,12 @@ export function isValuesDefined( values ) {
|
|
|
153
158
|
* Get initial selected side, factoring in whether the sides are linked,
|
|
154
159
|
* and whether the vertical / horizontal directions are grouped via splitOnAxis.
|
|
155
160
|
*
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
158
|
-
* @return
|
|
161
|
+
* @param isLinked Whether the box control's fields are linked.
|
|
162
|
+
* @param splitOnAxis Whether splitting by horizontal or vertical axis.
|
|
163
|
+
* @return The initial side.
|
|
159
164
|
*/
|
|
160
|
-
export function getInitialSide( isLinked, splitOnAxis ) {
|
|
161
|
-
let initialSide = 'all';
|
|
165
|
+
export function getInitialSide( isLinked: boolean, splitOnAxis: boolean ) {
|
|
166
|
+
let initialSide: keyof typeof LABELS = 'all';
|
|
162
167
|
|
|
163
168
|
if ( ! isLinked ) {
|
|
164
169
|
initialSide = splitOnAxis ? 'vertical' : 'top';
|
|
@@ -173,20 +178,20 @@ export function getInitialSide( isLinked, splitOnAxis ) {
|
|
|
173
178
|
* to their appropriate sides to facilitate correctly determining value for
|
|
174
179
|
* all input control.
|
|
175
180
|
*
|
|
176
|
-
* @param
|
|
177
|
-
* @return
|
|
181
|
+
* @param sides Available sides for box control.
|
|
182
|
+
* @return Normalized sides configuration.
|
|
178
183
|
*/
|
|
179
|
-
export function normalizeSides( sides ) {
|
|
180
|
-
const filteredSides = [];
|
|
184
|
+
export function normalizeSides( sides: BoxControlProps[ 'sides' ] ) {
|
|
185
|
+
const filteredSides: ( keyof BoxControlValue )[] = [];
|
|
181
186
|
|
|
182
187
|
if ( ! sides?.length ) {
|
|
183
188
|
return ALL_SIDES;
|
|
184
189
|
}
|
|
185
190
|
|
|
186
191
|
if ( sides.includes( 'vertical' ) ) {
|
|
187
|
-
filteredSides.push( ...[ 'top', 'bottom' ] );
|
|
192
|
+
filteredSides.push( ...( [ 'top', 'bottom' ] as const ) );
|
|
188
193
|
} else if ( sides.includes( 'horizontal' ) ) {
|
|
189
|
-
filteredSides.push( ...[ 'left', 'right' ] );
|
|
194
|
+
filteredSides.push( ...( [ 'left', 'right' ] as const ) );
|
|
190
195
|
} else {
|
|
191
196
|
const newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );
|
|
192
197
|
filteredSides.push( ...newSides );
|
|
@@ -199,13 +204,17 @@ export function normalizeSides( sides ) {
|
|
|
199
204
|
* Applies a value to an object representing top, right, bottom and left sides
|
|
200
205
|
* while taking into account any custom side configuration.
|
|
201
206
|
*
|
|
202
|
-
* @param
|
|
203
|
-
* @param
|
|
204
|
-
* @param
|
|
207
|
+
* @param currentValues The current values for each side.
|
|
208
|
+
* @param newValue The value to apply to the sides object.
|
|
209
|
+
* @param sides Array defining valid sides.
|
|
205
210
|
*
|
|
206
|
-
* @return
|
|
211
|
+
* @return Object containing the updated values for each side.
|
|
207
212
|
*/
|
|
208
|
-
export function applyValueToSides(
|
|
213
|
+
export function applyValueToSides(
|
|
214
|
+
currentValues: BoxControlValue,
|
|
215
|
+
newValue?: string,
|
|
216
|
+
sides?: BoxControlProps[ 'sides' ]
|
|
217
|
+
): BoxControlValue {
|
|
209
218
|
const newValues = { ...currentValues };
|
|
210
219
|
|
|
211
220
|
if ( sides?.length ) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -76,9 +77,14 @@ describe( 'Button', () => {
|
|
|
76
77
|
expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-pressed' );
|
|
77
78
|
} );
|
|
78
79
|
|
|
79
|
-
it( 'should render a button element with has-text when children are passed', () => {
|
|
80
|
+
it( 'should render a button element with has-text when children are passed', async () => {
|
|
81
|
+
const user = userEvent.setup();
|
|
82
|
+
|
|
80
83
|
render( <Button icon={ plusCircle }>Children</Button> );
|
|
81
|
-
|
|
84
|
+
|
|
85
|
+
// Move focus to the button
|
|
86
|
+
await user.tab();
|
|
87
|
+
|
|
82
88
|
expect( screen.getByRole( 'button' ) ).toHaveClass( 'has-text' );
|
|
83
89
|
} );
|
|
84
90
|
|
|
@@ -183,16 +189,14 @@ describe( 'Button', () => {
|
|
|
183
189
|
} );
|
|
184
190
|
|
|
185
191
|
it( 'should add an aria-label when the label property is used, with Tooltip wrapper', async () => {
|
|
192
|
+
const user = userEvent.setup();
|
|
193
|
+
|
|
186
194
|
render( <Button icon={ plusCircle } label="WordPress" /> );
|
|
187
|
-
// Wait for the `floating-ui` effects in `Tooltip`/`Popover` to finish running
|
|
188
|
-
// See also: https://floating-ui.com/docs/react-dom#testing
|
|
189
|
-
await act( () => Promise.resolve() );
|
|
190
195
|
|
|
191
196
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
192
197
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
} );
|
|
198
|
+
// Move focus to the button
|
|
199
|
+
await user.tab();
|
|
196
200
|
|
|
197
201
|
expect( screen.getByText( 'WordPress' ) ).toBeVisible();
|
|
198
202
|
} );
|
|
@@ -216,6 +220,8 @@ describe( 'Button', () => {
|
|
|
216
220
|
} );
|
|
217
221
|
|
|
218
222
|
it( 'should populate tooltip with label content for buttons without visible labels (no children)', async () => {
|
|
223
|
+
const user = userEvent.setup();
|
|
224
|
+
|
|
219
225
|
render(
|
|
220
226
|
<Button
|
|
221
227
|
describedBy="Description text"
|
|
@@ -223,13 +229,11 @@ describe( 'Button', () => {
|
|
|
223
229
|
icon={ plusCircle }
|
|
224
230
|
/>
|
|
225
231
|
);
|
|
226
|
-
await act( () => Promise.resolve() );
|
|
227
232
|
|
|
228
233
|
expect( screen.queryByText( 'Label' ) ).not.toBeInTheDocument();
|
|
229
234
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
} );
|
|
235
|
+
// Move focus to the button
|
|
236
|
+
await user.tab();
|
|
233
237
|
|
|
234
238
|
expect( screen.getByText( 'Label' ) ).toBeVisible();
|
|
235
239
|
} );
|
|
@@ -245,7 +249,6 @@ describe( 'Button', () => {
|
|
|
245
249
|
Children
|
|
246
250
|
</Button>
|
|
247
251
|
);
|
|
248
|
-
await act( () => Promise.resolve() );
|
|
249
252
|
|
|
250
253
|
expect(
|
|
251
254
|
screen.getByRole( 'button', {
|
|
@@ -254,7 +257,9 @@ describe( 'Button', () => {
|
|
|
254
257
|
).toBeVisible();
|
|
255
258
|
} );
|
|
256
259
|
|
|
257
|
-
it( 'should allow tooltip disable', () => {
|
|
260
|
+
it( 'should allow tooltip disable', async () => {
|
|
261
|
+
const user = userEvent.setup();
|
|
262
|
+
|
|
258
263
|
render(
|
|
259
264
|
<Button
|
|
260
265
|
icon={ plusCircle }
|
|
@@ -262,33 +267,37 @@ describe( 'Button', () => {
|
|
|
262
267
|
showTooltip={ false }
|
|
263
268
|
/>
|
|
264
269
|
);
|
|
265
|
-
const button = screen.getByRole( 'button', { name: 'WordPress' } );
|
|
266
270
|
|
|
267
|
-
expect(
|
|
271
|
+
expect(
|
|
272
|
+
screen.getByRole( 'button', { name: 'WordPress' } )
|
|
273
|
+
).toHaveAttribute( 'aria-label', 'WordPress' );
|
|
268
274
|
|
|
269
275
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
270
276
|
|
|
271
|
-
|
|
277
|
+
// Move focus to the button
|
|
278
|
+
await user.tab();
|
|
272
279
|
|
|
273
280
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
274
281
|
} );
|
|
275
282
|
|
|
276
283
|
it( 'should show the tooltip for empty children', async () => {
|
|
284
|
+
const user = userEvent.setup();
|
|
285
|
+
|
|
277
286
|
render(
|
|
278
287
|
<Button icon={ plusCircle } label="WordPress" children={ [] } />
|
|
279
288
|
);
|
|
280
|
-
await act( () => Promise.resolve() );
|
|
281
289
|
|
|
282
290
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
283
291
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
} );
|
|
292
|
+
// Move focus to the button
|
|
293
|
+
await user.tab();
|
|
287
294
|
|
|
288
295
|
expect( screen.getByText( 'WordPress' ) ).toBeVisible();
|
|
289
296
|
} );
|
|
290
297
|
|
|
291
|
-
it( 'should not show the tooltip when icon and children defined', () => {
|
|
298
|
+
it( 'should not show the tooltip when icon and children defined', async () => {
|
|
299
|
+
const user = userEvent.setup();
|
|
300
|
+
|
|
292
301
|
render(
|
|
293
302
|
<Button icon={ plusCircle } label="WordPress">
|
|
294
303
|
Children
|
|
@@ -297,26 +306,25 @@ describe( 'Button', () => {
|
|
|
297
306
|
|
|
298
307
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
299
308
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
} );
|
|
309
|
+
// Move focus to the button
|
|
310
|
+
await user.tab();
|
|
303
311
|
|
|
304
312
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
305
313
|
} );
|
|
306
314
|
|
|
307
315
|
it( 'should force showing the tooltip even if icon and children defined', async () => {
|
|
316
|
+
const user = userEvent.setup();
|
|
317
|
+
|
|
308
318
|
render(
|
|
309
319
|
<Button icon={ plusCircle } label="WordPress" showTooltip>
|
|
310
320
|
Children
|
|
311
321
|
</Button>
|
|
312
322
|
);
|
|
313
|
-
await act( () => Promise.resolve() );
|
|
314
323
|
|
|
315
324
|
expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
|
|
316
325
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
} );
|
|
326
|
+
// Move focus to the button
|
|
327
|
+
await user.tab();
|
|
320
328
|
|
|
321
329
|
expect( screen.getByText( 'WordPress' ) ).toBeVisible();
|
|
322
330
|
} );
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# `CircularOptionPicker`
|
|
2
|
+
|
|
3
|
+
<div class="callout callout-alert">
|
|
4
|
+
This component is not exported, and therefore can only be used internally to the `@wordpress/components` package.
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
`CircularOptionPicker` is a component that displays a set of options as circular buttons.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
import { CircularOptionPicker } from '../circular-option-picker';
|
|
13
|
+
import { useState } from '@wordpress/element';
|
|
14
|
+
|
|
15
|
+
const Example = () => {
|
|
16
|
+
const [ currentColor, setCurrentColor ] = useState();
|
|
17
|
+
const colors = [
|
|
18
|
+
{ color: '#f00', name: 'Red' },
|
|
19
|
+
{ color: '#0f0', name: 'Green' },
|
|
20
|
+
{ color: '#00f', name: 'Blue' },
|
|
21
|
+
];
|
|
22
|
+
const colorOptions = (
|
|
23
|
+
<>
|
|
24
|
+
{ colors.map( ( { color, name }, index ) => {
|
|
25
|
+
return (
|
|
26
|
+
<CircularOptionPicker.Option
|
|
27
|
+
key={ `${ color }-${ index }` }
|
|
28
|
+
tooltipText={ name }
|
|
29
|
+
style={ { backgroundColor: color, color } }
|
|
30
|
+
isSelected={ index === currentColor }
|
|
31
|
+
onClick={ () => setCurrentColor( index ) }
|
|
32
|
+
aria-label={ name }
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
} ) }
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
return (
|
|
39
|
+
<CircularOptionPicker
|
|
40
|
+
options={ colorOptions }
|
|
41
|
+
actions={
|
|
42
|
+
<CircularOptionPicker.ButtonAction
|
|
43
|
+
onClick={ () => setCurrentColor( undefined ) }
|
|
44
|
+
>
|
|
45
|
+
{ 'Clear' }
|
|
46
|
+
</CircularOptionPicker.ButtonAction>
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Props
|
|
54
|
+
|
|
55
|
+
### `className`: `string`
|
|
56
|
+
|
|
57
|
+
A CSS class to apply to the wrapper element.
|
|
58
|
+
|
|
59
|
+
- Required: No
|
|
60
|
+
|
|
61
|
+
### `actions`: `ReactNode`
|
|
62
|
+
|
|
63
|
+
The action(s) to be rendered after the options, such as a 'clear' button as seen in `ColorPalette`.
|
|
64
|
+
|
|
65
|
+
Usually a `CircularOptionPicker.ButtonAction` or `CircularOptionPicker.DropdownLinkAction` component.
|
|
66
|
+
|
|
67
|
+
- Required: No
|
|
68
|
+
|
|
69
|
+
### `options`: `ReactNode`
|
|
70
|
+
|
|
71
|
+
The options to be rendered, such as color swatches.
|
|
72
|
+
|
|
73
|
+
Usually a `CircularOptionPicker.Option` component.
|
|
74
|
+
|
|
75
|
+
- Required: No
|
|
76
|
+
|
|
77
|
+
### `children`: `ReactNode`
|
|
78
|
+
|
|
79
|
+
The child elements.
|
|
80
|
+
|
|
81
|
+
- Required: No
|
|
82
|
+
|
|
83
|
+
## Subcomponents
|
|
84
|
+
|
|
85
|
+
### `CircularOptionPicker.ButtonAction`
|
|
86
|
+
|
|
87
|
+
A `ButtonAction` is an action that is rendered as a button alongside the options themselves.
|
|
88
|
+
|
|
89
|
+
A common use case is a 'clear' button to deselect the currently selected option.
|
|
90
|
+
|
|
91
|
+
#### Props
|
|
92
|
+
|
|
93
|
+
##### `className`: `string`
|
|
94
|
+
|
|
95
|
+
A CSS class to apply to the underlying `Button` component.
|
|
96
|
+
|
|
97
|
+
- Required: No
|
|
98
|
+
|
|
99
|
+
##### `children`: `ReactNode`
|
|
100
|
+
|
|
101
|
+
The button's children.
|
|
102
|
+
|
|
103
|
+
- Required: No
|
|
104
|
+
|
|
105
|
+
##### Inherited props
|
|
106
|
+
|
|
107
|
+
`CircularOptionPicker.ButtonAction` also inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href` and `target`.
|
|
108
|
+
|
|
109
|
+
### `CircularOptionPicker.DropdownLinkAction`
|
|
110
|
+
|
|
111
|
+
`CircularOptionPicker.DropdownLinkAction` is an action that's hidden behind a dropdown toggle. The button is formatted as a link and rendered as an `anchor` element.
|
|
112
|
+
|
|
113
|
+
#### Props
|
|
114
|
+
|
|
115
|
+
##### `className`: `string`
|
|
116
|
+
|
|
117
|
+
A CSS class to apply to the underlying `Dropdown` component.
|
|
118
|
+
|
|
119
|
+
- Required: No
|
|
120
|
+
|
|
121
|
+
##### `linkText`: `string`
|
|
122
|
+
|
|
123
|
+
The text to be displayed on the button.
|
|
124
|
+
|
|
125
|
+
- Required: Yes
|
|
126
|
+
|
|
127
|
+
##### `dropdownProps`: `object`
|
|
128
|
+
|
|
129
|
+
The props for the underlying `Dropdown` component.
|
|
130
|
+
|
|
131
|
+
Inherits all of the [`Dropdown` props](/packages/components/src/dropdown/README.md#props), except for `className` and `renderToggle`.
|
|
132
|
+
|
|
133
|
+
- Required: Yes
|
|
134
|
+
|
|
135
|
+
##### `buttonProps`: `object`
|
|
136
|
+
|
|
137
|
+
Props for the underlying `Button` component.
|
|
138
|
+
|
|
139
|
+
Inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`, `target`, and `children`.
|
|
140
|
+
|
|
141
|
+
- Required: No
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
@@ -15,15 +14,21 @@ import { Icon, check } from '@wordpress/icons';
|
|
|
15
14
|
import Button from '../button';
|
|
16
15
|
import Dropdown from '../dropdown';
|
|
17
16
|
import Tooltip from '../tooltip';
|
|
17
|
+
import type {
|
|
18
|
+
CircularOptionPickerProps,
|
|
19
|
+
DropdownLinkActionProps,
|
|
20
|
+
OptionProps,
|
|
21
|
+
} from './types';
|
|
22
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
23
|
+
import type { ButtonAsButtonProps } from '../button/types';
|
|
18
24
|
|
|
19
|
-
function Option(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = props;
|
|
25
|
+
export function Option( {
|
|
26
|
+
className,
|
|
27
|
+
isSelected,
|
|
28
|
+
selectedIconProps,
|
|
29
|
+
tooltipText,
|
|
30
|
+
...additionalProps
|
|
31
|
+
}: OptionProps ) {
|
|
27
32
|
const optionButton = (
|
|
28
33
|
<Button
|
|
29
34
|
isPressed={ isSelected }
|
|
@@ -53,8 +58,12 @@ function Option( props ) {
|
|
|
53
58
|
);
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
function DropdownLinkAction(
|
|
57
|
-
|
|
61
|
+
export function DropdownLinkAction( {
|
|
62
|
+
buttonProps,
|
|
63
|
+
className,
|
|
64
|
+
dropdownProps,
|
|
65
|
+
linkText,
|
|
66
|
+
}: DropdownLinkActionProps ) {
|
|
58
67
|
return (
|
|
59
68
|
<Dropdown
|
|
60
69
|
className={ classnames(
|
|
@@ -77,8 +86,11 @@ function DropdownLinkAction( props ) {
|
|
|
77
86
|
);
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
function ButtonAction(
|
|
81
|
-
|
|
89
|
+
export function ButtonAction( {
|
|
90
|
+
className,
|
|
91
|
+
children,
|
|
92
|
+
...additionalProps
|
|
93
|
+
}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {
|
|
82
94
|
return (
|
|
83
95
|
<Button
|
|
84
96
|
className={ classnames(
|
|
@@ -93,7 +105,53 @@ function ButtonAction( props ) {
|
|
|
93
105
|
);
|
|
94
106
|
}
|
|
95
107
|
|
|
96
|
-
|
|
108
|
+
/**
|
|
109
|
+
*`CircularOptionPicker` is a component that displays a set of options as circular buttons.
|
|
110
|
+
*
|
|
111
|
+
* ```jsx
|
|
112
|
+
* import { CircularOptionPicker } from '../circular-option-picker';
|
|
113
|
+
* import { useState } from '@wordpress/element';
|
|
114
|
+
*
|
|
115
|
+
* const Example = () => {
|
|
116
|
+
* const [ currentColor, setCurrentColor ] = useState();
|
|
117
|
+
* const colors = [
|
|
118
|
+
* { color: '#f00', name: 'Red' },
|
|
119
|
+
* { color: '#0f0', name: 'Green' },
|
|
120
|
+
* { color: '#00f', name: 'Blue' },
|
|
121
|
+
* ];
|
|
122
|
+
* const colorOptions = (
|
|
123
|
+
* <>
|
|
124
|
+
* { colors.map( ( { color, name }, index ) => {
|
|
125
|
+
* return (
|
|
126
|
+
* <CircularOptionPicker.Option
|
|
127
|
+
* key={ `${ color }-${ index }` }
|
|
128
|
+
* tooltipText={ name }
|
|
129
|
+
* style={ { backgroundColor: color, color } }
|
|
130
|
+
* isSelected={ index === currentColor }
|
|
131
|
+
* onClick={ () => setCurrentColor( index ) }
|
|
132
|
+
* aria-label={ name }
|
|
133
|
+
* />
|
|
134
|
+
* );
|
|
135
|
+
* } ) }
|
|
136
|
+
* </>
|
|
137
|
+
* );
|
|
138
|
+
* return (
|
|
139
|
+
* <CircularOptionPicker
|
|
140
|
+
* options={ colorOptions }
|
|
141
|
+
* actions={
|
|
142
|
+
* <CircularOptionPicker.ButtonAction
|
|
143
|
+
* onClick={ () => setCurrentColor( undefined ) }
|
|
144
|
+
* >
|
|
145
|
+
* { 'Clear' }
|
|
146
|
+
* </CircularOptionPicker.ButtonAction>
|
|
147
|
+
* }
|
|
148
|
+
* />
|
|
149
|
+
* );
|
|
150
|
+
* };
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
function CircularOptionPicker( props: CircularOptionPickerProps ) {
|
|
97
155
|
const { actions, className, options, children } = props;
|
|
98
156
|
return (
|
|
99
157
|
<div
|
|
@@ -118,3 +176,5 @@ export default function CircularOptionPicker( props ) {
|
|
|
118
176
|
CircularOptionPicker.Option = Option;
|
|
119
177
|
CircularOptionPicker.ButtonAction = ButtonAction;
|
|
120
178
|
CircularOptionPicker.DropdownLinkAction = DropdownLinkAction;
|
|
179
|
+
|
|
180
|
+
export default CircularOptionPicker;
|