@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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
/**
|
|
6
|
+
* WordPress dependencies
|
|
7
|
+
*/
|
|
8
|
+
import { useState, createContext, useContext } from '@wordpress/element';
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import {
|
|
13
|
+
default as CircularOptionPicker,
|
|
14
|
+
ButtonAction,
|
|
15
|
+
DropdownLinkAction,
|
|
16
|
+
Option,
|
|
17
|
+
} from '..';
|
|
18
|
+
|
|
19
|
+
const CircularOptionPickerStoryContext = createContext< {
|
|
20
|
+
currentColor?: string;
|
|
21
|
+
setCurrentColor?: ( v: string | undefined ) => void;
|
|
22
|
+
} >( {} );
|
|
23
|
+
|
|
24
|
+
const meta: ComponentMeta< typeof CircularOptionPicker > = {
|
|
25
|
+
title: 'Components/CircularOptionPicker',
|
|
26
|
+
component: CircularOptionPicker,
|
|
27
|
+
subcomponents: {
|
|
28
|
+
'CircularOptionPicker.Option': Option,
|
|
29
|
+
'CircularOptionPicker.ButtonAction': ButtonAction,
|
|
30
|
+
'CircularOptionPicker.DropdownLinkAction': DropdownLinkAction,
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
actions: { control: { type: null } },
|
|
34
|
+
options: { control: { type: null } },
|
|
35
|
+
children: { control: { type: 'text' } },
|
|
36
|
+
},
|
|
37
|
+
parameters: {
|
|
38
|
+
actions: { argTypesRegex: '^on.*' },
|
|
39
|
+
controls: { expanded: true },
|
|
40
|
+
docs: { source: { state: 'open', excludeDecorators: true } },
|
|
41
|
+
},
|
|
42
|
+
decorators: [
|
|
43
|
+
// Share current color state between main component, `actions` and `options`
|
|
44
|
+
( Story ) => {
|
|
45
|
+
const [ currentColor, setCurrentColor ] = useState< string >();
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<CircularOptionPickerStoryContext.Provider
|
|
49
|
+
value={ {
|
|
50
|
+
currentColor,
|
|
51
|
+
setCurrentColor,
|
|
52
|
+
} }
|
|
53
|
+
>
|
|
54
|
+
<Story />
|
|
55
|
+
</CircularOptionPickerStoryContext.Provider>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
export default meta;
|
|
61
|
+
|
|
62
|
+
const colors = [
|
|
63
|
+
{ color: '#f00', name: 'Red' },
|
|
64
|
+
{ color: '#0f0', name: 'Green' },
|
|
65
|
+
{ color: '#0af', name: 'Blue' },
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const DefaultOptions = () => {
|
|
69
|
+
const { currentColor, setCurrentColor } = useContext(
|
|
70
|
+
CircularOptionPickerStoryContext
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
{ colors.map( ( { color, name }, index ) => {
|
|
76
|
+
return (
|
|
77
|
+
<CircularOptionPicker.Option
|
|
78
|
+
key={ `${ color }-${ index }` }
|
|
79
|
+
tooltipText={ name }
|
|
80
|
+
style={ { backgroundColor: color, color } }
|
|
81
|
+
isSelected={ color === currentColor }
|
|
82
|
+
onClick={ () => {
|
|
83
|
+
setCurrentColor?.( color );
|
|
84
|
+
} }
|
|
85
|
+
aria-label={ name }
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
} ) }
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const DefaultActions = () => {
|
|
94
|
+
const { setCurrentColor } = useContext( CircularOptionPickerStoryContext );
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<CircularOptionPicker.ButtonAction
|
|
98
|
+
onClick={ () => setCurrentColor?.( undefined ) }
|
|
99
|
+
>
|
|
100
|
+
{ 'Clear' }
|
|
101
|
+
</CircularOptionPicker.ButtonAction>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const Template: ComponentStory< typeof CircularOptionPicker > = ( props ) => (
|
|
106
|
+
<CircularOptionPicker { ...props } />
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
export const Default = Template.bind( {} );
|
|
110
|
+
Default.args = { options: <DefaultOptions /> };
|
|
111
|
+
|
|
112
|
+
export const WithButtonAction = Template.bind( {} );
|
|
113
|
+
WithButtonAction.args = {
|
|
114
|
+
...Default.args,
|
|
115
|
+
actions: <DefaultActions />,
|
|
116
|
+
};
|
|
117
|
+
WithButtonAction.storyName = 'With ButtonAction';
|
|
118
|
+
|
|
119
|
+
export const WithDropdownLinkAction = Template.bind( {} );
|
|
120
|
+
WithDropdownLinkAction.args = {
|
|
121
|
+
...Default.args,
|
|
122
|
+
actions: (
|
|
123
|
+
<CircularOptionPicker.DropdownLinkAction
|
|
124
|
+
dropdownProps={ {
|
|
125
|
+
popoverProps: { position: 'top right' },
|
|
126
|
+
renderContent: () => (
|
|
127
|
+
<div>This is an example of a DropdownLinkAction.</div>
|
|
128
|
+
),
|
|
129
|
+
} }
|
|
130
|
+
linkText="Learn More"
|
|
131
|
+
></CircularOptionPicker.DropdownLinkAction>
|
|
132
|
+
),
|
|
133
|
+
};
|
|
134
|
+
WithDropdownLinkAction.storyName = 'With DropdownLinkAction';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { Icon } from '@wordpress/icons';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import type { ButtonAsButtonProps } from '../button/types';
|
|
15
|
+
import type Dropdown from '../dropdown';
|
|
16
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
17
|
+
|
|
18
|
+
export type CircularOptionPickerProps = {
|
|
19
|
+
/**
|
|
20
|
+
* A CSS class to apply to the wrapper element.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The action(s) to be rendered after the options,
|
|
25
|
+
* such as a 'clear' button as seen in `ColorPalette`.
|
|
26
|
+
* Usually a `CircularOptionPicker.ButtonAction` or
|
|
27
|
+
* `CircularOptionPicker.DropdownLinkAction` component.
|
|
28
|
+
*/
|
|
29
|
+
actions?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The options to be rendered, such as color swatches.
|
|
32
|
+
* Usually a `CircularOptionPicker.Option` component.
|
|
33
|
+
*/
|
|
34
|
+
options: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* The child elements.
|
|
37
|
+
*/
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type DropdownLinkActionProps = {
|
|
42
|
+
buttonProps?: Omit<
|
|
43
|
+
WordPressComponentProps< ButtonAsButtonProps, 'button', false >,
|
|
44
|
+
'children'
|
|
45
|
+
>;
|
|
46
|
+
linkText: string;
|
|
47
|
+
dropdownProps: Omit<
|
|
48
|
+
React.ComponentProps< typeof Dropdown >,
|
|
49
|
+
'className' | 'renderToggle'
|
|
50
|
+
>;
|
|
51
|
+
className?: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type OptionProps = Omit<
|
|
55
|
+
WordPressComponentProps< ButtonAsButtonProps, 'button', false >,
|
|
56
|
+
'isPressed' | 'className'
|
|
57
|
+
> & {
|
|
58
|
+
className?: string;
|
|
59
|
+
tooltipText?: string;
|
|
60
|
+
isSelected: boolean;
|
|
61
|
+
// `icon` is explicitly defined as 'check' by CircleOptionPicker.Option
|
|
62
|
+
// and is not intended to be overridden.
|
|
63
|
+
// `size` relies on the `Icon` component's default size of `24` to fit
|
|
64
|
+
// `CircularOptionPicker`'s design, and should not be explicitly set.
|
|
65
|
+
selectedIconProps?: Omit<
|
|
66
|
+
React.ComponentProps< typeof Icon >,
|
|
67
|
+
'icon' | 'size'
|
|
68
|
+
>;
|
|
69
|
+
};
|
|
@@ -66,6 +66,13 @@ colors.
|
|
|
66
66
|
- Required: No
|
|
67
67
|
- Default: `false`
|
|
68
68
|
|
|
69
|
+
### `headingLevel`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
70
|
+
|
|
71
|
+
The heading level.
|
|
72
|
+
|
|
73
|
+
- Required: No
|
|
74
|
+
- Default: `2`
|
|
75
|
+
|
|
69
76
|
### `value`: `string`
|
|
70
77
|
|
|
71
78
|
Currently active value.
|
|
@@ -107,6 +107,7 @@ function MultiplePalettes( {
|
|
|
107
107
|
onChange,
|
|
108
108
|
value,
|
|
109
109
|
actions,
|
|
110
|
+
headingLevel,
|
|
110
111
|
}: MultiplePalettesProps ) {
|
|
111
112
|
if ( colors.length === 0 ) {
|
|
112
113
|
return null;
|
|
@@ -117,7 +118,9 @@ function MultiplePalettes( {
|
|
|
117
118
|
{ colors.map( ( { name, colors: colorPalette }, index ) => {
|
|
118
119
|
return (
|
|
119
120
|
<VStack spacing={ 2 } key={ index }>
|
|
120
|
-
<ColorHeading
|
|
121
|
+
<ColorHeading level={ headingLevel }>
|
|
122
|
+
{ name }
|
|
123
|
+
</ColorHeading>
|
|
121
124
|
<SinglePalette
|
|
122
125
|
clearColor={ clearColor }
|
|
123
126
|
colors={ colorPalette }
|
|
@@ -182,6 +185,7 @@ function UnforwardedColorPalette(
|
|
|
182
185
|
onChange,
|
|
183
186
|
value,
|
|
184
187
|
__experimentalIsRenderedInSidebar = false,
|
|
188
|
+
headingLevel = 2,
|
|
185
189
|
...otherProps
|
|
186
190
|
} = props;
|
|
187
191
|
const [ normalizedColorValue, setNormalizedColorValue ] = useState( value );
|
|
@@ -243,6 +247,7 @@ function UnforwardedColorPalette(
|
|
|
243
247
|
{ __( 'Clear' ) }
|
|
244
248
|
</CircularOptionPicker.ButtonAction>
|
|
245
249
|
),
|
|
250
|
+
headingLevel,
|
|
246
251
|
};
|
|
247
252
|
|
|
248
253
|
return (
|
|
@@ -179,7 +179,7 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
|
|
|
179
179
|
<button
|
|
180
180
|
aria-expanded="false"
|
|
181
181
|
aria-haspopup="true"
|
|
182
|
-
aria-label="Custom color picker. The currently selected color is called
|
|
182
|
+
aria-label="Custom color picker. The currently selected color is called "red" and has a value of "f00"."
|
|
183
183
|
class="components-flex components-color-palette__custom-color emotion-2 emotion-1"
|
|
184
184
|
data-wp-c16t="true"
|
|
185
185
|
data-wp-component="Flex"
|
|
@@ -7,6 +7,7 @@ import type { CSSProperties, ReactNode } from 'react';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import type { DropdownProps } from '../dropdown/types';
|
|
10
|
+
import type { HeadingSize } from '../heading/types';
|
|
10
11
|
|
|
11
12
|
export type ColorObject = {
|
|
12
13
|
name: string;
|
|
@@ -27,6 +28,7 @@ type PaletteProps = {
|
|
|
27
28
|
onChange: ( newColor?: string, index?: number ) => void;
|
|
28
29
|
value?: string;
|
|
29
30
|
actions?: ReactNode;
|
|
31
|
+
headingLevel?: HeadingSize;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export type SinglePaletteProps = PaletteProps & {
|
|
@@ -70,6 +72,12 @@ export type ColorPaletteProps = Pick< PaletteProps, 'onChange' > & {
|
|
|
70
72
|
* @default false
|
|
71
73
|
*/
|
|
72
74
|
enableAlpha?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The heading level.
|
|
77
|
+
*
|
|
78
|
+
* @default 2
|
|
79
|
+
*/
|
|
80
|
+
headingLevel?: HeadingSize;
|
|
73
81
|
/**
|
|
74
82
|
* Currently active value.
|
|
75
83
|
*/
|
|
@@ -17,9 +17,6 @@ These are the same as [the ones for `SelectControl`s](/packages/components/src/s
|
|
|
17
17
|
### Usage
|
|
18
18
|
|
|
19
19
|
```jsx
|
|
20
|
-
/**
|
|
21
|
-
* WordPress dependencies
|
|
22
|
-
*/
|
|
23
20
|
import { ComboboxControl } from '@wordpress/components';
|
|
24
21
|
import { useState } from '@wordpress/element';
|
|
25
22
|
|
|
@@ -36,10 +33,6 @@ const options = [
|
|
|
36
33
|
value: 'large',
|
|
37
34
|
label: 'Large',
|
|
38
35
|
},
|
|
39
|
-
{
|
|
40
|
-
value: 'huge',
|
|
41
|
-
label: 'Huge',
|
|
42
|
-
},
|
|
43
36
|
];
|
|
44
37
|
|
|
45
38
|
function MyComboboxControl() {
|
|
@@ -92,35 +85,35 @@ If this property is added, a help text will be generated using help property as
|
|
|
92
85
|
|
|
93
86
|
The options that can be chosen from.
|
|
94
87
|
|
|
95
|
-
- Type: `Array<{ value:
|
|
88
|
+
- Type: `Array<{ value: string, label: string }>`
|
|
96
89
|
- Required: Yes
|
|
97
90
|
|
|
98
91
|
#### onFilterValueChange
|
|
99
92
|
|
|
100
|
-
Function called
|
|
93
|
+
Function called when the control's search input value changes. The argument contains the next input value.
|
|
101
94
|
|
|
102
|
-
- Type: `
|
|
95
|
+
- Type: `( value: string ) => void`
|
|
103
96
|
- Required: No
|
|
104
97
|
|
|
105
98
|
#### onChange
|
|
106
99
|
|
|
107
100
|
Function called with the selected value changes.
|
|
108
101
|
|
|
109
|
-
- Type: `
|
|
102
|
+
- Type: `( value: string | null | undefined ) => void`
|
|
110
103
|
- Required: No
|
|
111
104
|
|
|
112
105
|
#### value
|
|
113
106
|
|
|
114
|
-
The current value of the
|
|
107
|
+
The current value of the control.
|
|
115
108
|
|
|
116
|
-
- Type: `
|
|
117
|
-
- Required:
|
|
109
|
+
- Type: `string | null`
|
|
110
|
+
- Required: No
|
|
118
111
|
|
|
119
112
|
#### __experimentalRenderItem
|
|
120
113
|
|
|
121
114
|
Custom renderer invoked for each option in the suggestion list. The render prop receives as its argument an object containing, under the `item` key, the single option's data (directly from the array of data passed to the `options` prop).
|
|
122
115
|
|
|
123
|
-
- Type: `
|
|
116
|
+
- Type: `( args: { item: object } ) => ReactNode`
|
|
124
117
|
- Required: No
|
|
125
118
|
|
|
126
119
|
## Related components
|
|
@@ -30,25 +30,83 @@ import { FlexBlock, FlexItem } from '../flex';
|
|
|
30
30
|
import withFocusOutside from '../higher-order/with-focus-outside';
|
|
31
31
|
import { useControlledValue } from '../utils/hooks';
|
|
32
32
|
import { normalizeTextString } from '../utils/strings';
|
|
33
|
+
import type { ComboboxControlOption, ComboboxControlProps } from './types';
|
|
34
|
+
import type { TokenInputProps } from '../form-token-field/types';
|
|
33
35
|
|
|
34
36
|
const noop = () => {};
|
|
35
37
|
|
|
36
38
|
const DetectOutside = withFocusOutside(
|
|
37
39
|
class extends Component {
|
|
40
|
+
// @ts-expect-error - TODO: Should be resolved when `withFocusOutside` is refactored to TypeScript
|
|
38
41
|
handleFocusOutside( event ) {
|
|
42
|
+
// @ts-expect-error - TODO: Should be resolved when `withFocusOutside` is refactored to TypeScript
|
|
39
43
|
this.props.onFocusOutside( event );
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
render() {
|
|
47
|
+
// @ts-expect-error - TODO: Should be resolved when `withFocusOutside` is refactored to TypeScript
|
|
43
48
|
return this.props.children;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
);
|
|
47
52
|
|
|
53
|
+
const getIndexOfMatchingSuggestion = (
|
|
54
|
+
selectedSuggestion: ComboboxControlOption | null,
|
|
55
|
+
matchingSuggestions: ComboboxControlOption[]
|
|
56
|
+
) =>
|
|
57
|
+
selectedSuggestion === null
|
|
58
|
+
? -1
|
|
59
|
+
: matchingSuggestions.indexOf( selectedSuggestion );
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* `ComboboxControl` is an enhanced version of a [`SelectControl`](../select-control/README.md) with the addition of
|
|
63
|
+
* being able to search for options using a search input.
|
|
64
|
+
*
|
|
65
|
+
* ```jsx
|
|
66
|
+
* import { ComboboxControl } from '@wordpress/components';
|
|
67
|
+
* import { useState } from '@wordpress/element';
|
|
68
|
+
*
|
|
69
|
+
* const options = [
|
|
70
|
+
* {
|
|
71
|
+
* value: 'small',
|
|
72
|
+
* label: 'Small',
|
|
73
|
+
* },
|
|
74
|
+
* {
|
|
75
|
+
* value: 'normal',
|
|
76
|
+
* label: 'Normal',
|
|
77
|
+
* },
|
|
78
|
+
* {
|
|
79
|
+
* value: 'large',
|
|
80
|
+
* label: 'Large',
|
|
81
|
+
* },
|
|
82
|
+
* ];
|
|
83
|
+
*
|
|
84
|
+
* function MyComboboxControl() {
|
|
85
|
+
* const [ fontSize, setFontSize ] = useState();
|
|
86
|
+
* const [ filteredOptions, setFilteredOptions ] = useState( options );
|
|
87
|
+
* return (
|
|
88
|
+
* <ComboboxControl
|
|
89
|
+
* label="Font Size"
|
|
90
|
+
* value={ fontSize }
|
|
91
|
+
* onChange={ setFontSize }
|
|
92
|
+
* options={ filteredOptions }
|
|
93
|
+
* onFilterValueChange={ ( inputValue ) =>
|
|
94
|
+
* setFilteredOptions(
|
|
95
|
+
* options.filter( ( option ) =>
|
|
96
|
+
* option.label
|
|
97
|
+
* .toLowerCase()
|
|
98
|
+
* .startsWith( inputValue.toLowerCase() )
|
|
99
|
+
* )
|
|
100
|
+
* )
|
|
101
|
+
* }
|
|
102
|
+
* />
|
|
103
|
+
* );
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
48
107
|
function ComboboxControl( {
|
|
49
|
-
/** Start opting into the new margin-free styles that will become the default in a future version. */
|
|
50
108
|
__nextHasNoMarginBottom = false,
|
|
51
|
-
__next36pxDefaultSize,
|
|
109
|
+
__next36pxDefaultSize = false,
|
|
52
110
|
value: valueProp,
|
|
53
111
|
label,
|
|
54
112
|
options,
|
|
@@ -62,7 +120,7 @@ function ComboboxControl( {
|
|
|
62
120
|
selected: __( 'Item selected.' ),
|
|
63
121
|
},
|
|
64
122
|
__experimentalRenderItem,
|
|
65
|
-
} ) {
|
|
123
|
+
}: ComboboxControlProps ) {
|
|
66
124
|
const [ value, setValue ] = useControlledValue( {
|
|
67
125
|
value: valueProp,
|
|
68
126
|
onChange: onChangeProp,
|
|
@@ -80,11 +138,11 @@ function ComboboxControl( {
|
|
|
80
138
|
const [ isExpanded, setIsExpanded ] = useState( false );
|
|
81
139
|
const [ inputHasFocus, setInputHasFocus ] = useState( false );
|
|
82
140
|
const [ inputValue, setInputValue ] = useState( '' );
|
|
83
|
-
const inputContainer = useRef();
|
|
141
|
+
const inputContainer = useRef< HTMLInputElement >( null );
|
|
84
142
|
|
|
85
143
|
const matchingSuggestions = useMemo( () => {
|
|
86
|
-
const startsWithMatch = [];
|
|
87
|
-
const containsMatch = [];
|
|
144
|
+
const startsWithMatch: ComboboxControlOption[] = [];
|
|
145
|
+
const containsMatch: ComboboxControlOption[] = [];
|
|
88
146
|
const match = normalizeTextString( inputValue );
|
|
89
147
|
options.forEach( ( option ) => {
|
|
90
148
|
const index = normalizeTextString( option.label ).indexOf( match );
|
|
@@ -98,7 +156,9 @@ function ComboboxControl( {
|
|
|
98
156
|
return startsWithMatch.concat( containsMatch );
|
|
99
157
|
}, [ inputValue, options ] );
|
|
100
158
|
|
|
101
|
-
const onSuggestionSelected = (
|
|
159
|
+
const onSuggestionSelected = (
|
|
160
|
+
newSelectedSuggestion: ComboboxControlOption
|
|
161
|
+
) => {
|
|
102
162
|
setValue( newSelectedSuggestion.value );
|
|
103
163
|
speak( messages.selected, 'assertive' );
|
|
104
164
|
setSelectedSuggestion( newSelectedSuggestion );
|
|
@@ -107,7 +167,10 @@ function ComboboxControl( {
|
|
|
107
167
|
};
|
|
108
168
|
|
|
109
169
|
const handleArrowNavigation = ( offset = 1 ) => {
|
|
110
|
-
const index =
|
|
170
|
+
const index = getIndexOfMatchingSuggestion(
|
|
171
|
+
selectedSuggestion,
|
|
172
|
+
matchingSuggestions
|
|
173
|
+
);
|
|
111
174
|
let nextIndex = index + offset;
|
|
112
175
|
if ( nextIndex < 0 ) {
|
|
113
176
|
nextIndex = matchingSuggestions.length - 1;
|
|
@@ -118,7 +181,9 @@ function ComboboxControl( {
|
|
|
118
181
|
setIsExpanded( true );
|
|
119
182
|
};
|
|
120
183
|
|
|
121
|
-
const onKeyDown
|
|
184
|
+
const onKeyDown: React.KeyboardEventHandler< HTMLDivElement > = (
|
|
185
|
+
event
|
|
186
|
+
) => {
|
|
122
187
|
let preventDefault = false;
|
|
123
188
|
|
|
124
189
|
if (
|
|
@@ -177,7 +242,7 @@ function ComboboxControl( {
|
|
|
177
242
|
setIsExpanded( false );
|
|
178
243
|
};
|
|
179
244
|
|
|
180
|
-
const onInputChange = ( event ) => {
|
|
245
|
+
const onInputChange: TokenInputProps[ 'onChange' ] = ( event ) => {
|
|
181
246
|
const text = event.value;
|
|
182
247
|
setInputValue( text );
|
|
183
248
|
onFilterValueChange( text );
|
|
@@ -188,14 +253,17 @@ function ComboboxControl( {
|
|
|
188
253
|
|
|
189
254
|
const handleOnReset = () => {
|
|
190
255
|
setValue( null );
|
|
191
|
-
inputContainer.current
|
|
256
|
+
inputContainer.current?.focus();
|
|
192
257
|
};
|
|
193
258
|
|
|
194
259
|
// Update current selections when the filter input changes.
|
|
195
260
|
useEffect( () => {
|
|
196
261
|
const hasMatchingSuggestions = matchingSuggestions.length > 0;
|
|
197
262
|
const hasSelectedMatchingSuggestions =
|
|
198
|
-
|
|
263
|
+
getIndexOfMatchingSuggestion(
|
|
264
|
+
selectedSuggestion,
|
|
265
|
+
matchingSuggestions
|
|
266
|
+
) > 0;
|
|
199
267
|
|
|
200
268
|
if ( hasMatchingSuggestions && ! hasSelectedMatchingSuggestions ) {
|
|
201
269
|
// If the current selection isn't present in the list of suggestions, then automatically select the first item from the list of suggestions.
|
|
@@ -235,7 +303,6 @@ function ComboboxControl( {
|
|
|
235
303
|
className,
|
|
236
304
|
'components-combobox-control'
|
|
237
305
|
) }
|
|
238
|
-
tabIndex="-1"
|
|
239
306
|
label={ label }
|
|
240
307
|
id={ `components-form-token-input-${ instanceId }` }
|
|
241
308
|
hideLabelFromVision={ hideLabelFromVision }
|
|
@@ -243,7 +310,7 @@ function ComboboxControl( {
|
|
|
243
310
|
>
|
|
244
311
|
<div
|
|
245
312
|
className="components-combobox-control__suggestions-container"
|
|
246
|
-
tabIndex=
|
|
313
|
+
tabIndex={ -1 }
|
|
247
314
|
onKeyDown={ onKeyDown }
|
|
248
315
|
>
|
|
249
316
|
<InputWrapperFlex
|
|
@@ -258,8 +325,9 @@ function ComboboxControl( {
|
|
|
258
325
|
onFocus={ onFocus }
|
|
259
326
|
onBlur={ onBlur }
|
|
260
327
|
isExpanded={ isExpanded }
|
|
261
|
-
selectedSuggestionIndex={
|
|
262
|
-
selectedSuggestion
|
|
328
|
+
selectedSuggestionIndex={ getIndexOfMatchingSuggestion(
|
|
329
|
+
selectedSuggestion,
|
|
330
|
+
matchingSuggestions
|
|
263
331
|
) }
|
|
264
332
|
onChange={ onInputChange }
|
|
265
333
|
/>
|
|
@@ -279,13 +347,17 @@ function ComboboxControl( {
|
|
|
279
347
|
{ isExpanded && (
|
|
280
348
|
<SuggestionsList
|
|
281
349
|
instanceId={ instanceId }
|
|
282
|
-
|
|
350
|
+
// The empty string for `value` here is not actually used, but is
|
|
351
|
+
// just a quick way to satisfy the TypeScript requirements of SuggestionsList.
|
|
352
|
+
// See: https://github.com/WordPress/gutenberg/pull/47581/files#r1091089330
|
|
353
|
+
match={ { label: inputValue, value: '' } }
|
|
283
354
|
displayTransform={ ( suggestion ) =>
|
|
284
355
|
suggestion.label
|
|
285
356
|
}
|
|
286
357
|
suggestions={ matchingSuggestions }
|
|
287
|
-
selectedIndex={
|
|
288
|
-
selectedSuggestion
|
|
358
|
+
selectedIndex={ getIndexOfMatchingSuggestion(
|
|
359
|
+
selectedSuggestion,
|
|
360
|
+
matchingSuggestions
|
|
289
361
|
) }
|
|
290
362
|
onHover={ setSelectedSuggestion }
|
|
291
363
|
onSelect={ onSuggestionSelected }
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import ComboboxControl from '..';
|
|
15
|
+
import type { ComboboxControlProps } from '../types';
|
|
16
|
+
|
|
17
|
+
const countries = [
|
|
18
|
+
{ name: 'Afghanistan', code: 'AF' },
|
|
19
|
+
{ name: 'Åland Islands', code: 'AX' },
|
|
20
|
+
{ name: 'Albania', code: 'AL' },
|
|
21
|
+
{ name: 'Algeria', code: 'DZ' },
|
|
22
|
+
{ name: 'American Samoa', code: 'AS' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const meta: ComponentMeta< typeof ComboboxControl > = {
|
|
26
|
+
title: 'Components/ComboboxControl',
|
|
27
|
+
component: ComboboxControl,
|
|
28
|
+
argTypes: {
|
|
29
|
+
value: { control: { type: null } },
|
|
30
|
+
},
|
|
31
|
+
parameters: {
|
|
32
|
+
actions: { argTypesRegex: '^on.*' },
|
|
33
|
+
controls: { expanded: true },
|
|
34
|
+
docs: { source: { state: 'open' } },
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export default meta;
|
|
38
|
+
|
|
39
|
+
const mapCountryOption = ( country: typeof countries[ number ] ) => ( {
|
|
40
|
+
value: country.code,
|
|
41
|
+
label: country.name,
|
|
42
|
+
} );
|
|
43
|
+
|
|
44
|
+
const countryOptions = countries.map( mapCountryOption );
|
|
45
|
+
|
|
46
|
+
const Template: ComponentStory< typeof ComboboxControl > = ( {
|
|
47
|
+
onChange,
|
|
48
|
+
...args
|
|
49
|
+
} ) => {
|
|
50
|
+
const [ value, setValue ] =
|
|
51
|
+
useState< ComboboxControlProps[ 'value' ] >( null );
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<ComboboxControl
|
|
56
|
+
{ ...args }
|
|
57
|
+
value={ value }
|
|
58
|
+
onChange={ ( ...changeArgs ) => {
|
|
59
|
+
setValue( ...changeArgs );
|
|
60
|
+
onChange?.( ...changeArgs );
|
|
61
|
+
} }
|
|
62
|
+
/>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
export const Default = Template.bind( {} );
|
|
67
|
+
Default.args = {
|
|
68
|
+
__next36pxDefaultSize: false,
|
|
69
|
+
allowReset: false,
|
|
70
|
+
label: 'Select a country',
|
|
71
|
+
options: countryOptions,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The rendered output of each suggestion can be customized by passing a
|
|
76
|
+
* render function to the `__experimentalRenderItem` prop. (This is still an experimental feature
|
|
77
|
+
* and is subject to change.)
|
|
78
|
+
*/
|
|
79
|
+
export const WithCustomRenderItem = Template.bind( {} );
|
|
80
|
+
WithCustomRenderItem.args = {
|
|
81
|
+
...Default.args,
|
|
82
|
+
label: 'Select an author',
|
|
83
|
+
options: [
|
|
84
|
+
{
|
|
85
|
+
value: 'parsley',
|
|
86
|
+
label: 'Parsley Montana',
|
|
87
|
+
age: 48,
|
|
88
|
+
country: 'Germany',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: 'cabbage',
|
|
92
|
+
label: 'Cabbage New York',
|
|
93
|
+
age: 44,
|
|
94
|
+
country: 'France',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
value: 'jake',
|
|
98
|
+
label: 'Jake Weary',
|
|
99
|
+
age: 41,
|
|
100
|
+
country: 'United Kingdom',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
__experimentalRenderItem: ( { item } ) => {
|
|
104
|
+
const { label, age, country } = item;
|
|
105
|
+
return (
|
|
106
|
+
<div>
|
|
107
|
+
<div style={ { marginBottom: '0.2rem' } }>{ label }</div>
|
|
108
|
+
<small>
|
|
109
|
+
Age: { age }, Country: { country }
|
|
110
|
+
</small>
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
};
|
|
@@ -9,8 +9,11 @@ import { css } from '@emotion/react';
|
|
|
9
9
|
*/
|
|
10
10
|
import { Flex } from '../flex';
|
|
11
11
|
import { space } from '../ui/utils/space';
|
|
12
|
+
import type { ComboboxControlProps } from './types';
|
|
12
13
|
|
|
13
|
-
const deprecatedDefaultSize = ( {
|
|
14
|
+
const deprecatedDefaultSize = ( {
|
|
15
|
+
__next36pxDefaultSize,
|
|
16
|
+
}: Pick< ComboboxControlProps, '__next36pxDefaultSize' > ) =>
|
|
14
17
|
! __next36pxDefaultSize &&
|
|
15
18
|
css`
|
|
16
19
|
height: 28px; // 30px - 2px vertical borders on parent container
|