@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,11 +13,14 @@ import { useState } from '@wordpress/element';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
+
import Button from '../../button';
|
|
16
17
|
import {
|
|
17
18
|
NavigatorProvider,
|
|
18
19
|
NavigatorScreen,
|
|
19
20
|
NavigatorButton,
|
|
20
21
|
NavigatorBackButton,
|
|
22
|
+
NavigatorToParentButton,
|
|
23
|
+
useNavigator,
|
|
21
24
|
} from '..';
|
|
22
25
|
|
|
23
26
|
jest.mock( 'framer-motion', () => {
|
|
@@ -50,6 +53,9 @@ const PATHS = {
|
|
|
50
53
|
HOME: '/',
|
|
51
54
|
CHILD: '/child',
|
|
52
55
|
NESTED: '/child/nested',
|
|
56
|
+
PRODUCT_PATTERN: '/product/:productId',
|
|
57
|
+
PRODUCT_1: '/product/1',
|
|
58
|
+
PRODUCT_2: '/product/2',
|
|
53
59
|
INVALID_HTML_ATTRIBUTE: INVALID_HTML_ATTRIBUTE.raw,
|
|
54
60
|
NOT_FOUND: '/not-found',
|
|
55
61
|
};
|
|
@@ -58,6 +64,7 @@ const SCREEN_TEXT = {
|
|
|
58
64
|
home: 'This is the home screen.',
|
|
59
65
|
child: 'This is the child screen.',
|
|
60
66
|
nested: 'This is the nested screen.',
|
|
67
|
+
product: 'This is the product screen.',
|
|
61
68
|
invalidHtmlPath: 'This is the screen with an invalid HTML value as a path.',
|
|
62
69
|
};
|
|
63
70
|
|
|
@@ -65,9 +72,12 @@ const BUTTON_TEXT = {
|
|
|
65
72
|
toNonExistingScreen: 'Navigate to non-existing screen.',
|
|
66
73
|
toChildScreen: 'Navigate to child screen.',
|
|
67
74
|
toNestedScreen: 'Navigate to nested screen.',
|
|
75
|
+
toProductScreen1: 'Navigate to product 1 screen.',
|
|
76
|
+
toProductScreen2: 'Navigate to product 2 screen.',
|
|
68
77
|
toInvalidHtmlPathScreen:
|
|
69
78
|
'Navigate to screen with an invalid HTML value as a path.',
|
|
70
79
|
back: 'Go back',
|
|
80
|
+
backUsingGoTo: 'Go back using goTo',
|
|
71
81
|
};
|
|
72
82
|
|
|
73
83
|
type CustomTestOnClickHandler = (
|
|
@@ -77,6 +87,7 @@ type CustomTestOnClickHandler = (
|
|
|
77
87
|
path: string;
|
|
78
88
|
}
|
|
79
89
|
| { type: 'goBack' }
|
|
90
|
+
| { type: 'goToParent' }
|
|
80
91
|
) => void;
|
|
81
92
|
|
|
82
93
|
function CustomNavigatorButton( {
|
|
@@ -98,20 +109,21 @@ function CustomNavigatorButton( {
|
|
|
98
109
|
);
|
|
99
110
|
}
|
|
100
111
|
|
|
101
|
-
function
|
|
112
|
+
function CustomNavigatorGoToBackButton( {
|
|
102
113
|
path,
|
|
103
114
|
onClick,
|
|
104
115
|
...props
|
|
105
116
|
}: Omit< ComponentPropsWithoutRef< typeof NavigatorButton >, 'onClick' > & {
|
|
106
117
|
onClick?: CustomTestOnClickHandler;
|
|
107
118
|
} ) {
|
|
119
|
+
const { goTo } = useNavigator();
|
|
108
120
|
return (
|
|
109
|
-
<
|
|
121
|
+
<Button
|
|
110
122
|
onClick={ () => {
|
|
123
|
+
goTo( path, { isBack: true } );
|
|
111
124
|
// Used to spy on the values passed to `navigator.goTo`.
|
|
112
125
|
onClick?.( { type: 'goTo', path } );
|
|
113
126
|
} }
|
|
114
|
-
path={ path }
|
|
115
127
|
{ ...props }
|
|
116
128
|
/>
|
|
117
129
|
);
|
|
@@ -134,6 +146,41 @@ function CustomNavigatorBackButton( {
|
|
|
134
146
|
);
|
|
135
147
|
}
|
|
136
148
|
|
|
149
|
+
function CustomNavigatorToParentButton( {
|
|
150
|
+
onClick,
|
|
151
|
+
...props
|
|
152
|
+
}: Omit< ComponentPropsWithoutRef< typeof NavigatorBackButton >, 'onClick' > & {
|
|
153
|
+
onClick?: CustomTestOnClickHandler;
|
|
154
|
+
} ) {
|
|
155
|
+
return (
|
|
156
|
+
<NavigatorToParentButton
|
|
157
|
+
onClick={ () => {
|
|
158
|
+
// Used to spy on the values passed to `navigator.goBack`.
|
|
159
|
+
onClick?.( { type: 'goToParent' } );
|
|
160
|
+
} }
|
|
161
|
+
{ ...props }
|
|
162
|
+
/>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const ProductScreen = ( {
|
|
167
|
+
onBackButtonClick,
|
|
168
|
+
}: {
|
|
169
|
+
onBackButtonClick?: CustomTestOnClickHandler;
|
|
170
|
+
} ) => {
|
|
171
|
+
const { params } = useNavigator();
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<NavigatorScreen path={ PATHS.PRODUCT_PATTERN }>
|
|
175
|
+
<p>{ SCREEN_TEXT.product }</p>
|
|
176
|
+
<p>Product ID is { params.productId }</p>
|
|
177
|
+
<CustomNavigatorBackButton onClick={ onBackButtonClick }>
|
|
178
|
+
{ BUTTON_TEXT.back }
|
|
179
|
+
</CustomNavigatorBackButton>
|
|
180
|
+
</NavigatorScreen>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
|
|
137
184
|
const MyNavigation = ( {
|
|
138
185
|
initialPath = PATHS.HOME,
|
|
139
186
|
onNavigatorButtonClick,
|
|
@@ -148,6 +195,12 @@ const MyNavigation = ( {
|
|
|
148
195
|
<NavigatorProvider initialPath={ initialPath }>
|
|
149
196
|
<NavigatorScreen path={ PATHS.HOME }>
|
|
150
197
|
<p>{ SCREEN_TEXT.home }</p>
|
|
198
|
+
{ /*
|
|
199
|
+
* A button useful to test focus restoration. This button is the first
|
|
200
|
+
* tabbable item in the screen, but should not receive focus when
|
|
201
|
+
* navigating to screen as a result of a backwards navigation.
|
|
202
|
+
*/ }
|
|
203
|
+
<button>First tabbable home screen button</button>
|
|
151
204
|
<CustomNavigatorButton
|
|
152
205
|
path={ PATHS.NOT_FOUND }
|
|
153
206
|
onClick={ onNavigatorButtonClick }
|
|
@@ -160,6 +213,18 @@ const MyNavigation = ( {
|
|
|
160
213
|
>
|
|
161
214
|
{ BUTTON_TEXT.toChildScreen }
|
|
162
215
|
</CustomNavigatorButton>
|
|
216
|
+
<CustomNavigatorButton
|
|
217
|
+
path={ PATHS.PRODUCT_1 }
|
|
218
|
+
onClick={ onNavigatorButtonClick }
|
|
219
|
+
>
|
|
220
|
+
{ BUTTON_TEXT.toProductScreen1 }
|
|
221
|
+
</CustomNavigatorButton>
|
|
222
|
+
<CustomNavigatorButton
|
|
223
|
+
path={ PATHS.PRODUCT_2 }
|
|
224
|
+
onClick={ onNavigatorButtonClick }
|
|
225
|
+
>
|
|
226
|
+
{ BUTTON_TEXT.toProductScreen2 }
|
|
227
|
+
</CustomNavigatorButton>
|
|
163
228
|
<CustomNavigatorButton
|
|
164
229
|
path={ PATHS.INVALID_HTML_ATTRIBUTE }
|
|
165
230
|
onClick={ onNavigatorButtonClick }
|
|
@@ -170,12 +235,18 @@ const MyNavigation = ( {
|
|
|
170
235
|
|
|
171
236
|
<NavigatorScreen path={ PATHS.CHILD }>
|
|
172
237
|
<p>{ SCREEN_TEXT.child }</p>
|
|
173
|
-
|
|
238
|
+
{ /*
|
|
239
|
+
* A button useful to test focus restoration. This button is the first
|
|
240
|
+
* tabbable item in the screen, but should not receive focus when
|
|
241
|
+
* navigating to screen as a result of a backwards navigation.
|
|
242
|
+
*/ }
|
|
243
|
+
<button>First tabbable child screen button</button>
|
|
244
|
+
<CustomNavigatorButton
|
|
174
245
|
path={ PATHS.NESTED }
|
|
175
246
|
onClick={ onNavigatorButtonClick }
|
|
176
247
|
>
|
|
177
248
|
{ BUTTON_TEXT.toNestedScreen }
|
|
178
|
-
</
|
|
249
|
+
</CustomNavigatorButton>
|
|
179
250
|
<CustomNavigatorBackButton
|
|
180
251
|
onClick={ onNavigatorButtonClick }
|
|
181
252
|
>
|
|
@@ -203,6 +274,8 @@ const MyNavigation = ( {
|
|
|
203
274
|
</CustomNavigatorBackButton>
|
|
204
275
|
</NavigatorScreen>
|
|
205
276
|
|
|
277
|
+
<ProductScreen onBackButtonClick={ onNavigatorButtonClick } />
|
|
278
|
+
|
|
206
279
|
<NavigatorScreen path={ PATHS.INVALID_HTML_ATTRIBUTE }>
|
|
207
280
|
<p>{ SCREEN_TEXT.invalidHtmlPath }</p>
|
|
208
281
|
<CustomNavigatorBackButton
|
|
@@ -229,6 +302,72 @@ const MyNavigation = ( {
|
|
|
229
302
|
);
|
|
230
303
|
};
|
|
231
304
|
|
|
305
|
+
const MyHierarchicalNavigation = ( {
|
|
306
|
+
initialPath = PATHS.HOME,
|
|
307
|
+
onNavigatorButtonClick,
|
|
308
|
+
}: {
|
|
309
|
+
initialPath?: string;
|
|
310
|
+
onNavigatorButtonClick?: CustomTestOnClickHandler;
|
|
311
|
+
} ) => {
|
|
312
|
+
return (
|
|
313
|
+
<>
|
|
314
|
+
<NavigatorProvider initialPath={ initialPath }>
|
|
315
|
+
<NavigatorScreen path={ PATHS.HOME }>
|
|
316
|
+
<p>{ SCREEN_TEXT.home }</p>
|
|
317
|
+
{ /*
|
|
318
|
+
* A button useful to test focus restoration. This button is the first
|
|
319
|
+
* tabbable item in the screen, but should not receive focus when
|
|
320
|
+
* navigating to screen as a result of a backwards navigation.
|
|
321
|
+
*/ }
|
|
322
|
+
<button>First tabbable home screen button</button>
|
|
323
|
+
<CustomNavigatorButton
|
|
324
|
+
path={ PATHS.CHILD }
|
|
325
|
+
onClick={ onNavigatorButtonClick }
|
|
326
|
+
>
|
|
327
|
+
{ BUTTON_TEXT.toChildScreen }
|
|
328
|
+
</CustomNavigatorButton>
|
|
329
|
+
</NavigatorScreen>
|
|
330
|
+
|
|
331
|
+
<NavigatorScreen path={ PATHS.CHILD }>
|
|
332
|
+
<p>{ SCREEN_TEXT.child }</p>
|
|
333
|
+
{ /*
|
|
334
|
+
* A button useful to test focus restoration. This button is the first
|
|
335
|
+
* tabbable item in the screen, but should not receive focus when
|
|
336
|
+
* navigating to screen as a result of a backwards navigation.
|
|
337
|
+
*/ }
|
|
338
|
+
<button>First tabbable child screen button</button>
|
|
339
|
+
<CustomNavigatorButton
|
|
340
|
+
path={ PATHS.NESTED }
|
|
341
|
+
onClick={ onNavigatorButtonClick }
|
|
342
|
+
>
|
|
343
|
+
{ BUTTON_TEXT.toNestedScreen }
|
|
344
|
+
</CustomNavigatorButton>
|
|
345
|
+
<CustomNavigatorToParentButton
|
|
346
|
+
onClick={ onNavigatorButtonClick }
|
|
347
|
+
>
|
|
348
|
+
{ BUTTON_TEXT.back }
|
|
349
|
+
</CustomNavigatorToParentButton>
|
|
350
|
+
</NavigatorScreen>
|
|
351
|
+
|
|
352
|
+
<NavigatorScreen path={ PATHS.NESTED }>
|
|
353
|
+
<p>{ SCREEN_TEXT.nested }</p>
|
|
354
|
+
<CustomNavigatorToParentButton
|
|
355
|
+
onClick={ onNavigatorButtonClick }
|
|
356
|
+
>
|
|
357
|
+
{ BUTTON_TEXT.back }
|
|
358
|
+
</CustomNavigatorToParentButton>
|
|
359
|
+
<CustomNavigatorGoToBackButton
|
|
360
|
+
path={ PATHS.CHILD }
|
|
361
|
+
onClick={ onNavigatorButtonClick }
|
|
362
|
+
>
|
|
363
|
+
{ BUTTON_TEXT.backUsingGoTo }
|
|
364
|
+
</CustomNavigatorGoToBackButton>
|
|
365
|
+
</NavigatorScreen>
|
|
366
|
+
</NavigatorProvider>
|
|
367
|
+
</>
|
|
368
|
+
);
|
|
369
|
+
};
|
|
370
|
+
|
|
232
371
|
const getScreen = ( screenKey: keyof typeof SCREEN_TEXT ) =>
|
|
233
372
|
screen.getByText( SCREEN_TEXT[ screenKey ] );
|
|
234
373
|
const queryScreen = ( screenKey: keyof typeof SCREEN_TEXT ) =>
|
|
@@ -369,7 +508,7 @@ describe( 'Navigator', () => {
|
|
|
369
508
|
} );
|
|
370
509
|
} );
|
|
371
510
|
|
|
372
|
-
it( 'should not
|
|
511
|
+
it( 'should not render anything if the path does not match any available screen', async () => {
|
|
373
512
|
const spy = jest.fn();
|
|
374
513
|
|
|
375
514
|
const user = userEvent.setup();
|
|
@@ -396,8 +535,6 @@ describe( 'Navigator', () => {
|
|
|
396
535
|
} );
|
|
397
536
|
|
|
398
537
|
it( 'should escape the value of the `path` prop', async () => {
|
|
399
|
-
const user = userEvent.setup();
|
|
400
|
-
|
|
401
538
|
render( <MyNavigation /> );
|
|
402
539
|
|
|
403
540
|
expect( getScreen( 'home' ) ).toBeInTheDocument();
|
|
@@ -407,24 +544,42 @@ describe( 'Navigator', () => {
|
|
|
407
544
|
|
|
408
545
|
// The following line tests the implementation details, but it's necessary
|
|
409
546
|
// as this would be otherwise transparent to the user.
|
|
547
|
+
// A potential way would be to check if an invalid HTML attribute could
|
|
548
|
+
// be detected in the tests (by JSDom or any other plugin). We could then
|
|
549
|
+
// make sure that an invalid path would not error because it's escaped
|
|
550
|
+
// correctly.
|
|
410
551
|
expect(
|
|
411
552
|
getNavigationButton( 'toInvalidHtmlPathScreen' )
|
|
412
553
|
).toHaveAttribute( 'id', INVALID_HTML_ATTRIBUTE.escaped );
|
|
554
|
+
} );
|
|
413
555
|
|
|
414
|
-
|
|
415
|
-
|
|
556
|
+
it( 'should match correctly paths with named arguments', async () => {
|
|
557
|
+
const user = userEvent.setup();
|
|
416
558
|
|
|
417
|
-
|
|
418
|
-
|
|
559
|
+
render( <MyNavigation /> );
|
|
560
|
+
|
|
561
|
+
expect( getScreen( 'home' ) ).toBeInTheDocument();
|
|
419
562
|
|
|
420
|
-
// Navigate
|
|
421
|
-
|
|
563
|
+
// Navigate to Product 1 screen
|
|
564
|
+
await user.click( getNavigationButton( 'toProductScreen1' ) );
|
|
565
|
+
|
|
566
|
+
expect( getScreen( 'product' ) ).toBeInTheDocument();
|
|
567
|
+
|
|
568
|
+
// Check that named parameter is extracted correctly
|
|
569
|
+
expect( screen.getByText( 'Product ID is 1' ) ).toBeInTheDocument();
|
|
570
|
+
|
|
571
|
+
// Navigate back to home screen
|
|
422
572
|
await user.click( getNavigationButton( 'back' ) );
|
|
423
573
|
|
|
424
574
|
expect( getScreen( 'home' ) ).toBeInTheDocument();
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
575
|
+
|
|
576
|
+
// Navigate to Product 2 screen
|
|
577
|
+
await user.click( getNavigationButton( 'toProductScreen2' ) );
|
|
578
|
+
|
|
579
|
+
expect( getScreen( 'product' ) ).toBeInTheDocument();
|
|
580
|
+
|
|
581
|
+
// Check that named parameter is extracted correctly
|
|
582
|
+
expect( screen.getByText( 'Product ID is 2' ) ).toBeInTheDocument();
|
|
428
583
|
} );
|
|
429
584
|
|
|
430
585
|
describe( 'focus management', () => {
|
|
@@ -437,7 +592,11 @@ describe( 'Navigator', () => {
|
|
|
437
592
|
await user.click( getNavigationButton( 'toChildScreen' ) );
|
|
438
593
|
|
|
439
594
|
// The first tabbable element receives focus.
|
|
440
|
-
expect(
|
|
595
|
+
expect(
|
|
596
|
+
screen.getByRole( 'button', {
|
|
597
|
+
name: 'First tabbable child screen button',
|
|
598
|
+
} )
|
|
599
|
+
).toHaveFocus();
|
|
441
600
|
|
|
442
601
|
// Navigate to nested screen.
|
|
443
602
|
await user.click( getNavigationButton( 'toNestedScreen' ) );
|
|
@@ -448,14 +607,29 @@ describe( 'Navigator', () => {
|
|
|
448
607
|
// Navigate back to child screen.
|
|
449
608
|
await user.click( getNavigationButton( 'back' ) );
|
|
450
609
|
|
|
451
|
-
//
|
|
610
|
+
// Focus is restored on the last element that had focus when the
|
|
611
|
+
// navigation away from the screen occurred.
|
|
452
612
|
expect( getNavigationButton( 'toNestedScreen' ) ).toHaveFocus();
|
|
453
613
|
|
|
454
|
-
// Navigate back to home screen
|
|
614
|
+
// Navigate back to home screen.
|
|
455
615
|
await user.click( getNavigationButton( 'back' ) );
|
|
456
616
|
|
|
457
|
-
//
|
|
617
|
+
// Focus is restored on the last element that had focus when the
|
|
618
|
+
// navigation away from the screen occurred.
|
|
458
619
|
expect( getNavigationButton( 'toChildScreen' ) ).toHaveFocus();
|
|
620
|
+
|
|
621
|
+
// Navigate to product screen for product 2
|
|
622
|
+
await user.click( getNavigationButton( 'toProductScreen2' ) );
|
|
623
|
+
|
|
624
|
+
// The first tabbable element receives focus.
|
|
625
|
+
expect( getNavigationButton( 'back' ) ).toHaveFocus();
|
|
626
|
+
|
|
627
|
+
// Navigate back to home screen.
|
|
628
|
+
await user.click( getNavigationButton( 'back' ) );
|
|
629
|
+
|
|
630
|
+
// Focus is restored on the last element that had focus when the
|
|
631
|
+
// navigation away from the screen occurred.
|
|
632
|
+
expect( getNavigationButton( 'toProductScreen2' ) ).toHaveFocus();
|
|
459
633
|
} );
|
|
460
634
|
|
|
461
635
|
it( 'should keep focus on an active element inside navigator, while re-rendering', async () => {
|
|
@@ -467,7 +641,11 @@ describe( 'Navigator', () => {
|
|
|
467
641
|
await user.click( getNavigationButton( 'toChildScreen' ) );
|
|
468
642
|
|
|
469
643
|
// The first tabbable element receives focus.
|
|
470
|
-
expect(
|
|
644
|
+
expect(
|
|
645
|
+
screen.getByRole( 'button', {
|
|
646
|
+
name: 'First tabbable child screen button',
|
|
647
|
+
} )
|
|
648
|
+
).toHaveFocus();
|
|
471
649
|
|
|
472
650
|
// Interact with the inner input.
|
|
473
651
|
// The focus should stay on the input element.
|
|
@@ -485,7 +663,11 @@ describe( 'Navigator', () => {
|
|
|
485
663
|
await user.click( getNavigationButton( 'toChildScreen' ) );
|
|
486
664
|
|
|
487
665
|
// The first tabbable element receives focus.
|
|
488
|
-
expect(
|
|
666
|
+
expect(
|
|
667
|
+
screen.getByRole( 'button', {
|
|
668
|
+
name: 'First tabbable child screen button',
|
|
669
|
+
} )
|
|
670
|
+
).toHaveFocus();
|
|
489
671
|
|
|
490
672
|
// Interact with the outer input.
|
|
491
673
|
// The focus should stay on the input element.
|
|
@@ -493,5 +675,67 @@ describe( 'Navigator', () => {
|
|
|
493
675
|
await user.type( outerInput, 'd' );
|
|
494
676
|
expect( outerInput ).toHaveFocus();
|
|
495
677
|
} );
|
|
678
|
+
|
|
679
|
+
it( 'should restore focus correctly even when the `path` needs to be escaped', async () => {
|
|
680
|
+
const user = userEvent.setup();
|
|
681
|
+
|
|
682
|
+
render( <MyNavigation /> );
|
|
683
|
+
|
|
684
|
+
expect( getScreen( 'home' ) ).toBeInTheDocument();
|
|
685
|
+
|
|
686
|
+
// Navigate to screen with an invalid HTML value for its `path`.
|
|
687
|
+
await user.click(
|
|
688
|
+
getNavigationButton( 'toInvalidHtmlPathScreen' )
|
|
689
|
+
);
|
|
690
|
+
|
|
691
|
+
expect( getScreen( 'invalidHtmlPath' ) ).toBeInTheDocument();
|
|
692
|
+
|
|
693
|
+
// Navigate back to home screen, check that the focus restoration selector
|
|
694
|
+
// worked correctly despite the escaping.
|
|
695
|
+
await user.click( getNavigationButton( 'back' ) );
|
|
696
|
+
|
|
697
|
+
expect( getScreen( 'home' ) ).toBeInTheDocument();
|
|
698
|
+
expect(
|
|
699
|
+
getNavigationButton( 'toInvalidHtmlPathScreen' )
|
|
700
|
+
).toHaveFocus();
|
|
701
|
+
} );
|
|
702
|
+
|
|
703
|
+
it( 'should restore focus while using goTo and goToParent', async () => {
|
|
704
|
+
const user = userEvent.setup();
|
|
705
|
+
|
|
706
|
+
render( <MyHierarchicalNavigation /> );
|
|
707
|
+
|
|
708
|
+
expect( getScreen( 'home' ) ).toBeInTheDocument();
|
|
709
|
+
|
|
710
|
+
// Navigate to child screen.
|
|
711
|
+
await user.click( getNavigationButton( 'toChildScreen' ) );
|
|
712
|
+
expect( getScreen( 'child' ) ).toBeInTheDocument();
|
|
713
|
+
|
|
714
|
+
// Navigate to nested screen.
|
|
715
|
+
await user.click( getNavigationButton( 'toNestedScreen' ) );
|
|
716
|
+
expect( getScreen( 'nested' ) ).toBeInTheDocument();
|
|
717
|
+
expect( getNavigationButton( 'back' ) ).toBeInTheDocument();
|
|
718
|
+
|
|
719
|
+
// Navigate back to child screen using the back button.
|
|
720
|
+
await user.click( getNavigationButton( 'back' ) );
|
|
721
|
+
expect( getScreen( 'child' ) ).toBeInTheDocument();
|
|
722
|
+
expect( getNavigationButton( 'toNestedScreen' ) ).toHaveFocus();
|
|
723
|
+
|
|
724
|
+
// Re navigate to nested screen.
|
|
725
|
+
await user.click( getNavigationButton( 'toNestedScreen' ) );
|
|
726
|
+
expect( getScreen( 'nested' ) ).toBeInTheDocument();
|
|
727
|
+
expect(
|
|
728
|
+
getNavigationButton( 'backUsingGoTo' )
|
|
729
|
+
).toBeInTheDocument();
|
|
730
|
+
|
|
731
|
+
// Navigate back to child screen using the go to button.
|
|
732
|
+
await user.click( getNavigationButton( 'backUsingGoTo' ) );
|
|
733
|
+
expect( getScreen( 'child' ) ).toBeInTheDocument();
|
|
734
|
+
expect( getNavigationButton( 'toNestedScreen' ) ).toHaveFocus();
|
|
735
|
+
|
|
736
|
+
// Navigate back to home screen.
|
|
737
|
+
await user.click( getNavigationButton( 'back' ) );
|
|
738
|
+
expect( getNavigationButton( 'toChildScreen' ) ).toHaveFocus();
|
|
739
|
+
} );
|
|
496
740
|
} );
|
|
497
741
|
} );
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { patternMatch, findParent } from '../utils/router';
|
|
5
|
+
|
|
6
|
+
describe( 'patternMatch', () => {
|
|
7
|
+
it( 'should return undefined if not pattern is matched', () => {
|
|
8
|
+
const result = patternMatch( '/test', [ { id: 'route', path: '/' } ] );
|
|
9
|
+
expect( result ).toBeUndefined();
|
|
10
|
+
} );
|
|
11
|
+
|
|
12
|
+
it( 'should match a pattern with no params', () => {
|
|
13
|
+
const result = patternMatch( '/test', [
|
|
14
|
+
{ id: 'route', path: '/test' },
|
|
15
|
+
] );
|
|
16
|
+
expect( result ).toEqual( { id: 'route', params: {} } );
|
|
17
|
+
} );
|
|
18
|
+
|
|
19
|
+
it( 'should match a pattern with params', () => {
|
|
20
|
+
const result = patternMatch( '/test/123', [
|
|
21
|
+
{ id: 'route', path: '/test/:id' },
|
|
22
|
+
] );
|
|
23
|
+
expect( result ).toEqual( { id: 'route', params: { id: '123' } } );
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
it( 'should match the first pattern in case of ambiguity', () => {
|
|
27
|
+
const result = patternMatch( '/test/123', [
|
|
28
|
+
{ id: 'route1', path: '/test/:id' },
|
|
29
|
+
{ id: 'route2', path: '/test/123' },
|
|
30
|
+
] );
|
|
31
|
+
expect( result ).toEqual( { id: 'route1', params: { id: '123' } } );
|
|
32
|
+
} );
|
|
33
|
+
|
|
34
|
+
it( 'should match a pattern with optional params', () => {
|
|
35
|
+
const result = patternMatch( '/test', [
|
|
36
|
+
{ id: 'route', path: '/test/:id?' },
|
|
37
|
+
] );
|
|
38
|
+
expect( result ).toEqual( { id: 'route', params: {} } );
|
|
39
|
+
} );
|
|
40
|
+
|
|
41
|
+
it( 'should return an array of matches for the same param', () => {
|
|
42
|
+
const result = patternMatch( '/some/basic/route', [
|
|
43
|
+
{ id: 'route', path: '/:test+' },
|
|
44
|
+
] );
|
|
45
|
+
expect( result ).toEqual( {
|
|
46
|
+
id: 'route',
|
|
47
|
+
params: { test: [ 'some', 'basic', 'route' ] },
|
|
48
|
+
} );
|
|
49
|
+
} );
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
describe( 'findParent', () => {
|
|
53
|
+
it( 'should return undefined if no parent is found', () => {
|
|
54
|
+
const result = findParent( '/test', [
|
|
55
|
+
{ id: 'route', path: '/test' },
|
|
56
|
+
] );
|
|
57
|
+
expect( result ).toBeUndefined();
|
|
58
|
+
} );
|
|
59
|
+
|
|
60
|
+
it( 'should return the parent path', () => {
|
|
61
|
+
const result = findParent( '/test', [
|
|
62
|
+
{ id: 'route1', path: '/test' },
|
|
63
|
+
{ id: 'route2', path: '/' },
|
|
64
|
+
] );
|
|
65
|
+
expect( result ).toEqual( '/' );
|
|
66
|
+
} );
|
|
67
|
+
|
|
68
|
+
it( 'should return to another parent path', () => {
|
|
69
|
+
const result = findParent( '/test/123', [
|
|
70
|
+
{ id: 'route1', path: '/test/:id' },
|
|
71
|
+
{ id: 'route2', path: '/test' },
|
|
72
|
+
] );
|
|
73
|
+
expect( result ).toEqual( '/test' );
|
|
74
|
+
} );
|
|
75
|
+
|
|
76
|
+
it( 'should return the parent path with params', () => {
|
|
77
|
+
const result = findParent( '/test/123/456', [
|
|
78
|
+
{ id: 'route1', path: '/test/:id/:subId' },
|
|
79
|
+
{ id: 'route2', path: '/test/:id' },
|
|
80
|
+
] );
|
|
81
|
+
expect( result ).toEqual( '/test/123' );
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
it( 'should return the parent path with optional params', () => {
|
|
85
|
+
const result = findParent( '/test/123', [
|
|
86
|
+
{ id: 'route', path: '/test/:id?' },
|
|
87
|
+
] );
|
|
88
|
+
expect( result ).toEqual( '/test' );
|
|
89
|
+
} );
|
|
90
|
+
|
|
91
|
+
it( 'should return the grand parent if no parent found', () => {
|
|
92
|
+
const result = findParent( '/test/123/456', [
|
|
93
|
+
{ id: 'route1', path: '/test/:id/:subId' },
|
|
94
|
+
{ id: 'route2', path: '/test' },
|
|
95
|
+
] );
|
|
96
|
+
expect( result ).toEqual( '/test' );
|
|
97
|
+
} );
|
|
98
|
+
|
|
99
|
+
it( 'should return the root when no grand parent found', () => {
|
|
100
|
+
const result = findParent( '/test/nested/path', [
|
|
101
|
+
{ id: 'route1', path: '/other-path' },
|
|
102
|
+
{ id: 'route2', path: '/yet-another-path' },
|
|
103
|
+
{ id: 'root', path: '/' },
|
|
104
|
+
] );
|
|
105
|
+
expect( result ).toEqual( '/' );
|
|
106
|
+
} );
|
|
107
|
+
|
|
108
|
+
it( 'should return undefined when no potential parent found', () => {
|
|
109
|
+
const result = findParent( '/test/nested/path', [
|
|
110
|
+
{ id: 'route1', path: '/other-path' },
|
|
111
|
+
{ id: 'route2', path: '/yet-another-path' },
|
|
112
|
+
] );
|
|
113
|
+
expect( result ).toBeUndefined();
|
|
114
|
+
} );
|
|
115
|
+
|
|
116
|
+
it( 'should return undefined for non supported paths', () => {
|
|
117
|
+
const result = findParent( 'this-is-a-path', [
|
|
118
|
+
{ id: 'route', path: '/' },
|
|
119
|
+
] );
|
|
120
|
+
expect( result ).toBeUndefined();
|
|
121
|
+
} );
|
|
122
|
+
} );
|
package/src/navigator/types.ts
CHANGED
|
@@ -3,25 +3,38 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ReactNode } from 'react';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { ButtonAsButtonProps } from '../button/types';
|
|
10
|
+
|
|
11
|
+
export type MatchParams = Record< string, string | string[] >;
|
|
12
|
+
|
|
6
13
|
type NavigateOptions = {
|
|
7
14
|
focusTargetSelector?: string;
|
|
15
|
+
isBack?: boolean;
|
|
8
16
|
};
|
|
9
17
|
|
|
10
18
|
export type NavigatorLocation = NavigateOptions & {
|
|
11
19
|
isInitial?: boolean;
|
|
12
|
-
isBack?: boolean;
|
|
13
20
|
path?: string;
|
|
14
21
|
hasRestoredFocus?: boolean;
|
|
15
22
|
};
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
// Returned by the `useNavigator` hook.
|
|
25
|
+
export type Navigator = {
|
|
18
26
|
location: NavigatorLocation;
|
|
27
|
+
params: MatchParams;
|
|
19
28
|
goTo: ( path: string, options?: NavigateOptions ) => void;
|
|
20
29
|
goBack: () => void;
|
|
30
|
+
goToParent: () => void;
|
|
21
31
|
};
|
|
22
32
|
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
export type NavigatorContext = Navigator & {
|
|
34
|
+
addScreen: ( screen: Screen ) => void;
|
|
35
|
+
removeScreen: ( screen: Screen ) => void;
|
|
36
|
+
match?: string;
|
|
37
|
+
};
|
|
25
38
|
|
|
26
39
|
export type NavigatorProviderProps = {
|
|
27
40
|
/**
|
|
@@ -45,18 +58,19 @@ export type NavigatorScreenProps = {
|
|
|
45
58
|
children: ReactNode;
|
|
46
59
|
};
|
|
47
60
|
|
|
48
|
-
type
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
variant?: 'primary' | 'secondary' | 'tertiary' | 'link';
|
|
52
|
-
};
|
|
53
|
-
export type NavigatorBackButtonProps = Omit< ButtonProps, 'href' > & {
|
|
61
|
+
export type NavigatorBackButtonProps = ButtonAsButtonProps;
|
|
62
|
+
|
|
63
|
+
export type NavigatorBackButtonHookProps = NavigatorBackButtonProps & {
|
|
54
64
|
/**
|
|
55
|
-
*
|
|
65
|
+
* Whether we should navigate to the parent screen.
|
|
66
|
+
*
|
|
67
|
+
* @default 'false'
|
|
56
68
|
*/
|
|
57
|
-
|
|
69
|
+
goToParent?: boolean;
|
|
58
70
|
};
|
|
59
71
|
|
|
72
|
+
export type NavigatorToParentButtonProps = NavigatorBackButtonProps;
|
|
73
|
+
|
|
60
74
|
export type NavigatorButtonProps = NavigatorBackButtonProps & {
|
|
61
75
|
/**
|
|
62
76
|
* The path of the screen to navigate to. The value of this prop needs to be
|
|
@@ -71,3 +85,8 @@ export type NavigatorButtonProps = NavigatorBackButtonProps & {
|
|
|
71
85
|
*/
|
|
72
86
|
attributeName?: string;
|
|
73
87
|
};
|
|
88
|
+
|
|
89
|
+
export type Screen = {
|
|
90
|
+
id: string;
|
|
91
|
+
path: string;
|
|
92
|
+
};
|
|
@@ -13,12 +13,15 @@ import type { Navigator } from './types';
|
|
|
13
13
|
* Retrieves a `navigator` instance.
|
|
14
14
|
*/
|
|
15
15
|
function useNavigator(): Navigator {
|
|
16
|
-
const { location, goTo, goBack } =
|
|
16
|
+
const { location, params, goTo, goBack, goToParent } =
|
|
17
|
+
useContext( NavigatorContext );
|
|
17
18
|
|
|
18
19
|
return {
|
|
19
20
|
location,
|
|
20
21
|
goTo,
|
|
21
22
|
goBack,
|
|
23
|
+
goToParent,
|
|
24
|
+
params,
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
27
|
|