@wordpress/components 28.5.0 → 28.7.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 +159 -0
- package/CONTRIBUTING.md +178 -64
- package/build/alignment-matrix-control/cell.js +6 -9
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +31 -19
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +57 -52
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles.js +73 -0
- package/build/alignment-matrix-control/styles.js.map +1 -0
- package/build/alignment-matrix-control/types.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +9 -9
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/base-control/index.js +54 -41
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/types.js.map +1 -1
- package/build/border-control/border-control/component.js +18 -13
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/styles.js +13 -13
- package/build/border-control/styles.js.map +1 -1
- package/build/checkbox-control/index.js +1 -0
- package/build/checkbox-control/index.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +17 -11
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +17 -14
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/circular-option-picker/types.js.map +1 -1
- package/build/clipboard-button/index.js +6 -6
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/utils.js +16 -5
- package/build/color-palette/utils.js.map +1 -1
- package/build/color-picker/color-copy-button.js +8 -8
- package/build/color-picker/color-copy-button.js.map +1 -1
- package/build/color-picker/hex-input.js +8 -8
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +9 -8
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +1 -0
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/types.js.map +1 -1
- package/build/composite/context.js +19 -0
- package/build/composite/context.js.map +1 -0
- package/build/composite/group-label.js +33 -0
- package/build/composite/group-label.js.map +1 -0
- package/build/composite/group.js +33 -0
- package/build/composite/group.js.map +1 -0
- package/build/composite/hover.js +33 -0
- package/build/composite/hover.js.map +1 -0
- package/build/composite/index.js +241 -9
- package/build/composite/index.js.map +1 -1
- package/build/composite/item.js +33 -0
- package/build/composite/item.js.map +1 -0
- package/build/composite/legacy/index.js +11 -8
- package/build/composite/legacy/index.js.map +1 -1
- package/build/composite/row.js +33 -0
- package/build/composite/row.js.map +1 -0
- package/build/composite/store.js +54 -0
- package/build/composite/store.js.map +1 -0
- package/build/composite/typeahead.js +33 -0
- package/build/composite/typeahead.js.map +1 -0
- package/build/composite/types.js +6 -0
- package/build/composite/types.js.map +1 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-select-control/types.js.map +1 -1
- package/build/custom-select-control-v2/custom-select.js +3 -2
- package/build/custom-select-control-v2/custom-select.js.map +1 -1
- package/build/custom-select-control-v2/styles.js +12 -14
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/date-time/date/styles.js +8 -8
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/time/index.js +11 -3
- package/build/date-time/time/index.js.map +1 -1
- package/build/date-time/time/time-input/index.js +17 -19
- package/build/date-time/time/time-input/index.js.map +1 -1
- package/build/date-time/types.js.map +1 -1
- package/build/dimension-control/index.js +31 -9
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/types.js.map +1 -1
- package/build/draggable/index.js +4 -4
- package/build/draggable/index.js.map +1 -1
- package/build/dropdown-menu-v2/checkbox-item.js +69 -0
- package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
- package/build/dropdown-menu-v2/context.js +17 -0
- package/build/dropdown-menu-v2/context.js.map +1 -0
- package/build/dropdown-menu-v2/group-label.js +40 -0
- package/build/dropdown-menu-v2/group-label.js.map +1 -0
- package/build/dropdown-menu-v2/group.js +29 -0
- package/build/dropdown-menu-v2/group.js.map +1 -0
- package/build/dropdown-menu-v2/index.js +60 -147
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/item-help-text.js +27 -0
- package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
- package/build/dropdown-menu-v2/item-label.js +27 -0
- package/build/dropdown-menu-v2/item-label.js.map +1 -0
- package/build/dropdown-menu-v2/item.js +53 -0
- package/build/dropdown-menu-v2/item.js.map +1 -0
- package/build/dropdown-menu-v2/radio-item.js +79 -0
- package/build/dropdown-menu-v2/radio-item.js.map +1 -0
- package/build/dropdown-menu-v2/separator.js +30 -0
- package/build/dropdown-menu-v2/separator.js.map +1 -0
- package/build/dropdown-menu-v2/styles.js +63 -85
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/dropdown-menu-v2/types.js.map +1 -1
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
- package/build/focal-point-picker/controls.js +1 -3
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/index.js +1 -2
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +11 -11
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js +7 -2
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/focal-point-picker/types.js.map +1 -1
- package/build/form-file-upload/types.js.map +1 -1
- package/build/form-token-field/types.js.map +1 -1
- package/build/index.js +11 -5
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +2 -2
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +5 -10
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-prefix-wrapper.js +3 -3
- package/build/input-control/input-prefix-wrapper.js.map +1 -1
- package/build/input-control/input-suffix-wrapper.js +2 -3
- package/build/input-control/input-suffix-wrapper.js.map +1 -1
- package/build/input-control/reducer/reducer.js +8 -8
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +75 -45
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/types.js.map +1 -1
- package/build/input-control/utils.js +3 -3
- package/build/input-control/utils.js.map +1 -1
- package/build/item-group/styles.js +11 -11
- package/build/item-group/styles.js.map +1 -1
- package/build/mobile/utils/alignments.native.js +1 -1
- package/build/mobile/utils/alignments.native.js.map +1 -1
- package/build/modal/index.js +5 -5
- package/build/modal/index.js.map +1 -1
- package/build/navigation/index.js +4 -4
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +13 -13
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/index.js +12 -13
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/component.js +1 -1
- package/build/navigator/navigator-back-button/component.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +5 -11
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +2 -2
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +116 -76
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-to-parent-button/component.js +13 -40
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build/navigator/types.js.map +1 -1
- package/build/navigator/use-navigator.js +1 -2
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/palette-edit/index.js +2 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +11 -11
- package/build/palette-edit/styles.js.map +1 -1
- package/build/popover/index.js +6 -1
- package/build/popover/index.js.map +1 -1
- package/build/private-apis.js +10 -14
- package/build/private-apis.js.map +1 -1
- package/build/progress-bar/styles.js +5 -5
- package/build/progress-bar/styles.js.map +1 -1
- package/build/query-controls/index.js +5 -6
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/types.js.map +1 -1
- package/build/radio-control/index.js +20 -19
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-group/radio.js +3 -2
- package/build/radio-group/radio.js.map +1 -1
- package/build/range-control/index.js +32 -9
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +31 -31
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/search-control/index.js +5 -4
- package/build/search-control/index.js.map +1 -1
- package/build/select-control/index.js +1 -0
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +12 -12
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +4 -4
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/snackbar/index.js +4 -4
- package/build/snackbar/index.js.map +1 -1
- package/build/tab-panel/index.js +3 -2
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +7 -6
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +6 -4
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/tabpanel.js +6 -1
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/text/styles.js +7 -7
- package/build/text/styles.js.map +1 -1
- package/build/text-control/index.js +1 -0
- package/build/text-control/index.js.map +1 -1
- package/build/textarea-control/index.js +1 -0
- package/build/textarea-control/index.js.map +1 -1
- package/build/textarea-control/styles/textarea-control-styles.js +8 -2
- package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build/toggle-control/index.js +9 -1
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +3 -2
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
- package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/tools-panel/styles.js +13 -13
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +6 -6
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tooltip/index.js +3 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-select/index.js +19 -6
- package/build/tree-select/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +7 -7
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/config-values.js +10 -7
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +4 -4
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +4 -7
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +31 -19
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +56 -50
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles.js +70 -0
- package/build-module/alignment-matrix-control/styles.js.map +1 -0
- package/build-module/alignment-matrix-control/types.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +9 -9
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/base-control/index.js +54 -42
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/types.js.map +1 -1
- package/build-module/border-control/border-control/component.js +18 -13
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/styles.js +13 -13
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -0
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +18 -12
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +16 -13
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/circular-option-picker/types.js.map +1 -1
- package/build-module/clipboard-button/index.js +6 -6
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/utils.js +16 -5
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +8 -8
- package/build-module/color-picker/color-copy-button.js.map +1 -1
- package/build-module/color-picker/hex-input.js +7 -8
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +8 -8
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +1 -0
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/types.js.map +1 -1
- package/build-module/composite/context.js +12 -0
- package/build-module/composite/context.js.map +1 -0
- package/build-module/composite/group-label.js +25 -0
- package/build-module/composite/group-label.js.map +1 -0
- package/build-module/composite/group.js +25 -0
- package/build-module/composite/group.js.map +1 -0
- package/build-module/composite/hover.js +25 -0
- package/build-module/composite/hover.js.map +1 -0
- package/build-module/composite/index.js +239 -6
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/item.js +25 -0
- package/build-module/composite/item.js.map +1 -0
- package/build-module/composite/legacy/index.js +11 -6
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/composite/row.js +25 -0
- package/build-module/composite/row.js.map +1 -0
- package/build-module/composite/store.js +46 -0
- package/build-module/composite/store.js.map +1 -0
- package/build-module/composite/typeahead.js +25 -0
- package/build-module/composite/typeahead.js.map +1 -0
- package/build-module/composite/types.js +2 -0
- package/build-module/composite/types.js.map +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-select-control/types.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +2 -1
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js +12 -14
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/date-time/date/styles.js +8 -8
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/time/index.js +11 -3
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/time/time-input/index.js +17 -19
- package/build-module/date-time/time/time-input/index.js.map +1 -1
- package/build-module/date-time/types.js.map +1 -1
- package/build-module/dimension-control/index.js +31 -9
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dimension-control/types.js.map +1 -1
- package/build-module/draggable/index.js +4 -4
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
- package/build-module/dropdown-menu-v2/context.js +11 -0
- package/build-module/dropdown-menu-v2/context.js.map +1 -0
- package/build-module/dropdown-menu-v2/group-label.js +32 -0
- package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
- package/build-module/dropdown-menu-v2/group.js +21 -0
- package/build-module/dropdown-menu-v2/group.js.map +1 -0
- package/build-module/dropdown-menu-v2/index.js +58 -144
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
- package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
- package/build-module/dropdown-menu-v2/item-label.js +19 -0
- package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
- package/build-module/dropdown-menu-v2/item.js +46 -0
- package/build-module/dropdown-menu-v2/item.js.map +1 -0
- package/build-module/dropdown-menu-v2/radio-item.js +72 -0
- package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
- package/build-module/dropdown-menu-v2/separator.js +22 -0
- package/build-module/dropdown-menu-v2/separator.js.map +1 -0
- package/build-module/dropdown-menu-v2/styles.js +63 -85
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2/types.js.map +1 -1
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
- package/build-module/focal-point-picker/controls.js +1 -3
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/index.js +1 -2
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +11 -11
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focal-point-picker/types.js.map +1 -1
- package/build-module/form-file-upload/types.js.map +1 -1
- package/build-module/form-token-field/types.js.map +1 -1
- package/build-module/index.js +3 -2
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -2
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +6 -11
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-prefix-wrapper.js +4 -3
- package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
- package/build-module/input-control/input-suffix-wrapper.js +3 -3
- package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +8 -8
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +74 -44
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/types.js.map +1 -1
- package/build-module/input-control/utils.js +3 -3
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/item-group/styles.js +11 -11
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/mobile/utils/alignments.native.js +1 -1
- package/build-module/mobile/utils/alignments.native.js.map +1 -1
- package/build-module/modal/index.js +5 -5
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/index.js +4 -4
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +14 -14
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/index.js +6 -6
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/component.js +1 -1
- package/build-module/navigator/navigator-back-button/component.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +4 -10
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +116 -76
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js +12 -41
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build-module/navigator/types.js.map +1 -1
- package/build-module/navigator/use-navigator.js +1 -2
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/palette-edit/index.js +2 -2
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +11 -11
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/popover/index.js +6 -1
- package/build-module/popover/index.js.map +1 -1
- package/build-module/private-apis.js +10 -14
- package/build-module/private-apis.js.map +1 -1
- package/build-module/progress-bar/styles.js +5 -5
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/query-controls/index.js +5 -6
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/types.js.map +1 -1
- package/build-module/radio-control/index.js +20 -19
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-group/radio.js +2 -1
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/range-control/index.js +32 -9
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +32 -32
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/search-control/index.js +5 -4
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/select-control/index.js +1 -0
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +13 -13
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/snackbar/index.js +4 -4
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/tab-panel/index.js +2 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +6 -5
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +4 -4
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +5 -3
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/tabpanel.js +6 -2
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/text/styles.js +7 -7
- package/build-module/text/styles.js.map +1 -1
- package/build-module/text-control/index.js +1 -0
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/textarea-control/index.js +1 -0
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/textarea-control/styles/textarea-control-styles.js +9 -2
- package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build-module/toggle-control/index.js +9 -1
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +2 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
- package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +13 -13
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +6 -6
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tooltip/index.js +2 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-select/index.js +19 -6
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +7 -7
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/config-values.js +10 -7
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +4 -4
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +30 -32
- package/build-style/style.css +30 -32
- package/build-types/alignment-matrix-control/cell.d.ts +1 -1
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/index.d.ts +16 -6
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
- package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/types.d.ts +12 -1
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
- package/build-types/base-control/hooks.d.ts +1 -0
- package/build-types/base-control/hooks.d.ts.map +1 -1
- package/build-types/base-control/index.d.ts +44 -0
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/types.d.ts +7 -0
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +2 -3
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +1 -0
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/composite/context.d.ts +7 -0
- package/build-types/composite/context.d.ts.map +1 -0
- package/build-types/composite/group-label.d.ts +3 -0
- package/build-types/composite/group-label.d.ts.map +1 -0
- package/build-types/composite/group.d.ts +3 -0
- package/build-types/composite/group.d.ts.map +1 -0
- package/build-types/composite/hover.d.ts +3 -0
- package/build-types/composite/hover.d.ts.map +1 -0
- package/build-types/composite/index.d.ts +185 -1
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/item.d.ts +3 -0
- package/build-types/composite/item.d.ts.map +1 -0
- package/build-types/composite/legacy/index.d.ts +7 -5
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/utils.d.ts +19 -0
- package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
- package/build-types/composite/row.d.ts +3 -0
- package/build-types/composite/row.d.ts.map +1 -0
- package/build-types/composite/store.d.ts +25 -0
- package/build-types/composite/store.d.ts.map +1 -0
- package/build-types/composite/stories/index.story.d.ts +14 -0
- package/build-types/composite/stories/index.story.d.ts.map +1 -0
- package/build-types/composite/stories/utils.d.ts +29 -0
- package/build-types/composite/stories/utils.d.ts.map +1 -0
- package/build-types/composite/typeahead.d.ts +3 -0
- package/build-types/composite/typeahead.d.ts.map +1 -0
- package/build-types/composite/types.d.ts +288 -0
- package/build-types/composite/types.d.ts.map +1 -0
- package/build-types/custom-select-control/types.d.ts +3 -3
- package/build-types/custom-select-control/types.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
- package/build-types/date-time/types.d.ts +7 -1
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +2 -1
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +13 -1
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/dimension-control/types.d.ts +2 -7
- package/build-types/dimension-control/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/context.d.ts +6 -0
- package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
- package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/group.d.ts +3 -0
- package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/index.d.ts +39 -18
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
- package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
- package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
- package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts +6 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
- package/build-types/focal-point-picker/controls.d.ts +1 -1
- package/build-types/focal-point-picker/controls.d.ts.map +1 -1
- package/build-types/focal-point-picker/index.d.ts +1 -1
- package/build-types/focal-point-picker/index.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
- package/build-types/focal-point-picker/types.d.ts +2 -2
- package/build-types/focal-point-picker/types.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +6 -0
- package/build-types/form-file-upload/types.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -0
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/index.d.ts +4 -2
- package/build-types/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
- package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
- package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +9 -0
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +23 -6
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +6 -6
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +2 -2
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +6 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +1 -1
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +47 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts +1 -2
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/query-controls/index.d.ts +1 -1
- package/build-types/query-controls/index.d.ts.map +1 -1
- package/build-types/query-controls/types.d.ts +2 -1
- package/build-types/query-controls/types.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +4 -2
- package/build-types/select-control/stories/index.story.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/tab-panel/index.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/tabpanel.d.ts +0 -3
- package/build-types/tabs/tabpanel.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/index.d.ts.map +1 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +7 -6
- package/package.json +20 -20
- package/src/alignment-matrix-control/README.md +1 -5
- package/src/alignment-matrix-control/cell.tsx +6 -12
- package/src/alignment-matrix-control/icon.tsx +48 -30
- package/src/alignment-matrix-control/index.tsx +61 -50
- package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
- package/src/alignment-matrix-control/styles.ts +113 -0
- package/src/alignment-matrix-control/types.ts +12 -1
- package/src/angle-picker-control/angle-circle.tsx +11 -9
- package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +2 -2
- package/src/base-control/README.md +5 -2
- package/src/base-control/index.tsx +61 -41
- package/src/base-control/types.ts +7 -0
- package/src/border-box-control/border-box-control/README.md +7 -0
- package/src/border-control/border-control/README.md +7 -0
- package/src/border-control/border-control/component.tsx +23 -16
- package/src/border-control/styles.ts +1 -1
- package/src/button/README.md +7 -0
- package/src/button/style.scss +2 -2
- package/src/button-group/style.scss +2 -2
- package/src/checkbox-control/index.tsx +1 -0
- package/src/checkbox-control/stories/index.story.tsx +1 -0
- package/src/checkbox-control/test/index.tsx +8 -1
- package/src/circular-option-picker/circular-option-picker-option.tsx +19 -20
- package/src/circular-option-picker/circular-option-picker.tsx +26 -12
- package/src/circular-option-picker/style.scss +3 -3
- package/src/circular-option-picker/types.ts +2 -3
- package/src/clipboard-button/index.tsx +6 -6
- package/src/color-indicator/style.scss +1 -1
- package/src/color-palette/style.scss +2 -2
- package/src/color-palette/test/utils.ts +21 -2
- package/src/color-palette/utils.ts +22 -11
- package/src/color-picker/color-copy-button.tsx +10 -8
- package/src/color-picker/hex-input.tsx +6 -10
- package/src/color-picker/input-with-slider.tsx +7 -10
- package/src/color-picker/styles.ts +1 -1
- package/src/combobox-control/README.md +8 -0
- package/src/combobox-control/index.tsx +1 -0
- package/src/combobox-control/stories/index.story.tsx +3 -4
- package/src/combobox-control/test/index.tsx +5 -1
- package/src/combobox-control/types.ts +1 -0
- package/src/composite/README.md +325 -0
- package/src/composite/context.ts +14 -0
- package/src/composite/group-label.tsx +30 -0
- package/src/composite/group.tsx +30 -0
- package/src/composite/hover.tsx +30 -0
- package/src/composite/index.tsx +257 -0
- package/src/composite/item.tsx +30 -0
- package/src/composite/legacy/index.tsx +16 -14
- package/src/composite/legacy/stories/utils.tsx +19 -0
- package/src/composite/row.tsx +30 -0
- package/src/composite/store.ts +46 -0
- package/src/composite/stories/index.story.tsx +339 -0
- package/src/composite/{current/stories → stories}/utils.tsx +22 -7
- package/src/composite/typeahead.tsx +30 -0
- package/src/composite/types.ts +298 -0
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
- package/src/custom-gradient-picker/style.scss +3 -22
- package/src/custom-select-control/README.md +7 -0
- package/src/custom-select-control/test/index.tsx +125 -0
- package/src/custom-select-control/types.ts +3 -3
- package/src/custom-select-control-v2/custom-select.tsx +2 -1
- package/src/custom-select-control-v2/styles.ts +4 -4
- package/src/date-time/date/styles.ts +2 -2
- package/src/date-time/time/index.tsx +26 -12
- package/src/date-time/time/test/index.tsx +3 -6
- package/src/date-time/time/time-input/index.tsx +25 -25
- package/src/date-time/time/time-input/test/index.tsx +6 -7
- package/src/date-time/types.ts +11 -1
- package/src/dimension-control/README.md +21 -0
- package/src/dimension-control/index.tsx +33 -10
- package/src/dimension-control/stories/index.story.tsx +8 -2
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -32
- package/src/dimension-control/test/index.test.js +6 -1
- package/src/dimension-control/types.ts +5 -7
- package/src/draggable/index.tsx +4 -4
- package/src/drop-zone/style.scss +1 -1
- package/src/dropdown-menu-v2/README.md +73 -60
- package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
- package/src/dropdown-menu-v2/context.tsx +13 -0
- package/src/dropdown-menu-v2/group-label.tsx +37 -0
- package/src/dropdown-menu-v2/group.tsx +26 -0
- package/src/dropdown-menu-v2/index.tsx +61 -199
- package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
- package/src/dropdown-menu-v2/item-label.tsx +23 -0
- package/src/dropdown-menu-v2/item.tsx +50 -0
- package/src/dropdown-menu-v2/radio-item.tsx +70 -0
- package/src/dropdown-menu-v2/separator.tsx +27 -0
- package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
- package/src/dropdown-menu-v2/styles.ts +118 -80
- package/src/dropdown-menu-v2/test/index.tsx +159 -132
- package/src/dropdown-menu-v2/types.ts +7 -0
- package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
- package/src/focal-point-picker/README.md +9 -1
- package/src/focal-point-picker/controls.tsx +1 -3
- package/src/focal-point-picker/index.tsx +1 -2
- package/src/focal-point-picker/stories/index.story.tsx +3 -0
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
- package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
- package/src/focal-point-picker/test/index.tsx +5 -1
- package/src/focal-point-picker/types.ts +2 -2
- package/src/font-size-picker/README.md +7 -0
- package/src/form-file-upload/README.md +8 -0
- package/src/form-file-upload/types.ts +6 -0
- package/src/form-toggle/style.scss +1 -1
- package/src/form-token-field/README.md +1 -0
- package/src/form-token-field/style.scss +2 -3
- package/src/form-token-field/types.ts +1 -0
- package/src/guide/style.scss +0 -1
- package/src/index.ts +6 -2
- package/src/input-control/README.md +8 -0
- package/src/input-control/index.tsx +2 -2
- package/src/input-control/input-base.tsx +4 -14
- package/src/input-control/input-prefix-wrapper.tsx +8 -4
- package/src/input-control/input-suffix-wrapper.tsx +4 -6
- package/src/input-control/reducer/reducer.ts +13 -10
- package/src/input-control/stories/index.story.tsx +31 -12
- package/src/input-control/styles/input-control-styles.tsx +42 -11
- package/src/input-control/types.ts +23 -7
- package/src/input-control/utils.ts +3 -3
- package/src/item-group/styles.ts +4 -4
- package/src/item-group/test/__snapshots__/index.js.snap +3 -3
- package/src/mobile/utils/alignments.native.js +1 -0
- package/src/modal/index.tsx +5 -5
- package/src/modal/style.scss +8 -7
- package/src/navigation/index.tsx +4 -4
- package/src/navigation/styles/navigation-styles.tsx +3 -3
- package/src/navigator/index.ts +6 -6
- package/src/navigator/navigator-back-button/component.tsx +1 -1
- package/src/navigator/navigator-back-button/hook.ts +7 -11
- package/src/navigator/navigator-button/hook.ts +1 -1
- package/src/navigator/navigator-provider/README.md +37 -36
- package/src/navigator/navigator-provider/component.tsx +110 -89
- package/src/navigator/navigator-screen/README.md +13 -1
- package/src/navigator/navigator-to-parent-button/README.md +2 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +14 -43
- package/src/navigator/stories/index.story.tsx +82 -253
- package/src/navigator/test/index.tsx +136 -6
- package/src/navigator/types.ts +47 -10
- package/src/navigator/use-navigator.ts +1 -3
- package/src/number-control/README.md +8 -0
- package/src/palette-edit/index.tsx +2 -2
- package/src/palette-edit/styles.ts +5 -5
- package/src/placeholder/style.scss +4 -1
- package/src/popover/index.tsx +9 -3
- package/src/popover/style.scss +2 -2
- package/src/popover/test/index.tsx +34 -0
- package/src/private-apis.ts +10 -29
- package/src/progress-bar/styles.ts +2 -2
- package/src/query-controls/README.md +7 -0
- package/src/query-controls/index.tsx +5 -6
- package/src/query-controls/types.ts +2 -1
- package/src/radio-control/index.tsx +28 -20
- package/src/radio-control/style.scss +13 -2
- package/src/radio-control/test/index.tsx +43 -40
- package/src/radio-group/radio.tsx +2 -1
- package/src/range-control/README.md +7 -0
- package/src/range-control/index.tsx +39 -9
- package/src/range-control/stories/index.story.tsx +7 -0
- package/src/range-control/styles/range-control-styles.ts +9 -9
- package/src/range-control/test/index.tsx +54 -14
- package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
- package/src/resizable-box/style.scss +2 -2
- package/src/search-control/index.tsx +7 -4
- package/src/search-control/stories/index.story.tsx +1 -0
- package/src/search-control/test/index.tsx +1 -0
- package/src/select-control/README.md +8 -0
- package/src/select-control/index.tsx +1 -0
- package/src/select-control/stories/index.story.tsx +8 -5
- package/src/select-control/styles/select-control-styles.ts +5 -5
- package/src/select-control/test/select-control.tsx +12 -6
- package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
- package/src/snackbar/index.tsx +4 -4
- package/src/snackbar/style.scss +2 -2
- package/src/tab-panel/index.tsx +4 -1
- package/src/tab-panel/style.scss +1 -2
- package/src/tabs/index.tsx +10 -5
- package/src/tabs/styles.ts +2 -3
- package/src/tabs/tablist.tsx +6 -4
- package/src/tabs/tabpanel.tsx +6 -2
- package/src/text/styles.ts +1 -1
- package/src/text-control/README.md +8 -0
- package/src/text-control/index.tsx +1 -0
- package/src/text-control/stories/index.story.tsx +3 -1
- package/src/text-control/style.scss +3 -2
- package/src/text-control/test/text-control.tsx +5 -1
- package/src/textarea-control/index.tsx +1 -0
- package/src/textarea-control/stories/index.story.tsx +2 -0
- package/src/textarea-control/styles/textarea-control-styles.ts +75 -2
- package/src/toggle-control/index.tsx +9 -0
- package/src/toggle-control/stories/index.story.tsx +1 -0
- package/src/toggle-control/test/index.tsx +7 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +8 -24
- package/src/toggle-group-control/test/index.tsx +5 -1
- package/src/toggle-group-control/toggle-group-control/README.md +7 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -0
- package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
- package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +2 -2
- package/src/toolbar/toolbar/style.scss +2 -2
- package/src/tools-panel/styles.ts +1 -1
- package/src/tools-panel/tools-panel/hook.ts +6 -6
- package/src/tooltip/index.tsx +2 -1
- package/src/tooltip/style.scss +1 -1
- package/src/tree-select/index.tsx +16 -5
- package/src/tree-select/stories/index.story.tsx +1 -0
- package/src/unit-control/README.md +7 -0
- package/src/unit-control/styles/unit-control-styles.ts +3 -2
- package/src/utils/config-values.js +10 -7
- package/src/utils/hooks/use-update-effect.js +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -86
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
- package/build/composite/current/index.js +0 -43
- package/build/composite/current/index.js.map +0 -1
- package/build/composite/v2.js +0 -17
- package/build/composite/v2.js.map +0 -1
- package/build/navigator/navigator-back-button/index.js +0 -14
- package/build/navigator/navigator-back-button/index.js.map +0 -1
- package/build/navigator/navigator-button/index.js +0 -14
- package/build/navigator/navigator-button/index.js.map +0 -1
- package/build/navigator/navigator-provider/index.js +0 -14
- package/build/navigator/navigator-provider/index.js.map +0 -1
- package/build/navigator/navigator-screen/index.js +0 -14
- package/build/navigator/navigator-screen/index.js.map +0 -1
- package/build/navigator/navigator-to-parent-button/index.js +0 -14
- package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
- package/build/utils/input/base.js +0 -20
- package/build/utils/input/base.js.map +0 -1
- package/build/utils/input/index.js +0 -17
- package/build/utils/input/index.js.map +0 -1
- package/build/utils/input/input-control.js +0 -21
- package/build/utils/input/input-control.js.map +0 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -81
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
- package/build-module/composite/current/index.js +0 -12
- package/build-module/composite/current/index.js.map +0 -1
- package/build-module/composite/v2.js +0 -5
- package/build-module/composite/v2.js.map +0 -1
- package/build-module/navigator/navigator-back-button/index.js +0 -2
- package/build-module/navigator/navigator-back-button/index.js.map +0 -1
- package/build-module/navigator/navigator-button/index.js +0 -2
- package/build-module/navigator/navigator-button/index.js.map +0 -1
- package/build-module/navigator/navigator-provider/index.js +0 -2
- package/build-module/navigator/navigator-provider/index.js.map +0 -1
- package/build-module/navigator/navigator-screen/index.js +0 -2
- package/build-module/navigator/navigator-screen/index.js.map +0 -1
- package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
- package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
- package/build-module/utils/input/base.js +0 -13
- package/build-module/utils/input/base.js.map +0 -1
- package/build-module/utils/input/index.js +0 -2
- package/build-module/utils/input/index.js.map +0 -1
- package/build-module/utils/input/input-control.js +0 -14
- package/build-module/utils/input/input-control.js.map +0 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
- package/build-types/composite/current/index.d.ts +0 -12
- package/build-types/composite/current/index.d.ts.map +0 -1
- package/build-types/composite/current/stories/index.story.d.ts +0 -13
- package/build-types/composite/current/stories/index.story.d.ts.map +0 -1
- package/build-types/composite/current/stories/utils.d.ts +0 -14
- package/build-types/composite/current/stories/utils.d.ts.map +0 -1
- package/build-types/composite/v2.d.ts +0 -2
- package/build-types/composite/v2.d.ts.map +0 -1
- package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-provider/index.d.ts +0 -2
- package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-screen/index.d.ts +0 -2
- package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
- package/build-types/utils/input/base.d.ts +0 -3
- package/build-types/utils/input/base.d.ts.map +0 -1
- package/build-types/utils/input/index.d.ts +0 -2
- package/build-types/utils/input/index.d.ts.map +0 -1
- package/build-types/utils/input/input-control.d.ts +0 -2
- package/build-types/utils/input/input-control.d.ts.map +0 -1
- package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
- package/src/composite/current/index.ts +0 -20
- package/src/composite/current/stories/index.story.tsx +0 -86
- package/src/composite/index.ts +0 -7
- package/src/composite/v2.ts +0 -4
- package/src/navigator/navigator-back-button/index.ts +0 -1
- package/src/navigator/navigator-button/index.ts +0 -1
- package/src/navigator/navigator-provider/index.ts +0 -1
- package/src/navigator/navigator-screen/index.ts +0 -1
- package/src/navigator/navigator-to-parent-button/index.ts +0 -1
- package/src/utils/input/base.js +0 -30
- package/src/utils/input/index.js +0 -1
- package/src/utils/input/input-control.js +0 -63
package/src/modal/index.tsx
CHANGED
|
@@ -134,9 +134,9 @@ function UnforwardedModal(
|
|
|
134
134
|
}, [] );
|
|
135
135
|
|
|
136
136
|
// Keeps a fresh ref for the subsequent effect.
|
|
137
|
-
const
|
|
137
|
+
const onRequestCloseRef = useRef< ModalProps[ 'onRequestClose' ] >();
|
|
138
138
|
useEffect( () => {
|
|
139
|
-
|
|
139
|
+
onRequestCloseRef.current = onRequestClose;
|
|
140
140
|
}, [ onRequestClose ] );
|
|
141
141
|
|
|
142
142
|
// The list of `onRequestClose` callbacks of open (non-nested) Modals. Only
|
|
@@ -149,10 +149,10 @@ function UnforwardedModal(
|
|
|
149
149
|
// onRequestClose for any prior and/or nested modals as applicable.
|
|
150
150
|
useEffect( () => {
|
|
151
151
|
// add this modal instance to the dismissers set
|
|
152
|
-
dismissers.add(
|
|
152
|
+
dismissers.add( onRequestCloseRef );
|
|
153
153
|
// request that all the other modals close themselves
|
|
154
154
|
for ( const dismisser of dismissers ) {
|
|
155
|
-
if ( dismisser !==
|
|
155
|
+
if ( dismisser !== onRequestCloseRef ) {
|
|
156
156
|
dismisser.current?.();
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -162,7 +162,7 @@ function UnforwardedModal(
|
|
|
162
162
|
dismisser.current?.();
|
|
163
163
|
}
|
|
164
164
|
// remove this modal instance from the dismissers set
|
|
165
|
-
dismissers.delete(
|
|
165
|
+
dismissers.delete( onRequestCloseRef );
|
|
166
166
|
};
|
|
167
167
|
}, [ dismissers, nestedDismissers ] );
|
|
168
168
|
|
package/src/modal/style.scss
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
background-color: rgba($black, 0.35);
|
|
9
9
|
z-index: z-index(".components-modal__screen-overlay");
|
|
10
10
|
display: flex;
|
|
11
|
-
// backdrop-filter: blur($grid-unit);
|
|
12
11
|
// This animates the appearance of the white background.
|
|
13
12
|
@include edit-post__fade-in-animation();
|
|
14
13
|
}
|
|
@@ -20,19 +19,19 @@
|
|
|
20
19
|
margin: $grid-unit-50 0 0 0;
|
|
21
20
|
width: 100%;
|
|
22
21
|
background: $white;
|
|
23
|
-
box-shadow: $
|
|
24
|
-
border-radius: $
|
|
22
|
+
box-shadow: $elevation-large;
|
|
23
|
+
border-radius: $radius-large $radius-large 0 0;
|
|
25
24
|
overflow: hidden;
|
|
26
25
|
// Have the content element fill the vertical space yet not overflow.
|
|
27
26
|
display: flex;
|
|
28
27
|
// Animate the modal frame/contents appearing on the page.
|
|
29
|
-
animation: components-modal__appear-animation 0.
|
|
28
|
+
animation: components-modal__appear-animation 0.26s cubic-bezier(0.29, 0, 0, 1);
|
|
30
29
|
animation-fill-mode: forwards;
|
|
31
30
|
@include reduce-motion("animation");
|
|
32
31
|
|
|
33
32
|
// Show a centered modal on bigger screens.
|
|
34
33
|
@include break-small() {
|
|
35
|
-
border-radius: $
|
|
34
|
+
border-radius: $radius-large;
|
|
36
35
|
margin: auto;
|
|
37
36
|
width: auto;
|
|
38
37
|
min-width: $modal-min-width;
|
|
@@ -80,10 +79,12 @@
|
|
|
80
79
|
|
|
81
80
|
@keyframes components-modal__appear-animation {
|
|
82
81
|
from {
|
|
83
|
-
|
|
82
|
+
opacity: 0;
|
|
83
|
+
transform: scale(0.9);
|
|
84
84
|
}
|
|
85
85
|
to {
|
|
86
|
-
|
|
86
|
+
opacity: 1;
|
|
87
|
+
transform: scale(1);
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
package/src/navigation/index.tsx
CHANGED
|
@@ -93,10 +93,10 @@ export function Navigation( {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
// Used to prevent the sliding animation on mount
|
|
96
|
-
const
|
|
96
|
+
const isMountedRef = useRef( false );
|
|
97
97
|
useEffect( () => {
|
|
98
|
-
if ( !
|
|
99
|
-
|
|
98
|
+
if ( ! isMountedRef.current ) {
|
|
99
|
+
isMountedRef.current = true;
|
|
100
100
|
}
|
|
101
101
|
}, [] );
|
|
102
102
|
|
|
@@ -130,7 +130,7 @@ export function Navigation( {
|
|
|
130
130
|
animateClassName
|
|
131
131
|
? clsx( {
|
|
132
132
|
[ animateClassName ]:
|
|
133
|
-
|
|
133
|
+
isMountedRef.current && slideOrigin,
|
|
134
134
|
} )
|
|
135
135
|
: undefined
|
|
136
136
|
}
|
|
@@ -15,7 +15,7 @@ import { COLORS } from '../../utils/colors-values';
|
|
|
15
15
|
import Button from '../../button';
|
|
16
16
|
import { Text } from '../../text';
|
|
17
17
|
import { Heading } from '../../heading';
|
|
18
|
-
import { rtl } from '../../utils';
|
|
18
|
+
import { rtl, CONFIG } from '../../utils';
|
|
19
19
|
import { space } from '../../utils/space';
|
|
20
20
|
|
|
21
21
|
export const NavigationUI = styled.div`
|
|
@@ -111,7 +111,7 @@ export const GroupTitleUI = styled( Heading )`
|
|
|
111
111
|
`;
|
|
112
112
|
|
|
113
113
|
export const ItemBaseUI = styled.li`
|
|
114
|
-
border-radius:
|
|
114
|
+
border-radius: ${ CONFIG.radiusSmall };
|
|
115
115
|
color: inherit;
|
|
116
116
|
margin-bottom: 0;
|
|
117
117
|
|
|
@@ -172,7 +172,7 @@ export const ItemBadgeUI = styled.span`
|
|
|
172
172
|
margin-right: ${ () => ( isRTL() ? space( 2 ) : '0' ) };
|
|
173
173
|
display: inline-flex;
|
|
174
174
|
padding: ${ space( 1 ) } ${ space( 3 ) };
|
|
175
|
-
border-radius:
|
|
175
|
+
border-radius: ${ CONFIG.radiusSmall };
|
|
176
176
|
|
|
177
177
|
@keyframes fade-in {
|
|
178
178
|
from {
|
package/src/navigator/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { NavigatorProvider } from './navigator-provider';
|
|
2
|
-
export { NavigatorScreen } from './navigator-screen';
|
|
3
|
-
export { NavigatorButton } from './navigator-button';
|
|
4
|
-
export { NavigatorBackButton } from './navigator-back-button';
|
|
5
|
-
export { NavigatorToParentButton } from './navigator-to-parent-button';
|
|
6
|
-
export {
|
|
1
|
+
export { NavigatorProvider } from './navigator-provider/component';
|
|
2
|
+
export { NavigatorScreen } from './navigator-screen/component';
|
|
3
|
+
export { NavigatorButton } from './navigator-button/component';
|
|
4
|
+
export { NavigatorBackButton } from './navigator-back-button/component';
|
|
5
|
+
export { NavigatorToParentButton } from './navigator-to-parent-button/component';
|
|
6
|
+
export { useNavigator } from './use-navigator';
|
|
@@ -9,32 +9,28 @@ import { useCallback } from '@wordpress/element';
|
|
|
9
9
|
import type { WordPressComponentProps } from '../../context';
|
|
10
10
|
import { useContextSystem } from '../../context';
|
|
11
11
|
import Button from '../../button';
|
|
12
|
-
import useNavigator from '../use-navigator';
|
|
13
|
-
import type {
|
|
12
|
+
import { useNavigator } from '../use-navigator';
|
|
13
|
+
import type { NavigatorBackButtonProps } from '../types';
|
|
14
14
|
|
|
15
15
|
export function useNavigatorBackButton(
|
|
16
|
-
props: WordPressComponentProps<
|
|
16
|
+
props: WordPressComponentProps< NavigatorBackButtonProps, 'button' >
|
|
17
17
|
) {
|
|
18
18
|
const {
|
|
19
19
|
onClick,
|
|
20
20
|
as = Button,
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
...otherProps
|
|
23
23
|
} = useContextSystem( props, 'NavigatorBackButton' );
|
|
24
24
|
|
|
25
|
-
const { goBack
|
|
25
|
+
const { goBack } = useNavigator();
|
|
26
26
|
const handleClick: React.MouseEventHandler< HTMLButtonElement > =
|
|
27
27
|
useCallback(
|
|
28
28
|
( e ) => {
|
|
29
29
|
e.preventDefault();
|
|
30
|
-
|
|
31
|
-
goToParent();
|
|
32
|
-
} else {
|
|
33
|
-
goBack();
|
|
34
|
-
}
|
|
30
|
+
goBack();
|
|
35
31
|
onClick?.( e );
|
|
36
32
|
},
|
|
37
|
-
[
|
|
33
|
+
[ goBack, onClick ]
|
|
38
34
|
);
|
|
39
35
|
|
|
40
36
|
return {
|
|
@@ -10,7 +10,7 @@ import { escapeAttribute } from '@wordpress/escape-html';
|
|
|
10
10
|
import type { WordPressComponentProps } from '../../context';
|
|
11
11
|
import { useContextSystem } from '../../context';
|
|
12
12
|
import Button from '../../button';
|
|
13
|
-
import useNavigator from '../use-navigator';
|
|
13
|
+
import { useNavigator } from '../use-navigator';
|
|
14
14
|
import type { NavigatorButtonProps } from '../types';
|
|
15
15
|
|
|
16
16
|
const cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>
|
|
@@ -10,38 +10,42 @@ The `NavigatorProvider` component allows rendering nested views/panels/menus (vi
|
|
|
10
10
|
|
|
11
11
|
```jsx
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
__experimentalNavigatorProvider as NavigatorProvider,
|
|
14
|
+
__experimentalNavigatorScreen as NavigatorScreen,
|
|
15
|
+
__experimentalNavigatorButton as NavigatorButton,
|
|
16
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
18
|
|
|
19
19
|
const MyNavigation = () => (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</NavigatorScreen>
|
|
34
|
-
</NavigatorProvider>
|
|
20
|
+
<NavigatorProvider initialPath="/">
|
|
21
|
+
<NavigatorScreen path="/">
|
|
22
|
+
<p>This is the home screen.</p>
|
|
23
|
+
<NavigatorButton path="/child">
|
|
24
|
+
Navigate to child screen.
|
|
25
|
+
</NavigatorButton>
|
|
26
|
+
</NavigatorScreen>
|
|
27
|
+
|
|
28
|
+
<NavigatorScreen path="/child">
|
|
29
|
+
<p>This is the child screen.</p>
|
|
30
|
+
<NavigatorBackButton>Go back</NavigatorBackButton>
|
|
31
|
+
</NavigatorScreen>
|
|
32
|
+
</NavigatorProvider>
|
|
35
33
|
);
|
|
36
34
|
```
|
|
35
|
+
|
|
37
36
|
**Important note**
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
`Navigator` assumes that screens are organized hierarchically according to their `path`, which should follow a URL-like scheme where each path segment starts with and is separated by the `/` character.
|
|
39
|
+
|
|
40
|
+
`Navigator` will treat "back" navigations as going to the parent screen — it is therefore responsibility of the consumer of the component to create the correct screen hierarchy.
|
|
41
|
+
|
|
40
42
|
For example:
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
43
|
+
|
|
44
|
+
- `/` is the root of all paths. There should always be a screen with `path="/"`.
|
|
45
|
+
- `/parent/child` is a child of `/parent`.
|
|
46
|
+
- `/parent/child/grand-child` is a child of `/parent/child`.
|
|
47
|
+
- `/parent/:param` is a child of `/parent` as well.
|
|
48
|
+
- if the current screen has a `path` with value `/parent/child/grand-child`, when going "back" `Navigator` will try to recursively navigate the path hierarchy until a matching screen (or the root `/`) is found.
|
|
45
49
|
|
|
46
50
|
## Props
|
|
47
51
|
|
|
@@ -65,28 +69,25 @@ The `goTo` function allows navigating to a given path. The second argument can a
|
|
|
65
69
|
|
|
66
70
|
The available options are:
|
|
67
71
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
### `goToParent`: `() => void;`
|
|
72
|
+
- `focusTargetSelector`: `string`. An optional property used to specify the CSS selector used to restore focus on the matching element when navigating back;
|
|
73
|
+
- `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);
|
|
74
|
+
- `skipFocus`: `boolean`. An optional property used to opt out of `Navigator`'s focus management, useful when the consumer of the component wants to manage focus themselves;
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
### `goBack`: `( path: string, options: NavigateOptions ) => void`
|
|
74
77
|
|
|
75
|
-
Parent/child navigation only works if the
|
|
78
|
+
The `goBack` function allows navigating to the parent screen. Parent/child navigation only works if the paths you define are hierarchical (see note above).
|
|
76
79
|
|
|
77
80
|
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.
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
The `goBack` function allows navigating to the previous path.
|
|
82
|
+
The available options are the same as for the `goTo` method, except for the `isBack` property, which is not available for the `goBack` method.
|
|
82
83
|
|
|
83
84
|
### `location`: `NavigatorLocation`
|
|
84
85
|
|
|
85
86
|
The `location` object represent the current location, and has a few properties:
|
|
86
87
|
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
88
|
+
- `path`: `string`. The path associated to the location.
|
|
89
|
+
- `isBack`: `boolean`. A flag that is `true` when the current location was reached by navigating backwards.
|
|
90
|
+
- `isInitial`: `boolean`. A flag that is `true` only for the initial location.
|
|
90
91
|
|
|
91
92
|
### `params`: `Record< string, string | string[] >`
|
|
92
93
|
|
|
@@ -8,6 +8,7 @@ import type { ForwardedRef } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
import { useMemo, useReducer } from '@wordpress/element';
|
|
10
10
|
import isShallowEqual from '@wordpress/is-shallow-equal';
|
|
11
|
+
import warning from '@wordpress/warning';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
@@ -27,24 +28,31 @@ import type {
|
|
|
27
28
|
Screen,
|
|
28
29
|
NavigateToParentOptions,
|
|
29
30
|
} from '../types';
|
|
31
|
+
import deprecated from '@wordpress/deprecated';
|
|
30
32
|
|
|
31
33
|
type MatchedPath = ReturnType< typeof patternMatch >;
|
|
32
34
|
|
|
33
35
|
type RouterAction =
|
|
34
36
|
| { type: 'add' | 'remove'; screen: Screen }
|
|
35
|
-
| { type: 'goback' }
|
|
36
37
|
| { type: 'goto'; path: string; options?: NavigateOptions }
|
|
37
38
|
| { type: 'gotoparent'; options?: NavigateToParentOptions };
|
|
38
39
|
|
|
39
40
|
type RouterState = {
|
|
41
|
+
initialPath: string;
|
|
40
42
|
screens: Screen[];
|
|
41
|
-
|
|
43
|
+
currentLocation: NavigatorLocation;
|
|
42
44
|
matchedPath: MatchedPath;
|
|
45
|
+
focusSelectors: Map< string, string >;
|
|
43
46
|
};
|
|
44
47
|
|
|
45
|
-
const MAX_HISTORY_LENGTH = 50;
|
|
46
|
-
|
|
47
48
|
function addScreen( { screens }: RouterState, screen: Screen ) {
|
|
49
|
+
if ( screens.some( ( s ) => s.path === screen.path ) ) {
|
|
50
|
+
warning(
|
|
51
|
+
`Navigator: a screen with path ${ screen.path } already exists.
|
|
52
|
+
The screen with id ${ screen.id } will not be added.`
|
|
53
|
+
);
|
|
54
|
+
return screens;
|
|
55
|
+
}
|
|
48
56
|
return [ ...screens, screen ];
|
|
49
57
|
}
|
|
50
58
|
|
|
@@ -52,95 +60,83 @@ function removeScreen( { screens }: RouterState, screen: Screen ) {
|
|
|
52
60
|
return screens.filter( ( s ) => s.id !== screen.id );
|
|
53
61
|
}
|
|
54
62
|
|
|
55
|
-
function goBack( { locationHistory }: RouterState ) {
|
|
56
|
-
if ( locationHistory.length <= 1 ) {
|
|
57
|
-
return locationHistory;
|
|
58
|
-
}
|
|
59
|
-
return [
|
|
60
|
-
...locationHistory.slice( 0, -2 ),
|
|
61
|
-
{
|
|
62
|
-
...locationHistory[ locationHistory.length - 2 ],
|
|
63
|
-
isBack: true,
|
|
64
|
-
hasRestoredFocus: false,
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
63
|
function goTo(
|
|
70
64
|
state: RouterState,
|
|
71
65
|
path: string,
|
|
72
66
|
options: NavigateOptions = {}
|
|
73
67
|
) {
|
|
74
|
-
const {
|
|
68
|
+
const { focusSelectors } = state;
|
|
69
|
+
const currentLocation = { ...state.currentLocation, isInitial: false };
|
|
70
|
+
|
|
75
71
|
const {
|
|
76
|
-
|
|
72
|
+
// Default assignments
|
|
77
73
|
isBack = false,
|
|
78
74
|
skipFocus = false,
|
|
79
|
-
|
|
75
|
+
// Extract to avoid forwarding
|
|
76
|
+
replace,
|
|
77
|
+
focusTargetSelector,
|
|
78
|
+
// Rest
|
|
80
79
|
...restOptions
|
|
81
80
|
} = options;
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
locationHistory[ locationHistory.length - 1 ].path === path;
|
|
86
|
-
if ( isNavigatingToSamePath ) {
|
|
87
|
-
return locationHistory;
|
|
82
|
+
if ( currentLocation.path === path ) {
|
|
83
|
+
return { currentLocation, focusSelectors };
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if ( isNavigatingToPreviousPath ) {
|
|
96
|
-
return goBack( state );
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const newLocation = {
|
|
100
|
-
...restOptions,
|
|
101
|
-
path,
|
|
102
|
-
isBack,
|
|
103
|
-
hasRestoredFocus: false,
|
|
104
|
-
skipFocus,
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
if ( locationHistory.length === 0 ) {
|
|
108
|
-
return replace ? [] : [ newLocation ];
|
|
86
|
+
let focusSelectorsCopy: typeof focusSelectors | undefined;
|
|
87
|
+
function getFocusSelectorsCopy() {
|
|
88
|
+
focusSelectorsCopy =
|
|
89
|
+
focusSelectorsCopy ?? new Map( state.focusSelectors );
|
|
90
|
+
return focusSelectorsCopy;
|
|
109
91
|
}
|
|
110
92
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
newLocationHistory.push(
|
|
118
|
-
// Assign `focusTargetSelector` to the previous location in history
|
|
119
|
-
// (the one we just navigated from).
|
|
120
|
-
{
|
|
121
|
-
...locationHistory[ locationHistory.length - 1 ],
|
|
122
|
-
focusTargetSelector,
|
|
123
|
-
}
|
|
93
|
+
// Set a focus selector that will be used when navigating
|
|
94
|
+
// back to the current location.
|
|
95
|
+
if ( focusTargetSelector && currentLocation.path ) {
|
|
96
|
+
getFocusSelectorsCopy().set(
|
|
97
|
+
currentLocation.path,
|
|
98
|
+
focusTargetSelector
|
|
124
99
|
);
|
|
125
100
|
}
|
|
126
101
|
|
|
127
|
-
|
|
102
|
+
// Get the focus selector for the new location.
|
|
103
|
+
let currentFocusSelector;
|
|
104
|
+
if ( focusSelectors.get( path ) ) {
|
|
105
|
+
if ( isBack ) {
|
|
106
|
+
// Use the found focus selector only when navigating back.
|
|
107
|
+
currentFocusSelector = focusSelectors.get( path );
|
|
108
|
+
}
|
|
109
|
+
// Make a copy of the focusSelectors map to remove the focus selector
|
|
110
|
+
// only if necessary (ie. a focus selector was found).
|
|
111
|
+
getFocusSelectorsCopy().delete( path );
|
|
112
|
+
}
|
|
128
113
|
|
|
129
|
-
return
|
|
114
|
+
return {
|
|
115
|
+
currentLocation: {
|
|
116
|
+
...restOptions,
|
|
117
|
+
path,
|
|
118
|
+
isBack,
|
|
119
|
+
hasRestoredFocus: false,
|
|
120
|
+
focusTargetSelector: currentFocusSelector,
|
|
121
|
+
skipFocus,
|
|
122
|
+
},
|
|
123
|
+
focusSelectors: focusSelectorsCopy ?? focusSelectors,
|
|
124
|
+
};
|
|
130
125
|
}
|
|
131
126
|
|
|
132
127
|
function goToParent(
|
|
133
128
|
state: RouterState,
|
|
134
129
|
options: NavigateToParentOptions = {}
|
|
135
130
|
) {
|
|
136
|
-
const {
|
|
137
|
-
const
|
|
131
|
+
const { screens, focusSelectors } = state;
|
|
132
|
+
const currentLocation = { ...state.currentLocation, isInitial: false };
|
|
133
|
+
const currentPath = currentLocation.path;
|
|
138
134
|
if ( currentPath === undefined ) {
|
|
139
|
-
return
|
|
135
|
+
return { currentLocation, focusSelectors };
|
|
140
136
|
}
|
|
141
137
|
const parentPath = findParent( currentPath, screens );
|
|
142
138
|
if ( parentPath === undefined ) {
|
|
143
|
-
return
|
|
139
|
+
return { currentLocation, focusSelectors };
|
|
144
140
|
}
|
|
145
141
|
return goTo( state, parentPath, {
|
|
146
142
|
...options,
|
|
@@ -152,7 +148,13 @@ function routerReducer(
|
|
|
152
148
|
state: RouterState,
|
|
153
149
|
action: RouterAction
|
|
154
150
|
): RouterState {
|
|
155
|
-
let {
|
|
151
|
+
let {
|
|
152
|
+
screens,
|
|
153
|
+
currentLocation,
|
|
154
|
+
matchedPath,
|
|
155
|
+
focusSelectors,
|
|
156
|
+
...restState
|
|
157
|
+
} = state;
|
|
156
158
|
switch ( action.type ) {
|
|
157
159
|
case 'add':
|
|
158
160
|
screens = addScreen( state, action.screen );
|
|
@@ -160,30 +162,31 @@ function routerReducer(
|
|
|
160
162
|
case 'remove':
|
|
161
163
|
screens = removeScreen( state, action.screen );
|
|
162
164
|
break;
|
|
163
|
-
case 'goback':
|
|
164
|
-
locationHistory = goBack( state );
|
|
165
|
-
break;
|
|
166
165
|
case 'goto':
|
|
167
|
-
|
|
166
|
+
( { currentLocation, focusSelectors } = goTo(
|
|
167
|
+
state,
|
|
168
|
+
action.path,
|
|
169
|
+
action.options
|
|
170
|
+
) );
|
|
168
171
|
break;
|
|
169
172
|
case 'gotoparent':
|
|
170
|
-
|
|
173
|
+
( { currentLocation, focusSelectors } = goToParent(
|
|
174
|
+
state,
|
|
175
|
+
action.options
|
|
176
|
+
) );
|
|
171
177
|
break;
|
|
172
178
|
}
|
|
173
179
|
|
|
174
180
|
// Return early in case there is no change
|
|
175
181
|
if (
|
|
176
182
|
screens === state.screens &&
|
|
177
|
-
|
|
183
|
+
currentLocation === state.currentLocation
|
|
178
184
|
) {
|
|
179
185
|
return state;
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
// Compute the matchedPath
|
|
183
|
-
const currentPath =
|
|
184
|
-
locationHistory.length > 0
|
|
185
|
-
? locationHistory[ locationHistory.length - 1 ].path
|
|
186
|
-
: undefined;
|
|
189
|
+
const currentPath = currentLocation.path;
|
|
187
190
|
matchedPath =
|
|
188
191
|
currentPath !== undefined
|
|
189
192
|
? patternMatch( currentPath, screens )
|
|
@@ -200,34 +203,55 @@ function routerReducer(
|
|
|
200
203
|
matchedPath = state.matchedPath;
|
|
201
204
|
}
|
|
202
205
|
|
|
203
|
-
return {
|
|
206
|
+
return {
|
|
207
|
+
...restState,
|
|
208
|
+
screens,
|
|
209
|
+
currentLocation,
|
|
210
|
+
matchedPath,
|
|
211
|
+
focusSelectors,
|
|
212
|
+
};
|
|
204
213
|
}
|
|
205
214
|
|
|
206
215
|
function UnconnectedNavigatorProvider(
|
|
207
216
|
props: WordPressComponentProps< NavigatorProviderProps, 'div' >,
|
|
208
217
|
forwardedRef: ForwardedRef< any >
|
|
209
218
|
) {
|
|
210
|
-
const {
|
|
211
|
-
|
|
219
|
+
const {
|
|
220
|
+
initialPath: initialPathProp,
|
|
221
|
+
children,
|
|
222
|
+
className,
|
|
223
|
+
...otherProps
|
|
224
|
+
} = useContextSystem( props, 'NavigatorProvider' );
|
|
212
225
|
|
|
213
226
|
const [ routerState, dispatch ] = useReducer(
|
|
214
227
|
routerReducer,
|
|
215
|
-
|
|
228
|
+
initialPathProp,
|
|
216
229
|
( path ) => ( {
|
|
217
230
|
screens: [],
|
|
218
|
-
|
|
231
|
+
currentLocation: { path, isInitial: true },
|
|
219
232
|
matchedPath: undefined,
|
|
233
|
+
focusSelectors: new Map(),
|
|
234
|
+
initialPath: initialPathProp,
|
|
220
235
|
} )
|
|
221
236
|
);
|
|
222
237
|
|
|
223
238
|
// The methods are constant forever, create stable references to them.
|
|
224
239
|
const methods = useMemo(
|
|
225
240
|
() => ( {
|
|
226
|
-
|
|
241
|
+
// Note: calling goBack calls `goToParent` internally, as it was established
|
|
242
|
+
// that `goBack` should behave like `goToParent`, and `goToParent` should
|
|
243
|
+
// be marked as deprecated.
|
|
244
|
+
goBack: ( options: NavigateToParentOptions | undefined ) =>
|
|
245
|
+
dispatch( { type: 'gotoparent', options } ),
|
|
227
246
|
goTo: ( path: string, options?: NavigateOptions ) =>
|
|
228
247
|
dispatch( { type: 'goto', path, options } ),
|
|
229
|
-
goToParent: ( options: NavigateToParentOptions | undefined ) =>
|
|
230
|
-
|
|
248
|
+
goToParent: ( options: NavigateToParentOptions | undefined ) => {
|
|
249
|
+
deprecated( `wp.components.useNavigator().goToParent`, {
|
|
250
|
+
since: '6.7',
|
|
251
|
+
alternative: 'wp.components.useNavigator().goBack',
|
|
252
|
+
} );
|
|
253
|
+
dispatch( { type: 'gotoparent', options } );
|
|
254
|
+
},
|
|
231
255
|
addScreen: ( screen: Screen ) =>
|
|
232
256
|
dispatch( { type: 'add', screen } ),
|
|
233
257
|
removeScreen: ( screen: Screen ) =>
|
|
@@ -236,19 +260,16 @@ function UnconnectedNavigatorProvider(
|
|
|
236
260
|
[]
|
|
237
261
|
);
|
|
238
262
|
|
|
239
|
-
const {
|
|
263
|
+
const { currentLocation, matchedPath } = routerState;
|
|
240
264
|
|
|
241
265
|
const navigatorContextValue: NavigatorContextType = useMemo(
|
|
242
266
|
() => ( {
|
|
243
|
-
location:
|
|
244
|
-
...locationHistory[ locationHistory.length - 1 ],
|
|
245
|
-
isInitial: locationHistory.length === 1,
|
|
246
|
-
},
|
|
267
|
+
location: currentLocation,
|
|
247
268
|
params: matchedPath?.params ?? {},
|
|
248
269
|
match: matchedPath?.id,
|
|
249
270
|
...methods,
|
|
250
271
|
} ),
|
|
251
|
-
[
|
|
272
|
+
[ currentLocation, matchedPath, methods ]
|
|
252
273
|
);
|
|
253
274
|
|
|
254
275
|
const cx = useCx();
|
|
@@ -16,6 +16,18 @@ The component accepts the following props:
|
|
|
16
16
|
|
|
17
17
|
### `path`: `string`
|
|
18
18
|
|
|
19
|
-
The screen
|
|
19
|
+
The screen"s path, matched against the current path stored in the navigator.
|
|
20
|
+
|
|
21
|
+
`Navigator` assumes that screens are organized hierarchically according to their `path`, which should follow a URL-like scheme where each path segment starts with and is separated by the `/` character.
|
|
22
|
+
|
|
23
|
+
`Navigator` will treat "back" navigations as going to the parent screen — it is therefore responsibility of the consumer of the component to create the correct screen hierarchy.
|
|
24
|
+
|
|
25
|
+
For example:
|
|
26
|
+
|
|
27
|
+
- `/` is the root of all paths. There should always be a screen with `path="/"`.
|
|
28
|
+
- `/parent/child` is a child of `/parent`.
|
|
29
|
+
- `/parent/child/grand-child` is a child of `/parent/child`.
|
|
30
|
+
- `/parent/:param` is a child of `/parent` as well.
|
|
31
|
+
- if the current screen has a `path` with value `/parent/child/grand-child`, when going "back" `Navigator` will try to recursively navigate the path hierarchy until a matching screen (or the root `/`) is found.
|
|
20
32
|
|
|
21
33
|
- Required: Yes
|