@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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Composite","
|
|
1
|
+
{"version":3,"names":["Composite","useCompositeStore","positionToPlacement","__experimentalPopoverLegacyPositionToPlacement","createPrivateSlotFill","DropdownMenu","DropdownMenuV2","DropdownMenuGroup","DropdownMenuGroupV2","DropdownMenuItem","DropdownMenuItemV2","DropdownMenuCheckboxItem","DropdownMenuCheckboxItemV2","DropdownMenuRadioItem","DropdownMenuRadioItemV2","DropdownMenuSeparator","DropdownMenuSeparatorV2","DropdownMenuItemLabel","DropdownMenuItemLabelV2","DropdownMenuItemHelpText","DropdownMenuItemHelpTextV2","ComponentsContext","Theme","Tabs","kebabCase","lock","privateApis","CompositeV2","CompositeGroupV2","Group","CompositeItemV2","Item","CompositeRowV2","Row","useCompositeStoreV2"],"sources":["@wordpress/components/src/private-apis.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { Composite, useCompositeStore } from './composite';\nimport { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';\nimport { createPrivateSlotFill } from './slot-fill';\nimport {\n\tDropdownMenu as DropdownMenuV2,\n\tDropdownMenuGroup as DropdownMenuGroupV2,\n\tDropdownMenuItem as DropdownMenuItemV2,\n\tDropdownMenuCheckboxItem as DropdownMenuCheckboxItemV2,\n\tDropdownMenuRadioItem as DropdownMenuRadioItemV2,\n\tDropdownMenuSeparator as DropdownMenuSeparatorV2,\n\tDropdownMenuItemLabel as DropdownMenuItemLabelV2,\n\tDropdownMenuItemHelpText as DropdownMenuItemHelpTextV2,\n} from './dropdown-menu-v2';\nimport { ComponentsContext } from './context/context-system-provider';\nimport Theme from './theme';\nimport Tabs from './tabs';\nimport { kebabCase } from './utils/strings';\nimport { lock } from './lock-unlock';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tCompositeV2: Composite,\n\tCompositeGroupV2: Composite.Group,\n\tCompositeItemV2: Composite.Item,\n\tCompositeRowV2: Composite.Row,\n\tuseCompositeStoreV2: useCompositeStore,\n\t__experimentalPopoverLegacyPositionToPlacement,\n\tcreatePrivateSlotFill,\n\tComponentsContext,\n\tTabs,\n\tTheme,\n\tDropdownMenuV2,\n\tDropdownMenuGroupV2,\n\tDropdownMenuItemV2,\n\tDropdownMenuCheckboxItemV2,\n\tDropdownMenuRadioItemV2,\n\tDropdownMenuSeparatorV2,\n\tDropdownMenuItemLabelV2,\n\tDropdownMenuItemHelpTextV2,\n\tkebabCase,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,iBAAiB,QAAQ,aAAa;AAC1D,SAASC,mBAAmB,IAAIC,8CAA8C,QAAQ,iBAAiB;AACvG,SAASC,qBAAqB,QAAQ,aAAa;AACnD,SACCC,YAAY,IAAIC,cAAc,EAC9BC,iBAAiB,IAAIC,mBAAmB,EACxCC,gBAAgB,IAAIC,kBAAkB,EACtCC,wBAAwB,IAAIC,0BAA0B,EACtDC,qBAAqB,IAAIC,uBAAuB,EAChDC,qBAAqB,IAAIC,uBAAuB,EAChDC,qBAAqB,IAAIC,uBAAuB,EAChDC,wBAAwB,IAAIC,0BAA0B,QAChD,oBAAoB;AAC3B,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,IAAI,MAAM,QAAQ;AACzB,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,eAAe;AAEpC,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BD,IAAI,CAAEC,WAAW,EAAE;EAClBC,WAAW,EAAE3B,SAAS;EACtB4B,gBAAgB,EAAE5B,SAAS,CAAC6B,KAAK;EACjCC,eAAe,EAAE9B,SAAS,CAAC+B,IAAI;EAC/BC,cAAc,EAAEhC,SAAS,CAACiC,GAAG;EAC7BC,mBAAmB,EAAEjC,iBAAiB;EACtCE,8CAA8C;EAC9CC,qBAAqB;EACrBiB,iBAAiB;EACjBE,IAAI;EACJD,KAAK;EACLhB,cAAc;EACdE,mBAAmB;EACnBE,kBAAkB;EAClBE,0BAA0B;EAC1BE,uBAAuB;EACvBE,uBAAuB;EACvBE,uBAAuB;EACvBE,0BAA0B;EAC1BI;AACD,CAAE,CAAC","ignoreList":[]}
|
|
@@ -34,14 +34,14 @@ export const Track = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "produ
|
|
|
34
34
|
} : {
|
|
35
35
|
target: "e15u147w2",
|
|
36
36
|
label: "Track"
|
|
37
|
-
})("position:relative;overflow:hidden;height:", CONFIG.borderWidthFocus, ";background-color:color-mix(\n\t\tin srgb,\n\t\t", COLORS.theme.foreground, ",\n\t\ttransparent 90%\n\t);border-radius:", CONFIG.
|
|
37
|
+
})("position:relative;overflow:hidden;height:", CONFIG.borderWidthFocus, ";background-color:color-mix(\n\t\tin srgb,\n\t\t", COLORS.theme.foreground, ",\n\t\ttransparent 90%\n\t);border-radius:", CONFIG.radiusFull, ";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQytCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWw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dGlvbjogJzEuNXMnLFxuXHRcdFx0XHRcdGFuaW1hdGlvblRpbWluZ0Z1bmN0aW9uOiAnZWFzZS1pbi1vdXQnLFxuXHRcdFx0XHRcdGFuaW1hdGlvbkl0ZXJhdGlvbkNvdW50OiAnaW5maW5pdGUnLFxuXHRcdFx0XHRcdGFuaW1hdGlvbk5hbWU6IGFuaW1hdGVQcm9ncmVzc0JhciggaXNSVEwoKSApLFxuXHRcdFx0XHRcdHdpZHRoOiBgJHsgSU5ERVRFUk1JTkFURV9UUkFDS19XSURUSCB9JWAsXG5cdFx0XHQgIH0gKVxuXHRcdFx0OiBjc3MoIHtcblx0XHRcdFx0XHR3aWR0aDogJ3ZhcigtLWluZGljYXRvci13aWR0aCknLFxuXHRcdFx0XHRcdHRyYW5zaXRpb246ICd3aWR0aCAwLjRzIGVhc2UtaW4tb3V0Jyxcblx0XHRcdCAgfSApIH07XG5gO1xuXG5leHBvcnQgY29uc3QgUHJvZ3Jlc3NFbGVtZW50ID0gc3R5bGVkLnByb2dyZXNzYFxuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0bGVmdDogMDtcblx0b3BhY2l0eTogMDtcblx0d2lkdGg6IDEwMCU7XG5cdGhlaWdodDogMTAwJTtcbmA7XG4iXX0= */"));
|
|
38
38
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
39
39
|
name: "152sa26",
|
|
40
40
|
styles: "width:var(--indicator-width);transition:width 0.4s ease-in-out"
|
|
41
41
|
} : {
|
|
42
42
|
name: "1ox6xu8-Indicator",
|
|
43
43
|
styles: "width:var(--indicator-width);transition:width 0.4s ease-in-out;label:Indicator;",
|
|
44
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
44
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL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2RlLlxuXHRvdXRsaW5lOiAycHggc29saWQgdHJhbnNwYXJlbnQ7XG5cdG91dGxpbmUtb2Zmc2V0OiAtMnB4O1xuXG5cdCR7ICggeyBpc0luZGV0ZXJtaW5hdGUgfSApID0+XG5cdFx0aXNJbmRldGVybWluYXRlXG5cdFx0XHQ/IGNzcygge1xuXHRcdFx0XHRcdGFuaW1hdGlvbkR1cmF0aW9uOiAnMS41cycsXG5cdFx0XHRcdFx0YW5pbWF0aW9uVGltaW5nRnVuY3Rpb246ICdlYXNlLWluLW91dCcsXG5cdFx0XHRcdFx0YW5pbWF0aW9uSXRlcmF0aW9uQ291bnQ6ICdpbmZpbml0ZScsXG5cdFx0XHRcdFx0YW5pbWF0aW9uTmFtZTogYW5pbWF0ZVByb2dyZXNzQmFyKCBpc1JUTCgpICksXG5cdFx0XHRcdFx0d2lkdGg6IGAkeyBJTkRFVEVSTUlOQVRFX1RSQUNLX1dJRFRIIH0lYCxcblx0XHRcdCAgfSApXG5cdFx0XHQ6IGNzcygge1xuXHRcdFx0XHRcdHdpZHRoOiAndmFyKC0taW5kaWNhdG9yLXdpZHRoKScsXG5cdFx0XHRcdFx0dHJhbnNpdGlvbjogJ3dpZHRoIDAuNHMgZWFzZS1pbi1vdXQnLFxuXHRcdFx0ICB9ICkgfTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQcm9ncmVzc0VsZW1lbnQgPSBzdHlsZWQucHJvZ3Jlc3NgXG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAwO1xuXHRsZWZ0OiAwO1xuXHRvcGFjaXR5OiAwO1xuXHR3aWR0aDogMTAwJTtcblx0aGVpZ2h0OiAxMDAlO1xuYDtcbiJdfQ== */",
|
|
45
45
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
46
46
|
};
|
|
47
47
|
export const Indicator = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -49,7 +49,7 @@ export const Indicator = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "p
|
|
|
49
49
|
} : {
|
|
50
50
|
target: "e15u147w1",
|
|
51
51
|
label: "Indicator"
|
|
52
|
-
})("display:inline-block;position:absolute;top:0;height:100%;border-radius:", CONFIG.
|
|
52
|
+
})("display:inline-block;position:absolute;top:0;height:100%;border-radius:", CONFIG.radiusFull, ";background-color:color-mix(\n\t\tin srgb,\n\t\t", COLORS.theme.foreground, ",\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;", ({
|
|
53
53
|
isIndeterminate
|
|
54
54
|
}) => isIndeterminate ? /*#__PURE__*/css({
|
|
55
55
|
animationDuration: '1.5s',
|
|
@@ -57,7 +57,7 @@ export const Indicator = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "p
|
|
|
57
57
|
animationIterationCount: 'infinite',
|
|
58
58
|
animationName: animateProgressBar(isRTL()),
|
|
59
59
|
width: `${INDETERMINATE_TRACK_WIDTH}%`
|
|
60
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:Indicator;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
60
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Indicator;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEwRUsiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9wcm9ncmVzcy1iYXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgY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3Rpb246ICdlYXNlLWluLW91dCcsXG5cdFx0XHRcdFx0YW5pbWF0aW9uSXRlcmF0aW9uQ291bnQ6ICdpbmZpbml0ZScsXG5cdFx0XHRcdFx0YW5pbWF0aW9uTmFtZTogYW5pbWF0ZVByb2dyZXNzQmFyKCBpc1JUTCgpICksXG5cdFx0XHRcdFx0d2lkdGg6IGAkeyBJTkRFVEVSTUlOQVRFX1RSQUNLX1dJRFRIIH0lYCxcblx0XHRcdCAgfSApXG5cdFx0XHQ6IGNzcygge1xuXHRcdFx0XHRcdHdpZHRoOiAndmFyKC0taW5kaWNhdG9yLXdpZHRoKScsXG5cdFx0XHRcdFx0dHJhbnNpdGlvbjogJ3dpZHRoIDAuNHMgZWFzZS1pbi1vdXQnLFxuXHRcdFx0ICB9ICkgfTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQcm9ncmVzc0VsZW1lbnQgPSBzdHlsZWQucHJvZ3Jlc3NgXG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAwO1xuXHRsZWZ0OiAwO1xuXHRvcGFjaXR5OiAwO1xuXHR3aWR0aDogMTAwJTtcblx0aGVpZ2h0OiAxMDAlO1xuYDtcbiJdfQ== */"));
|
|
61
61
|
export const ProgressElement = /*#__PURE__*/_styled("progress", process.env.NODE_ENV === "production" ? {
|
|
62
62
|
target: "e15u147w0"
|
|
63
63
|
} : {
|
|
@@ -69,7 +69,7 @@ export const ProgressElement = /*#__PURE__*/_styled("progress", process.env.NODE
|
|
|
69
69
|
} : {
|
|
70
70
|
name: "11fb690",
|
|
71
71
|
styles: "position:absolute;top:0;left:0;opacity:0;width:100%;height:100%",
|
|
72
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcHJvZ3Jlc3MtYmFyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQ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maW5pdGUnLFxuXHRcdFx0XHRcdGFuaW1hdGlvbk5hbWU6IGFuaW1hdGVQcm9ncmVzc0JhciggaXNSVEwoKSApLFxuXHRcdFx0XHRcdHdpZHRoOiBgJHsgSU5ERVRFUk1JTkFURV9UUkFDS19XSURUSCB9JWAsXG5cdFx0XHQgIH0gKVxuXHRcdFx0OiBjc3MoIHtcblx0XHRcdFx0XHR3aWR0aDogJ3ZhcigtLWluZGljYXRvci13aWR0aCknLFxuXHRcdFx0XHRcdHRyYW5zaXRpb246ICd3aWR0aCAwLjRzIGVhc2UtaW4tb3V0Jyxcblx0XHRcdCAgfSApIH07XG5gO1xuXG5leHBvcnQgY29uc3QgUHJvZ3Jlc3NFbGVtZW50ID0gc3R5bGVkLnByb2dyZXNzYFxuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0bGVmdDogMDtcblx0b3BhY2l0eTogMDtcblx0d2lkdGg6IDEwMCU7XG5cdGhlaWdodDogMTAwJTtcbmA7XG4iXX0= */",
|
|
73
73
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
74
74
|
});
|
|
75
75
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","keyframes","isRTL","COLORS","CONFIG","animateProgressBar","isRtl","animationDirection","INDETERMINATE_TRACK_WIDTH","Track","_styled","process","env","NODE_ENV","target","label","borderWidthFocus","theme","foreground","
|
|
1
|
+
{"version":3,"names":["css","keyframes","isRTL","COLORS","CONFIG","animateProgressBar","isRtl","animationDirection","INDETERMINATE_TRACK_WIDTH","Track","_styled","process","env","NODE_ENV","target","label","borderWidthFocus","theme","foreground","radiusFull","_ref","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","Indicator","isIndeterminate","animationDuration","animationTimingFunction","animationIterationCount","animationName","width","ProgressElement"],"sources":["@wordpress/components/src/progress-bar/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css, keyframes } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\nfunction animateProgressBar( isRtl = false ) {\n\tconst animationDirection = isRtl ? 'right' : 'left';\n\n\treturn keyframes( {\n\t\t'0%': {\n\t\t\t[ animationDirection ]: '-50%',\n\t\t},\n\t\t'100%': {\n\t\t\t[ animationDirection ]: '100%',\n\t\t},\n\t} );\n}\n\n// Width of the indicator for the indeterminate progress bar\nexport const INDETERMINATE_TRACK_WIDTH = 50;\n\nexport const Track = styled.div`\n\tposition: relative;\n\toverflow: hidden;\n\theight: ${ CONFIG.borderWidthFocus };\n\t/* Text color at 10% opacity */\n\tbackground-color: color-mix(\n\t\tin srgb,\n\t\t${ COLORS.theme.foreground },\n\t\ttransparent 90%\n\t);\n\tborder-radius: ${ CONFIG.radiusFull };\n\n\t// Windows high contrast mode.\n\toutline: 2px solid transparent;\n\toutline-offset: 2px;\n\n\t:where( & ) {\n\t\twidth: 160px;\n\t}\n`;\n\nexport const Indicator = styled.div< {\n\tisIndeterminate: boolean;\n} >`\n\tdisplay: inline-block;\n\tposition: absolute;\n\ttop: 0;\n\theight: 100%;\n\tborder-radius: ${ CONFIG.radiusFull };\n\t/* Text color at 90% opacity */\n\tbackground-color: color-mix(\n\t\tin srgb,\n\t\t${ COLORS.theme.foreground },\n\t\ttransparent 10%\n\t);\n\n\t// Windows high contrast mode.\n\toutline: 2px solid transparent;\n\toutline-offset: -2px;\n\n\t${ ( { isIndeterminate } ) =>\n\t\tisIndeterminate\n\t\t\t? css( {\n\t\t\t\t\tanimationDuration: '1.5s',\n\t\t\t\t\tanimationTimingFunction: 'ease-in-out',\n\t\t\t\t\tanimationIterationCount: 'infinite',\n\t\t\t\t\tanimationName: animateProgressBar( isRTL() ),\n\t\t\t\t\twidth: `${ INDETERMINATE_TRACK_WIDTH }%`,\n\t\t\t } )\n\t\t\t: css( {\n\t\t\t\t\twidth: 'var(--indicator-width)',\n\t\t\t\t\ttransition: 'width 0.4s ease-in-out',\n\t\t\t } ) };\n`;\n\nexport const ProgressElement = styled.progress`\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\topacity: 0;\n\twidth: 100%;\n\theight: 100%;\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;;AAE/C;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAEzC,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,KAAK,EAAG;EAC5C,MAAMC,kBAAkB,GAAGD,KAAK,GAAG,OAAO,GAAG,MAAM;EAEnD,OAAOL,SAAS,CAAE;IACjB,IAAI,EAAE;MACL,CAAEM,kBAAkB,GAAI;IACzB,CAAC;IACD,MAAM,EAAE;MACP,CAAEA,kBAAkB,GAAI;IACzB;EACD,CAAE,CAAC;AACJ;;AAEA;AACA,OAAO,MAAMC,yBAAyB,GAAG,EAAE;AAE3C,OAAO,MAAMC,KAAK,gBAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,gDAGNX,MAAM,CAACY,gBAAgB,sDAI9Bb,MAAM,CAACc,KAAK,CAACC,UAAU,gDAGTd,MAAM,CAACe,UAAU,mFAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA,opGASnC;AAAC,IAAAO,IAAA,GAAAT,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAQ,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA;AAEF,OAAO,MAAMC,SAAS,gBAAAhB,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,8EAOHX,MAAM,CAACe,UAAU,sDAI/BhB,MAAM,CAACc,KAAK,CAACC,UAAU,oFAQxB,CAAE;EAAES;AAAgB,CAAC,KACvBA,eAAe,gBACZ3B,GAAG,CAAE;EACL4B,iBAAiB,EAAE,MAAM;EACzBC,uBAAuB,EAAE,aAAa;EACtCC,uBAAuB,EAAE,UAAU;EACnCC,aAAa,EAAE1B,kBAAkB,CAAEH,KAAK,CAAC,CAAE,CAAC;EAC5C8B,KAAK,EAAG,GAAGxB,yBAA2B;AACtC,CAAC,EAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,8CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,kpGAAC,CAAC,GAAAO,IAIA,SAAAT,OAAA,CAAAC,GAAA,CAAAC,QAAA,opGACP;AAED,OAAO,MAAMoB,eAAe,gBAAAvB,OAAA,aAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAQ,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAO3B","ignoreList":[]}
|
|
@@ -49,7 +49,6 @@ function isMultipleCategorySelection(props) {
|
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
export function QueryControls({
|
|
52
|
-
__next40pxDefaultSize = false,
|
|
53
52
|
authorList,
|
|
54
53
|
selectedAuthorId,
|
|
55
54
|
numberOfItems,
|
|
@@ -70,9 +69,9 @@ export function QueryControls({
|
|
|
70
69
|
className: "components-query-controls",
|
|
71
70
|
children: [onOrderChange && onOrderByChange && /*#__PURE__*/_jsx(SelectControl, {
|
|
72
71
|
__nextHasNoMarginBottom: true,
|
|
73
|
-
__next40pxDefaultSize:
|
|
72
|
+
__next40pxDefaultSize: true,
|
|
74
73
|
label: __('Order by'),
|
|
75
|
-
value: `${orderBy}/${order}`,
|
|
74
|
+
value: orderBy === undefined || order === undefined ? undefined : `${orderBy}/${order}`,
|
|
76
75
|
options: [{
|
|
77
76
|
label: __('Newest to oldest'),
|
|
78
77
|
value: 'date/desc'
|
|
@@ -101,14 +100,14 @@ export function QueryControls({
|
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
}, "query-controls-order-select"), isSingleCategorySelection(props) && props.categoriesList && props.onCategoryChange && /*#__PURE__*/_jsx(CategorySelect, {
|
|
104
|
-
__next40pxDefaultSize:
|
|
103
|
+
__next40pxDefaultSize: true,
|
|
105
104
|
categoriesList: props.categoriesList,
|
|
106
105
|
label: __('Category'),
|
|
107
106
|
noOptionLabel: _x('All', 'categories'),
|
|
108
107
|
selectedCategoryId: props.selectedCategoryId,
|
|
109
108
|
onChange: props.onCategoryChange
|
|
110
109
|
}, "query-controls-category-select"), isMultipleCategorySelection(props) && props.categorySuggestions && props.onCategoryChange && /*#__PURE__*/_jsx(FormTokenField, {
|
|
111
|
-
__next40pxDefaultSize:
|
|
110
|
+
__next40pxDefaultSize: true,
|
|
112
111
|
__nextHasNoMarginBottom: true,
|
|
113
112
|
label: __('Categories'),
|
|
114
113
|
value: props.selectedCategories && props.selectedCategories.map(item => ({
|
|
@@ -123,7 +122,7 @@ export function QueryControls({
|
|
|
123
122
|
onChange: props.onCategoryChange,
|
|
124
123
|
maxSuggestions: MAX_CATEGORIES_SUGGESTIONS
|
|
125
124
|
}, "query-controls-categories-select"), onAuthorChange && /*#__PURE__*/_jsx(AuthorSelect, {
|
|
126
|
-
__next40pxDefaultSize:
|
|
125
|
+
__next40pxDefaultSize: true,
|
|
127
126
|
authorList: authorList,
|
|
128
127
|
label: __('Author'),
|
|
129
128
|
noOptionLabel: _x('All', 'authors'),
|
|
@@ -131,7 +130,7 @@ export function QueryControls({
|
|
|
131
130
|
onChange: onAuthorChange
|
|
132
131
|
}, "query-controls-author-select"), onNumberOfItemsChange && /*#__PURE__*/_jsx(RangeControl, {
|
|
133
132
|
__nextHasNoMarginBottom: true,
|
|
134
|
-
__next40pxDefaultSize:
|
|
133
|
+
__next40pxDefaultSize: true,
|
|
135
134
|
label: __('Number of items'),
|
|
136
135
|
value: numberOfItems,
|
|
137
136
|
onChange: onNumberOfItemsChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","AuthorSelect","CategorySelect","FormTokenField","RangeControl","SelectControl","VStack","jsx","_jsx","DEFAULT_MIN_ITEMS","DEFAULT_MAX_ITEMS","MAX_CATEGORIES_SUGGESTIONS","isSingleCategorySelection","props","isMultipleCategorySelection","QueryControls","__next40pxDefaultSize","authorList","selectedAuthorId","numberOfItems","order","orderBy","maxItems","minItems","onAuthorChange","onNumberOfItemsChange","onOrderChange","onOrderByChange","spacing","className","children","__nextHasNoMarginBottom","label","value","options","onChange","newOrderBy","newOrder","split","categoriesList","onCategoryChange","noOptionLabel","selectedCategoryId","categorySuggestions","selectedCategories","map","item","id","name","suggestions","Object","keys","maxSuggestions","min","max","required"],"sources":["@wordpress/components/src/query-controls/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AuthorSelect from './author-select';\nimport CategorySelect from './category-select';\nimport FormTokenField from '../form-token-field';\nimport RangeControl from '../range-control';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport type {\n\tQueryControlsProps,\n\tQueryControlsWithMultipleCategorySelectionProps,\n\tQueryControlsWithSingleCategorySelectionProps,\n} from './types';\n\nconst DEFAULT_MIN_ITEMS = 1;\nconst DEFAULT_MAX_ITEMS = 100;\nconst MAX_CATEGORIES_SUGGESTIONS = 20;\n\nfunction isSingleCategorySelection(\n\tprops: QueryControlsProps\n): props is QueryControlsWithSingleCategorySelectionProps {\n\treturn 'categoriesList' in props;\n}\n\nfunction isMultipleCategorySelection(\n\tprops: QueryControlsProps\n): props is QueryControlsWithMultipleCategorySelectionProps {\n\treturn 'categorySuggestions' in props;\n}\n\n/**\n * Controls to query for posts.\n *\n * ```jsx\n * const MyQueryControls = () => (\n * <QueryControls\n * { ...{ maxItems, minItems, numberOfItems, order, orderBy } }\n * onOrderByChange={ ( newOrderBy ) => {\n * updateQuery( { orderBy: newOrderBy } )\n * }\n * onOrderChange={ ( newOrder ) => {\n * updateQuery( { order: newOrder } )\n * }\n * categoriesList={ categories }\n * selectedCategoryId={ category }\n * onCategoryChange={ ( newCategory ) => {\n * updateQuery( { category: newCategory } )\n * }\n * onNumberOfItemsChange={ ( newNumberOfItems ) => {\n * updateQuery( { numberOfItems: newNumberOfItems } )\n * } }\n * />\n * );\n * ```\n */\nexport function QueryControls( {\n\t__next40pxDefaultSize = false,\n\tauthorList,\n\tselectedAuthorId,\n\tnumberOfItems,\n\torder,\n\torderBy,\n\tmaxItems = DEFAULT_MAX_ITEMS,\n\tminItems = DEFAULT_MIN_ITEMS,\n\tonAuthorChange,\n\tonNumberOfItemsChange,\n\tonOrderChange,\n\tonOrderByChange,\n\t// Props for single OR multiple category selection are not destructured here,\n\t// but instead are destructured inline where necessary.\n\t...props\n}: QueryControlsProps ) {\n\treturn (\n\t\t<VStack spacing=\"4\" className=\"components-query-controls\">\n\t\t\t{ [\n\t\t\t\tonOrderChange && onOrderByChange && (\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tkey=\"query-controls-order-select\"\n\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Newest to oldest' ),\n\t\t\t\t\t\t\t\tvalue: 'date/desc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Oldest to newest' ),\n\t\t\t\t\t\t\t\tvalue: 'date/asc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\t\t\t\t\t\t\tlabel: __( 'A → Z' ),\n\t\t\t\t\t\t\t\tvalue: 'title/asc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\t\t\t\t\t\t\tlabel: __( 'Z → A' ),\n\t\t\t\t\t\t\t\tvalue: 'title/desc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tif ( typeof value !== 'string' ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\t\t\t\tif ( newOrder !== order ) {\n\t\t\t\t\t\t\t\tonOrderChange(\n\t\t\t\t\t\t\t\t\tnewOrder as NonNullable<\n\t\t\t\t\t\t\t\t\t\tQueryControlsProps[ 'order' ]\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( newOrderBy !== orderBy ) {\n\t\t\t\t\t\t\t\tonOrderByChange(\n\t\t\t\t\t\t\t\t\tnewOrderBy as NonNullable<\n\t\t\t\t\t\t\t\t\t\tQueryControlsProps[ 'orderBy' ]\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tisSingleCategorySelection( props ) &&\n\t\t\t\t\tprops.categoriesList &&\n\t\t\t\t\tprops.onCategoryChange && (\n\t\t\t\t\t\t<CategorySelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tkey=\"query-controls-category-select\"\n\t\t\t\t\t\t\tcategoriesList={ props.categoriesList }\n\t\t\t\t\t\t\tlabel={ __( 'Category' ) }\n\t\t\t\t\t\t\tnoOptionLabel={ _x( 'All', 'categories' ) }\n\t\t\t\t\t\t\tselectedCategoryId={ props.selectedCategoryId }\n\t\t\t\t\t\t\tonChange={ props.onCategoryChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\tisMultipleCategorySelection( props ) &&\n\t\t\t\t\tprops.categorySuggestions &&\n\t\t\t\t\tprops.onCategoryChange && (\n\t\t\t\t\t\t<FormTokenField\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tkey=\"query-controls-categories-select\"\n\t\t\t\t\t\t\tlabel={ __( 'Categories' ) }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tprops.selectedCategories &&\n\t\t\t\t\t\t\t\tprops.selectedCategories.map( ( item ) => ( {\n\t\t\t\t\t\t\t\t\tid: item.id,\n\t\t\t\t\t\t\t\t\t// Keeping the fallback to `item.value` for legacy reasons,\n\t\t\t\t\t\t\t\t\t// even if items of `selectedCategories` should not have a\n\t\t\t\t\t\t\t\t\t// `value` property.\n\t\t\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\t\t\tvalue: item.name || item.value,\n\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsuggestions={ Object.keys(\n\t\t\t\t\t\t\t\tprops.categorySuggestions\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ props.onCategoryChange }\n\t\t\t\t\t\t\tmaxSuggestions={ MAX_CATEGORIES_SUGGESTIONS }\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\tonAuthorChange && (\n\t\t\t\t\t<AuthorSelect\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tkey=\"query-controls-author-select\"\n\t\t\t\t\t\tauthorList={ authorList }\n\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\tnoOptionLabel={ _x( 'All', 'authors' ) }\n\t\t\t\t\t\tselectedAuthorId={ selectedAuthorId }\n\t\t\t\t\t\tonChange={ onAuthorChange }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tonNumberOfItemsChange && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tkey=\"query-controls-range-control\"\n\t\t\t\t\t\tlabel={ __( 'Number of items' ) }\n\t\t\t\t\t\tvalue={ numberOfItems }\n\t\t\t\t\t\tonChange={ onNumberOfItemsChange }\n\t\t\t\t\t\tmin={ minItems }\n\t\t\t\t\t\tmax={ maxItems }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t] }\n\t\t</VStack>\n\t);\n}\n\nexport default QueryControls;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;;AAExC;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAASC,MAAM,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOpC,MAAMC,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,iBAAiB,GAAG,GAAG;AAC7B,MAAMC,0BAA0B,GAAG,EAAE;AAErC,SAASC,yBAAyBA,CACjCC,KAAyB,EACgC;EACzD,OAAO,gBAAgB,IAAIA,KAAK;AACjC;AAEA,SAAS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CAAG;MACHR,QAAQ,EAAGtB,KAAK,CAAC2B,gBAAkB;MACnCY,cAAc,EAAGzC;IAA4B,GAjBzC,kCAkBJ,CACD,EACFa,cAAc,iBACbhB,IAAA,CAACP,YAAY;MACZe,qBAAqB,EAAGA,qBAAuB;MAE/CC,UAAU,EAAGA,UAAY;MACzBe,KAAK,EAAGjC,EAAE,CAAE,QAAS,CAAG;MACxB0C,aAAa,EAAGzC,EAAE,CAAE,KAAK,EAAE,SAAU,CAAG;MACxCkB,gBAAgB,EAAGA,gBAAkB;MACrCiB,QAAQ,EAAGX;IAAgB,GALvB,8BAMJ,CACD,EACDC,qBAAqB,iBACpBjB,IAAA,CAACJ,YAAY;MACZ2B,uBAAuB;MACvBf,qBAAqB,EAAGA,qBAAuB;MAE/CgB,KAAK,EAAGjC,EAAE,CAAE,iBAAkB,CAAG;MACjCkC,KAAK,EAAGd,aAAe;MACvBgB,QAAQ,EAAGV,qBAAuB;MAClC4B,GAAG,EAAG9B,QAAU;MAChB+B,GAAG,EAAGhC,QAAU;MAChBiC,QAAQ;IAAA,GANJ,8BAOJ,CACD;EACD,CACM,CAAC;AAEX;AAEA,eAAexC,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","_x","AuthorSelect","CategorySelect","FormTokenField","RangeControl","SelectControl","VStack","jsx","_jsx","DEFAULT_MIN_ITEMS","DEFAULT_MAX_ITEMS","MAX_CATEGORIES_SUGGESTIONS","isSingleCategorySelection","props","isMultipleCategorySelection","QueryControls","authorList","selectedAuthorId","numberOfItems","order","orderBy","maxItems","minItems","onAuthorChange","onNumberOfItemsChange","onOrderChange","onOrderByChange","spacing","className","children","__nextHasNoMarginBottom","__next40pxDefaultSize","label","value","undefined","options","onChange","newOrderBy","newOrder","split","categoriesList","onCategoryChange","noOptionLabel","selectedCategoryId","categorySuggestions","selectedCategories","map","item","id","name","suggestions","Object","keys","maxSuggestions","min","max","required"],"sources":["@wordpress/components/src/query-controls/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AuthorSelect from './author-select';\nimport CategorySelect from './category-select';\nimport FormTokenField from '../form-token-field';\nimport RangeControl from '../range-control';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport type {\n\tQueryControlsProps,\n\tQueryControlsWithMultipleCategorySelectionProps,\n\tQueryControlsWithSingleCategorySelectionProps,\n} from './types';\n\nconst DEFAULT_MIN_ITEMS = 1;\nconst DEFAULT_MAX_ITEMS = 100;\nconst MAX_CATEGORIES_SUGGESTIONS = 20;\n\nfunction isSingleCategorySelection(\n\tprops: QueryControlsProps\n): props is QueryControlsWithSingleCategorySelectionProps {\n\treturn 'categoriesList' in props;\n}\n\nfunction isMultipleCategorySelection(\n\tprops: QueryControlsProps\n): props is QueryControlsWithMultipleCategorySelectionProps {\n\treturn 'categorySuggestions' in props;\n}\n\n/**\n * Controls to query for posts.\n *\n * ```jsx\n * const MyQueryControls = () => (\n * <QueryControls\n * { ...{ maxItems, minItems, numberOfItems, order, orderBy } }\n * onOrderByChange={ ( newOrderBy ) => {\n * updateQuery( { orderBy: newOrderBy } )\n * }\n * onOrderChange={ ( newOrder ) => {\n * updateQuery( { order: newOrder } )\n * }\n * categoriesList={ categories }\n * selectedCategoryId={ category }\n * onCategoryChange={ ( newCategory ) => {\n * updateQuery( { category: newCategory } )\n * }\n * onNumberOfItemsChange={ ( newNumberOfItems ) => {\n * updateQuery( { numberOfItems: newNumberOfItems } )\n * } }\n * />\n * );\n * ```\n */\nexport function QueryControls( {\n\tauthorList,\n\tselectedAuthorId,\n\tnumberOfItems,\n\torder,\n\torderBy,\n\tmaxItems = DEFAULT_MAX_ITEMS,\n\tminItems = DEFAULT_MIN_ITEMS,\n\tonAuthorChange,\n\tonNumberOfItemsChange,\n\tonOrderChange,\n\tonOrderByChange,\n\t// Props for single OR multiple category selection are not destructured here,\n\t// but instead are destructured inline where necessary.\n\t...props\n}: QueryControlsProps ) {\n\treturn (\n\t\t<VStack spacing=\"4\" className=\"components-query-controls\">\n\t\t\t{ [\n\t\t\t\tonOrderChange && onOrderByChange && (\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tkey=\"query-controls-order-select\"\n\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\torderBy === undefined || order === undefined\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: `${ orderBy }/${ order }`\n\t\t\t\t\t\t}\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Newest to oldest' ),\n\t\t\t\t\t\t\t\tvalue: 'date/desc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Oldest to newest' ),\n\t\t\t\t\t\t\t\tvalue: 'date/asc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\t\t\t\t\t\t\tlabel: __( 'A → Z' ),\n\t\t\t\t\t\t\t\tvalue: 'title/asc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\t\t\t\t\t\t\tlabel: __( 'Z → A' ),\n\t\t\t\t\t\t\t\tvalue: 'title/desc',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tif ( typeof value !== 'string' ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\t\t\t\tif ( newOrder !== order ) {\n\t\t\t\t\t\t\t\tonOrderChange(\n\t\t\t\t\t\t\t\t\tnewOrder as NonNullable<\n\t\t\t\t\t\t\t\t\t\tQueryControlsProps[ 'order' ]\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( newOrderBy !== orderBy ) {\n\t\t\t\t\t\t\t\tonOrderByChange(\n\t\t\t\t\t\t\t\t\tnewOrderBy as NonNullable<\n\t\t\t\t\t\t\t\t\t\tQueryControlsProps[ 'orderBy' ]\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tisSingleCategorySelection( props ) &&\n\t\t\t\t\tprops.categoriesList &&\n\t\t\t\t\tprops.onCategoryChange && (\n\t\t\t\t\t\t<CategorySelect\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tkey=\"query-controls-category-select\"\n\t\t\t\t\t\t\tcategoriesList={ props.categoriesList }\n\t\t\t\t\t\t\tlabel={ __( 'Category' ) }\n\t\t\t\t\t\t\tnoOptionLabel={ _x( 'All', 'categories' ) }\n\t\t\t\t\t\t\tselectedCategoryId={ props.selectedCategoryId }\n\t\t\t\t\t\t\tonChange={ props.onCategoryChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\tisMultipleCategorySelection( props ) &&\n\t\t\t\t\tprops.categorySuggestions &&\n\t\t\t\t\tprops.onCategoryChange && (\n\t\t\t\t\t\t<FormTokenField\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tkey=\"query-controls-categories-select\"\n\t\t\t\t\t\t\tlabel={ __( 'Categories' ) }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tprops.selectedCategories &&\n\t\t\t\t\t\t\t\tprops.selectedCategories.map( ( item ) => ( {\n\t\t\t\t\t\t\t\t\tid: item.id,\n\t\t\t\t\t\t\t\t\t// Keeping the fallback to `item.value` for legacy reasons,\n\t\t\t\t\t\t\t\t\t// even if items of `selectedCategories` should not have a\n\t\t\t\t\t\t\t\t\t// `value` property.\n\t\t\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\t\t\tvalue: item.name || item.value,\n\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsuggestions={ Object.keys(\n\t\t\t\t\t\t\t\tprops.categorySuggestions\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ props.onCategoryChange }\n\t\t\t\t\t\t\tmaxSuggestions={ MAX_CATEGORIES_SUGGESTIONS }\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\tonAuthorChange && (\n\t\t\t\t\t<AuthorSelect\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tkey=\"query-controls-author-select\"\n\t\t\t\t\t\tauthorList={ authorList }\n\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\tnoOptionLabel={ _x( 'All', 'authors' ) }\n\t\t\t\t\t\tselectedAuthorId={ selectedAuthorId }\n\t\t\t\t\t\tonChange={ onAuthorChange }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tonNumberOfItemsChange && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tkey=\"query-controls-range-control\"\n\t\t\t\t\t\tlabel={ __( 'Number of items' ) }\n\t\t\t\t\t\tvalue={ numberOfItems }\n\t\t\t\t\t\tonChange={ onNumberOfItemsChange }\n\t\t\t\t\t\tmin={ minItems }\n\t\t\t\t\t\tmax={ maxItems }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t] }\n\t\t</VStack>\n\t);\n}\n\nexport default QueryControls;\n"],"mappings":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{"version":3,"names":[],"sources":["@wordpress/components/src/query-controls/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { FormTokenFieldProps } from '../form-token-field/types';\nimport type { TreeSelectProps } from '../tree-select/types';\n\nexport type Author = {\n\tid: number;\n\tname: string;\n};\n\nexport type Category = {\n\tid: number;\n\tname: string;\n\tparent: number;\n};\n\nexport type TermWithParentAndChildren = {\n\tid: string;\n\tname: string;\n\tparent: number | null;\n\tchildren: TermWithParentAndChildren[];\n};\n\nexport type TermsByParent = Record< string, TermWithParentAndChildren[] >;\n\nexport type CategorySelectProps = Pick<\n\tTreeSelectProps,\n\t'label' | 'noOptionLabel'\n> & {\n\tcategoriesList: Category[];\n\tonChange: ( newCategory: string ) => void;\n\tselectedCategoryId?: Category[ 'id' ];\n\t__next40pxDefaultSize: boolean;\n};\n\nexport type AuthorSelectProps = Pick<\n\tTreeSelectProps,\n\t'label' | 'noOptionLabel'\n> & {\n\tauthorList?: Author[];\n\tonChange: ( newAuthor: string ) => void;\n\tselectedAuthorId?: Author[ 'id' ];\n\t__next40pxDefaultSize: boolean;\n};\n\ntype Order = 'asc' | 'desc';\ntype OrderBy = 'date' | 'title';\n\ntype BaseQueryControlsProps = {\n\t/**\n\t * An array of the authors to select from.\n\t */\n\tauthorList?: AuthorSelectProps[ 'authorList' ];\n\t/**\n\t * The maximum number of items.\n\t *\n\t * @default 100\n\t */\n\tmaxItems?: number;\n\t/**\n\t * The minimum number of items.\n\t *\n\t * @default 1\n\t */\n\tminItems?: number;\n\t/**\n\t * The selected number of items to retrieve via the query.\n\t */\n\tnumberOfItems?: number;\n\t/**\n\t * A function that receives the new author value.\n\t * If not specified, the author controls are not rendered.\n\t */\n\tonAuthorChange?: AuthorSelectProps[ 'onChange' ];\n\t/**\n\t * A function that receives the new number of items.\n\t * If not specified, then the number of items\n\t * range control is not rendered.\n\t */\n\tonNumberOfItemsChange?: ( newNumber?: number ) => void;\n\t/**\n\t * A function that receives the new order value.\n\t * If this prop or the `onOrderByChange` prop are not specified,\n\t * then the order controls are not rendered.\n\t */\n\tonOrderChange?: ( newOrder: Order ) => void;\n\t/**\n\t * A function that receives the new orderby value.\n\t * If this prop or the `onOrderChange` prop are not specified,\n\t * then the order controls are not rendered.\n\t */\n\tonOrderByChange?: ( newOrderBy: OrderBy ) => void;\n\t/**\n\t * The order in which to retrieve posts.\n\t */\n\torder?: Order;\n\t/**\n\t * The meta key by which to order posts.\n\t */\n\torderBy?: OrderBy;\n\t/**\n\t * The selected author ID.\n\t */\n\tselectedAuthorId?: AuthorSelectProps[ 'selectedAuthorId' ];\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/query-controls/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { FormTokenFieldProps } from '../form-token-field/types';\nimport type { TreeSelectProps } from '../tree-select/types';\n\nexport type Author = {\n\tid: number;\n\tname: string;\n};\n\nexport type Category = {\n\tid: number;\n\tname: string;\n\tparent: number;\n};\n\nexport type TermWithParentAndChildren = {\n\tid: string;\n\tname: string;\n\tparent: number | null;\n\tchildren: TermWithParentAndChildren[];\n};\n\nexport type TermsByParent = Record< string, TermWithParentAndChildren[] >;\n\nexport type CategorySelectProps = Pick<\n\tTreeSelectProps,\n\t'label' | 'noOptionLabel'\n> & {\n\tcategoriesList: Category[];\n\tonChange: ( newCategory: string ) => void;\n\tselectedCategoryId?: Category[ 'id' ];\n\t__next40pxDefaultSize: boolean;\n};\n\nexport type AuthorSelectProps = Pick<\n\tTreeSelectProps,\n\t'label' | 'noOptionLabel'\n> & {\n\tauthorList?: Author[];\n\tonChange: ( newAuthor: string ) => void;\n\tselectedAuthorId?: Author[ 'id' ];\n\t__next40pxDefaultSize: boolean;\n};\n\ntype Order = 'asc' | 'desc';\ntype OrderBy = 'date' | 'title';\n\ntype BaseQueryControlsProps = {\n\t/**\n\t * An array of the authors to select from.\n\t */\n\tauthorList?: AuthorSelectProps[ 'authorList' ];\n\t/**\n\t * The maximum number of items.\n\t *\n\t * @default 100\n\t */\n\tmaxItems?: number;\n\t/**\n\t * The minimum number of items.\n\t *\n\t * @default 1\n\t */\n\tminItems?: number;\n\t/**\n\t * The selected number of items to retrieve via the query.\n\t */\n\tnumberOfItems?: number;\n\t/**\n\t * A function that receives the new author value.\n\t * If not specified, the author controls are not rendered.\n\t */\n\tonAuthorChange?: AuthorSelectProps[ 'onChange' ];\n\t/**\n\t * A function that receives the new number of items.\n\t * If not specified, then the number of items\n\t * range control is not rendered.\n\t */\n\tonNumberOfItemsChange?: ( newNumber?: number ) => void;\n\t/**\n\t * A function that receives the new order value.\n\t * If this prop or the `onOrderByChange` prop are not specified,\n\t * then the order controls are not rendered.\n\t */\n\tonOrderChange?: ( newOrder: Order ) => void;\n\t/**\n\t * A function that receives the new orderby value.\n\t * If this prop or the `onOrderChange` prop are not specified,\n\t * then the order controls are not rendered.\n\t */\n\tonOrderByChange?: ( newOrderBy: OrderBy ) => void;\n\t/**\n\t * The order in which to retrieve posts.\n\t */\n\torder?: Order;\n\t/**\n\t * The meta key by which to order posts.\n\t */\n\torderBy?: OrderBy;\n\t/**\n\t * The selected author ID.\n\t */\n\tselectedAuthorId?: AuthorSelectProps[ 'selectedAuthorId' ];\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @deprecated Default behavior since WP 6.7. Prop can be safely removed.\n\t * @ignore\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n\nexport type QueryControlsWithSingleCategorySelectionProps =\n\tBaseQueryControlsProps & {\n\t\t/**\n\t\t * An array of categories. When passed in conjunction with the\n\t\t * `onCategoryChange` prop, it causes the component to render UI that allows\n\t\t * selecting one category at a time.\n\t\t */\n\t\tcategoriesList?: CategorySelectProps[ 'categoriesList' ];\n\t\t/**\n\t\t * The selected category for the `categoriesList` prop.\n\t\t */\n\t\tselectedCategoryId?: CategorySelectProps[ 'selectedCategoryId' ];\n\t\t/**\n\t\t * A function that receives the new category value. If not specified, the\n\t\t * category controls are not rendered.\n\t\t * The function's signature changes depending on whether multiple category\n\t\t * selection is enabled or not.\n\t\t */\n\t\tonCategoryChange?: CategorySelectProps[ 'onChange' ];\n\t};\n\nexport type QueryControlsWithMultipleCategorySelectionProps =\n\tBaseQueryControlsProps & {\n\t\t/**\n\t\t * An object of categories with the category name as the key. When passed in\n\t\t * conjunction with the `onCategoryChange` prop, it causes the component to\n\t\t * render UI that enables multiple selection.\n\t\t */\n\t\tcategorySuggestions?: Record< Category[ 'name' ], Category >;\n\t\t/**\n\t\t * The selected categories for the `categorySuggestions` prop.\n\t\t */\n\t\tselectedCategories?: Category[];\n\t\t/**\n\t\t * A function that receives the new category value. If not specified, the\n\t\t * category controls are not rendered.\n\t\t * The function's signature changes depending on whether multiple category\n\t\t * selection is enabled or not.\n\t\t */\n\t\tonCategoryChange?: FormTokenFieldProps[ 'onChange' ];\n\t};\n\nexport type QueryControlsProps =\n\t| QueryControlsWithSingleCategorySelectionProps\n\t| QueryControlsWithMultipleCategorySelectionProps;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -12,6 +12,19 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
12
12
|
*/
|
|
13
13
|
import BaseControl from '../base-control';
|
|
14
14
|
import { VStack } from '../v-stack';
|
|
15
|
+
import { StyledHelp } from '../base-control/styles/base-control-styles';
|
|
16
|
+
import { VisuallyHidden } from '../visually-hidden';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
function generateOptionDescriptionId(radioGroupId, index) {
|
|
20
|
+
return `${radioGroupId}-${index}-option-description`;
|
|
21
|
+
}
|
|
22
|
+
function generateOptionId(radioGroupId, index) {
|
|
23
|
+
return `${radioGroupId}-${index}`;
|
|
24
|
+
}
|
|
25
|
+
function generateHelpId(radioGroupId) {
|
|
26
|
+
return `${radioGroupId}__help`;
|
|
27
|
+
}
|
|
15
28
|
|
|
16
29
|
/**
|
|
17
30
|
* Render a user interface to select the user type using radio inputs.
|
|
@@ -38,8 +51,6 @@ import { VStack } from '../v-stack';
|
|
|
38
51
|
* };
|
|
39
52
|
* ```
|
|
40
53
|
*/
|
|
41
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
42
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
43
54
|
export function RadioControl(props) {
|
|
44
55
|
const {
|
|
45
56
|
label,
|
|
@@ -49,42 +60,58 @@ export function RadioControl(props) {
|
|
|
49
60
|
onChange,
|
|
50
61
|
hideLabelFromVision,
|
|
51
62
|
options = [],
|
|
63
|
+
id: preferredId,
|
|
52
64
|
...additionalProps
|
|
53
65
|
} = props;
|
|
54
|
-
const
|
|
55
|
-
const id = `inspector-radio-control-${instanceId}`;
|
|
66
|
+
const id = useInstanceId(RadioControl, 'inspector-radio-control', preferredId);
|
|
56
67
|
const onChangeValue = event => onChange(event.target.value);
|
|
57
68
|
if (!options?.length) {
|
|
58
69
|
return null;
|
|
59
70
|
}
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
-
__nextHasNoMarginBottom: true,
|
|
62
|
-
label: label,
|
|
71
|
+
return /*#__PURE__*/_jsxs("fieldset", {
|
|
63
72
|
id: id,
|
|
64
|
-
hideLabelFromVision: hideLabelFromVision,
|
|
65
|
-
help: help,
|
|
66
73
|
className: clsx(className, 'components-radio-control'),
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
"aria-describedby": !!help ? generateHelpId(id) : undefined,
|
|
75
|
+
children: [hideLabelFromVision ? /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
76
|
+
as: "legend",
|
|
77
|
+
children: label
|
|
78
|
+
}) : /*#__PURE__*/_jsx(BaseControl.VisualLabel, {
|
|
79
|
+
as: "legend",
|
|
80
|
+
children: label
|
|
81
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
82
|
+
spacing: 3,
|
|
83
|
+
className: clsx('components-radio-control__group-wrapper', {
|
|
84
|
+
'has-help': !!help
|
|
85
|
+
}),
|
|
69
86
|
children: options.map((option, index) => /*#__PURE__*/_jsxs("div", {
|
|
70
87
|
className: "components-radio-control__option",
|
|
71
88
|
children: [/*#__PURE__*/_jsx("input", {
|
|
72
|
-
id:
|
|
89
|
+
id: generateOptionId(id, index),
|
|
73
90
|
className: "components-radio-control__input",
|
|
74
91
|
type: "radio",
|
|
75
92
|
name: id,
|
|
76
93
|
value: option.value,
|
|
77
94
|
onChange: onChangeValue,
|
|
78
95
|
checked: option.value === selected,
|
|
79
|
-
"aria-describedby": !!
|
|
96
|
+
"aria-describedby": !!option.description ? generateOptionDescriptionId(id, index) : undefined,
|
|
80
97
|
...additionalProps
|
|
81
98
|
}), /*#__PURE__*/_jsx("label", {
|
|
82
99
|
className: "components-radio-control__label",
|
|
83
|
-
htmlFor:
|
|
100
|
+
htmlFor: generateOptionId(id, index),
|
|
84
101
|
children: option.label
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
|
|
102
|
+
}), !!option.description ? /*#__PURE__*/_jsx(StyledHelp, {
|
|
103
|
+
__nextHasNoMarginBottom: true,
|
|
104
|
+
id: generateOptionDescriptionId(id, index),
|
|
105
|
+
className: "components-radio-control__option-description",
|
|
106
|
+
children: option.description
|
|
107
|
+
}) : null]
|
|
108
|
+
}, generateOptionId(id, index)))
|
|
109
|
+
}), !!help && /*#__PURE__*/_jsx(StyledHelp, {
|
|
110
|
+
__nextHasNoMarginBottom: true,
|
|
111
|
+
id: generateHelpId(id),
|
|
112
|
+
className: "components-base-control__help",
|
|
113
|
+
children: help
|
|
114
|
+
})]
|
|
88
115
|
});
|
|
89
116
|
}
|
|
90
117
|
export default RadioControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useInstanceId","BaseControl","VStack","jsx","_jsx","jsxs","_jsxs","RadioControl","props","label","className","selected","help","onChange","hideLabelFromVision","options","
|
|
1
|
+
{"version":3,"names":["clsx","useInstanceId","BaseControl","VStack","StyledHelp","VisuallyHidden","jsx","_jsx","jsxs","_jsxs","generateOptionDescriptionId","radioGroupId","index","generateOptionId","generateHelpId","RadioControl","props","label","className","selected","help","onChange","hideLabelFromVision","options","id","preferredId","additionalProps","onChangeValue","event","target","value","length","undefined","children","as","VisualLabel","spacing","map","option","type","name","checked","description","htmlFor","__nextHasNoMarginBottom"],"sources":["@wordpress/components/src/radio-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioControlProps } from './types';\nimport { VStack } from '../v-stack';\nimport { StyledHelp } from '../base-control/styles/base-control-styles';\nimport { VisuallyHidden } from '../visually-hidden';\n\nfunction generateOptionDescriptionId( radioGroupId: string, index: number ) {\n\treturn `${ radioGroupId }-${ index }-option-description`;\n}\n\nfunction generateOptionId( radioGroupId: string, index: number ) {\n\treturn `${ radioGroupId }-${ index }`;\n}\n\nfunction generateHelpId( radioGroupId: string ) {\n\treturn `${ radioGroupId }__help`;\n}\n\n/**\n * Render a user interface to select the user type using radio inputs.\n *\n * ```jsx\n * import { RadioControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRadioControl = () => {\n * const [ option, setOption ] = useState( 'a' );\n *\n * return (\n * <RadioControl\n * label=\"User type\"\n * help=\"The type of the current user\"\n * selected={ option }\n * options={ [\n * { label: 'Author', value: 'a' },\n * { label: 'Editor', value: 'e' },\n * ] }\n * onChange={ ( value ) => setOption( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function RadioControl(\n\tprops: WordPressComponentProps< RadioControlProps, 'input', false >\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\tselected,\n\t\thelp,\n\t\tonChange,\n\t\thideLabelFromVision,\n\t\toptions = [],\n\t\tid: preferredId,\n\t\t...additionalProps\n\t} = props;\n\tconst id = useInstanceId(\n\t\tRadioControl,\n\t\t'inspector-radio-control',\n\t\tpreferredId\n\t);\n\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\tif ( ! options?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<fieldset\n\t\t\tid={ id }\n\t\t\tclassName={ clsx( className, 'components-radio-control' ) }\n\t\t\taria-describedby={ !! help ? generateHelpId( id ) : undefined }\n\t\t>\n\t\t\t{ hideLabelFromVision ? (\n\t\t\t\t<VisuallyHidden as=\"legend\">{ label }</VisuallyHidden>\n\t\t\t) : (\n\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t{ label }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t) }\n\n\t\t\t<VStack\n\t\t\t\tspacing={ 3 }\n\t\t\t\tclassName={ clsx( 'components-radio-control__group-wrapper', {\n\t\t\t\t\t'has-help': !! help,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ options.map( ( option, index ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ generateOptionId( id, index ) }\n\t\t\t\t\t\tclassName=\"components-radio-control__option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={ generateOptionId( id, index ) }\n\t\t\t\t\t\t\tclassName=\"components-radio-control__input\"\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ id }\n\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\t\t\tchecked={ option.value === selected }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t!! option.description\n\t\t\t\t\t\t\t\t\t? generateOptionDescriptionId( id, index )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tclassName=\"components-radio-control__label\"\n\t\t\t\t\t\t\thtmlFor={ generateOptionId( id, index ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t{ !! option.description ? (\n\t\t\t\t\t\t\t<StyledHelp\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tid={ generateOptionDescriptionId( id, index ) }\n\t\t\t\t\t\t\t\tclassName=\"components-radio-control__option-description\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ option.description }\n\t\t\t\t\t\t\t</StyledHelp>\n\t\t\t\t\t\t) : null }\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tid={ generateHelpId( id ) }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n\nexport default RadioControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AAGzC,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,UAAU,QAAQ,4CAA4C;AACvE,SAASC,cAAc,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEpD,SAASC,2BAA2BA,CAAEC,YAAoB,EAAEC,KAAa,EAAG;EAC3E,OAAQ,GAAGD,YAAc,IAAIC,KAAO,qBAAoB;AACzD;AAEA,SAASC,gBAAgBA,CAAEF,YAAoB,EA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+B;MAAAe,QAAA,EAEvCb;IAAI,CACK,CACZ;EAAA,CACQ,CAAC;AAEb;AAEA,eAAeL,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/radio-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\n\nexport type RadioControlProps = Pick<\n\tBaseControlProps,\n\t'label' | 'help' | 'hideLabelFromVision'\n> & {\n\t/**\n\t * A function that receives the value of the new option that is being\n\t * selected as input.\n\t */\n\tonChange: ( value: string ) => void;\n\t/**\n\t * An array of objects containing the value and label of the options.\n\t */\n\toptions?: {\n\t\t/**\n\t\t * The label to be shown to the user\n\t\t */\n\t\tlabel: string;\n\t\t/**\n\t\t * The internal value compared against select and passed to onChange\n\t\t */\n\t\tvalue: string;\n\t}[];\n\t/**\n\t * The value property of the currently selected option.\n\t */\n\tselected?: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/radio-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\n\nexport type RadioControlProps = Pick<\n\tBaseControlProps,\n\t'label' | 'help' | 'hideLabelFromVision'\n> & {\n\t/**\n\t * A function that receives the value of the new option that is being\n\t * selected as input.\n\t */\n\tonChange: ( value: string ) => void;\n\t/**\n\t * An array of objects containing the value and label of the options.\n\t */\n\toptions?: {\n\t\t/**\n\t\t * The label to be shown to the user\n\t\t */\n\t\tlabel: string;\n\t\t/**\n\t\t * The internal value compared against select and passed to onChange\n\t\t */\n\t\tvalue: string;\n\t\t/**\n\t\t * Optional help text to be shown in addition the label.\n\t\t */\n\t\tdescription?: string;\n\t}[];\n\t/**\n\t * The value property of the currently selected option.\n\t */\n\tselected?: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ import { forwardRef, useContext } from '@wordpress/element';
|
|
|
7
7
|
* External dependencies
|
|
8
8
|
*/
|
|
9
9
|
import * as Ariakit from '@ariakit/react';
|
|
10
|
+
import { useStoreState } from '@ariakit/react';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -23,7 +24,7 @@ function UnforwardedRadio({
|
|
|
23
24
|
store,
|
|
24
25
|
disabled
|
|
25
26
|
} = useContext(RadioGroupContext);
|
|
26
|
-
const selectedValue = store
|
|
27
|
+
const selectedValue = useStoreState(store, 'value');
|
|
27
28
|
const isChecked = selectedValue !== undefined && selectedValue === value;
|
|
28
29
|
return /*#__PURE__*/_jsx(Ariakit.Radio, {
|
|
29
30
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useContext","Ariakit","Button","RadioGroupContext","jsx","_jsx","UnforwardedRadio","value","children","props","ref","store","disabled","selectedValue","
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","Ariakit","useStoreState","Button","RadioGroupContext","jsx","_jsx","UnforwardedRadio","value","children","props","ref","store","disabled","selectedValue","isChecked","undefined","Radio","render","variant"],"sources":["@wordpress/components/src/radio-group/radio.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { RadioGroupContext } from './context';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioProps } from './types';\n\nfunction UnforwardedRadio(\n\t{\n\t\tvalue,\n\t\tchildren,\n\t\t...props\n\t}: WordPressComponentProps< RadioProps, 'button', false >,\n\tref: React.ForwardedRef< any >\n) {\n\tconst { store, disabled } = useContext( RadioGroupContext );\n\n\tconst selectedValue = useStoreState( store, 'value' );\n\tconst isChecked = selectedValue !== undefined && selectedValue === value;\n\n\treturn (\n\t\t<Ariakit.Radio\n\t\t\tdisabled={ disabled }\n\t\t\tstore={ store }\n\t\t\tref={ ref }\n\t\t\tvalue={ value }\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ isChecked ? 'primary' : 'secondary' }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ children || value }\n\t\t</Ariakit.Radio>\n\t);\n}\n\n/**\n * @deprecated Use `RadioControl` or `ToggleGroupControl` instead.\n */\nexport const Radio = forwardRef( UnforwardedRadio );\nexport default Radio;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,iBAAiB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI9C,SAASC,gBAAgBA,CACxB;EACCC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACoD,CAAC,EACzDC,GAA8B,EAC7B;EACD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGb,UAAU,CAAEI,iBAAkB,CAAC;EAE3D,MAAMU,aAAa,GAAGZ,aAAa,CAAEU,KAAK,EAAE,OAAQ,CAAC;EACrD,MAAMG,SAAS,GAAGD,aAAa,KAAKE,SAAS,IAAIF,aAAa,KAAKN,KAAK;EAExE,oBACCF,IAAA,CAACL,OAAO,CAACgB,KAAK;IACbJ,QAAQ,EAAGA,QAAU;IACrBD,KAAK,EAAGA,KAAO;IACfD,GAAG,EAAGA,GAAK;IACXH,KAAK,EAAGA,KAAO;IACfU,MAAM,eACLZ,IAAA,CAACH,MAAM;MACNgB,OAAO,EAAGJ,SAAS,GAAG,SAAS,GAAG,WAAa;MAAA,GAC1CL;IAAK,CACV,CACD;IAAAD,QAAA,EAECA,QAAQ,IAAID;EAAK,CACL,CAAC;AAElB;;AAEA;AACA;AACA;AACA,OAAO,MAAMS,KAAK,GAAGlB,UAAU,CAAEQ,gBAAiB,CAAC;AACnD,eAAeU,KAAK","ignoreList":[]}
|
|
@@ -26,6 +26,23 @@ import { space } from '../utils/space';
|
|
|
26
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
28
|
const noop = () => {};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Computes the value that `RangeControl` should reset to when pressing
|
|
32
|
+
* the reset button.
|
|
33
|
+
*/
|
|
34
|
+
function computeResetValue({
|
|
35
|
+
resetFallbackValue,
|
|
36
|
+
initialPosition
|
|
37
|
+
}) {
|
|
38
|
+
if (resetFallbackValue !== undefined) {
|
|
39
|
+
return !Number.isNaN(resetFallbackValue) ? resetFallbackValue : null;
|
|
40
|
+
}
|
|
41
|
+
if (initialPosition !== undefined) {
|
|
42
|
+
return !Number.isNaN(initialPosition) ? initialPosition : null;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
29
46
|
function UnforwardedRangeControl(props, forwardedRef) {
|
|
30
47
|
const {
|
|
31
48
|
__nextHasNoMarginBottom = false,
|
|
@@ -124,12 +141,10 @@ function UnforwardedRangeControl(props, forwardedRef) {
|
|
|
124
141
|
}
|
|
125
142
|
};
|
|
126
143
|
const handleOnReset = () => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if
|
|
130
|
-
|
|
131
|
-
onChangeResetValue = undefined;
|
|
132
|
-
}
|
|
144
|
+
// Reset to `resetFallbackValue` if defined, otherwise set internal value
|
|
145
|
+
// to `null` — which, if propagated to the `value` prop, will cause
|
|
146
|
+
// the value to be reset to the `initialPosition` prop if defined.
|
|
147
|
+
const resetValue = Number.isNaN(resetFallbackValue) ? null : resetFallbackValue !== null && resetFallbackValue !== void 0 ? resetFallbackValue : null;
|
|
133
148
|
setValue(resetValue);
|
|
134
149
|
|
|
135
150
|
/**
|
|
@@ -145,7 +160,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
|
|
|
145
160
|
* preserve the undefined callback argument, except when a
|
|
146
161
|
* resetFallbackValue is defined.
|
|
147
162
|
*/
|
|
148
|
-
onChange(
|
|
163
|
+
onChange(resetValue !== null && resetValue !== void 0 ? resetValue : undefined);
|
|
149
164
|
};
|
|
150
165
|
const handleShowTooltip = () => setShowTooltip(true);
|
|
151
166
|
const handleHideTooltip = () => setShowTooltip(false);
|
|
@@ -164,6 +179,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
|
|
|
164
179
|
};
|
|
165
180
|
return /*#__PURE__*/_jsx(BaseControl, {
|
|
166
181
|
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
182
|
+
__associatedWPComponentName: "RangeControl",
|
|
167
183
|
className: classes,
|
|
168
184
|
label: label,
|
|
169
185
|
hideLabelFromVision: hideLabelFromVision,
|
|
@@ -259,8 +275,15 @@ function UnforwardedRangeControl(props, forwardedRef) {
|
|
|
259
275
|
className: "components-range-control__reset"
|
|
260
276
|
// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.
|
|
261
277
|
,
|
|
262
|
-
accessibleWhenDisabled: !disabled
|
|
263
|
-
|
|
278
|
+
accessibleWhenDisabled: !disabled
|
|
279
|
+
// The reset button should be disabled if RangeControl itself is disabled,
|
|
280
|
+
// or if the current `value` is equal to the value that would be currently
|
|
281
|
+
// assigned when clicking the button.
|
|
282
|
+
,
|
|
283
|
+
disabled: disabled || value === computeResetValue({
|
|
284
|
+
resetFallbackValue,
|
|
285
|
+
initialPosition
|
|
286
|
+
}),
|
|
264
287
|
variant: "secondary",
|
|
265
288
|
size: "small",
|
|
266
289
|
onClick: handleOnReset,
|