@wordpress/components 28.4.0 → 28.6.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 +113 -1
- package/CONTRIBUTING.md +155 -64
- package/build/alignment-matrix-control/cell.js +2 -2
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/index.js +6 -5
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -17
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.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/autocomplete/autocompleter-ui.js +2 -0
- package/build/autocomplete/autocompleter-ui.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/styles/base-control-styles.js +8 -8
- package/build/base-control/styles/base-control-styles.js.map +1 -1
- package/build/base-control/types.js.map +1 -1
- package/build/border-control/styles.js +18 -24
- 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 +4 -4
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +3 -3
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/circular-option-picker/types.js.map +1 -1
- package/build/color-palette/index.js +1 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/utils.js +17 -5
- package/build/color-palette/utils.js.map +1 -1
- package/build/color-picker/input-with-slider.js +1 -0
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/combobox-control/index.js +1 -0
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/context.js +19 -0
- package/build/composite/context.js.map +1 -0
- package/build/composite/index.js +287 -9
- package/build/composite/index.js.map +1 -1
- package/build/composite/legacy/index.js +10 -8
- package/build/composite/legacy/index.js.map +1 -1
- package/build/composite/types.js +6 -0
- package/build/composite/types.js.map +1 -0
- package/build/custom-select-control/index.js +37 -14
- package/build/custom-select-control/index.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 +9 -9
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/date-time/index.js +0 -7
- package/build/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +77 -41
- package/build/date-time/time/index.js.map +1 -1
- package/build/date-time/time/styles.js +11 -11
- package/build/date-time/time/styles.js.map +1 -1
- package/build/date-time/{time-input → time/time-input}/index.js +7 -7
- package/build/date-time/time/time-input/index.js.map +1 -0
- package/build/date-time/types.js.map +1 -1
- package/build/dimension-control/index.js +25 -8
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/types.js.map +1 -1
- package/build/dropdown-menu-v2/index.js +3 -2
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js +23 -21
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- 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/types.js.map +1 -1
- package/build/form-file-upload/types.js.map +1 -1
- package/build/form-toggle/index.js +24 -24
- package/build/form-toggle/index.js.map +1 -1
- package/build/guide/index.js +2 -0
- package/build/guide/index.js.map +1 -1
- package/build/heading/types.js.map +1 -1
- package/build/index.js +5 -5
- package/build/index.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 +18 -11
- package/build/modal/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 +3 -9
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +17 -9
- 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/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 +6 -6
- 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 +6 -7
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/types.js.map +1 -1
- package/build/radio-control/index.js +43 -15
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/types.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 +29 -29
- package/build/range-control/styles/range-control-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 +21 -8
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/types.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 +3 -2
- package/build/tabs/index.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 +2 -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 +35 -25
- 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 +7 -1
- 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-option/component.js +6 -1
- package/build/toggle-group-control/toggle-group-control-option/component.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/toggle-group-control/toggle-group-control-option-icon/component.js +14 -14
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/tools-panel/styles.js +13 -13
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tooltip/index.js +14 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-select/index.js +20 -8
- 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 -3
- package/build/utils/config-values.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +2 -2
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +4 -3
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -18
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.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/autocomplete/autocompleter-ui.js +2 -0
- package/build-module/autocomplete/autocompleter-ui.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/styles/base-control-styles.js +8 -8
- package/build-module/base-control/styles/base-control-styles.js.map +1 -1
- package/build-module/base-control/types.js.map +1 -1
- package/build-module/border-control/styles.js +13 -23
- 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 +4 -4
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +1 -1
- 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/color-palette/index.js +1 -1
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/utils.js +17 -5
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -0
- package/build-module/color-picker/input-with-slider.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/composite/context.js +12 -0
- package/build-module/composite/context.js.map +1 -0
- package/build-module/composite/index.js +284 -6
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/legacy/index.js +10 -6
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/composite/types.js +2 -0
- package/build-module/composite/types.js.map +1 -0
- package/build-module/custom-select-control/index.js +38 -14
- package/build-module/custom-select-control/index.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 +9 -9
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/date-time/index.js +1 -2
- package/build-module/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +77 -41
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/time/styles.js +11 -11
- package/build-module/date-time/time/styles.js.map +1 -1
- package/build-module/date-time/{time-input → time/time-input}/index.js +7 -7
- package/build-module/date-time/time/time-input/index.js.map +1 -0
- package/build-module/date-time/types.js.map +1 -1
- package/build-module/dimension-control/index.js +25 -8
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dimension-control/types.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +2 -1
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js +23 -21
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- 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/types.js.map +1 -1
- package/build-module/form-file-upload/types.js.map +1 -1
- package/build-module/form-toggle/index.js +23 -22
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/guide/index.js +2 -0
- package/build-module/guide/index.js.map +1 -1
- package/build-module/heading/types.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.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 +17 -11
- package/build-module/modal/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 +3 -9
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +17 -9
- 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/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 +6 -6
- 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 +6 -7
- 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 +44 -17
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/types.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 +29 -29
- package/build-module/range-control/styles/range-control-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 +21 -8
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/types.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 +2 -1
- package/build-module/tabs/index.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 +2 -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 +34 -24
- 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 +7 -1
- 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-option/component.js +6 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.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/toggle-group-control/toggle-group-control-option-icon/component.js +14 -14
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.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/tooltip/index.js +14 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-select/index.js +20 -8
- 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 -3
- package/build-module/utils/config-values.js.map +1 -1
- package/build-style/style-rtl.css +79 -33
- package/build-style/style.css +79 -33
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.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/styles.d.ts.map +1 -1
- package/build-types/button/stories/e2e/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/types.d.ts +2 -3
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +2 -2
- package/build-types/color-palette/utils.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 +3 -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/composite/context.d.ts +7 -0
- package/build-types/composite/context.d.ts.map +1 -0
- package/build-types/composite/index.d.ts +181 -1
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/legacy/index.d.ts +7 -2
- 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/stories/index.story.d.ts +13 -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/types.d.ts +288 -0
- package/build-types/composite/types.d.ts.map +1 -0
- package/build-types/custom-select-control/index.d.ts +2 -2
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/types.d.ts +7 -7
- 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/custom-select-control-v2/styles.d.ts +16 -28
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +2 -2
- package/build-types/date-time/date-time/index.d.ts +1 -1
- package/build-types/date-time/index.d.ts +1 -2
- package/build-types/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +5 -0
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/time/index.d.ts +4 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/date-time/{time-input → time/time-input}/index.d.ts +1 -1
- package/build-types/date-time/time/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/test/index.d.ts.map +1 -0
- 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 +1 -0
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +8 -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/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +24 -42
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- 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/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-toggle/index.d.ts +2 -5
- package/build-types/form-toggle/index.d.ts.map +1 -1
- package/build-types/guide/index.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +1 -1
- package/build-types/heading/types.d.ts +1 -1
- package/build-types/heading/types.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +2 -2
- 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/types.d.ts +45 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +2 -2
- 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-control/stories/index.story.d.ts +1 -0
- package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-control/test/index.d.ts +2 -0
- package/build-types/radio-control/test/index.d.ts.map +1 -0
- package/build-types/radio-control/types.d.ts +4 -0
- package/build-types/radio-control/types.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/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 +4 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +13 -5
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +27 -27
- package/build-types/select-control/types.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 +8 -14
- 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 +1 -0
- 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 +3 -9
- 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 +6 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +6 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +14 -14
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/test/utils/index.d.ts +1 -5
- package/build-types/tooltip/test/utils/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +10 -3
- package/package.json +20 -20
- package/src/alignment-matrix-control/cell.tsx +3 -3
- package/src/alignment-matrix-control/index.tsx +5 -4
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +2 -2
- package/src/alignment-matrix-control/test/index.tsx +1 -3
- package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +2 -2
- package/src/autocomplete/autocompleter-ui.tsx +2 -0
- package/src/autocomplete/style.scss +0 -6
- package/src/base-control/README.md +5 -2
- package/src/base-control/index.tsx +61 -41
- package/src/base-control/styles/base-control-styles.ts +1 -1
- 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/styles.ts +1 -6
- package/src/button/README.md +7 -0
- package/src/button/stories/e2e/index.story.tsx +103 -21
- package/src/button/style.scss +51 -23
- package/src/button/test/index.tsx +18 -40
- 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 +8 -6
- package/src/circular-option-picker/circular-option-picker.tsx +1 -1
- package/src/circular-option-picker/style.scss +3 -3
- package/src/circular-option-picker/test/index.tsx +1 -4
- package/src/circular-option-picker/types.ts +2 -3
- package/src/color-indicator/style.scss +1 -1
- package/src/color-palette/index.tsx +22 -20
- package/src/color-palette/style.scss +2 -2
- package/src/color-palette/utils.ts +23 -10
- package/src/color-picker/input-with-slider.tsx +1 -0
- 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/composite/README.md +325 -0
- package/src/composite/context.ts +14 -0
- package/src/composite/index.tsx +341 -0
- package/src/composite/legacy/index.tsx +15 -14
- package/src/composite/legacy/stories/utils.tsx +19 -0
- package/src/composite/legacy/test/index.tsx +2 -18
- package/src/composite/stories/index.story.tsx +466 -0
- package/src/composite/{current/stories → stories}/utils.tsx +22 -7
- package/src/composite/types.ts +298 -0
- package/src/custom-gradient-picker/style.scss +2 -2
- package/src/custom-select-control/README.md +7 -0
- package/src/custom-select-control/index.tsx +55 -25
- package/src/custom-select-control/test/index.tsx +172 -30
- package/src/custom-select-control/types.ts +7 -7
- package/src/custom-select-control-v2/custom-select.tsx +2 -1
- package/src/custom-select-control-v2/styles.ts +7 -6
- package/src/custom-select-control-v2/test/index.tsx +15 -19
- package/src/date-time/index.ts +1 -2
- package/src/date-time/stories/time.story.tsx +17 -0
- package/src/date-time/time/index.tsx +72 -28
- package/src/date-time/time/styles.ts +1 -0
- package/src/date-time/{time-input → time/time-input}/index.tsx +9 -9
- package/src/date-time/types.ts +11 -1
- package/src/dimension-control/README.md +17 -0
- package/src/dimension-control/index.tsx +26 -9
- package/src/dimension-control/stories/index.story.tsx +1 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +0 -16
- package/src/dimension-control/test/index.test.js +5 -1
- package/src/dimension-control/types.ts +5 -7
- package/src/drop-zone/style.scss +1 -1
- package/src/dropdown-menu-v2/index.tsx +5 -3
- package/src/dropdown-menu-v2/styles.ts +35 -32
- package/src/dropdown-menu-v2/test/index.tsx +1 -4
- 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/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/font-size-picker/test/index.tsx +50 -43
- package/src/form-file-upload/README.md +8 -0
- package/src/form-file-upload/types.ts +6 -0
- package/src/form-toggle/index.tsx +23 -21
- package/src/form-token-field/README.md +1 -0
- package/src/guide/index.tsx +2 -0
- package/src/guide/style.scss +0 -1
- package/src/heading/types.ts +1 -4
- package/src/index.ts +1 -1
- package/src/input-control/README.md +8 -0
- package/src/item-group/styles.ts +1 -1
- package/src/mobile/utils/alignments.native.js +1 -0
- package/src/modal/index.tsx +21 -20
- package/src/modal/style.scss +3 -3
- package/src/navigator/navigator-back-button/component.tsx +1 -1
- package/src/navigator/navigator-back-button/hook.ts +6 -10
- package/src/navigator/navigator-provider/README.md +38 -36
- package/src/navigator/navigator-provider/component.tsx +13 -7
- 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/test/index.tsx +136 -6
- package/src/navigator/types.ts +45 -10
- package/src/number-control/README.md +8 -0
- package/src/palette-edit/styles.ts +5 -5
- package/src/placeholder/style.scss +15 -3
- 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 +6 -12
- package/src/progress-bar/styles.ts +2 -2
- package/src/query-controls/README.md +7 -0
- package/src/query-controls/index.tsx +10 -7
- package/src/query-controls/types.ts +2 -1
- package/src/radio-control/index.tsx +62 -13
- package/src/radio-control/stories/index.story.tsx +23 -0
- package/src/radio-control/style.scss +38 -3
- package/src/radio-control/test/index.tsx +277 -0
- package/src/radio-control/types.ts +4 -0
- 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 +2 -2
- package/src/range-control/test/index.tsx +54 -14
- 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 +16 -1
- package/src/select-control/index.tsx +34 -22
- package/src/select-control/stories/index.story.tsx +8 -5
- package/src/select-control/test/select-control.tsx +155 -5
- package/src/select-control/types.ts +70 -65
- package/src/snackbar/style.scss +2 -2
- package/src/tab-panel/index.tsx +4 -1
- package/src/tab-panel/style.scss +1 -1
- package/src/tab-panel/test/index.tsx +1 -8
- package/src/tabs/index.tsx +2 -1
- package/src/tabs/tablist.tsx +6 -4
- package/src/tabs/tabpanel.tsx +6 -2
- package/src/tabs/test/index.tsx +68 -84
- package/src/text/styles.ts +1 -1
- package/src/text-control/README.md +9 -0
- package/src/text-control/index.tsx +2 -0
- package/src/text-control/stories/index.story.tsx +3 -1
- package/src/text-control/style.scss +5 -0
- 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/README.md +9 -0
- package/src/toggle-control/index.tsx +34 -22
- package/src/toggle-control/stories/index.story.tsx +1 -0
- package/src/toggle-control/style.scss +2 -1
- package/src/toggle-control/test/index.tsx +7 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +14 -30
- package/src/toggle-group-control/test/index.tsx +5 -7
- package/src/toggle-group-control/toggle-group-control/README.md +20 -1
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +7 -1
- package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
- package/src/toggle-group-control/toggle-group-control-option/README.md +6 -1
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +6 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +2 -2
- package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
- package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +14 -14
- package/src/toolbar/toolbar/style.scss +2 -2
- package/src/tools-panel/styles.ts +1 -1
- package/src/tooltip/index.tsx +16 -2
- package/src/tooltip/style.scss +1 -1
- package/src/tooltip/test/index.tsx +0 -5
- package/src/tooltip/test/utils/index.tsx +5 -5
- package/src/tree-select/index.tsx +17 -7
- 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 +1 -1
- package/src/utils/config-values.js +10 -3
- package/tsconfig.tsbuildinfo +1 -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/date-time/time-input/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/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/date-time/time-input/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/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/date-time/stories/time-input.story.d.ts +0 -12
- package/build-types/date-time/stories/time-input.story.d.ts.map +0 -1
- package/build-types/date-time/time-input/index.d.ts.map +0 -1
- package/build-types/date-time/time-input/test/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/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/date-time/stories/time-input.story.tsx +0 -36
- 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/build-types/date-time/{time-input → time/time-input}/test/index.d.ts +0 -0
- /package/src/date-time/{time-input → time/time-input}/test/index.tsx +0 -0
|
@@ -1,8 +1,286 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Composite is a component that may contain navigable items represented by
|
|
3
|
+
* Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements
|
|
4
|
+
* all the keyboard navigation mechanisms to ensure that there's only one
|
|
5
|
+
* tab stop for the whole Composite element. This means that it can behave as
|
|
6
|
+
* a roving tabindex or aria-activedescendant container.
|
|
7
|
+
*
|
|
8
|
+
* @see https://ariakit.org/components/composite
|
|
9
|
+
*/
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* External dependencies
|
|
13
|
+
*/
|
|
14
|
+
import * as Ariakit from '@ariakit/react';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
import { useMemo, forwardRef } from '@wordpress/element';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Internal dependencies
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { CompositeContext, useCompositeContext } from './context';
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
/**
|
|
28
|
+
* Creates a composite store.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
33
|
+
*
|
|
34
|
+
* const store = useCompositeStore();
|
|
35
|
+
* <Composite store={store}>
|
|
36
|
+
* <Composite.Item>Item</Composite.Item>
|
|
37
|
+
* <Composite.Item>Item</Composite.Item>
|
|
38
|
+
* <Composite.Item>Item</Composite.Item>
|
|
39
|
+
* </Composite>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function useCompositeStore({
|
|
43
|
+
focusLoop = false,
|
|
44
|
+
focusWrap = false,
|
|
45
|
+
focusShift = false,
|
|
46
|
+
virtualFocus = false,
|
|
47
|
+
orientation = 'both',
|
|
48
|
+
rtl = false,
|
|
49
|
+
...props
|
|
50
|
+
} = {}) {
|
|
51
|
+
return Ariakit.useCompositeStore({
|
|
52
|
+
focusLoop,
|
|
53
|
+
focusWrap,
|
|
54
|
+
focusShift,
|
|
55
|
+
virtualFocus,
|
|
56
|
+
orientation,
|
|
57
|
+
rtl,
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const Group = forwardRef(function CompositeGroup(props, ref) {
|
|
62
|
+
const context = useCompositeContext();
|
|
63
|
+
return /*#__PURE__*/_jsx(Ariakit.CompositeGroup, {
|
|
64
|
+
store: context?.store,
|
|
65
|
+
...props,
|
|
66
|
+
ref: ref
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
Group.displayName = 'Composite.Group';
|
|
70
|
+
const GroupLabel = forwardRef(function CompositeGroupLabel(props, ref) {
|
|
71
|
+
const context = useCompositeContext();
|
|
72
|
+
return /*#__PURE__*/_jsx(Ariakit.CompositeGroupLabel, {
|
|
73
|
+
store: context?.store,
|
|
74
|
+
...props,
|
|
75
|
+
ref: ref
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
GroupLabel.displayName = 'Composite.GroupLabel';
|
|
79
|
+
const Item = forwardRef(function CompositeItem(props, ref) {
|
|
80
|
+
const context = useCompositeContext();
|
|
81
|
+
return /*#__PURE__*/_jsx(Ariakit.CompositeItem, {
|
|
82
|
+
store: context?.store,
|
|
83
|
+
...props,
|
|
84
|
+
ref: ref
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
Item.displayName = 'Composite.Item';
|
|
88
|
+
const Row = forwardRef(function CompositeRow(props, ref) {
|
|
89
|
+
const context = useCompositeContext();
|
|
90
|
+
return /*#__PURE__*/_jsx(Ariakit.CompositeRow, {
|
|
91
|
+
store: context?.store,
|
|
92
|
+
...props,
|
|
93
|
+
ref: ref
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
Row.displayName = 'Composite.Row';
|
|
97
|
+
const Hover = forwardRef(function CompositeHover(props, ref) {
|
|
98
|
+
const context = useCompositeContext();
|
|
99
|
+
return /*#__PURE__*/_jsx(Ariakit.CompositeHover, {
|
|
100
|
+
store: context?.store,
|
|
101
|
+
...props,
|
|
102
|
+
ref: ref
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
Hover.displayName = 'Composite.Hover';
|
|
106
|
+
const Typeahead = forwardRef(function CompositeTypeahead(props, ref) {
|
|
107
|
+
const context = useCompositeContext();
|
|
108
|
+
return /*#__PURE__*/_jsx(Ariakit.CompositeTypeahead, {
|
|
109
|
+
store: context?.store,
|
|
110
|
+
...props,
|
|
111
|
+
ref: ref
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
Typeahead.displayName = 'Composite.Typeahead';
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)
|
|
118
|
+
* role, which provides a single tab stop on the page and arrow key navigation
|
|
119
|
+
* through the focusable descendants.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```jsx
|
|
123
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
124
|
+
*
|
|
125
|
+
* const store = useCompositeStore();
|
|
126
|
+
* <Composite store={store}>
|
|
127
|
+
* <Composite.Item>Item 1</Composite.Item>
|
|
128
|
+
* <Composite.Item>Item 2</Composite.Item>
|
|
129
|
+
* </Composite>
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export const Composite = Object.assign(forwardRef(function Composite({
|
|
133
|
+
children,
|
|
134
|
+
store,
|
|
135
|
+
disabled = false,
|
|
136
|
+
...props
|
|
137
|
+
}, ref) {
|
|
138
|
+
const contextValue = useMemo(() => ({
|
|
139
|
+
store
|
|
140
|
+
}), [store]);
|
|
141
|
+
return /*#__PURE__*/_jsx(Ariakit.Composite, {
|
|
142
|
+
disabled: disabled,
|
|
143
|
+
store: store,
|
|
144
|
+
...props,
|
|
145
|
+
ref: ref,
|
|
146
|
+
children: /*#__PURE__*/_jsx(CompositeContext.Provider, {
|
|
147
|
+
value: contextValue,
|
|
148
|
+
children: children
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
}), {
|
|
152
|
+
displayName: 'Composite',
|
|
153
|
+
/**
|
|
154
|
+
* Renders a group element for composite items.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```jsx
|
|
158
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
159
|
+
*
|
|
160
|
+
* const store = useCompositeStore();
|
|
161
|
+
* <Composite store={store}>
|
|
162
|
+
* <Composite.Group>
|
|
163
|
+
* <Composite.GroupLabel>Label</Composite.GroupLabel>
|
|
164
|
+
* <Composite.Item>Item 1</Composite.Item>
|
|
165
|
+
* <Composite.Item>Item 2</Composite.Item>
|
|
166
|
+
* </CompositeGroup>
|
|
167
|
+
* </Composite>
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
Group,
|
|
171
|
+
/**
|
|
172
|
+
* Renders a label in a composite group. This component must be wrapped with
|
|
173
|
+
* `Composite.Group` so the `aria-labelledby` prop is properly set on the
|
|
174
|
+
* composite group element.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```jsx
|
|
178
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
179
|
+
*
|
|
180
|
+
* const store = useCompositeStore();
|
|
181
|
+
* <Composite store={store}>
|
|
182
|
+
* <Composite.Group>
|
|
183
|
+
* <Composite.GroupLabel>Label</Composite.GroupLabel>
|
|
184
|
+
* <Composite.Item>Item 1</Composite.Item>
|
|
185
|
+
* <Composite.Item>Item 2</Composite.Item>
|
|
186
|
+
* </CompositeGroup>
|
|
187
|
+
* </Composite>
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
GroupLabel,
|
|
191
|
+
/**
|
|
192
|
+
* Renders a composite item.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```jsx
|
|
196
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
197
|
+
*
|
|
198
|
+
* const store = useCompositeStore();
|
|
199
|
+
* <Composite store={store}>
|
|
200
|
+
* <Composite.Item>Item 1</Composite.Item>
|
|
201
|
+
* <Composite.Item>Item 2</Composite.Item>
|
|
202
|
+
* <Composite.Item>Item 3</Composite.Item>
|
|
203
|
+
* </Composite>
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
Item,
|
|
207
|
+
/**
|
|
208
|
+
* Renders a composite row. Wrapping `Composite.Item` elements within
|
|
209
|
+
* `Composite.Row` will create a two-dimensional composite widget, such as a
|
|
210
|
+
* grid.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```jsx
|
|
214
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
215
|
+
*
|
|
216
|
+
* const store = useCompositeStore();
|
|
217
|
+
* <Composite store={store}>
|
|
218
|
+
* <Composite.Row>
|
|
219
|
+
* <Composite.Item>Item 1.1</Composite.Item>
|
|
220
|
+
* <Composite.Item>Item 1.2</Composite.Item>
|
|
221
|
+
* <Composite.Item>Item 1.3</Composite.Item>
|
|
222
|
+
* </Composite.Row>
|
|
223
|
+
* <Composite.Row>
|
|
224
|
+
* <Composite.Item>Item 2.1</Composite.Item>
|
|
225
|
+
* <Composite.Item>Item 2.2</Composite.Item>
|
|
226
|
+
* <Composite.Item>Item 2.3</Composite.Item>
|
|
227
|
+
* </Composite.Row>
|
|
228
|
+
* </Composite>
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
Row,
|
|
232
|
+
/**
|
|
233
|
+
* Renders an element in a composite widget that receives focus on mouse move
|
|
234
|
+
* and loses focus to the composite base element on mouse leave. This should
|
|
235
|
+
* be combined with the `Composite.Item` component.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```jsx
|
|
239
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
240
|
+
*
|
|
241
|
+
* const store = useCompositeStore();
|
|
242
|
+
* <Composite store={store}>
|
|
243
|
+
* <Composite.Hover render={ <Composite.Item /> }>
|
|
244
|
+
* Item 1
|
|
245
|
+
* </Composite.Hover>
|
|
246
|
+
* <Composite.Hover render={ <Composite.Item /> }>
|
|
247
|
+
* Item 2
|
|
248
|
+
* </Composite.Hover>
|
|
249
|
+
* </Composite>
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
Hover,
|
|
253
|
+
/**
|
|
254
|
+
* Renders a component that adds typeahead functionality to composite
|
|
255
|
+
* components. Hitting printable character keys will move focus to the next
|
|
256
|
+
* composite item that begins with the input characters.
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```jsx
|
|
260
|
+
* import { Composite, useCompositeStore } from '@wordpress/components';
|
|
261
|
+
*
|
|
262
|
+
* const store = useCompositeStore();
|
|
263
|
+
* <Composite store={store} render={ <CompositeTypeahead /> }>
|
|
264
|
+
* <Composite.Item>Item 1</Composite.Item>
|
|
265
|
+
* <Composite.Item>Item 2</Composite.Item>
|
|
266
|
+
* </Composite>
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
Typeahead,
|
|
270
|
+
/**
|
|
271
|
+
* The React context used by the composite components. It can be used by
|
|
272
|
+
* to access the composite store, and to forward the context when composite
|
|
273
|
+
* sub-components are rendered across portals (ie. `SlotFill` components)
|
|
274
|
+
* that would not otherwise forward the context to the `Fill` children.
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```jsx
|
|
278
|
+
* import { Composite } from '@wordpress/components';
|
|
279
|
+
* import { useContext } from '@wordpress/element';
|
|
280
|
+
*
|
|
281
|
+
* const compositeContext = useContext( Composite.Context );
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
Context: CompositeContext
|
|
285
|
+
});
|
|
8
286
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/composite/index.ts"],"sourcesContent":["// Originally this pointed at a Reakit implementation of\n// `Composite`, but we are removing Reakit entirely from the\n// codebase. We will continue to support the Reakit API\n// through the 'legacy' version, which uses Ariakit under\n// the hood.\n\nexport * from './legacy';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,cAAc,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","useMemo","forwardRef","CompositeContext","useCompositeContext","jsx","_jsx","useCompositeStore","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","props","Group","CompositeGroup","ref","context","store","displayName","GroupLabel","CompositeGroupLabel","Item","CompositeItem","Row","CompositeRow","Hover","CompositeHover","Typeahead","CompositeTypeahead","Composite","Object","assign","children","disabled","contextValue","Provider","value","Context"],"sources":["@wordpress/components/src/composite/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { CompositeContext, useCompositeContext } from './context';\nimport type {\n\tCompositeStoreProps,\n\tCompositeProps,\n\tCompositeGroupProps,\n\tCompositeGroupLabelProps,\n\tCompositeItemProps,\n\tCompositeRowProps,\n\tCompositeHoverProps,\n\tCompositeTypeaheadProps,\n} from './types';\n\n/**\n * Creates a composite store.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * </Composite>\n * ```\n */\nexport function useCompositeStore( {\n\tfocusLoop = false,\n\tfocusWrap = false,\n\tfocusShift = false,\n\tvirtualFocus = false,\n\torientation = 'both',\n\trtl = false,\n\t...props\n}: CompositeStoreProps = {} ) {\n\treturn Ariakit.useCompositeStore( {\n\t\tfocusLoop,\n\t\tfocusWrap,\n\t\tfocusShift,\n\t\tvirtualFocus,\n\t\torientation,\n\t\trtl,\n\t\t...props,\n\t} );\n}\n\nconst Group = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupProps, 'div', false >\n>( function CompositeGroup( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroup\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nGroup.displayName = 'Composite.Group';\n\nconst GroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupLabelProps, 'div', false >\n>( function CompositeGroupLabel( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroupLabel\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nGroupLabel.displayName = 'Composite.GroupLabel';\n\nconst Item = forwardRef<\n\tHTMLButtonElement,\n\tWordPressComponentProps< CompositeItemProps, 'button', false >\n>( function CompositeItem( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeItem\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nItem.displayName = 'Composite.Item';\n\nconst Row = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeRowProps, 'div', false >\n>( function CompositeRow( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeRow\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nRow.displayName = 'Composite.Row';\n\nconst Hover = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeHoverProps, 'div', false >\n>( function CompositeHover( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeHover\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nHover.displayName = 'Composite.Hover';\n\nconst Typeahead = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeTypeaheadProps, 'div', false >\n>( function CompositeTypeahead( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeTypeahead\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nTypeahead.displayName = 'Composite.Typeahead';\n\n/**\n * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)\n * role, which provides a single tab stop on the page and arrow key navigation\n * through the focusable descendants.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item 1</Composite.Item>\n * <Composite.Item>Item 2</Composite.Item>\n * </Composite>\n * ```\n */\nexport const Composite = Object.assign(\n\tforwardRef<\n\t\tHTMLDivElement,\n\t\tWordPressComponentProps< CompositeProps, 'div', false >\n\t>( function Composite(\n\t\t{ children, store, disabled = false, ...props },\n\t\tref\n\t) {\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t} ),\n\t\t\t[ store ]\n\t\t);\n\n\t\treturn (\n\t\t\t<Ariakit.Composite\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tstore={ store }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<CompositeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CompositeContext.Provider>\n\t\t\t</Ariakit.Composite>\n\t\t);\n\t} ),\n\t{\n\t\tdisplayName: 'Composite',\n\t\t/**\n\t\t * Renders a group element for composite items.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroup,\n\t\t/**\n\t\t * Renders a label in a composite group. This component must be wrapped with\n\t\t * `Composite.Group` so the `aria-labelledby` prop is properly set on the\n\t\t * composite group element.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroupLabel,\n\t\t/**\n\t\t * Renders a composite item.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * <Composite.Item>Item 3</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tItem,\n\t\t/**\n\t\t * Renders a composite row. Wrapping `Composite.Item` elements within\n\t\t * `Composite.Row` will create a two-dimensional composite widget, such as a\n\t\t * grid.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 1.1</Composite.Item>\n\t\t * <Composite.Item>Item 1.2</Composite.Item>\n\t\t * <Composite.Item>Item 1.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 2.1</Composite.Item>\n\t\t * <Composite.Item>Item 2.2</Composite.Item>\n\t\t * <Composite.Item>Item 2.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tRow,\n\t\t/**\n\t\t * Renders an element in a composite widget that receives focus on mouse move\n\t\t * and loses focus to the composite base element on mouse leave. This should\n\t\t * be combined with the `Composite.Item` component.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 1\n\t\t * </Composite.Hover>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 2\n\t\t * </Composite.Hover>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tHover,\n\t\t/**\n\t\t * Renders a component that adds typeahead functionality to composite\n\t\t * components. Hitting printable character keys will move focus to the next\n\t\t * composite item that begins with the input characters.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store} render={ <CompositeTypeahead /> }>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tTypeahead,\n\t\t/**\n\t\t * The React context used by the composite components. It can be used by\n\t\t * to access the composite store, and to forward the context when composite\n\t\t * sub-components are rendered across portals (ie. `SlotFill` components)\n\t\t * that would not otherwise forward the context to the `Fill` children.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t * import { useContext } from '@wordpress/element';\n\t\t *\n\t\t * const compositeContext = useContext( Composite.Context );\n\t\t * ```\n\t\t */\n\t\tContext: CompositeContext,\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAExD;AACA;AACA;;AAEA,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAYlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAE;EAClCC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;EACjBC,UAAU,GAAG,KAAK;EAClBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,MAAM;EACpBC,GAAG,GAAG,KAAK;EACX,GAAGC;AACiB,CAAC,GAAG,CAAC,CAAC,EAAG;EAC7B,OAAOd,OAAO,CAACO,iBAAiB,CAAE;IACjCC,SAAS;IACTC,SAAS;IACTC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,GAAG;IACH,G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jBI,QAAQ,EAAGA,QAAU;IACrBhB,KAAK,EAAGA,KAAO;IAAA,GACVL,KAAK;IACVG,GAAG,EAAGA,GAAK;IAAAiB,QAAA,eAEX5B,IAAA,CAACH,gBAAgB,CAACkC,QAAQ;MAACC,KAAK,EAAGF,YAAc;MAAAF,QAAA,EAC9CA;IAAQ,CACgB;EAAC,CACV,CAAC;AAEtB,CAAE,CAAC,EACH;EACCd,WAAW,EAAE,WAAW;EACxB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEL,KAAK;EACL;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,UAAU;EACV;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,IAAI;EACJ;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,GAAG;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,KAAK;EACL;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,SAAS;EACT;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEU,OAAO,EAAEpC;AACV,CACD,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* tab stop for the whole Composite element. This means that it can behave as
|
|
6
6
|
* a roving tabindex or aria-activedescendant container.
|
|
7
7
|
*
|
|
8
|
+
* This file aims at providing components that are as close as possible to the
|
|
9
|
+
* original `reakit`-based implementation (which was removed from the codebase),
|
|
10
|
+
* although it is recommended that consumers of the package switch to the stable,
|
|
11
|
+
* un-prefixed, `ariakit`-based version of `Composite`.
|
|
12
|
+
*
|
|
8
13
|
* @see https://ariakit.org/components/composite
|
|
9
14
|
*/
|
|
10
15
|
|
|
@@ -16,7 +21,7 @@ import { forwardRef } from '@wordpress/element';
|
|
|
16
21
|
/**
|
|
17
22
|
* Internal dependencies
|
|
18
23
|
*/
|
|
19
|
-
import
|
|
24
|
+
import { Composite as Current, useCompositeStore } from '..';
|
|
20
25
|
import { useInstanceId } from '@wordpress/compose';
|
|
21
26
|
|
|
22
27
|
// Legacy composite components can either provide state through a
|
|
@@ -79,19 +84,18 @@ const unproxiedCompositeGroup = forwardRef(({
|
|
|
79
84
|
role,
|
|
80
85
|
...props
|
|
81
86
|
}, ref) => {
|
|
82
|
-
const Component = role === 'row' ? Current.
|
|
87
|
+
const Component = role === 'row' ? Current.Row : Current.Group;
|
|
83
88
|
return /*#__PURE__*/_jsx(Component, {
|
|
84
89
|
ref: ref,
|
|
85
90
|
role: role,
|
|
86
91
|
...props
|
|
87
92
|
});
|
|
88
93
|
});
|
|
89
|
-
|
|
90
|
-
export const Composite = proxyComposite(Current.Composite, {
|
|
94
|
+
export const Composite = proxyComposite(Current, {
|
|
91
95
|
baseId: 'id'
|
|
92
96
|
});
|
|
93
97
|
export const CompositeGroup = proxyComposite(unproxiedCompositeGroup);
|
|
94
|
-
export const CompositeItem = proxyComposite(Current.
|
|
98
|
+
export const CompositeItem = proxyComposite(Current.Item, {
|
|
95
99
|
focusable: 'accessibleWhenDisabled'
|
|
96
100
|
});
|
|
97
101
|
export function useCompositeState(legacyStateOptions = {}) {
|
|
@@ -108,7 +112,7 @@ export function useCompositeState(legacyStateOptions = {}) {
|
|
|
108
112
|
} = legacyStateOptions;
|
|
109
113
|
return {
|
|
110
114
|
baseId: useInstanceId(Composite, 'composite', baseId),
|
|
111
|
-
store:
|
|
115
|
+
store: useCompositeStore({
|
|
112
116
|
defaultActiveId,
|
|
113
117
|
rtl,
|
|
114
118
|
orientation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","Current","useInstanceId","jsx","_jsx","mapLegacyStatePropsToComponentProps","legacyProps","state","rest","store","props","proxyComposite","ProxiedComponent","propMap","displayName","Component","id","baseId","Object","entries","forEach","from","to","hasOwnProperty","assign","unproxiedCompositeGroup","role","ref","
|
|
1
|
+
{"version":3,"names":["forwardRef","Composite","Current","useCompositeStore","useInstanceId","jsx","_jsx","mapLegacyStatePropsToComponentProps","legacyProps","state","rest","store","props","proxyComposite","ProxiedComponent","propMap","displayName","Component","id","baseId","Object","entries","forEach","from","to","hasOwnProperty","assign","unproxiedCompositeGroup","role","ref","Row","Group","CompositeGroup","CompositeItem","Item","focusable","useCompositeState","legacyStateOptions","currentId","defaultActiveId","orientation","rtl","loop","focusLoop","wrap","focusWrap","shift","focusShift","unstable_virtual","virtualFocus"],"sources":["@wordpress/components/src/composite/legacy/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * This file aims at providing components that are as close as possible to the\n * original `reakit`-based implementation (which was removed from the codebase),\n * although it is recommended that consumers of the package switch to the stable,\n * un-prefixed, `ariakit`-based version of `Composite`.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Composite as Current, useCompositeStore } from '..';\nimport { useInstanceId } from '@wordpress/compose';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nexport interface LegacyStateOptions {\n\t/**\n\t * ID that will serve as a base for all the items IDs.\n\t */\n\tbaseId?: string;\n\t/**\n\t * Determines how next and previous functions will behave. If `rtl` is set\n\t * to `true`, they will be inverted. This only affects the composite widget\n\t * behavior. You still need to set `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: boolean;\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the orientation value determines\n\t * which arrow keys can be used to move focus.\n\t */\n\torientation?: Orientation;\n\t/**\n\t * The current focused item `id`.\n\t */\n\tcurrentId?: string;\n\t/**\n\t * Determines how focus moves from the start and end of rows and columns.\n\t *\n\t * @default false\n\t */\n\tloop?: boolean | Orientation;\n\t/**\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus the first item in the next row or column and vice-versa.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\twrap?: boolean | Orientation;\n\t/**\n\t * If enabled, moving up or down when there's no next item or the next item\n\t * is disabled will shift to the item right before it.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\tunstable_virtual?: boolean;\n}\n\ntype Component = React.FunctionComponent< any >;\n\ntype CompositeStore = ReturnType< typeof useCompositeStore >;\ntype CompositeStoreState = { store: CompositeStore };\nexport type CompositeState = CompositeStoreState &\n\tRequired< Pick< LegacyStateOptions, 'baseId' > >;\n\n// Legacy composite components can either provide state through a\n// single `state` prop, or via individual props, usually through\n// spreading the state generated by `useCompositeState`.\n// That is, `<Composite* { ...state }>`.\nexport type CompositeStateProps =\n\t| { state: CompositeState }\n\t| ( CompositeState & { state?: never } );\ntype ComponentProps< C extends Component > = React.ComponentPropsWithRef< C >;\nexport type CompositeProps< C extends Component > = ComponentProps< C > &\n\tCompositeStateProps;\ntype CompositeComponent< C extends Component > = (\n\tprops: CompositeProps< C >\n) => React.ReactElement;\ntype CompositeComponentProps = CompositeState &\n\t(\n\t\t| ComponentProps< typeof Current.Group >\n\t\t| ComponentProps< typeof Current.Item >\n\t\t| ComponentProps< typeof Current.Row >\n\t);\n\nfunction mapLegacyStatePropsToComponentProps(\n\tlegacyProps: CompositeStateProps\n): CompositeComponentProps {\n\t// If a `state` prop is provided, we unpack that; otherwise,\n\t// the necessary props are provided directly in `legacyProps`.\n\tif ( legacyProps.state ) {\n\t\tconst { state, ...rest } = legacyProps;\n\t\tconst { store, ...props } =\n\t\t\tmapLegacyStatePropsToComponentProps( state );\n\t\treturn { ...rest, ...props, store };\n\t}\n\n\treturn legacyProps;\n}\n\nfunction proxyComposite< C extends Component >(\n\tProxiedComponent: C | React.ForwardRefExoticComponent< C >,\n\tpropMap: Record< string, string > = {}\n): CompositeComponent< C > {\n\tconst displayName = ProxiedComponent.displayName;\n\tconst Component = ( legacyProps: CompositeStateProps ) => {\n\t\tconst { store, ...rest } =\n\t\t\tmapLegacyStatePropsToComponentProps( legacyProps );\n\t\tconst props = rest as ComponentProps< C >;\n\t\tprops.id = useInstanceId( store, props.baseId, props.id );\n\n\t\tObject.entries( propMap ).forEach( ( [ from, to ] ) => {\n\t\t\tif ( props.hasOwnProperty( from ) ) {\n\t\t\t\tObject.assign( props, { [ to ]: props[ from ] } );\n\t\t\t\tdelete props[ from ];\n\t\t\t}\n\t\t} );\n\n\t\tdelete props.baseId;\n\n\t\treturn <ProxiedComponent { ...props } store={ store } />;\n\t};\n\tComponent.displayName = displayName;\n\treturn Component;\n}\n\n// The old `CompositeGroup` used to behave more like the current\n// `CompositeRow`, but this has been split into two different\n// components. We handle that difference by checking on the\n// provided role, and returning the appropriate component.\nconst unproxiedCompositeGroup = forwardRef<\n\tany,\n\tReact.ComponentPropsWithoutRef< typeof Current.Group | typeof Current.Row >\n>( ( { role, ...props }, ref ) => {\n\tconst Component = role === 'row' ? Current.Row : Current.Group;\n\treturn <Component ref={ ref } role={ role } { ...props } />;\n} );\n\nexport const Composite = proxyComposite( Current, { baseId: 'id' } );\nexport const CompositeGroup = proxyComposite( unproxiedCompositeGroup );\nexport const CompositeItem = proxyComposite( Current.Item, {\n\tfocusable: 'accessibleWhenDisabled',\n} );\n\nexport function useCompositeState(\n\tlegacyStateOptions: LegacyStateOptions = {}\n): CompositeState {\n\tconst {\n\t\tbaseId,\n\t\tcurrentId: defaultActiveId,\n\t\torientation,\n\t\trtl = false,\n\t\tloop: focusLoop = false,\n\t\twrap: focusWrap = false,\n\t\tshift: focusShift = false,\n\t\t// eslint-disable-next-line camelcase\n\t\tunstable_virtual: virtualFocus,\n\t} = legacyStateOptions;\n\n\treturn {\n\t\tbaseId: useInstanceId( Composite, 'composite', baseId ),\n\t\tstore: useCompositeStore( {\n\t\t\tdefaultActiveId,\n\t\t\trtl,\n\t\t\torientation,\n\t\t\tfocusLoop,\n\t\t\tfocusShift,\n\t\t\tfocusWrap,\n\t\t\tvirtualFocus,\n\t\t} ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,SAAS,IAAIC,OAAO,EAAEC,iBAAiB,QAAQ,IAAI;AAC5D,SAASC,aAAa,QAAQ,oBAAoB;;AA6DlD;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAiBA,SAASC,mCAAmCA,CAC3CC,WAAgC,EACN;EAC1B;EACA;EACA,IAAKA,WAAW,CAACC,KAAK,EAAG;IACxB,MAAM;MAAEA,KAAK;MAAE,GAAGC;IAAK,CAAC,GAAGF,WAAW;IACtC,MAAM;MAAEG,KAAK;MAAE,GAAGC;IAAM,CAAC,GACxBL,mCAAmC,CAAEE,KAAM,CAAC;IAC7C,OAAO;MAAE,GAAGC,IAAI;MAAE,GAAGE,KAAK;MAAED;IAAM,CAAC;EACpC;EAEA,OAAOH,WAAW;AACnB;AAEA,SAASK,cAAcA,CACtBC,gBAA0D,EAC1DC,OAAiC,GAAG,CAAC,CAAC,EACZ;EAC1B,MAAMC,WAAW,GAAGF,gBAAgB,CAACE,WAAW;EAChD,MAAMC,SAAS,GAAKT,WAAgC,IAAM;IACzD,MAAM;MAAEG,KAAK;MAAE,GAAGD;IAAK,C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Ec,uBAAwB,CAAC;AACvE,OAAO,MAAMM,aAAa,GAAGpB,cAAc,CAAEX,OAAO,CAACgC,IAAI,EAAE;EAC1DC,SAAS,EAAE;AACZ,CAAE,CAAC;AAEH,OAAO,SAASC,iBAAiBA,CAChCC,kBAAsC,GAAG,CAAC,CAAC,EAC1B;EACjB,MAAM;IACLlB,MAAM;IACNmB,SAAS,EAAEC,eAAe;IAC1BC,WAAW;IACXC,GAAG,GAAG,KAAK;IACXC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,KAAK,EAAEC,UAAU,GAAG,KAAK;IACzB;IACAC,gBAAgB,EAAEC;EACnB,CAAC,GAAGZ,kBAAkB;EAEtB,OAAO;IACNlB,MAAM,EAAEf,aAAa,CAAEH,SAAS,EAAE,WAAW,EAAEkB,MAAO,CAAC;IACvDR,KAAK,EAAER,iBAAiB,CAAE;MACzBoC,eAAe;MACfE,GAAG;MACHD,WAAW;MACXG,SAAS;MACTI,UAAU;MACVF,SAAS;MACTI;IACD,CAAE;EACH,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/composite/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\n\nexport type CompositeContextProps =\n\t| {\n\t\t\t/**\n\t\t\t * Object returned by the `useCompositeStore` hook.\n\t\t\t */\n\t\t\tstore: Ariakit.CompositeStore;\n\t }\n\t| undefined;\n\nexport type CompositeStoreProps = {\n\t/**\n\t * The current active item `id`. The active item is the element within the\n\t * composite widget that has either DOM or virtual focus (in case\n\t * the `virtualFocus` prop is enabled).\n\t * - `null` represents the base composite element (the one with a [composite\n\t * role](https://w3c.github.io/aria/#composite)). Users will be able to\n\t * navigate out of it using arrow keys.\n\t * - If `activeId` is initially set to `null`, the base composite element\n\t * itself will have focus and users will be able to navigate to it using\n\t * arrow keys.\n\t */\n\tactiveId?: Ariakit.CompositeStoreProps[ 'activeId' ];\n\t/**\n\t * The composite item id that should be active by default when the composite\n\t * widget is rendered. If `null`, the composite element itself will have focus\n\t * and users will be able to navigate to it using arrow keys. If `undefined`,\n\t * the first enabled item will be focused.\n\t */\n\tdefaultActiveId?: Ariakit.CompositeStoreProps[ 'defaultActiveId' ];\n\t/**\n\t * A callback that gets called when the `activeId` state changes.\n\t */\n\tsetActiveId?: Ariakit.CompositeStoreProps[ 'setActiveId' ];\n\t/**\n\t * Determines how the focus behaves when the user reaches the end of the\n\t * composite widget.\n\t *\n\t * On one-dimensional composite widgets:\n\t * - `true` loops from the last item to the first item and vice-versa.\n\t * - `horizontal` loops only if `orientation` is `horizontal` or not set.\n\t * - `vertical` loops only if `orientation` is `vertical` or not set.\n\t * - If `activeId` is initially set to `null`, the composite element will\n\t * be focused in between the last and first items.\n\t *\n\t * On two-dimensional composite widgets (ie. when using `CompositeRow`):\n\t * - `true` loops from the last row/column item to the first item in the same\n\t * row/column and vice-versa. If it's the last item in the last row, it\n\t * moves to the first item in the first row and vice-versa.\n\t * - `horizontal` loops only from the last row item to the first item in the\n\t * same row.\n\t * - `vertical` loops only from the last column item to the first item in the\n\t * column row.\n\t * - If `activeId` is initially set to `null`, vertical loop will have no\n\t * effect as moving down from the last row or up from the first row will\n\t * focus on the composite element.\n\t * - If `focusWrap` matches the value of `focusLoop`, it'll wrap between the\n\t * last item in the last row or column and the first item in the first row or\n\t * column and vice-versa.\n\t *\n\t * @default false\n\t */\n\tfocusLoop?: Ariakit.CompositeStoreProps[ 'focusLoop' ];\n\t/**\n\t * **Works only on two-dimensional composite widgets**.\n\t *\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus on the first item in the next row or column and vice-versa.\n\t * - `true` wraps between rows and columns.\n\t * - `horizontal` wraps only between rows.\n\t * - `vertical` wraps only between columns.\n\t * - If `focusLoop` matches the value of `focusWrap`, it'll wrap between the\n\t * last item in the last row or column and the first item in the first row or\n\t * column and vice-versa.\n\t *\n\t * @default false\n\t */\n\tfocusWrap?: Ariakit.CompositeStoreProps[ 'focusWrap' ];\n\t/**\n\t * **Works only on two-dimensional composite widgets**.\n\t *\n\t * If enabled, moving up or down when there's no next item or when the next\n\t * item is disabled will shift to the item right before it.\n\t *\n\t * @default false\n\t */\n\tfocusShift?: Ariakit.CompositeStoreProps[ 'focusShift' ];\n\t/**\n\t * If enabled, the composite element will act as an\n\t * [`aria-activedescendant`](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant)\n\t * container instead of [roving\n\t * tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).\n\t * DOM focus will remain on the composite element while its items receive\n\t * virtual focus.\n\t *\n\t * In both scenarios, the item in focus will carry the `data-active-item`\n\t * attribute.\n\t *\n\t * @default false\n\t */\n\tvirtualFocus?: Ariakit.CompositeStoreProps[ 'virtualFocus' ];\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the `orientation` value determines\n\t * which arrow keys can be used to move focus:\n\t * - `both`: all arrow keys work.\n\t * - `horizontal`: only left and right arrow keys work.\n\t * - `vertical`: only up and down arrow keys work.\n\t *\n\t * It doesn't have any effect on two-dimensional composites.\n\t *\n\t * @default \"both\"\n\t */\n\torientation?: Ariakit.CompositeStoreProps[ 'orientation' ];\n\t/**\n\t * Determines how the `store`'s `next` and `previous` functions will behave.\n\t * If `rtl` is set to `true`, they will be inverted.\n\t *\n\t * This only affects the composite widget behavior. You still need to set\n\t * `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: Ariakit.CompositeStoreProps[ 'rtl' ];\n};\n\nexport type CompositeProps = {\n\t/**\n\t * Object returned by the `useCompositeStore` hook.\n\t */\n\tstore: Ariakit.CompositeStore;\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeProps[ 'render' ];\n\t/**\n\t * Makes the component a focusable element. When this element gains keyboard\n\t * focus, it gets a `data-focus-visible` attribute and triggers the\n\t * `onFocusVisible` prop.\n\t * The component supports the `disabled` prop even for those elements not\n\t * supporting the native `disabled` attribute. Disabled elements may be\n\t * still accessible via keyboard by using the the `accessibleWhenDisabled`\n\t * prop.\n\t * Non-native focusable elements will lose their focusability entirely.\n\t * However, native focusable elements will retain their inherent focusability.\n\t */\n\tfocusable?: Ariakit.CompositeProps[ 'focusable' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * This feature can be combined with the `accessibleWhenDisabled` prop to\n\t * make disabled elements still accessible via keyboard.\n\t *\n\t * **Note**: For this prop to work, the `focusable` prop must be set to\n\t * `true`, if it's not set by default.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.CompositeProps[ 'disabled' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.CompositeProps[ 'accessibleWhenDisabled' ];\n\t/**\n\t * Custom event handler invoked when the element gains focus through keyboard\n\t * interaction or a key press occurs while the element is in focus. This is\n\t * the programmatic equivalent of the `data-focus-visible` attribute.\n\t *\n\t * **Note**: For this prop to work, the `focusable` prop must be set to `true`\n\t * if it's not set by default.\n\t */\n\tonFocusVisible?: Ariakit.CompositeProps[ 'onFocusVisible' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeProps[ 'children' ];\n};\n\nexport type CompositeGroupProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeGroupProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeGroupProps[ 'children' ];\n};\n\nexport type CompositeGroupLabelProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeGroupLabelProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeGroupLabelProps[ 'children' ];\n};\n\nexport type CompositeItemProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeItemProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeItemProps[ 'children' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.CompositeItemProps[ 'accessibleWhenDisabled' ];\n};\n\nexport type CompositeRowProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeRowProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeRowProps[ 'children' ];\n};\n\nexport type CompositeHoverProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeHoverProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeHoverProps[ 'children' ];\n};\n\nexport type CompositeTypeaheadProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeTypeaheadProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeTypeaheadProps[ 'children' ];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -4,14 +4,22 @@
|
|
|
4
4
|
import * as Ariakit from '@ariakit/react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
11
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
+
|
|
7
13
|
/**
|
|
8
14
|
* Internal dependencies
|
|
9
15
|
*/
|
|
10
16
|
import _CustomSelect from '../custom-select-control-v2/custom-select';
|
|
11
17
|
import CustomSelectItem from '../custom-select-control-v2/item';
|
|
12
18
|
import * as Styled from '../custom-select-control-v2/styles';
|
|
19
|
+
import { VisuallyHidden } from '../visually-hidden';
|
|
13
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
23
|
function useDeprecatedProps({
|
|
16
24
|
__experimentalShowSelectedHint,
|
|
17
25
|
...otherProps
|
|
@@ -34,6 +42,14 @@ function applyOptionDeprecations({
|
|
|
34
42
|
...rest
|
|
35
43
|
};
|
|
36
44
|
}
|
|
45
|
+
function getDescribedBy(currentValue, describedBy) {
|
|
46
|
+
if (describedBy) {
|
|
47
|
+
return describedBy;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// translators: %s: The selected option.
|
|
51
|
+
return sprintf(__('Currently selected: %s'), currentValue);
|
|
52
|
+
}
|
|
37
53
|
function CustomSelectControl(props) {
|
|
38
54
|
const {
|
|
39
55
|
__next40pxDefaultSize = false,
|
|
@@ -46,6 +62,7 @@ function CustomSelectControl(props) {
|
|
|
46
62
|
showSelectedHint = false,
|
|
47
63
|
...restProps
|
|
48
64
|
} = useDeprecatedProps(props);
|
|
65
|
+
const descriptionId = useInstanceId(CustomSelectControl, 'custom-select-control__description');
|
|
49
66
|
|
|
50
67
|
// Forward props + store from v2 implementation
|
|
51
68
|
const store = Ariakit.useSelectStore({
|
|
@@ -103,10 +120,10 @@ function CustomSelectControl(props) {
|
|
|
103
120
|
})
|
|
104
121
|
}, key);
|
|
105
122
|
});
|
|
123
|
+
const {
|
|
124
|
+
value: currentValue
|
|
125
|
+
} = store.getState();
|
|
106
126
|
const renderSelectedValueHint = () => {
|
|
107
|
-
const {
|
|
108
|
-
value: currentValue
|
|
109
|
-
} = store.getState();
|
|
110
127
|
const selectedOptionHint = options?.map(applyOptionDeprecations)?.find(({
|
|
111
128
|
name
|
|
112
129
|
}) => currentValue === name)?.hint;
|
|
@@ -127,17 +144,24 @@ function CustomSelectControl(props) {
|
|
|
127
144
|
}
|
|
128
145
|
return size;
|
|
129
146
|
})();
|
|
130
|
-
return /*#__PURE__*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
148
|
+
children: [/*#__PURE__*/_jsx(_CustomSelect, {
|
|
149
|
+
"aria-describedby": descriptionId,
|
|
150
|
+
renderSelectedValue: showSelectedHint ? renderSelectedValueHint : undefined,
|
|
151
|
+
size: translatedSize,
|
|
152
|
+
store: store,
|
|
153
|
+
className: clsx(
|
|
154
|
+
// Keeping the classname for legacy reasons
|
|
155
|
+
'components-custom-select-control', classNameProp),
|
|
156
|
+
isLegacy: true,
|
|
157
|
+
...restProps,
|
|
158
|
+
children: children
|
|
159
|
+
}), /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
160
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
161
|
+
id: descriptionId,
|
|
162
|
+
children: getDescribedBy(currentValue, describedBy)
|
|
163
|
+
})
|
|
164
|
+
})]
|
|
141
165
|
});
|
|
142
166
|
}
|
|
143
167
|
export default CustomSelectControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","clsx","_CustomSelect","CustomSelectItem","Styled","jsx","_jsx","jsxs","_jsxs","useDeprecatedProps","__experimentalShowSelectedHint","otherProps","showSelectedHint","applyOptionDeprecations","__experimentalHint","rest","hint","CustomSelectControl","props","__next40pxDefaultSize","describedBy","options","onChange","size","value","className","classNameProp","restProps","store","useSelectStore","setValue","nextValue","nextOption","find","item","name","Promise","resolve","state","getState","changeObject","highlightedIndex","renderedItems","findIndex","inputValue","isOpen","open","selectedItem","type","defaultValue","children","map","key","style","withHint","WithHintItemWrapper","WithHintItemHint","renderSelectedValueHint","currentValue","selectedOptionHint","SelectedExperimentalHintWrapper","SelectedExperimentalHintItem","translatedSize","renderSelectedValue","undefined","isLegacy"],"sources":["@wordpress/components/src/custom-select-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport _CustomSelect from '../custom-select-control-v2/custom-select';\nimport CustomSelectItem from '../custom-select-control-v2/item';\nimport * as Styled from '../custom-select-control-v2/styles';\nimport type { CustomSelectProps } from './types';\n\nfunction useDeprecatedProps( {\n\t__experimentalShowSelectedHint,\n\t...otherProps\n}: CustomSelectProps ) {\n\treturn {\n\t\tshowSelectedHint: __experimentalShowSelectedHint,\n\t\t...otherProps,\n\t};\n}\n\n// The removal of `__experimentalHint` in favour of `hint` doesn't happen in\n// the `useDeprecatedProps` hook in order not to break consumers that rely\n// on object identity (see https://github.com/WordPress/gutenberg/pull/63248#discussion_r1672213131)\nfunction applyOptionDeprecations( {\n\t__experimentalHint,\n\t...rest\n}: CustomSelectProps[ 'options' ][ number ] ) {\n\treturn {\n\t\thint: __experimentalHint,\n\t\t...rest,\n\t};\n}\n\nfunction CustomSelectControl( props: CustomSelectProps ) {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tdescribedBy,\n\t\toptions,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\tclassName: classNameProp,\n\t\tshowSelectedHint = false,\n\t\t...restProps\n\t} = useDeprecatedProps( props );\n\n\t// Forward props + store from v2 implementation\n\tconst store = Ariakit.useSelectStore( {\n\t\tasync setValue( nextValue ) {\n\t\t\tconst nextOption = options.find(\n\t\t\t\t( item ) => item.name === nextValue\n\t\t\t);\n\n\t\t\tif ( ! onChange || ! nextOption ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Executes the logic in a microtask after the popup is closed.\n\t\t\t// This is simply to ensure the isOpen state matches the one from the\n\t\t\t// previous legacy implementation.\n\t\t\tawait Promise.resolve();\n\t\t\tconst state = store.getState();\n\n\t\t\tconst changeObject = {\n\t\t\t\thighlightedIndex: state.renderedItems.findIndex(\n\t\t\t\t\t( item ) => item.value === nextValue\n\t\t\t\t),\n\t\t\t\tinputValue: '',\n\t\t\t\tisOpen: state.open,\n\t\t\t\tselectedItem: nextOption,\n\t\t\t\ttype: '',\n\t\t\t};\n\t\t\tonChange( changeObject );\n\t\t},\n\t\tvalue: value?.name,\n\t\t// Setting the first option as a default value when no value is provided\n\t\t// is already done natively by the underlying Ariakit component,\n\t\t// but doing this explicitly avoids the `onChange` callback from firing\n\t\t// on initial render, thus making this implementation closer to the v1.\n\t\tdefaultValue: options[ 0 ]?.name,\n\t} );\n\n\tconst children = options\n\t\t.map( applyOptionDeprecations )\n\t\t.map( ( { name, key, hint, style, className } ) => {\n\t\t\tconst withHint = (\n\t\t\t\t<Styled.WithHintItemWrapper>\n\t\t\t\t\t<span>{ name }</span>\n\t\t\t\t\t<Styled.WithHintItemHint\n\t\t\t\t\t\t// Keeping the classname for legacy reasons\n\t\t\t\t\t\tclassName=\"components-custom-select-control__item-hint\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ hint }\n\t\t\t\t\t</Styled.WithHintItemHint>\n\t\t\t\t</Styled.WithHintItemWrapper>\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<CustomSelectItem\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvalue={ name }\n\t\t\t\t\tchildren={ hint ? withHint : name }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t// Keeping the classnames for legacy reasons\n\t\t\t\t\t\t'components-custom-select-control__item',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-hint': hint,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\n\tconst renderSelectedValueHint = () => {\n\t\tconst { value: currentValue } = store.getState();\n\n\t\tconst selectedOptionHint = options\n\t\t\t?.map( applyOptionDeprecations )\n\t\t\t?.find( ( { name } ) => currentValue === name )?.hint;\n\n\t\treturn (\n\t\t\t<Styled.SelectedExperimentalHintWrapper>\n\t\t\t\t{ currentValue }\n\t\t\t\t{ selectedOptionHint && (\n\t\t\t\t\t<Styled.SelectedExperimentalHintItem\n\t\t\t\t\t\t// Keeping the classname for legacy reasons\n\t\t\t\t\t\tclassName=\"components-custom-select-control__hint\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ selectedOptionHint }\n\t\t\t\t\t</Styled.SelectedExperimentalHintItem>\n\t\t\t\t) }\n\t\t\t</Styled.SelectedExperimentalHintWrapper>\n\t\t);\n\t};\n\n\tconst translatedSize = ( () => {\n\t\tif (\n\t\t\t( __next40pxDefaultSize && size === 'default' ) ||\n\t\t\tsize === '__unstable-large'\n\t\t) {\n\t\t\treturn 'default';\n\t\t}\n\t\tif ( ! __next40pxDefaultSize && size === 'default' ) {\n\t\t\treturn 'compact';\n\t\t}\n\t\treturn size;\n\t} )();\n\n\treturn (\n\t\t<_CustomSelect\n\t\t\taria-describedby={ describedBy }\n\t\t\trenderSelectedValue={\n\t\t\t\tshowSelectedHint ? renderSelectedValueHint : undefined\n\t\t\t}\n\t\t\tsize={ translatedSize }\n\t\t\tstore={ store }\n\t\t\tclassName={ clsx(\n\t\t\t\t// Keeping the classname for legacy reasons\n\t\t\t\t'components-custom-select-control',\n\t\t\t\tclassNameProp\n\t\t\t) }\n\t\t\tisLegacy\n\t\t\t{ ...restProps }\n\t\t>\n\t\t\t{ children }\n\t\t</_CustomSelect>\n\t);\n}\n\nexport default CustomSelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,aAAa,MAAM,2CAA2C;AACrE,OAAOC,gBAAgB,MAAM,kCAAkC;AAC/D,OAAO,KAAKC,MAAM,MAAM,oCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAG7D,SAASC,kBAAkBA,CAAE;EAC5BC,8BAA8B;EAC9B,GAAGC;AACe,CAAC,EAAG;EACtB,OAAO;IACNC,gBAAgB,EAAEF,8BAA8B;IAChD,GAAGC;EACJ,CAAC;AACF;;AAEA;AACA;A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AEhDS;MAAkB,CACgB,CACrC;IAAA,CACsC,CAAC;EAE3C,CAAC;EAED,MAAMG,cAAc,GAAG,CAAE,MAAM;IAC9B,IACG3C,qBAAqB,IAAII,IAAI,KAAK,SAAS,IAC7CA,IAAI,KAAK,kBAAkB,EAC1B;MACD,OAAO,SAAS;IACjB;IACA,IAAK,CAAEJ,qBAAqB,IAAII,IAAI,KAAK,SAAS,EAAG;MACpD,OAAO,SAAS;IACjB;IACA,OAAOA,IAAI;EACZ,CAAC,EAAG,CAAC;EAEL,oBACCjB,IAAA,CAACJ,aAAa;IACb,oBAAmBkB,WAAa;IAChC2C,mBAAmB,EAClBnD,gBAAgB,GAAG6C,uBAAuB,GAAGO,SAC7C;IACDzC,IAAI,EAAGuC,cAAgB;IACvBlC,KAAK,EAAGA,KAAO;IACfH,SAAS,EAAGxB,IAAI;IACf;IACA,kCAAkC,EAClCyB,aACD,CAAG;IACHuC,QAAQ;IAAA,GACHtC,SAAS;IAAAuB,QAAA,EAEZA;EAAQ,CACI,CAAC;AAElB;AAEA,eAAejC,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","clsx","useInstanceId","__","sprintf","_CustomSelect","CustomSelectItem","Styled","VisuallyHidden","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useDeprecatedProps","__experimentalShowSelectedHint","otherProps","showSelectedHint","applyOptionDeprecations","__experimentalHint","rest","hint","getDescribedBy","currentValue","describedBy","CustomSelectControl","props","__next40pxDefaultSize","options","onChange","size","value","className","classNameProp","restProps","descriptionId","store","useSelectStore","setValue","nextValue","nextOption","find","item","name","Promise","resolve","state","getState","changeObject","highlightedIndex","renderedItems","findIndex","inputValue","isOpen","open","selectedItem","type","defaultValue","children","map","key","style","withHint","WithHintItemWrapper","WithHintItemHint","renderSelectedValueHint","selectedOptionHint","SelectedExperimentalHintWrapper","SelectedExperimentalHintItem","translatedSize","renderSelectedValue","undefined","isLegacy","id"],"sources":["@wordpress/components/src/custom-select-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport _CustomSelect from '../custom-select-control-v2/custom-select';\nimport CustomSelectItem from '../custom-select-control-v2/item';\nimport * as Styled from '../custom-select-control-v2/styles';\nimport type { CustomSelectProps, CustomSelectOption } from './types';\nimport { VisuallyHidden } from '../visually-hidden';\n\nfunction useDeprecatedProps< T extends CustomSelectOption >( {\n\t__experimentalShowSelectedHint,\n\t...otherProps\n}: CustomSelectProps< T > ) {\n\treturn {\n\t\tshowSelectedHint: __experimentalShowSelectedHint,\n\t\t...otherProps,\n\t};\n}\n\n// The removal of `__experimentalHint` in favour of `hint` doesn't happen in\n// the `useDeprecatedProps` hook in order not to break consumers that rely\n// on object identity (see https://github.com/WordPress/gutenberg/pull/63248#discussion_r1672213131)\nfunction applyOptionDeprecations( {\n\t__experimentalHint,\n\t...rest\n}: CustomSelectOption ) {\n\treturn {\n\t\thint: __experimentalHint,\n\t\t...rest,\n\t};\n}\n\nfunction getDescribedBy( currentValue: string, describedBy?: string ) {\n\tif ( describedBy ) {\n\t\treturn describedBy;\n\t}\n\n\t// translators: %s: The selected option.\n\treturn sprintf( __( 'Currently selected: %s' ), currentValue );\n}\n\nfunction CustomSelectControl< T extends CustomSelectOption >(\n\tprops: CustomSelectProps< T >\n) {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tdescribedBy,\n\t\toptions,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\tclassName: classNameProp,\n\t\tshowSelectedHint = false,\n\t\t...restProps\n\t} = useDeprecatedProps( props );\n\n\tconst descriptionId = useInstanceId(\n\t\tCustomSelectControl,\n\t\t'custom-select-control__description'\n\t);\n\n\t// Forward props + store from v2 implementation\n\tconst store = Ariakit.useSelectStore< string >( {\n\t\tasync setValue( nextValue ) {\n\t\t\tconst nextOption = options.find(\n\t\t\t\t( item ) => item.name === nextValue\n\t\t\t);\n\n\t\t\tif ( ! onChange || ! nextOption ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Executes the logic in a microtask after the popup is closed.\n\t\t\t// This is simply to ensure the isOpen state matches the one from the\n\t\t\t// previous legacy implementation.\n\t\t\tawait Promise.resolve();\n\t\t\tconst state = store.getState();\n\n\t\t\tconst changeObject = {\n\t\t\t\thighlightedIndex: state.renderedItems.findIndex(\n\t\t\t\t\t( item ) => item.value === nextValue\n\t\t\t\t),\n\t\t\t\tinputValue: '',\n\t\t\t\tisOpen: state.open,\n\t\t\t\tselectedItem: nextOption,\n\t\t\t\ttype: '',\n\t\t\t};\n\t\t\tonChange( changeObject );\n\t\t},\n\t\tvalue: value?.name,\n\t\t// Setting the first option as a default value when no value is provided\n\t\t// is already done natively by the underlying Ariakit component,\n\t\t// but doing this explicitly avoids the `onChange` callback from firing\n\t\t// on initial render, thus making this implementation closer to the v1.\n\t\tdefaultValue: options[ 0 ]?.name,\n\t} );\n\n\tconst children = options\n\t\t.map( applyOptionDeprecations )\n\t\t.map( ( { name, key, hint, style, className } ) => {\n\t\t\tconst withHint = (\n\t\t\t\t<Styled.WithHintItemWrapper>\n\t\t\t\t\t<span>{ name }</span>\n\t\t\t\t\t<Styled.WithHintItemHint\n\t\t\t\t\t\t// Keeping the classname for legacy reasons\n\t\t\t\t\t\tclassName=\"components-custom-select-control__item-hint\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ hint }\n\t\t\t\t\t</Styled.WithHintItemHint>\n\t\t\t\t</Styled.WithHintItemWrapper>\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<CustomSelectItem\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvalue={ name }\n\t\t\t\t\tchildren={ hint ? withHint : name }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t// Keeping the classnames for legacy reasons\n\t\t\t\t\t\t'components-custom-select-control__item',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-hint': hint,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\n\tconst { value: currentValue } = store.getState();\n\n\tconst renderSelectedValueHint = () => {\n\t\tconst selectedOptionHint = options\n\t\t\t?.map( applyOptionDeprecations )\n\t\t\t?.find( ( { name } ) => currentValue === name )?.hint;\n\n\t\treturn (\n\t\t\t<Styled.SelectedExperimentalHintWrapper>\n\t\t\t\t{ currentValue }\n\t\t\t\t{ selectedOptionHint && (\n\t\t\t\t\t<Styled.SelectedExperimentalHintItem\n\t\t\t\t\t\t// Keeping the classname for legacy reasons\n\t\t\t\t\t\tclassName=\"components-custom-select-control__hint\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ selectedOptionHint }\n\t\t\t\t\t</Styled.SelectedExperimentalHintItem>\n\t\t\t\t) }\n\t\t\t</Styled.SelectedExperimentalHintWrapper>\n\t\t);\n\t};\n\n\tconst translatedSize = ( () => {\n\t\tif (\n\t\t\t( __next40pxDefaultSize && size === 'default' ) ||\n\t\t\tsize === '__unstable-large'\n\t\t) {\n\t\t\treturn 'default';\n\t\t}\n\t\tif ( ! __next40pxDefaultSize && size === 'default' ) {\n\t\t\treturn 'compact';\n\t\t}\n\t\treturn size;\n\t} )();\n\n\treturn (\n\t\t<>\n\t\t\t<_CustomSelect\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\trenderSelectedValue={\n\t\t\t\t\tshowSelectedHint ? renderSelectedValueHint : undefined\n\t\t\t\t}\n\t\t\t\tsize={ translatedSize }\n\t\t\t\tstore={ store }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t// Keeping the classname for legacy reasons\n\t\t\t\t\t'components-custom-select-control',\n\t\t\t\t\tclassNameProp\n\t\t\t\t) }\n\t\t\t\tisLegacy\n\t\t\t\t{ ...restProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</_CustomSelect>\n\t\t\t<VisuallyHidden>\n\t\t\t\t<span id={ descriptionId }>\n\t\t\t\t\t{ getDescribedBy( currentValue, describedBy ) }\n\t\t\t\t</span>\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nexport default CustomSelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,aAAa,MAAM,2CAA2C;AACrE,OAAOC,gBAAgB,MAAM,kCAAkC;AAC/D,OAAO,KAAKC,MAAM,MAAM,oCAAoC;AAE5D,SAASC,cAAc,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEpD,SAASC,kBAAkBA,CAAkC;EAC5DC,8BAA8B;EAC9B,GAAGC;AACoB,CAAC,EAAG;EAC3B,OAAO;IACNC,gBAAgB,EAAEF,8BAA8B;IAChD,GAAGC;EACJ,CAAC;AACF;;AAEA;AACA;AACA;AACA,SAASE,uBAAuBA,CAAE;EACjCC,kBAAkB;EAClB,GAAGC;AACgB,CAAC,EAAG;EACvB,OAAO;IACNC,IAAI,EAAEF,kBAAkB;IACxB,GAAGC;EACJ,CAAC;AACF;AAEA,SAASE,cAAcA,CAAEC,YAAoB,EAAEC,WAAoB,EAAG;EACrE,IAAKA,WAAW,EAAG;IAClB,OAAOA,WAAW;EACnB;;EAEA;EACA,OAAOrB,OAAO,CAAED,EAAE,CAAE,wBAAyB,CAAC,EAAEqB,YAAa,CAAC;AAC/D;AAEA,SAASE,mBAAmBA,CAC3BC,KAA6B,EAC5B;EACD,MAA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IG,IAAI,KAAK,SAAS,IAC7CA,IAAI,KAAK,kBAAkB,EAC1B;MACD,OAAO,SAAS;IACjB;IACA,IAAK,CAAEH,qBAAqB,IAAIG,IAAI,KAAK,SAAS,EAAG;MACpD,OAAO,SAAS;IACjB;IACA,OAAOA,IAAI;EACZ,CAAC,EAAG,CAAC;EAEL,oBACCnB,KAAA,CAAAE,SAAA;IAAA6C,QAAA,gBACCjD,IAAA,CAACL,aAAa;MACb,oBAAmB+B,aAAe;MAClCmC,mBAAmB,EAClBrD,gBAAgB,GAAGgD,uBAAuB,GAAGM,SAC7C;MACDzC,IAAI,EAAGuC,cAAgB;MACvBjC,KAAK,EAAGA,KAAO;MACfJ,SAAS,EAAGhC,IAAI;MACf;MACA,kCAAkC,EAClCiC,aACD,CAAG;MACHuC,QAAQ;MAAA,GACHtC,SAAS;MAAAwB,QAAA,EAEZA;IAAQ,CACI,CAAC,eAChBjD,IAAA,CAACF,cAAc;MAAAmD,QAAA,eACdjD,IAAA;QAAMgE,EAAE,EAAGtC,aAAe;QAAAuB,QAAA,EACvBpC,cAAc,CAAEC,YAAY,EAAEC,WAAY;MAAC,CACxC;IAAC,CACQ,CAAC;EAAA,CAChB,CAAC;AAEL;AAEA,eAAeC,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/custom-select-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { FocusEventHandler, MouseEventHandler } from 'react';\n\n/**\n * The object structure for the options array.\n */\
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/custom-select-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { FocusEventHandler, MouseEventHandler } from 'react';\n\n/**\n * The object structure for the options array.\n */\nexport type CustomSelectOption = {\n\tkey: string;\n\tname: string;\n\tstyle?: React.CSSProperties;\n\tclassName?: string;\n\thint?: string;\n\t/**\n\t * Use the `hint` property instead\n\t * @deprecated\n\t * @ignore\n\t */\n\t__experimentalHint?: string;\n\t[ key: string ]: any;\n};\n\n/**\n * The object returned from the onChange event.\n */\ntype CustomSelectChangeObject< T extends CustomSelectOption > = {\n\thighlightedIndex?: number;\n\tinputValue?: string;\n\tisOpen?: boolean;\n\ttype?: string;\n\tselectedItem: T;\n};\n\nexport type CustomSelectProps< T extends CustomSelectOption > = {\n\t/**\n\t * Optional classname for the component.\n\t */\n\tclassName?: string;\n\t/**\n\t * Hide the label visually, while keeping available to assistive technology.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * Description for the select trigger button used by assistive technology.\n\t * If no value is passed, the text \"Currently selected: selectedItem.name\"\n\t * will be used fully translated.\n\t */\n\tdescribedBy?: string;\n\t/**\n\t * Label for the control.\n\t */\n\tlabel: string;\n\t/**\n\t * Function called with the control's internal state changes. The `selectedItem`\n\t * property contains the next selected item.\n\t */\n\tonChange?: ( newValue: CustomSelectChangeObject< NoInfer< T > > ) => void;\n\t/**\n\t * A handler for `blur` events on the trigger button.\n\t *\n\t * @ignore\n\t */\n\tonBlur?: FocusEventHandler< HTMLButtonElement >;\n\t/**\n\t * A handler for `focus` events on the trigger button.\n\t *\n\t * @ignore\n\t */\n\tonFocus?: FocusEventHandler< HTMLButtonElement >;\n\t/**\n\t * A handler for `mouseout` events on the trigger button.\n\t *\n\t * @ignore\n\t */\n\tonMouseOut?: MouseEventHandler< HTMLButtonElement >;\n\t/**\n\t * A handler for `mouseover` events on the trigger button.\n\t *\n\t * @ignore\n\t */\n\tonMouseOver?: MouseEventHandler< HTMLButtonElement >;\n\t/**\n\t * The list of options that can be chosen from.\n\t */\n\toptions: ReadonlyArray< T >;\n\t/**\n\t * The size of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'small' | '__unstable-large';\n\t/**\n\t * Can be used to externally control the value of the control.\n\t */\n\tvalue?: NoInfer< T >;\n\t/**\n\t * Use the `showSelectedHint` property instead.\n\t * @deprecated\n\t * @ignore\n\t */\n\t__experimentalShowSelectedHint?: boolean;\n\t/**\n\t * Show the hint of the selected item in the trigger button.\n\t *\n\t * @default false\n\t */\n\tshowSelectedHint?: boolean;\n\t/**\n\t * Opt-in prop for an unconstrained width style which became the default in\n\t * WordPress 6.5. The prop is no longer needed and can be safely removed.\n\t *\n\t * @deprecated\n\t * @ignore\n\t */\n\t__nextUnconstrainedWidth?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
|