@wordpress/components 23.3.1 → 23.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/build/alignment-matrix-control/utils.js +4 -4
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +37 -29
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/angle-picker-control/index.js +44 -9
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/{base-field → angle-picker-control}/types.js +0 -0
- package/build/angle-picker-control/types.js.map +1 -0
- package/build/autocomplete/autocompleter-ui.native.js +1 -0
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/base-control/hooks.js +1 -1
- package/build/base-control/hooks.js.map +1 -1
- package/build/border-box-control/utils.js +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/box-control/all-input-control.js +2 -2
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +32 -3
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +5 -5
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/styles/box-control-icon-styles.js +28 -28
- package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +23 -23
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/box-control/styles/box-control-visualizer-styles.js +19 -19
- package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build/box-control/types.js +6 -0
- package/build/box-control/types.js.map +1 -0
- package/build/box-control/unit-control.js.map +1 -1
- package/build/box-control/utils.js +23 -23
- package/build/box-control/utils.js.map +1 -1
- package/build/color-palette/index.js +15 -7
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/utils.js +12 -4
- package/build/color-palette/utils.js.map +1 -1
- package/build/combobox-control/index.js +68 -12
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +2 -2
- package/build/combobox-control/styles.js.map +1 -1
- package/build/combobox-control/types.js +6 -0
- package/build/combobox-control/types.js.map +1 -0
- package/build/custom-gradient-picker/index.js +0 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-select-control/index.js +7 -0
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/time/index.js +1 -1
- package/build/date-time/time/index.js.map +1 -1
- package/build/date-time/utils.js +1 -1
- package/build/date-time/utils.js.map +1 -1
- package/build/draggable/index.js +2 -2
- package/build/draggable/index.js.map +1 -1
- package/build/focal-point-picker/utils.js +3 -3
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/font-size-picker/utils.js +2 -2
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/gradient-picker/index.js +9 -4
- package/build/gradient-picker/index.js.map +1 -1
- package/build/index.js +16 -10
- package/build/index.js.map +1 -1
- package/build/input-control/reducer/reducer.js +5 -5
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/utils.js +1 -1
- package/build/input-control/utils.js.map +1 -1
- package/build/menu-items-choice/index.js +40 -3
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/menu-items-choice/types.js +6 -0
- package/build/menu-items-choice/types.js.map +1 -0
- package/build/modal/index.js +41 -3
- package/build/modal/index.js.map +1 -1
- package/build/navigator/context.js +5 -1
- package/build/navigator/context.js.map +1 -1
- package/build/navigator/index.js +8 -0
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +11 -3
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +119 -11
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +18 -7
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-to-parent-button/component.js +75 -0
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -0
- package/build/navigator/navigator-to-parent-button/index.js +16 -0
- package/build/navigator/navigator-to-parent-button/index.js.map +1 -0
- package/build/navigator/use-navigator.js +6 -2
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/navigator/utils/router.js +57 -0
- package/build/navigator/utils/router.js.map +1 -0
- package/build/palette-edit/index.js +4 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/panel/header.js +9 -0
- package/build/panel/header.js.map +1 -1
- package/build/panel/index.js +21 -3
- package/build/panel/index.js.map +1 -1
- package/build/panel/row.js +10 -4
- package/build/panel/row.js.map +1 -1
- package/build/panel/types.js +6 -0
- package/build/panel/types.js.map +1 -0
- package/build/popover/index.js +15 -3
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js +46 -0
- package/build/popover/overlay-middlewares.js.map +1 -0
- package/build/popover/utils.js +45 -6
- package/build/popover/utils.js.map +1 -1
- package/build/private-apis.js +35 -0
- package/build/private-apis.js.map +1 -0
- package/build/query-controls/terms.js +1 -1
- package/build/query-controls/terms.js.map +1 -1
- package/build/range-control/utils.js +4 -4
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +14 -14
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/select-control/index.js +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +38 -25
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/snackbar/index.js +2 -2
- package/build/snackbar/index.js.map +1 -1
- package/build/toolbar/toolbar/index.js +25 -14
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar/toolbar-container.js +5 -4
- package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build/toolbar/toolbar/types.js +6 -0
- package/build/toolbar/toolbar/types.js.map +1 -0
- package/build/toolbar/toolbar-button/index.js +2 -0
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/toolbar-button-container.js +1 -0
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js +2 -0
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/toolbar/toolbar-dropdown-menu/index.js +2 -0
- package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +2 -0
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
- package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build/toolbar/toolbar-group/toolbar-group-container.js +1 -0
- package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +2 -0
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +61 -5
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +8 -6
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +2 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js +2 -0
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +5 -4
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +24 -13
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tree-grid/cell.js +15 -4
- package/build/tree-grid/cell.js.map +1 -1
- package/build/tree-grid/index.js +81 -19
- package/build/tree-grid/index.js.map +1 -1
- package/build/tree-grid/item.js +14 -3
- package/build/tree-grid/item.js.map +1 -1
- package/build/tree-grid/roving-tab-index-context.js +1 -1
- package/build/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +13 -6
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-grid/roving-tab-index.js +0 -3
- package/build/tree-grid/roving-tab-index.js.map +1 -1
- package/build/tree-grid/row.js +20 -18
- package/build/tree-grid/row.js.map +1 -1
- package/build/tree-grid/types.js +6 -0
- package/build/tree-grid/types.js.map +1 -0
- package/build/ui/context/context-connect.js +7 -7
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/ui/utils/get-valid-children.js +1 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/ui/utils/space.js +1 -1
- package/build/ui/utils/space.js.map +1 -1
- package/build/unit-control/index.js +2 -2
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/utils.js +20 -20
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/events.js +4 -4
- package/build/utils/events.js.map +1 -1
- package/build/utils/hooks/use-controlled-state.js +2 -2
- package/build/utils/hooks/use-controlled-state.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js +4 -4
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build/utils/hooks/use-latest-ref.js +1 -1
- package/build/utils/hooks/use-latest-ref.js.map +1 -1
- package/build/utils/unit-values.js +3 -3
- package/build/utils/unit-values.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +4 -4
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +37 -29
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +42 -8
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/{base-field → angle-picker-control}/types.js +0 -0
- package/build-module/{base-field → angle-picker-control}/types.js.map +0 -0
- package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/base-control/hooks.js +1 -1
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/border-box-control/utils.js +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/box-control/all-input-control.js +2 -2
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -1
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +31 -3
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +5 -5
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/styles/box-control-icon-styles.js +28 -28
- package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +23 -23
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/box-control/styles/box-control-visualizer-styles.js +19 -19
- package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
- package/build-module/box-control/types.js +2 -0
- package/{build/base-field → build-module/box-control}/types.js.map +0 -0
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/box-control/utils.js +23 -23
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/color-palette/index.js +16 -8
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/utils.js +12 -4
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/combobox-control/index.js +68 -12
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +2 -2
- package/build-module/combobox-control/styles.js.map +1 -1
- package/build-module/combobox-control/types.js +2 -0
- package/build-module/{resizable-box/styles/resizable-box.styles.js.map → combobox-control/types.js.map} +0 -0
- package/build-module/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-select-control/index.js +5 -0
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -1
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/utils.js +1 -1
- package/build-module/date-time/utils.js.map +1 -1
- package/build-module/draggable/index.js +2 -2
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +3 -3
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/font-size-picker/utils.js +2 -2
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/gradient-picker/index.js +9 -4
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/index.js +5 -4
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +5 -5
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/utils.js +1 -1
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/menu-items-choice/index.js +40 -4
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/menu-items-choice/types.js +2 -0
- package/{build/resizable-box/styles/resizable-box.styles.js.map → build-module/menu-items-choice/types.js.map} +0 -0
- package/build-module/modal/index.js +41 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/context.js +5 -1
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/navigator/index.js +1 -0
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +11 -3
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +117 -12
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +20 -9
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js +61 -0
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -0
- package/build-module/navigator/navigator-to-parent-button/index.js +2 -0
- package/build-module/navigator/navigator-to-parent-button/index.js.map +1 -0
- package/build-module/navigator/use-navigator.js +6 -2
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/navigator/utils/router.js +51 -0
- package/build-module/navigator/utils/router.js.map +1 -0
- package/build-module/palette-edit/index.js +4 -1
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/header.js +9 -0
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +20 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/panel/row.js +9 -3
- package/build-module/panel/row.js.map +1 -1
- package/build-module/panel/types.js +2 -0
- package/build-module/panel/types.js.map +1 -0
- package/build-module/popover/index.js +14 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js +38 -0
- package/build-module/popover/overlay-middlewares.js.map +1 -0
- package/build-module/popover/utils.js +41 -5
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/private-apis.js +20 -0
- package/build-module/private-apis.js.map +1 -0
- package/build-module/query-controls/terms.js +1 -1
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/range-control/utils.js +4 -4
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +14 -14
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/select-control/index.js +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +38 -25
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/snackbar/index.js +2 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +25 -13
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar/toolbar-container.js +4 -3
- package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
- package/build-module/toolbar/toolbar/types.js +2 -0
- package/build-module/toolbar/toolbar/types.js.map +1 -0
- package/build-module/toolbar/toolbar-button/index.js +1 -0
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js +1 -0
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js +2 -0
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/toolbar/toolbar-dropdown-menu/index.js +1 -0
- package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -0
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +1 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js +1 -0
- package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +1 -0
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +59 -4
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +8 -6
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +2 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js +2 -0
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +3 -3
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +25 -13
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tree-grid/cell.js +16 -4
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/tree-grid/index.js +81 -21
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/tree-grid/item.js +14 -2
- package/build-module/tree-grid/item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +11 -4
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index.js +0 -3
- package/build-module/tree-grid/roving-tab-index.js.map +1 -1
- package/build-module/tree-grid/row.js +22 -17
- package/build-module/tree-grid/row.js.map +1 -1
- package/build-module/tree-grid/types.js +2 -0
- package/build-module/tree-grid/types.js.map +1 -0
- package/build-module/ui/context/context-connect.js +7 -7
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js +1 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/ui/utils/space.js +1 -1
- package/build-module/ui/utils/space.js.map +1 -1
- package/build-module/unit-control/index.js +2 -2
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/utils.js +20 -20
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/events.js +4 -4
- package/build-module/utils/events.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-state.js +2 -2
- package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js +4 -4
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/utils/hooks/use-latest-ref.js +1 -1
- package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
- package/build-module/utils/unit-values.js +3 -3
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-style/style-rtl.css +5 -11
- package/build-style/style.css +5 -11
- package/build-types/alignment-matrix-control/utils.d.ts +4 -4
- package/build-types/angle-picker-control/angle-circle.d.ts +6 -0
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -0
- package/build-types/angle-picker-control/index.d.ts +29 -0
- package/build-types/angle-picker-control/index.d.ts.map +1 -0
- package/build-types/angle-picker-control/stories/index.d.ts +15 -0
- package/build-types/angle-picker-control/stories/index.d.ts.map +1 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +20 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -0
- package/build-types/angle-picker-control/types.d.ts +26 -0
- package/build-types/angle-picker-control/types.d.ts.map +1 -0
- package/build-types/base-control/hooks.d.ts +2 -2
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +3 -3
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +2 -2
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +3 -3
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +2 -2
- package/build-types/border-box-control/stories/index.d.ts +1 -1
- package/build-types/{base-field → border-box-control}/test/index.d.ts +0 -0
- package/build-types/border-box-control/test/index.d.ts.map +1 -0
- package/build-types/border-box-control/test/utils.d.ts +2 -0
- package/build-types/border-box-control/test/utils.d.ts.map +1 -0
- package/build-types/border-control/border-control/hook.d.ts +2 -2
- package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -2
- package/build-types/border-control/border-control-style-picker/hook.d.ts +2 -2
- package/build-types/box-control/all-input-control.d.ts +4 -0
- package/build-types/box-control/all-input-control.d.ts.map +1 -0
- package/build-types/box-control/axial-input-controls.d.ts +4 -0
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -0
- package/build-types/box-control/icon.d.ts +8 -0
- package/build-types/box-control/icon.d.ts.map +1 -0
- package/build-types/box-control/index.d.ts +31 -0
- package/build-types/box-control/index.d.ts.map +1 -0
- package/build-types/box-control/input-controls.d.ts +4 -0
- package/build-types/box-control/input-controls.d.ts.map +1 -0
- package/build-types/box-control/linked-button.d.ts +9 -0
- package/build-types/box-control/linked-button.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-icon-styles.d.ts +42 -0
- package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-styles.d.ts +42 -0
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +46 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +1 -0
- package/build-types/box-control/test/index.d.ts +2 -0
- package/build-types/box-control/test/index.d.ts.map +1 -0
- package/build-types/box-control/types.d.ts +99 -0
- package/build-types/box-control/types.d.ts.map +1 -0
- package/build-types/box-control/unit-control.d.ts +4 -0
- package/build-types/box-control/unit-control.d.ts.map +1 -0
- package/build-types/box-control/utils.d.ts +84 -0
- package/build-types/box-control/utils.d.ts.map +1 -0
- package/build-types/button/deprecated.d.ts +2 -2
- package/build-types/button/types.d.ts +3 -1
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +2 -2
- package/build-types/card/card-body/hook.d.ts +2 -2
- package/build-types/card/card-divider/hook.d.ts +2 -2
- package/build-types/card/card-footer/hook.d.ts +2 -2
- package/build-types/card/card-header/hook.d.ts +2 -2
- package/build-types/card/card-media/hook.d.ts +2 -2
- package/build-types/color-palette/index.d.ts +3 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +6 -2
- package/build-types/color-palette/stories/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-palette/types.d.ts +8 -0
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts +8 -5
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +7 -7
- package/build-types/combobox-control/index.d.ts +51 -0
- package/build-types/combobox-control/index.d.ts.map +1 -0
- package/build-types/combobox-control/stories/index.d.ts +18 -0
- package/build-types/combobox-control/stories/index.d.ts.map +1 -0
- package/build-types/combobox-control/styles.d.ts +8 -0
- package/build-types/combobox-control/styles.d.ts.map +1 -0
- package/build-types/combobox-control/test/index.d.ts +2 -0
- package/build-types/combobox-control/test/index.d.ts.map +1 -0
- package/build-types/combobox-control/types.d.ts +62 -0
- package/build-types/combobox-control/types.d.ts.map +1 -0
- package/build-types/custom-select-control/index.d.ts +1 -0
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/styles.d.ts +3 -3
- package/build-types/date-time/time/styles.d.ts +8 -8
- package/build-types/date-time/utils.d.ts +1 -1
- package/build-types/elevation/hook.d.ts +2 -2
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/flex/flex/hook.d.ts +2 -2
- package/build-types/flex/flex-block/hook.d.ts +2 -2
- package/build-types/flex/flex-item/hook.d.ts +2 -2
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -2
- package/build-types/focal-point-picker/utils.d.ts +3 -3
- package/build-types/font-size-picker/utils.d.ts +2 -2
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/grid/hook.d.ts +2 -2
- package/build-types/h-stack/component.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +2 -2
- package/build-types/heading/hook.d.ts +2 -2
- package/build-types/input-control/reducer/reducer.d.ts +3 -3
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -2
- package/build-types/input-control/utils.d.ts +1 -1
- package/build-types/item-group/item/hook.d.ts +2 -2
- package/build-types/item-group/item-group/hook.d.ts +2 -2
- package/build-types/menu-items-choice/index.d.ts +38 -0
- package/build-types/menu-items-choice/index.d.ts.map +1 -0
- package/build-types/menu-items-choice/stories/index.d.ts +12 -0
- package/build-types/menu-items-choice/stories/index.d.ts.map +1 -0
- package/build-types/menu-items-choice/types.d.ts +53 -0
- package/build-types/menu-items-choice/types.d.ts.map +1 -0
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +2 -0
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/navigator/context.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +1 -0
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +22 -3
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +24 -6
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +22 -3
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +22 -4
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +27 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +1 -0
- package/build-types/navigator/stories/index.d.ts +1 -0
- package/build-types/navigator/stories/index.d.ts.map +1 -1
- package/build-types/navigator/test/router.d.ts +2 -0
- package/build-types/navigator/test/router.d.ts.map +1 -0
- package/build-types/navigator/types.d.ts +25 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/navigator/utils/router.d.ts +10 -0
- package/build-types/navigator/utils/router.d.ts.map +1 -0
- package/build-types/number-control/index.d.ts +2 -2
- package/build-types/number-control/stories/index.d.ts +2 -2
- package/build-types/panel/header.d.ts +13 -0
- package/build-types/panel/header.d.ts.map +1 -0
- package/build-types/panel/index.d.ts +21 -0
- package/build-types/panel/index.d.ts.map +1 -0
- package/build-types/panel/row.d.ts +12 -0
- package/build-types/panel/row.d.ts.map +1 -0
- package/build-types/panel/test/header.d.ts +2 -0
- package/build-types/panel/test/header.d.ts.map +1 -0
- package/build-types/panel/test/index.d.ts +2 -0
- package/build-types/{base-field → panel}/test/index.d.ts.map +1 -1
- package/build-types/panel/test/row.d.ts +2 -0
- package/build-types/panel/test/row.d.ts.map +1 -0
- package/build-types/panel/types.d.ts +38 -0
- package/build-types/panel/types.d.ts.map +1 -0
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts +9 -0
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -0
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/popover/stories/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +3 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +12 -4
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/private-apis.d.ts +4 -0
- package/build-types/private-apis.d.ts.map +1 -0
- package/build-types/query-controls/terms.d.ts +1 -1
- package/build-types/range-control/index.d.ts +2 -2
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
- package/build-types/range-control/utils.d.ts +4 -4
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +5 -4
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +6 -6
- package/build-types/resizable-box/stories/index.d.ts +2 -2
- package/build-types/scrollable/hook.d.ts +2 -2
- package/build-types/search-control/index.d.ts +1 -1
- package/build-types/search-control/stories/index.d.ts +2 -2
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +3 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +2 -2
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/surface/hook.d.ts +2 -2
- package/build-types/text/hook.d.ts +2 -2
- package/build-types/text-control/index.d.ts +3 -3
- package/build-types/toolbar/index.d.ts +7 -0
- package/build-types/toolbar/index.d.ts.map +1 -0
- package/build-types/toolbar/stories/index.d.ts +14 -0
- package/build-types/toolbar/stories/index.d.ts.map +1 -0
- package/build-types/toolbar/test/index.d.ts +2 -0
- package/build-types/toolbar/test/index.d.ts.map +1 -0
- package/build-types/toolbar/test/toolbar-group.d.ts +2 -0
- package/build-types/toolbar/test/toolbar-group.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/index.d.ts +25 -0
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/toolbar-container.d.ts +5 -0
- package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar/types.d.ts +15 -0
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-button/index.d.ts +12 -0
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +3 -0
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-context/index.d.ts +3 -0
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +3 -0
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/index.d.ts +39 -0
- package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +7 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +7 -0
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-item/index.d.ts +7 -0
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -0
- package/build-types/tools-panel/stories/index.d.ts +17 -0
- package/build-types/tools-panel/stories/index.d.ts.map +1 -0
- package/build-types/tools-panel/tools-panel/component.d.ts +54 -2
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +4 -3
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -3
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +42 -15
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tree-grid/cell.d.ts +13 -0
- package/build-types/tree-grid/cell.d.ts.map +1 -0
- package/build-types/tree-grid/index.d.ts +70 -0
- package/build-types/tree-grid/index.d.ts.map +1 -0
- package/build-types/tree-grid/item.d.ts +12 -0
- package/build-types/tree-grid/item.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index-context.d.ts +10 -0
- package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index-item.d.ts +5 -0
- package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -0
- package/build-types/tree-grid/roving-tab-index.d.ts +10 -0
- package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -0
- package/build-types/tree-grid/row.d.ts +12 -0
- package/build-types/tree-grid/row.d.ts.map +1 -0
- package/build-types/tree-grid/stories/index.d.ts +13 -0
- package/build-types/tree-grid/stories/index.d.ts.map +1 -0
- package/build-types/tree-grid/test/cell.d.ts +2 -0
- package/build-types/tree-grid/test/cell.d.ts.map +1 -0
- package/build-types/tree-grid/test/index.d.ts +2 -0
- package/build-types/tree-grid/test/index.d.ts.map +1 -0
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts +2 -0
- package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +1 -0
- package/build-types/tree-grid/test/roving-tab-index.d.ts +2 -0
- package/build-types/tree-grid/test/roving-tab-index.d.ts.map +1 -0
- package/build-types/tree-grid/test/row.d.ts +2 -0
- package/build-types/tree-grid/test/row.d.ts.map +1 -0
- package/build-types/tree-grid/types.d.ts +109 -0
- package/build-types/tree-grid/types.d.ts.map +1 -0
- package/build-types/truncate/hook.d.ts +2 -2
- package/build-types/ui/context/context-connect.d.ts +7 -7
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -1
- package/build-types/ui/control-group/hook.d.ts +2 -2
- package/build-types/ui/control-label/hook.d.ts +2 -2
- package/build-types/ui/form-group/form-group.d.ts +2 -2
- package/build-types/ui/form-group/use-form-group.d.ts +2 -2
- package/build-types/ui/utils/get-valid-children.d.ts +1 -1
- package/build-types/ui/utils/space.d.ts +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -2
- package/build-types/unit-control/utils.d.ts +20 -20
- package/build-types/utils/events.d.ts +2 -2
- package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts +4 -4
- package/build-types/utils/hooks/use-latest-ref.d.ts +1 -1
- package/build-types/utils/unit-values.d.ts +3 -3
- package/build-types/v-stack/component.d.ts +2 -2
- package/build-types/v-stack/hook.d.ts +2 -2
- package/build-types/v-stack/stories/index.d.ts +2 -2
- package/package.json +20 -18
- package/src/alignment-matrix-control/utils.tsx +4 -4
- package/src/angle-picker-control/README.md +17 -14
- package/src/angle-picker-control/{angle-circle.js → angle-circle.tsx} +44 -12
- package/src/angle-picker-control/{index.js → index.tsx} +54 -10
- package/src/angle-picker-control/stories/index.tsx +57 -0
- package/src/angle-picker-control/styles/{angle-picker-control-styles.js → angle-picker-control-styles.tsx} +5 -1
- package/src/angle-picker-control/types.ts +29 -0
- package/src/autocomplete/autocompleter-ui.native.js +1 -0
- package/src/base-control/hooks.ts +1 -1
- package/src/border-box-control/test/{index.js → index.tsx} +76 -102
- package/src/border-box-control/test/{utils.js → utils.ts} +20 -0
- package/src/border-box-control/utils.ts +1 -1
- package/src/box-control/README.md +17 -26
- package/src/box-control/{all-input-control.js → all-input-control.tsx} +10 -6
- package/src/box-control/{axial-input-controls.js → axial-input-controls.tsx} +29 -24
- package/src/box-control/{icon.js → icon.tsx} +9 -4
- package/src/box-control/{index.js → index.tsx} +43 -8
- package/src/box-control/{input-controls.js → input-controls.tsx} +26 -16
- package/src/box-control/{linked-button.js → linked-button.tsx} +4 -1
- package/src/box-control/styles/{box-control-icon-styles.js → box-control-icon-styles.ts} +1 -1
- package/src/box-control/styles/{box-control-styles.js → box-control-styles.ts} +10 -2
- package/src/box-control/styles/{box-control-visualizer-styles.js → box-control-visualizer-styles.ts} +6 -2
- package/src/box-control/test/{index.js → index.tsx} +12 -9
- package/src/box-control/types.ts +121 -0
- package/src/box-control/{unit-control.js → unit-control.tsx} +9 -2
- package/src/box-control/{utils.js → utils.ts} +47 -38
- package/src/button/test/index.tsx +38 -30
- package/src/button/types.ts +5 -2
- package/src/color-palette/README.md +7 -0
- package/src/color-palette/index.tsx +19 -6
- package/src/color-palette/test/utils.ts +17 -1
- package/src/color-palette/types.ts +8 -0
- package/src/color-palette/utils.ts +12 -7
- package/src/combobox-control/README.md +8 -15
- package/src/combobox-control/{index.js → index.tsx} +91 -19
- package/src/combobox-control/stories/index.tsx +114 -0
- package/src/combobox-control/styles.ts +4 -1
- package/src/combobox-control/test/{index.js → index.tsx} +9 -7
- package/src/combobox-control/types.ts +69 -0
- package/src/custom-gradient-picker/index.js +0 -1
- package/src/custom-select-control/index.js +9 -0
- package/src/custom-select-control/stories/index.js +2 -2
- package/src/custom-select-control/test/index.js +2 -2
- package/src/date-time/time/index.tsx +1 -1
- package/src/date-time/utils.ts +1 -1
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/draggable/index.tsx +2 -2
- package/src/dropdown-menu/test/index.js +3 -11
- package/src/focal-point-picker/utils.ts +3 -3
- package/src/font-size-picker/utils.ts +2 -2
- package/src/gradient-picker/README.md +8 -0
- package/src/gradient-picker/index.js +6 -1
- package/src/index.js +5 -2
- package/src/input-control/reducer/reducer.ts +5 -5
- package/src/input-control/utils.ts +1 -1
- package/src/menu-items-choice/index.tsx +83 -0
- package/src/menu-items-choice/stories/index.tsx +79 -0
- package/src/menu-items-choice/types.ts +54 -0
- package/src/modal/index.tsx +45 -1
- package/src/modal/style.scss +8 -0
- package/src/modal/types.ts +2 -0
- package/src/navigator/context.ts +4 -0
- package/src/navigator/index.ts +1 -0
- package/src/navigator/navigator-back-button/README.md +1 -17
- package/src/navigator/navigator-back-button/hook.ts +10 -5
- package/src/navigator/navigator-button/README.md +1 -1
- package/src/navigator/navigator-provider/README.md +25 -4
- package/src/navigator/navigator-provider/component.tsx +170 -14
- package/src/navigator/navigator-screen/component.tsx +22 -11
- package/src/navigator/navigator-to-parent-button/README.md +15 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +65 -0
- package/src/navigator/navigator-to-parent-button/index.ts +1 -0
- package/src/navigator/stories/index.tsx +93 -3
- package/src/navigator/test/index.tsx +267 -23
- package/src/navigator/test/router.ts +122 -0
- package/src/navigator/types.ts +31 -12
- package/src/navigator/use-navigator.ts +4 -1
- package/src/navigator/utils/router.ts +49 -0
- package/src/palette-edit/index.js +4 -1
- package/src/panel/README.md +2 -2
- package/src/panel/header.tsx +20 -0
- package/src/panel/index.tsx +48 -0
- package/src/panel/row.tsx +37 -0
- package/src/panel/stories/index.js +22 -0
- package/src/panel/test/__snapshots__/{header.js.snap → header.tsx.snap} +0 -0
- package/src/panel/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/panel/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
- package/src/panel/test/{header.js → header.tsx} +1 -1
- package/src/panel/test/{index.js → index.tsx} +6 -4
- package/src/panel/test/{row.js → row.tsx} +4 -2
- package/src/panel/types.ts +38 -0
- package/src/popover/README.md +4 -1
- package/src/popover/index.tsx +17 -1
- package/src/popover/overlay-middlewares.tsx +29 -0
- package/src/popover/stories/index.tsx +7 -1
- package/src/popover/test/index.tsx +29 -21
- package/src/popover/types.ts +4 -2
- package/src/popover/utils.ts +39 -3
- package/src/private-apis.js +22 -0
- package/src/query-controls/terms.ts +1 -1
- package/src/range-control/utils.ts +4 -4
- package/src/resizable-box/resize-tooltip/styles/{resize-tooltip.styles.js → resize-tooltip.styles.ts} +0 -0
- package/src/resizable-box/resize-tooltip/utils.ts +14 -14
- package/src/select-control/README.md +3 -1
- package/src/select-control/index.tsx +3 -1
- package/src/select-control/style.scss +0 -10
- package/src/select-control/styles/select-control-styles.ts +36 -22
- package/src/select-control/types.ts +3 -1
- package/src/snackbar/index.tsx +2 -2
- package/src/toolbar/stories/{index.js → index.tsx} +39 -26
- package/src/toolbar/test/{index.js → index.tsx} +0 -0
- package/src/toolbar/test/{toolbar-group.js → toolbar-group.tsx} +2 -2
- package/src/toolbar/toolbar/README.md +7 -2
- package/src/toolbar/toolbar/{index.js → index.tsx} +33 -12
- package/src/toolbar/toolbar/{toolbar-container.js → toolbar-container.tsx} +9 -2
- package/src/toolbar/toolbar/types.ts +15 -0
- package/src/toolbar/toolbar-button/index.js +2 -0
- package/src/toolbar/toolbar-button/toolbar-button-container.js +2 -0
- package/src/toolbar/toolbar-context/index.js +2 -0
- package/src/toolbar/toolbar-dropdown-menu/index.js +2 -0
- package/src/toolbar/toolbar-group/index.js +2 -0
- package/src/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
- package/src/toolbar/toolbar-group/toolbar-group-container.js +2 -0
- package/src/toolbar/toolbar-item/index.js +2 -0
- package/src/tools-panel/stories/{index.js → index.tsx} +196 -95
- package/src/tools-panel/test/index.js +71 -6
- package/src/tools-panel/tools-panel/README.md +12 -4
- package/src/tools-panel/tools-panel/component.tsx +57 -3
- package/src/tools-panel/tools-panel/hook.ts +8 -7
- package/src/tools-panel/tools-panel-header/README.md +7 -0
- package/src/tools-panel/tools-panel-header/component.tsx +2 -1
- package/src/tools-panel/tools-panel-header/hook.ts +6 -4
- package/src/tools-panel/tools-panel-item/README.md +6 -4
- package/src/tools-panel/tools-panel-item/component.tsx +4 -4
- package/src/tools-panel/tools-panel-item/hook.ts +28 -16
- package/src/tools-panel/types.ts +43 -15
- package/src/tree-grid/README.md +18 -58
- package/src/tree-grid/cell.tsx +41 -0
- package/src/tree-grid/{index.js → index.tsx} +111 -35
- package/src/tree-grid/item.tsx +32 -0
- package/src/tree-grid/{roving-tab-index-context.js → roving-tab-index-context.ts} +9 -1
- package/src/tree-grid/roving-tab-index-item.tsx +50 -0
- package/src/tree-grid/{roving-tab-index.js → roving-tab-index.tsx} +7 -5
- package/src/tree-grid/row.tsx +47 -0
- package/src/tree-grid/stories/index.tsx +144 -0
- package/src/tree-grid/test/__snapshots__/{cell.js.snap → cell.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{roving-tab-index-item.js.snap → roving-tab-index-item.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{roving-tab-index.js.snap → roving-tab-index.tsx.snap} +0 -0
- package/src/tree-grid/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
- package/src/tree-grid/test/{cell.js → cell.tsx} +7 -4
- package/src/tree-grid/test/{index.js → index.tsx} +13 -5
- package/src/tree-grid/test/{roving-tab-index-item.js → roving-tab-index-item.tsx} +7 -4
- package/src/tree-grid/test/{roving-tab-index.js → roving-tab-index.tsx} +0 -0
- package/src/tree-grid/test/{row.js → row.tsx} +4 -4
- package/src/tree-grid/types.ts +116 -0
- package/src/ui/context/context-connect.ts +7 -7
- package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
- package/src/ui/utils/get-valid-children.ts +1 -1
- package/src/ui/utils/space.ts +1 -1
- package/src/unit-control/index.tsx +2 -2
- package/src/unit-control/utils.ts +20 -20
- package/src/utils/events.ts +4 -4
- package/src/utils/hooks/use-controlled-state.js +2 -2
- package/src/utils/hooks/use-controlled-value.ts +4 -4
- package/src/utils/hooks/use-latest-ref.ts +1 -1
- package/src/utils/unit-values.ts +3 -3
- package/tsconfig.json +6 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/build/base-field/hook.js +0 -54
- package/build/base-field/hook.js.map +0 -1
- package/build/base-field/index.js +0 -14
- package/build/base-field/index.js.map +0 -1
- package/build/base-field/styles.js +0 -33
- package/build/base-field/styles.js.map +0 -1
- package/build/resizable-box/styles/resizable-box.styles.js +0 -2
- package/build-module/base-field/hook.js +0 -37
- package/build-module/base-field/hook.js.map +0 -1
- package/build-module/base-field/index.js +0 -2
- package/build-module/base-field/index.js.map +0 -1
- package/build-module/base-field/styles.js +0 -18
- package/build-module/base-field/styles.js.map +0 -1
- package/build-module/resizable-box/styles/resizable-box.styles.js +0 -2
- package/build-types/base-field/hook.d.ts +0 -270
- package/build-types/base-field/hook.d.ts.map +0 -1
- package/build-types/base-field/index.d.ts +0 -2
- package/build-types/base-field/index.d.ts.map +0 -1
- package/build-types/base-field/styles.d.ts +0 -6
- package/build-types/base-field/styles.d.ts.map +0 -1
- package/build-types/base-field/types.d.ts +0 -29
- package/build-types/base-field/types.d.ts.map +0 -1
- package/build-types/resizable-box/styles/resizable-box.styles.d.ts +0 -1
- package/build-types/resizable-box/styles/resizable-box.styles.d.ts.map +0 -1
- package/src/angle-picker-control/stories/index.js +0 -29
- package/src/base-field/README.md +0 -66
- package/src/base-field/hook.ts +0 -51
- package/src/base-field/index.ts +0 -1
- package/src/base-field/styles.ts +0 -86
- package/src/base-field/test/__snapshots__/index.tsx.snap +0 -141
- package/src/base-field/test/index.tsx +0 -84
- package/src/base-field/types.ts +0 -29
- package/src/combobox-control/stories/index.js +0 -339
- package/src/menu-items-choice/index.js +0 -43
- package/src/panel/header.js +0 -10
- package/src/panel/index.js +0 -26
- package/src/panel/row.js +0 -20
- package/src/resizable-box/styles/resizable-box.styles.js +0 -0
- package/src/tools-panel/stories/utils/tools-panel-with-item-group-slot.js +0 -246
- package/src/tree-grid/cell.js +0 -24
- package/src/tree-grid/item.js +0 -20
- package/src/tree-grid/roving-tab-index-item.js +0 -33
- package/src/tree-grid/row.js +0 -31
- package/src/tree-grid/stories/index.js +0 -106
|
@@ -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
|
|
@@ -12,7 +12,8 @@ import { useState } from '@wordpress/element';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import ComboboxControl from '
|
|
15
|
+
import ComboboxControl from '..';
|
|
16
|
+
import type { ComboboxControlOption, ComboboxControlProps } from '../types';
|
|
16
17
|
|
|
17
18
|
const timezones = [
|
|
18
19
|
{ label: 'Greenwich Mean Time', value: 'GMT' },
|
|
@@ -49,20 +50,21 @@ const timezones = [
|
|
|
49
50
|
];
|
|
50
51
|
|
|
51
52
|
const defaultLabelText = 'Select a timezone';
|
|
52
|
-
const getLabel = ( labelText ) => screen.getByText( labelText );
|
|
53
|
-
const getInput = ( name ) => screen.getByRole( 'combobox', { name } );
|
|
54
|
-
const getOption = ( name ) => screen.getByRole( 'option', { name } );
|
|
53
|
+
const getLabel = ( labelText: string ) => screen.getByText( labelText );
|
|
54
|
+
const getInput = ( name: string ) => screen.getByRole( 'combobox', { name } );
|
|
55
|
+
const getOption = ( name: string ) => screen.getByRole( 'option', { name } );
|
|
55
56
|
const getAllOptions = () => screen.getAllByRole( 'option' );
|
|
56
|
-
const getOptionSearchString = ( option ) =>
|
|
57
|
+
const getOptionSearchString = ( option: ComboboxControlOption ) =>
|
|
58
|
+
option.label.substring( 0, 11 );
|
|
57
59
|
const setupUser = () => userEvent.setup();
|
|
58
60
|
|
|
59
61
|
const ControlledComboboxControl = ( {
|
|
60
62
|
value: valueProp,
|
|
61
63
|
onChange,
|
|
62
64
|
...props
|
|
63
|
-
} ) => {
|
|
65
|
+
}: ComboboxControlProps ) => {
|
|
64
66
|
const [ value, setValue ] = useState( valueProp );
|
|
65
|
-
const handleOnChange = ( newValue ) => {
|
|
67
|
+
const handleOnChange: ComboboxControlProps[ 'onChange' ] = ( newValue ) => {
|
|
66
68
|
setValue( newValue );
|
|
67
69
|
onChange?.( newValue );
|
|
68
70
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { BaseControlProps } from '../base-control/types';
|
|
5
|
+
|
|
6
|
+
export type ComboboxControlOption = {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
[ key: string ]: any;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ComboboxControlProps = Pick<
|
|
13
|
+
BaseControlProps,
|
|
14
|
+
| '__nextHasNoMarginBottom'
|
|
15
|
+
| 'className'
|
|
16
|
+
| 'label'
|
|
17
|
+
| 'hideLabelFromVision'
|
|
18
|
+
| 'help'
|
|
19
|
+
> & {
|
|
20
|
+
/**
|
|
21
|
+
* Custom renderer invoked for each option in the suggestion list.
|
|
22
|
+
* The render prop receives as its argument an object containing, under the `item` key,
|
|
23
|
+
* the single option's data (directly from the array of data passed to the `options` prop).
|
|
24
|
+
*/
|
|
25
|
+
__experimentalRenderItem?: ( args: {
|
|
26
|
+
item: ComboboxControlOption;
|
|
27
|
+
} ) => React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
30
|
+
*
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
__next36pxDefaultSize?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Show a reset button to clear the input.
|
|
36
|
+
*
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
allowReset?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Customizable UI messages.
|
|
42
|
+
*/
|
|
43
|
+
messages?: {
|
|
44
|
+
/**
|
|
45
|
+
* The message to announce to screen readers when a suggestion is selected.
|
|
46
|
+
*
|
|
47
|
+
* @default `__( 'Item selected.' )`
|
|
48
|
+
*/
|
|
49
|
+
selected: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Function called with the selected value changes.
|
|
53
|
+
*/
|
|
54
|
+
onChange?: ( value: ComboboxControlProps[ 'value' ] ) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Function called when the control's search input value changes. The argument contains the next input value.
|
|
57
|
+
*
|
|
58
|
+
* @default noop
|
|
59
|
+
*/
|
|
60
|
+
onFilterValueChange?: ( value: string ) => void;
|
|
61
|
+
/**
|
|
62
|
+
* The options that can be chosen from.
|
|
63
|
+
*/
|
|
64
|
+
options: ComboboxControlOption[];
|
|
65
|
+
/**
|
|
66
|
+
* The current value of the control.
|
|
67
|
+
*/
|
|
68
|
+
value?: string | null;
|
|
69
|
+
};
|
|
@@ -257,3 +257,12 @@ export default function CustomSelectControl( props ) {
|
|
|
257
257
|
</div>
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
|
+
|
|
261
|
+
export function StableCustomSelectControl( props ) {
|
|
262
|
+
return (
|
|
263
|
+
<CustomSelectControl
|
|
264
|
+
{ ...props }
|
|
265
|
+
__experimentalShowSelectedHint={ false }
|
|
266
|
+
/>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import CustomSelectControl from '
|
|
4
|
+
import CustomSelectControl from '..';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/CustomSelectControl',
|
|
@@ -10,9 +10,9 @@ export default {
|
|
|
10
10
|
__next36pxDefaultSize: { control: { type: 'boolean' } },
|
|
11
11
|
__experimentalShowSelectedHint: { control: { type: 'boolean' } },
|
|
12
12
|
size: {
|
|
13
|
+
options: [ 'small', 'default', '__unstable-large' ],
|
|
13
14
|
control: {
|
|
14
15
|
type: 'radio',
|
|
15
|
-
options: [ 'small', 'default', '__unstable-large' ],
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
},
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { render, fireEvent, screen } from '@testing-library/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import CustomSelectControl from '..';
|
|
10
10
|
|
|
11
11
|
describe( 'CustomSelectControl', () => {
|
|
12
12
|
it( 'Captures the keypress event and does not let it propagate', () => {
|
|
@@ -51,7 +51,7 @@ function from12hTo24h( hours: number, isPm: boolean ) {
|
|
|
51
51
|
* given width. For example, the hours and minutes inputs are padded to 2 so
|
|
52
52
|
* that '4' appears as '04'.
|
|
53
53
|
*
|
|
54
|
-
* @param
|
|
54
|
+
* @param pad How many digits the value should be.
|
|
55
55
|
*/
|
|
56
56
|
function buildPadInputStateReducer( pad: number ) {
|
|
57
57
|
return ( state: InputState, action: InputAction ) => {
|
package/src/date-time/utils.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { toDate } from 'date-fns';
|
|
|
7
7
|
* Like date-fn's toDate, but tries to guess the format when a string is
|
|
8
8
|
* given.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param input Value to turn into a date.
|
|
11
11
|
*/
|
|
12
12
|
export function inputToDate( input: Date | string | number ): Date {
|
|
13
13
|
if ( typeof input === 'string' ) {
|
|
@@ -116,7 +116,6 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
116
116
|
width: 100%;
|
|
117
117
|
max-width: none;
|
|
118
118
|
cursor: pointer;
|
|
119
|
-
overflow: hidden;
|
|
120
119
|
white-space: nowrap;
|
|
121
120
|
text-overflow: ellipsis;
|
|
122
121
|
font-size: 16px;
|
|
@@ -126,6 +125,7 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
126
125
|
padding-bottom: 0;
|
|
127
126
|
padding-left: 8px;
|
|
128
127
|
padding-right: 26px;
|
|
128
|
+
overflow: hidden;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
@media ( min-width: 600px ) {
|
|
@@ -387,7 +387,6 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
387
387
|
width: 100%;
|
|
388
388
|
max-width: none;
|
|
389
389
|
cursor: pointer;
|
|
390
|
-
overflow: hidden;
|
|
391
390
|
white-space: nowrap;
|
|
392
391
|
text-overflow: ellipsis;
|
|
393
392
|
font-size: 16px;
|
|
@@ -397,6 +396,7 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
397
396
|
padding-bottom: 0;
|
|
398
397
|
padding-left: 8px;
|
|
399
398
|
padding-right: 26px;
|
|
399
|
+
overflow: hidden;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
@media ( min-width: 600px ) {
|
|
@@ -668,7 +668,6 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
668
668
|
width: 100%;
|
|
669
669
|
max-width: none;
|
|
670
670
|
cursor: pointer;
|
|
671
|
-
overflow: hidden;
|
|
672
671
|
white-space: nowrap;
|
|
673
672
|
text-overflow: ellipsis;
|
|
674
673
|
font-size: 16px;
|
|
@@ -678,6 +677,7 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
678
677
|
padding-bottom: 0;
|
|
679
678
|
padding-left: 8px;
|
|
680
679
|
padding-right: 26px;
|
|
680
|
+
overflow: hidden;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
@media ( min-width: 600px ) {
|
|
@@ -961,7 +961,6 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
961
961
|
width: 100%;
|
|
962
962
|
max-width: none;
|
|
963
963
|
cursor: pointer;
|
|
964
|
-
overflow: hidden;
|
|
965
964
|
white-space: nowrap;
|
|
966
965
|
text-overflow: ellipsis;
|
|
967
966
|
font-size: 16px;
|
|
@@ -971,6 +970,7 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
971
970
|
padding-bottom: 0;
|
|
972
971
|
padding-left: 8px;
|
|
973
972
|
padding-right: 26px;
|
|
973
|
+
overflow: hidden;
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
@media ( min-width: 600px ) {
|
package/src/draggable/index.tsx
CHANGED
|
@@ -75,7 +75,7 @@ export function Draggable( {
|
|
|
75
75
|
/**
|
|
76
76
|
* Removes the element clone, resets cursor, and removes drag listener.
|
|
77
77
|
*
|
|
78
|
-
* @param
|
|
78
|
+
* @param event The non-custom DragEvent.
|
|
79
79
|
*/
|
|
80
80
|
function end( event: DragEvent ) {
|
|
81
81
|
event.preventDefault();
|
|
@@ -94,7 +94,7 @@ export function Draggable( {
|
|
|
94
94
|
* - Sets transfer data.
|
|
95
95
|
* - Adds dragover listener.
|
|
96
96
|
*
|
|
97
|
-
* @param
|
|
97
|
+
* @param event The non-custom DragEvent.
|
|
98
98
|
*/
|
|
99
99
|
function start( event: DragEvent ) {
|
|
100
100
|
const { ownerDocument } = event.target as HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { render, screen, waitFor, within } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -63,10 +63,6 @@ describe( 'DropdownMenu', () => {
|
|
|
63
63
|
|
|
64
64
|
await user.keyboard( '[ArrowDown]' );
|
|
65
65
|
|
|
66
|
-
// Wait for the `floating-ui` effects in `Dropdown`/`Popover` to finish running
|
|
67
|
-
// See also: https://floating-ui.com/docs/react-dom#testing
|
|
68
|
-
await act( () => Promise.resolve() );
|
|
69
|
-
|
|
70
66
|
const menu = screen.getByRole( 'menu' );
|
|
71
67
|
|
|
72
68
|
// we need to wait because showing the dropdown is animated
|
|
@@ -86,15 +82,11 @@ describe( 'DropdownMenu', () => {
|
|
|
86
82
|
/>
|
|
87
83
|
);
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
// Move focus on the toggle button
|
|
86
|
+
await user.tab();
|
|
91
87
|
|
|
92
88
|
await user.keyboard( '[ArrowDown]' );
|
|
93
89
|
|
|
94
|
-
// Wait for the `floating-ui` effects in `Dropdown`/`Popover` to finish running
|
|
95
|
-
// See also: https://floating-ui.com/docs/react-dom#testing
|
|
96
|
-
await act( () => Promise.resolve() );
|
|
97
|
-
|
|
98
90
|
const menu = screen.getByRole( 'menu' );
|
|
99
91
|
|
|
100
92
|
// we need to wait because showing the dropdown is animated
|
|
@@ -19,7 +19,7 @@ const VIDEO_EXTENSIONS = [
|
|
|
19
19
|
/**
|
|
20
20
|
* Gets the extension of a file name.
|
|
21
21
|
*
|
|
22
|
-
* @param
|
|
22
|
+
* @param filename The file name.
|
|
23
23
|
* @return The extension of the file name.
|
|
24
24
|
*/
|
|
25
25
|
export function getExtension( filename = '' ): string {
|
|
@@ -30,7 +30,7 @@ export function getExtension( filename = '' ): string {
|
|
|
30
30
|
/**
|
|
31
31
|
* Checks if a file is a video.
|
|
32
32
|
*
|
|
33
|
-
* @param
|
|
33
|
+
* @param filename The file name.
|
|
34
34
|
* @return Whether the file is a video.
|
|
35
35
|
*/
|
|
36
36
|
export function isVideoType( filename: string = '' ): boolean {
|
|
@@ -44,7 +44,7 @@ export function isVideoType( filename: string = '' ): boolean {
|
|
|
44
44
|
/**
|
|
45
45
|
* Transforms a fraction value to a percentage value.
|
|
46
46
|
*
|
|
47
|
-
* @param
|
|
47
|
+
* @param fraction The fraction value.
|
|
48
48
|
* @return A percentage value.
|
|
49
49
|
*/
|
|
50
50
|
export function fractionToPercentage( fraction: number ): number {
|