@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
|
@@ -13,7 +13,7 @@ import { parseQuantityAndUnitFromRawValue } from '../unit-control';
|
|
|
13
13
|
* Some themes use css vars for their font sizes, so until we
|
|
14
14
|
* have the way of calculating them don't display them.
|
|
15
15
|
*
|
|
16
|
-
* @param
|
|
16
|
+
* @param value The value that is checked.
|
|
17
17
|
* @return Whether the value is a simple css value.
|
|
18
18
|
*/
|
|
19
19
|
export function isSimpleCssValue(
|
|
@@ -27,7 +27,7 @@ export function isSimpleCssValue(
|
|
|
27
27
|
* If all of the given font sizes have the same unit (e.g. 'px'), return that
|
|
28
28
|
* unit. Otherwise return null.
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
30
|
+
* @param fontSizes List of font sizes.
|
|
31
31
|
* @return The common unit, or null.
|
|
32
32
|
*/
|
|
33
33
|
export function getCommonSizeUnit( fontSizes: FontSize[] ) {
|
|
@@ -101,3 +101,11 @@ Start opting into the new margin-free styles that will become the default in a f
|
|
|
101
101
|
- Type: `Boolean`
|
|
102
102
|
- Required: No
|
|
103
103
|
- Default: `false`
|
|
104
|
+
|
|
105
|
+
### headingLevel
|
|
106
|
+
|
|
107
|
+
The heading level.
|
|
108
|
+
|
|
109
|
+
- Type: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
110
|
+
- Required: No
|
|
111
|
+
- Default: `2`
|
|
@@ -77,13 +77,16 @@ function MultipleOrigin( {
|
|
|
77
77
|
onChange,
|
|
78
78
|
value,
|
|
79
79
|
actions,
|
|
80
|
+
headingLevel,
|
|
80
81
|
} ) {
|
|
81
82
|
return (
|
|
82
83
|
<VStack spacing={ 3 } className={ className }>
|
|
83
84
|
{ gradients.map( ( { name, gradients: gradientSet }, index ) => {
|
|
84
85
|
return (
|
|
85
86
|
<VStack spacing={ 2 } key={ index }>
|
|
86
|
-
<ColorHeading
|
|
87
|
+
<ColorHeading level={ headingLevel }>
|
|
88
|
+
{ name }
|
|
89
|
+
</ColorHeading>
|
|
87
90
|
<SingleOrigin
|
|
88
91
|
clearGradient={ clearGradient }
|
|
89
92
|
gradients={ gradientSet }
|
|
@@ -112,6 +115,7 @@ export default function GradientPicker( {
|
|
|
112
115
|
clearable = true,
|
|
113
116
|
disableCustomGradients = false,
|
|
114
117
|
__experimentalIsRenderedInSidebar,
|
|
118
|
+
headingLevel = 2,
|
|
115
119
|
} ) {
|
|
116
120
|
const clearGradient = useCallback(
|
|
117
121
|
() => onChange( undefined ),
|
|
@@ -168,6 +172,7 @@ export default function GradientPicker( {
|
|
|
168
172
|
</CircularOptionPicker.ButtonAction>
|
|
169
173
|
)
|
|
170
174
|
}
|
|
175
|
+
headingLevel={ headingLevel }
|
|
171
176
|
/>
|
|
172
177
|
) }
|
|
173
178
|
</VStack>
|
package/src/index.js
CHANGED
|
@@ -59,7 +59,7 @@ export {
|
|
|
59
59
|
useCompositeState as __unstableUseCompositeState,
|
|
60
60
|
} from './composite';
|
|
61
61
|
export { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';
|
|
62
|
-
export {
|
|
62
|
+
export { StableCustomSelectControl as CustomSelectControl } from './custom-select-control';
|
|
63
63
|
export { default as Dashicon } from './dashicon';
|
|
64
64
|
export { default as DateTimePicker, DatePicker, TimePicker } from './date-time';
|
|
65
65
|
export { default as __experimentalDimensionControl } from './dimension-control';
|
|
@@ -115,6 +115,7 @@ export {
|
|
|
115
115
|
NavigatorScreen as __experimentalNavigatorScreen,
|
|
116
116
|
NavigatorButton as __experimentalNavigatorButton,
|
|
117
117
|
NavigatorBackButton as __experimentalNavigatorBackButton,
|
|
118
|
+
NavigatorToParentButton as __experimentalNavigatorToParentButton,
|
|
118
119
|
useNavigator as __experimentalUseNavigator,
|
|
119
120
|
} from './navigator';
|
|
120
121
|
export { default as Notice } from './notice';
|
|
@@ -126,7 +127,6 @@ export { default as PanelHeader } from './panel/header';
|
|
|
126
127
|
export { default as PanelRow } from './panel/row';
|
|
127
128
|
export { default as Placeholder } from './placeholder';
|
|
128
129
|
export { default as Popover } from './popover';
|
|
129
|
-
export { positionToPlacement as __experimentalPopoverPositionToPlacement } from './popover/utils';
|
|
130
130
|
export { default as QueryControls } from './query-controls';
|
|
131
131
|
export { default as __experimentalRadio } from './radio-group/radio';
|
|
132
132
|
export { default as __experimentalRadioGroup } from './radio-group';
|
|
@@ -212,3 +212,6 @@ export {
|
|
|
212
212
|
} from './higher-order/with-focus-return';
|
|
213
213
|
export { default as withNotices } from './higher-order/with-notices';
|
|
214
214
|
export { default as withSpokenMessages } from './higher-order/with-spoken-messages';
|
|
215
|
+
|
|
216
|
+
// Private APIs.
|
|
217
|
+
export { privateApis } from './private-apis';
|
|
@@ -23,7 +23,7 @@ import type { InputChangeCallback } from '../types';
|
|
|
23
23
|
/**
|
|
24
24
|
* Prepares initialState for the reducer.
|
|
25
25
|
*
|
|
26
|
-
* @param
|
|
26
|
+
* @param initialState The initial state.
|
|
27
27
|
* @return Prepared initialState for the reducer
|
|
28
28
|
*/
|
|
29
29
|
function mergeInitialState(
|
|
@@ -45,7 +45,7 @@ function mergeInitialState(
|
|
|
45
45
|
* exception for CONTROL actions is because they represent controlled updates
|
|
46
46
|
* from props and no case has yet presented for their specialization.
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param composedStateReducers A reducer to specialize state changes.
|
|
49
49
|
* @return The reducer.
|
|
50
50
|
*/
|
|
51
51
|
function inputControlStateReducer(
|
|
@@ -140,9 +140,9 @@ function inputControlStateReducer(
|
|
|
140
140
|
* This technique uses the "stateReducer" design pattern:
|
|
141
141
|
* https://kentcdodds.com/blog/the-state-reducer-pattern/
|
|
142
142
|
*
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
145
|
-
* @param
|
|
143
|
+
* @param stateReducer An external state reducer.
|
|
144
|
+
* @param initialState The initial state for the reducer.
|
|
145
|
+
* @param onChangeHandler A handler for the onChange event.
|
|
146
146
|
* @return State, dispatch, and a collection of actions.
|
|
147
147
|
*/
|
|
148
148
|
export function useInputControlStateReducer(
|
|
@@ -21,7 +21,7 @@ import type { InputChangeCallback } from './types';
|
|
|
21
21
|
/**
|
|
22
22
|
* Gets a CSS cursor value based on a drag direction.
|
|
23
23
|
*
|
|
24
|
-
* @param
|
|
24
|
+
* @param dragDirection The drag direction.
|
|
25
25
|
* @return The CSS cursor value.
|
|
26
26
|
*/
|
|
27
27
|
export function getDragCursor( dragDirection: string ): string {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { check } from '@wordpress/icons';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import MenuItem from '../menu-item';
|
|
10
|
+
import type { MenuItemsChoiceProps } from './types';
|
|
11
|
+
|
|
12
|
+
const noop = () => {};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `MenuItemsChoice` functions similarly to a set of `MenuItem`s, but allows the user to select one option from a set of multiple choices.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* ```jsx
|
|
19
|
+
* import { MenuGroup, MenuItemsChoice } from '@wordpress/components';
|
|
20
|
+
* import { useState } from '@wordpress/element';
|
|
21
|
+
*
|
|
22
|
+
* const MyMenuItemsChoice = () => {
|
|
23
|
+
* const [ mode, setMode ] = useState( 'visual' );
|
|
24
|
+
* const choices = [
|
|
25
|
+
* {
|
|
26
|
+
* value: 'visual',
|
|
27
|
+
* label: 'Visual editor',
|
|
28
|
+
* },
|
|
29
|
+
* {
|
|
30
|
+
* value: 'text',
|
|
31
|
+
* label: 'Code editor',
|
|
32
|
+
* },
|
|
33
|
+
* ];
|
|
34
|
+
*
|
|
35
|
+
* return (
|
|
36
|
+
* <MenuGroup label="Editor">
|
|
37
|
+
* <MenuItemsChoice
|
|
38
|
+
* choices={ choices }
|
|
39
|
+
* value={ mode }
|
|
40
|
+
* onSelect={ ( newMode ) => setMode( newMode ) }
|
|
41
|
+
* />
|
|
42
|
+
* </MenuGroup>
|
|
43
|
+
* );
|
|
44
|
+
* };
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function MenuItemsChoice( {
|
|
48
|
+
choices = [],
|
|
49
|
+
onHover = noop,
|
|
50
|
+
onSelect,
|
|
51
|
+
value,
|
|
52
|
+
}: MenuItemsChoiceProps ) {
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
{ choices.map( ( item ) => {
|
|
56
|
+
const isSelected = value === item.value;
|
|
57
|
+
return (
|
|
58
|
+
<MenuItem
|
|
59
|
+
key={ item.value }
|
|
60
|
+
role="menuitemradio"
|
|
61
|
+
icon={ isSelected && check }
|
|
62
|
+
info={ item.info }
|
|
63
|
+
isSelected={ isSelected }
|
|
64
|
+
shortcut={ item.shortcut }
|
|
65
|
+
className="components-menu-items-choice"
|
|
66
|
+
onClick={ () => {
|
|
67
|
+
if ( ! isSelected ) {
|
|
68
|
+
onSelect( item.value );
|
|
69
|
+
}
|
|
70
|
+
} }
|
|
71
|
+
onMouseEnter={ () => onHover( item.value ) }
|
|
72
|
+
onMouseLeave={ () => onHover( null ) }
|
|
73
|
+
aria-label={ item[ 'aria-label' ] }
|
|
74
|
+
>
|
|
75
|
+
{ item.label }
|
|
76
|
+
</MenuItem>
|
|
77
|
+
);
|
|
78
|
+
} ) }
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default MenuItemsChoice;
|
|
@@ -0,0 +1,79 @@
|
|
|
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 MenuItemsChoice from '..';
|
|
15
|
+
import MenuGroup from '../../menu-group';
|
|
16
|
+
|
|
17
|
+
const meta: ComponentMeta< typeof MenuItemsChoice > = {
|
|
18
|
+
component: MenuItemsChoice,
|
|
19
|
+
title: 'Components/MenuItemsChoice',
|
|
20
|
+
argTypes: {
|
|
21
|
+
onHover: { action: 'onHover' },
|
|
22
|
+
onSelect: { action: 'onSelect' },
|
|
23
|
+
value: { control: { type: null } },
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
controls: {
|
|
27
|
+
expanded: true,
|
|
28
|
+
},
|
|
29
|
+
docs: { source: { state: 'open' } },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
|
|
34
|
+
const Template: ComponentStory< typeof MenuItemsChoice > = ( {
|
|
35
|
+
onHover,
|
|
36
|
+
onSelect,
|
|
37
|
+
choices,
|
|
38
|
+
} ) => {
|
|
39
|
+
const [ choice, setChoice ] = useState( choices[ 0 ]?.value ?? '' );
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<MenuGroup label="Editor">
|
|
43
|
+
<MenuItemsChoice
|
|
44
|
+
choices={ choices }
|
|
45
|
+
value={ choice }
|
|
46
|
+
onSelect={ ( ...selectArgs ) => {
|
|
47
|
+
onSelect( ...selectArgs );
|
|
48
|
+
setChoice( ...selectArgs );
|
|
49
|
+
} }
|
|
50
|
+
onHover={ onHover }
|
|
51
|
+
/>
|
|
52
|
+
</MenuGroup>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Default: ComponentStory< typeof MenuItemsChoice > = Template.bind(
|
|
57
|
+
{}
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
Default.args = {
|
|
61
|
+
choices: [
|
|
62
|
+
{
|
|
63
|
+
value: 'arbitrary-choice-1',
|
|
64
|
+
label: 'Arbitrary Label #1',
|
|
65
|
+
info: 'Arbitrary Explanatory 1',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: 'arbitrary-choice-2',
|
|
69
|
+
label: 'Arbitrary Label #2',
|
|
70
|
+
info: 'Arbitrary Explanatory 2',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: 'arbitrary-choice-3',
|
|
74
|
+
label: 'Arbitrary Label #3',
|
|
75
|
+
info: 'Arbitrary Explanatory 3',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
value: 'arbitrary-choice-1',
|
|
79
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ShortcutProps } from '../shortcut/types';
|
|
5
|
+
|
|
6
|
+
export type MenuItemsChoiceProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Array of choices.
|
|
9
|
+
*
|
|
10
|
+
* @default []
|
|
11
|
+
*/
|
|
12
|
+
choices: readonly MenuItemChoice[];
|
|
13
|
+
/**
|
|
14
|
+
* Value of currently selected choice (should match a `value` property
|
|
15
|
+
* from a choice in `choices`).
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
/**
|
|
19
|
+
* Callback function to be called with the selected choice when user
|
|
20
|
+
* selects a new choice.
|
|
21
|
+
*/
|
|
22
|
+
onSelect( value: string ): void;
|
|
23
|
+
/**
|
|
24
|
+
* Callback function to be called with a choice when user
|
|
25
|
+
* hovers over a new choice (will be empty on mouse leave).
|
|
26
|
+
*
|
|
27
|
+
* @default noop
|
|
28
|
+
*/
|
|
29
|
+
onHover: ( value: string | null ) => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type MenuItemChoice = {
|
|
33
|
+
/**
|
|
34
|
+
* Human-readable label for choice.
|
|
35
|
+
*/
|
|
36
|
+
label: string;
|
|
37
|
+
/**
|
|
38
|
+
* Unique value for choice.
|
|
39
|
+
*/
|
|
40
|
+
value: string;
|
|
41
|
+
/**
|
|
42
|
+
* Additional information which will be rendered below the given label.
|
|
43
|
+
*/
|
|
44
|
+
info?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional keyboard sequence to trigger choice with keyboard shortcut
|
|
47
|
+
* (e.g. `ctrl+s`).
|
|
48
|
+
*/
|
|
49
|
+
shortcut?: ShortcutProps[ 'shortcut' ];
|
|
50
|
+
/**
|
|
51
|
+
* Aria compliant label.
|
|
52
|
+
*/
|
|
53
|
+
[ 'aria-label' ]?: string;
|
|
54
|
+
};
|
package/src/modal/index.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
useRef,
|
|
15
15
|
useState,
|
|
16
16
|
forwardRef,
|
|
17
|
+
useLayoutEffect,
|
|
17
18
|
} from '@wordpress/element';
|
|
18
19
|
import {
|
|
19
20
|
useInstanceId,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
} from '@wordpress/compose';
|
|
26
27
|
import { __ } from '@wordpress/i18n';
|
|
27
28
|
import { close } from '@wordpress/icons';
|
|
29
|
+
import { getScrollContainer } from '@wordpress/dom';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* Internal dependencies
|
|
@@ -76,8 +78,26 @@ function UnforwardedModal(
|
|
|
76
78
|
const constrainedTabbingRef = useConstrainedTabbing();
|
|
77
79
|
const focusReturnRef = useFocusReturn();
|
|
78
80
|
const focusOutsideProps = useFocusOutside( onRequestClose );
|
|
81
|
+
const contentRef = useRef< HTMLDivElement >( null );
|
|
82
|
+
const childrenContainerRef = useRef< HTMLDivElement >( null );
|
|
79
83
|
|
|
80
84
|
const [ hasScrolledContent, setHasScrolledContent ] = useState( false );
|
|
85
|
+
const [ hasScrollableContent, setHasScrollableContent ] = useState( false );
|
|
86
|
+
|
|
87
|
+
// Determines whether the Modal content is scrollable and updates the state.
|
|
88
|
+
const isContentScrollable = useCallback( () => {
|
|
89
|
+
if ( ! contentRef.current ) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const closestScrollContainer = getScrollContainer( contentRef.current );
|
|
94
|
+
|
|
95
|
+
if ( contentRef.current === closestScrollContainer ) {
|
|
96
|
+
setHasScrollableContent( true );
|
|
97
|
+
} else {
|
|
98
|
+
setHasScrollableContent( false );
|
|
99
|
+
}
|
|
100
|
+
}, [ contentRef ] );
|
|
81
101
|
|
|
82
102
|
useEffect( () => {
|
|
83
103
|
openModalCount++;
|
|
@@ -97,6 +117,22 @@ function UnforwardedModal(
|
|
|
97
117
|
};
|
|
98
118
|
}, [ bodyOpenClassName ] );
|
|
99
119
|
|
|
120
|
+
// Calls the isContentScrollable callback when the Modal children container resizes.
|
|
121
|
+
useLayoutEffect( () => {
|
|
122
|
+
if ( ! window.ResizeObserver || ! childrenContainerRef.current ) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const resizeObserver = new ResizeObserver( isContentScrollable );
|
|
127
|
+
resizeObserver.observe( childrenContainerRef.current );
|
|
128
|
+
|
|
129
|
+
isContentScrollable();
|
|
130
|
+
|
|
131
|
+
return () => {
|
|
132
|
+
resizeObserver.disconnect();
|
|
133
|
+
};
|
|
134
|
+
}, [ isContentScrollable, childrenContainerRef ] );
|
|
135
|
+
|
|
100
136
|
function handleEscapeKeyDown( event: KeyboardEvent< HTMLDivElement > ) {
|
|
101
137
|
if (
|
|
102
138
|
// Ignore keydowns from IMEs
|
|
@@ -172,10 +208,18 @@ function UnforwardedModal(
|
|
|
172
208
|
<div
|
|
173
209
|
className={ classnames( 'components-modal__content', {
|
|
174
210
|
'hide-header': __experimentalHideHeader,
|
|
211
|
+
'is-scrollable': hasScrollableContent,
|
|
175
212
|
'has-scrolled-content': hasScrolledContent,
|
|
176
213
|
} ) }
|
|
177
214
|
role="document"
|
|
178
215
|
onScroll={ onContentContainerScroll }
|
|
216
|
+
ref={ contentRef }
|
|
217
|
+
aria-label={
|
|
218
|
+
hasScrollableContent
|
|
219
|
+
? __( 'Scrollable section' )
|
|
220
|
+
: undefined
|
|
221
|
+
}
|
|
222
|
+
tabIndex={ hasScrollableContent ? 0 : undefined }
|
|
179
223
|
>
|
|
180
224
|
{ ! __experimentalHideHeader && (
|
|
181
225
|
<div className="components-modal__header">
|
|
@@ -208,7 +252,7 @@ function UnforwardedModal(
|
|
|
208
252
|
) }
|
|
209
253
|
</div>
|
|
210
254
|
) }
|
|
211
|
-
{ children }
|
|
255
|
+
<div ref={ childrenContainerRef }>{ children }</div>
|
|
212
256
|
</div>
|
|
213
257
|
</div>
|
|
214
258
|
</StyleProvider>
|
package/src/modal/style.scss
CHANGED
|
@@ -129,4 +129,12 @@
|
|
|
129
129
|
margin-top: 0;
|
|
130
130
|
padding-top: $grid-unit-30;
|
|
131
131
|
}
|
|
132
|
+
|
|
133
|
+
&.is-scrollable:focus-visible {
|
|
134
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
135
|
+
|
|
136
|
+
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
137
|
+
outline: 2px solid transparent;
|
|
138
|
+
outline-offset: -2px;
|
|
139
|
+
}
|
|
132
140
|
}
|
package/src/modal/types.ts
CHANGED
package/src/navigator/context.ts
CHANGED
|
@@ -12,5 +12,9 @@ const initialContextValue: NavigatorContextType = {
|
|
|
12
12
|
location: {},
|
|
13
13
|
goTo: () => {},
|
|
14
14
|
goBack: () => {},
|
|
15
|
+
goToParent: () => {},
|
|
16
|
+
addScreen: () => {},
|
|
17
|
+
removeScreen: () => {},
|
|
18
|
+
params: {},
|
|
15
19
|
};
|
|
16
20
|
export const NavigatorContext = createContext( initialContextValue );
|
package/src/navigator/index.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { NavigatorProvider } from './navigator-provider';
|
|
|
2
2
|
export { NavigatorScreen } from './navigator-screen';
|
|
3
3
|
export { NavigatorButton } from './navigator-button';
|
|
4
4
|
export { NavigatorBackButton } from './navigator-back-button';
|
|
5
|
+
export { NavigatorToParentButton } from './navigator-to-parent-button';
|
|
5
6
|
export { default as useNavigator } from './use-navigator';
|
|
@@ -10,22 +10,6 @@ The `NavigatorBackButton` component can be used to navigate to a screen and shou
|
|
|
10
10
|
|
|
11
11
|
Refer to [the `NavigatorProvider` component](/packages/components/src/navigator/navigator-provider/README.md#usage) for a usage example.
|
|
12
12
|
|
|
13
|
-
## Props
|
|
14
|
-
|
|
15
|
-
The component accepts the following props:
|
|
16
|
-
|
|
17
|
-
### `onClick`: `React.MouseEventHandler< HTMLElement >`
|
|
18
|
-
|
|
19
|
-
The callback called in response to a `click` event.
|
|
20
|
-
|
|
21
|
-
- Required: No
|
|
22
|
-
|
|
23
|
-
### `path`: `string`
|
|
24
|
-
|
|
25
|
-
The path of the screen to navigate to.
|
|
26
|
-
|
|
27
|
-
- Required: Yes
|
|
28
|
-
|
|
29
13
|
### Inherited props
|
|
30
14
|
|
|
31
|
-
`NavigatorBackButton` also inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`.
|
|
15
|
+
`NavigatorBackButton` also inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href` and `target`.
|
|
@@ -9,26 +9,31 @@ import { useCallback } from '@wordpress/element';
|
|
|
9
9
|
import { useContextSystem, WordPressComponentProps } from '../../ui/context';
|
|
10
10
|
import Button from '../../button';
|
|
11
11
|
import useNavigator from '../use-navigator';
|
|
12
|
-
import type {
|
|
12
|
+
import type { NavigatorBackButtonHookProps } from '../types';
|
|
13
13
|
|
|
14
14
|
export function useNavigatorBackButton(
|
|
15
|
-
props: WordPressComponentProps<
|
|
15
|
+
props: WordPressComponentProps< NavigatorBackButtonHookProps, 'button' >
|
|
16
16
|
) {
|
|
17
17
|
const {
|
|
18
18
|
onClick,
|
|
19
19
|
as = Button,
|
|
20
|
+
goToParent: goToParentProp = false,
|
|
20
21
|
...otherProps
|
|
21
22
|
} = useContextSystem( props, 'NavigatorBackButton' );
|
|
22
23
|
|
|
23
|
-
const { goBack } = useNavigator();
|
|
24
|
+
const { goBack, goToParent } = useNavigator();
|
|
24
25
|
const handleClick: React.MouseEventHandler< HTMLButtonElement > =
|
|
25
26
|
useCallback(
|
|
26
27
|
( e ) => {
|
|
27
28
|
e.preventDefault();
|
|
28
|
-
|
|
29
|
+
if ( goToParentProp ) {
|
|
30
|
+
goToParent();
|
|
31
|
+
} else {
|
|
32
|
+
goBack();
|
|
33
|
+
}
|
|
29
34
|
onClick?.( e );
|
|
30
35
|
},
|
|
31
|
-
[ goBack, onClick ]
|
|
36
|
+
[ goToParentProp, goToParent, goBack, onClick ]
|
|
32
37
|
);
|
|
33
38
|
|
|
34
39
|
return {
|
|
@@ -35,4 +35,4 @@ The path of the screen to navigate to. The value of this prop needs to be [a val
|
|
|
35
35
|
|
|
36
36
|
### Inherited props
|
|
37
37
|
|
|
38
|
-
`NavigatorButton` also inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`.
|
|
38
|
+
`NavigatorButton` also inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href` and `target`.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
-
The `NavigatorProvider` component allows rendering nested views/panels/menus (via the [`NavigatorScreen` component](/packages/components/src/navigator/navigator-screen/README.md)) and navigate between these different states (via the [`NavigatorButton`](/packages/components/src/navigator/navigator-button/README.md) and [`NavigatorBackButton`](/packages/components/src/navigator/navigator-back-button/README.md) components or the `useNavigator` hook). The Global Styles sidebar is an example of this.
|
|
7
|
+
The `NavigatorProvider` component allows rendering nested views/panels/menus (via the [`NavigatorScreen` component](/packages/components/src/navigator/navigator-screen/README.md)) and navigate between these different states (via the [`NavigatorButton`](/packages/components/src/navigator/navigator-button/README.md), [`NavigatorToParentButton`](/packages/components/src/navigator/navigator-to-parent-button/README.md) and [`NavigatorBackButton`](/packages/components/src/navigator/navigator-back-button/README.md) components or the `useNavigator` hook). The Global Styles sidebar is an example of this.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__experimentalNavigatorProvider as NavigatorProvider,
|
|
14
14
|
__experimentalNavigatorScreen as NavigatorScreen,
|
|
15
15
|
__experimentalNavigatorButton as NavigatorButton,
|
|
16
|
-
|
|
16
|
+
__experimentalNavigatorToParentButton as NavigatorToParentButton,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
18
|
|
|
19
19
|
const MyNavigation = () => (
|
|
@@ -27,13 +27,21 @@ const MyNavigation = () => (
|
|
|
27
27
|
|
|
28
28
|
<NavigatorScreen path="/child">
|
|
29
29
|
<p>This is the child screen.</p>
|
|
30
|
-
<
|
|
30
|
+
<NavigatorToParentButton>
|
|
31
31
|
Go back
|
|
32
|
-
</
|
|
32
|
+
</NavigatorToParentButton>
|
|
33
33
|
</NavigatorScreen>
|
|
34
34
|
</NavigatorProvider>
|
|
35
35
|
);
|
|
36
36
|
```
|
|
37
|
+
**Important note**
|
|
38
|
+
|
|
39
|
+
Parent/child navigation only works if the path you define are hierarchical, following a URL-like scheme where each path segment is separated by the `/` character.
|
|
40
|
+
For example:
|
|
41
|
+
- `/` is the root of all paths. There should always be a screen with `path="/"`.
|
|
42
|
+
- `/parent/child` is a child of `/parent`.
|
|
43
|
+
- `/parent/child/grand-child` is a child of `/parent/child`.
|
|
44
|
+
- `/parent/:param` is a child of `/parent` as well.
|
|
37
45
|
|
|
38
46
|
## Props
|
|
39
47
|
|
|
@@ -58,6 +66,15 @@ The `goTo` function allows navigating to a given path. The second argument can a
|
|
|
58
66
|
The available options are:
|
|
59
67
|
|
|
60
68
|
- `focusTargetSelector`: `string`. An optional property used to specify the CSS selector used to restore focus on the matching element when navigating back.
|
|
69
|
+
- `isBack`: `boolean`. An optional property used to specify whether the navigation should be considered as backwards (thus enabling focus restoration when possible, and causing the animation to be backwards too)
|
|
70
|
+
|
|
71
|
+
### `goToParent`: `() => void;`
|
|
72
|
+
|
|
73
|
+
The `goToParent` function allows navigating to the parent screen.
|
|
74
|
+
|
|
75
|
+
Parent/child navigation only works if the path you define are hierarchical (see note above).
|
|
76
|
+
|
|
77
|
+
When a match is not found, the function will try to recursively navigate the path hierarchy until a matching screen (or the root `/`) are found.
|
|
61
78
|
|
|
62
79
|
### `goBack`: `() => void`
|
|
63
80
|
|
|
@@ -70,3 +87,7 @@ The `location` object represent the current location, and has a few properties:
|
|
|
70
87
|
- `path`: `string`. The path associated to the location.
|
|
71
88
|
- `isBack`: `boolean`. A flag that is `true` when the current location was reached by navigating backwards in the location stack.
|
|
72
89
|
- `isInitial`: `boolean`. A flag that is `true` only for the first (root) location in the location stack.
|
|
90
|
+
|
|
91
|
+
### `params`: `Record< string, string | string[] >`
|
|
92
|
+
|
|
93
|
+
The parsed record of parameters from the current location. For example if the current screen path is `/product/:productId` and the location is `/product/123`, then `params` will be `{ productId: '123' }`.
|