@wordpress/components 28.5.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 +82 -0
- 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/base-control/index.js +54 -41
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/types.js.map +1 -1
- package/build/border-control/styles.js +13 -13
- package/build/border-control/styles.js.map +1 -1
- package/build/checkbox-control/index.js +1 -0
- package/build/checkbox-control/index.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +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/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/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/date-time/time/index.js +11 -3
- package/build/date-time/time/index.js.map +1 -1
- 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/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/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 +5 -6
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/types.js.map +1 -1
- package/build/radio-control/index.js +20 -19
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-group/radio.js +3 -2
- package/build/radio-group/radio.js.map +1 -1
- package/build/range-control/index.js +32 -9
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +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 +1 -0
- package/build/select-control/index.js.map +1 -1
- package/build/tab-panel/index.js +3 -2
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +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 +1 -0
- package/build/text-control/index.js.map +1 -1
- package/build/textarea-control/index.js +1 -0
- package/build/textarea-control/index.js.map +1 -1
- package/build/textarea-control/styles/textarea-control-styles.js +8 -2
- package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build/toggle-control/index.js +9 -1
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +3 -2
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/tools-panel/styles.js +13 -13
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tooltip/index.js +3 -2
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-select/index.js +19 -6
- package/build/tree-select/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +7 -7
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/config-values.js +4 -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/base-control/index.js +54 -42
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/types.js.map +1 -1
- package/build-module/border-control/styles.js +13 -13
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -0
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +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/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/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/date-time/time/index.js +11 -3
- package/build-module/date-time/time/index.js.map +1 -1
- 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/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/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 +5 -6
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/types.js.map +1 -1
- package/build-module/radio-control/index.js +20 -19
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-group/radio.js +2 -1
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/range-control/index.js +32 -9
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +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 +1 -0
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/tab-panel/index.js +2 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +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 +1 -0
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/textarea-control/index.js +1 -0
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/textarea-control/styles/textarea-control-styles.js +9 -2
- package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
- package/build-module/toggle-control/index.js +9 -1
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +2 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +13 -13
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tooltip/index.js +2 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-select/index.js +19 -6
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +7 -7
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/config-values.js +4 -3
- package/build-module/utils/config-values.js.map +1 -1
- package/build-style/style-rtl.css +19 -9
- package/build-style/style.css +19 -9
- 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/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/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/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.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/types.d.ts +3 -3
- package/build-types/custom-select-control/types.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/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.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/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +2 -2
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +6 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +45 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/query-controls/index.d.ts +1 -1
- package/build-types/query-controls/index.d.ts.map +1 -1
- package/build-types/query-controls/types.d.ts +2 -1
- package/build-types/query-controls/types.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +4 -2
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/tabpanel.d.ts +0 -3
- package/build-types/tabs/tabpanel.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/index.d.ts.map +1 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +4 -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/angle-picker-control/styles/angle-picker-control-styles.tsx +2 -2
- package/src/base-control/README.md +5 -2
- package/src/base-control/index.tsx +61 -41
- package/src/base-control/types.ts +7 -0
- package/src/border-box-control/border-box-control/README.md +7 -0
- package/src/border-control/border-control/README.md +7 -0
- package/src/border-control/styles.ts +1 -1
- package/src/button/README.md +7 -0
- package/src/button/style.scss +2 -2
- package/src/button-group/style.scss +2 -2
- package/src/checkbox-control/index.tsx +1 -0
- package/src/checkbox-control/stories/index.story.tsx +1 -0
- package/src/checkbox-control/test/index.tsx +8 -1
- package/src/circular-option-picker/circular-option-picker-option.tsx +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/types.ts +2 -3
- package/src/color-indicator/style.scss +1 -1
- 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/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/test/index.tsx +125 -0
- package/src/custom-select-control/types.ts +3 -3
- package/src/custom-select-control-v2/custom-select.tsx +2 -1
- package/src/date-time/time/index.tsx +26 -12
- 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 +17 -15
- 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/form-file-upload/README.md +8 -0
- package/src/form-file-upload/types.ts +6 -0
- package/src/form-token-field/README.md +1 -0
- package/src/guide/style.scss +0 -1
- 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/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 +4 -1
- package/src/popover/index.tsx +9 -3
- package/src/popover/style.scss +2 -2
- package/src/popover/test/index.tsx +34 -0
- package/src/private-apis.ts +6 -12
- package/src/progress-bar/styles.ts +2 -2
- package/src/query-controls/README.md +7 -0
- package/src/query-controls/index.tsx +5 -6
- package/src/query-controls/types.ts +2 -1
- package/src/radio-control/index.tsx +28 -20
- package/src/radio-control/style.scss +13 -2
- package/src/radio-control/test/index.tsx +43 -40
- package/src/radio-group/radio.tsx +2 -1
- package/src/range-control/README.md +7 -0
- package/src/range-control/index.tsx +39 -9
- package/src/range-control/stories/index.story.tsx +7 -0
- package/src/range-control/styles/range-control-styles.ts +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 +8 -0
- package/src/select-control/index.tsx +1 -0
- package/src/select-control/stories/index.story.tsx +8 -5
- package/src/select-control/test/select-control.tsx +12 -6
- 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/tabs/index.tsx +2 -1
- package/src/tabs/tablist.tsx +6 -4
- package/src/tabs/tabpanel.tsx +6 -2
- package/src/text/styles.ts +1 -1
- package/src/text-control/README.md +8 -0
- package/src/text-control/index.tsx +1 -0
- package/src/text-control/stories/index.story.tsx +3 -1
- package/src/text-control/test/text-control.tsx +5 -1
- package/src/textarea-control/index.tsx +1 -0
- package/src/textarea-control/stories/index.story.tsx +2 -0
- package/src/textarea-control/styles/textarea-control-styles.ts +75 -2
- package/src/toggle-control/index.tsx +9 -0
- package/src/toggle-control/stories/index.story.tsx +1 -0
- package/src/toggle-control/test/index.tsx +7 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +8 -24
- package/src/toggle-group-control/test/index.tsx +5 -1
- package/src/toggle-group-control/toggle-group-control/README.md +7 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -0
- package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +2 -2
- package/src/toolbar/toolbar/style.scss +2 -2
- package/src/tools-panel/styles.ts +1 -1
- package/src/tooltip/index.tsx +2 -1
- package/src/tooltip/style.scss +1 -1
- package/src/tree-select/index.tsx +16 -5
- package/src/tree-select/stories/index.story.tsx +1 -0
- package/src/unit-control/README.md +7 -0
- package/src/unit-control/styles/unit-control-styles.ts +1 -1
- package/src/utils/config-values.js +4 -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/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/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/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/utils/input/base.js +0 -30
- package/src/utils/input/index.js +0 -1
- package/src/utils/input/input-control.js +0 -63
|
@@ -13,10 +13,6 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
13
13
|
box-sizing: inherit;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.emotion-2 {
|
|
17
|
-
margin-bottom: calc(4px * 2);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
.components-panel__row .emotion-2 {
|
|
21
17
|
margin-bottom: inherit;
|
|
22
18
|
}
|
|
@@ -299,10 +295,6 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
299
295
|
box-sizing: inherit;
|
|
300
296
|
}
|
|
301
297
|
|
|
302
|
-
.emotion-2 {
|
|
303
|
-
margin-bottom: calc(4px * 2);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
298
|
.components-panel__row .emotion-2 {
|
|
307
299
|
margin-bottom: inherit;
|
|
308
300
|
}
|
|
@@ -595,10 +587,6 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
595
587
|
box-sizing: inherit;
|
|
596
588
|
}
|
|
597
589
|
|
|
598
|
-
.emotion-2 {
|
|
599
|
-
margin-bottom: calc(4px * 2);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
590
|
.components-panel__row .emotion-2 {
|
|
603
591
|
margin-bottom: inherit;
|
|
604
592
|
}
|
|
@@ -903,10 +891,6 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
903
891
|
box-sizing: inherit;
|
|
904
892
|
}
|
|
905
893
|
|
|
906
|
-
.emotion-2 {
|
|
907
|
-
margin-bottom: calc(4px * 2);
|
|
908
|
-
}
|
|
909
|
-
|
|
910
894
|
.components-panel__row .emotion-2 {
|
|
911
895
|
margin-bottom: inherit;
|
|
912
896
|
}
|
|
@@ -12,7 +12,11 @@ import { plus } from '@wordpress/icons';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import { DimensionControl } from '../';
|
|
15
|
+
import { DimensionControl as _DimensionControl } from '../';
|
|
16
|
+
|
|
17
|
+
const DimensionControl = ( props ) => {
|
|
18
|
+
return <_DimensionControl { ...props } __nextHasNoMarginBottom />;
|
|
19
|
+
};
|
|
16
20
|
|
|
17
21
|
describe( 'DimensionControl', () => {
|
|
18
22
|
const onChangeHandler = jest.fn();
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { IconType } from '../icon';
|
|
5
|
+
import type { SelectControlProps } from '../select-control/types';
|
|
5
6
|
|
|
6
7
|
export type Size = {
|
|
7
8
|
/**
|
|
@@ -14,7 +15,10 @@ export type Size = {
|
|
|
14
15
|
slug: string;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
export type DimensionControlProps =
|
|
18
|
+
export type DimensionControlProps = Pick<
|
|
19
|
+
SelectControlProps,
|
|
20
|
+
'__next40pxDefaultSize' | '__nextHasNoMarginBottom'
|
|
21
|
+
> & {
|
|
18
22
|
/**
|
|
19
23
|
* Label for the control.
|
|
20
24
|
*/
|
|
@@ -45,10 +49,4 @@ export type DimensionControlProps = {
|
|
|
45
49
|
* @default ''
|
|
46
50
|
*/
|
|
47
51
|
className?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Start opting into the larger default height that will become the default size in a future version.
|
|
50
|
-
*
|
|
51
|
-
* @default false
|
|
52
|
-
*/
|
|
53
|
-
__next40pxDefaultSize?: boolean;
|
|
54
52
|
};
|
package/src/drop-zone/style.scss
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import * as Ariakit from '@ariakit/react';
|
|
5
|
+
import { useStoreState } from '@ariakit/react';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -248,9 +249,10 @@ const UnconnectedDropdownMenu = (
|
|
|
248
249
|
);
|
|
249
250
|
|
|
250
251
|
// Extract the side from the applied placement — useful for animations.
|
|
251
|
-
const appliedPlacementSide =
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
const appliedPlacementSide = useStoreState(
|
|
253
|
+
dropdownMenuStore,
|
|
254
|
+
'placement'
|
|
255
|
+
).split( '-' )[ 0 ];
|
|
254
256
|
|
|
255
257
|
if (
|
|
256
258
|
dropdownMenuStore.parent &&
|
|
@@ -25,13 +25,15 @@ const ITEM_PADDING_BLOCK = space( 2 );
|
|
|
25
25
|
const ITEM_PADDING_INLINE = space( 3 );
|
|
26
26
|
|
|
27
27
|
// TODO:
|
|
28
|
-
// -
|
|
29
|
-
// -
|
|
30
|
-
// -
|
|
31
|
-
const DEFAULT_BORDER_COLOR = COLORS.gray[ 300 ];
|
|
32
|
-
const DIVIDER_COLOR = COLORS.gray[ 200 ];
|
|
33
|
-
const
|
|
34
|
-
const
|
|
28
|
+
// - border color and divider color are different from COLORS.theme variables
|
|
29
|
+
// - lighter text color is not defined in COLORS.theme, should it be?
|
|
30
|
+
// - lighter background color is not defined in COLORS.theme, should it be?
|
|
31
|
+
const DEFAULT_BORDER_COLOR = COLORS.theme.gray[ 300 ];
|
|
32
|
+
const DIVIDER_COLOR = COLORS.theme.gray[ 200 ];
|
|
33
|
+
const LIGHTER_TEXT_COLOR = COLORS.theme.gray[ 700 ];
|
|
34
|
+
const LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[ 100 ];
|
|
35
|
+
const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground;
|
|
36
|
+
const DEFAULT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ DEFAULT_BORDER_COLOR }, ${ CONFIG.elevationXSmall }`;
|
|
35
37
|
const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VARIANT_BORDER_COLOR }`;
|
|
36
38
|
|
|
37
39
|
const GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';
|
|
@@ -87,7 +89,7 @@ export const DropdownMenu = styled( Ariakit.Menu )<
|
|
|
87
89
|
padding: ${ CONTENT_WRAPPER_PADDING };
|
|
88
90
|
|
|
89
91
|
background-color: ${ COLORS.ui.background };
|
|
90
|
-
border-radius:
|
|
92
|
+
border-radius: ${ CONFIG.radiusMedium };
|
|
91
93
|
${ ( props ) => css`
|
|
92
94
|
box-shadow: ${ props.variant === 'toolbar'
|
|
93
95
|
? TOOLBAR_VARIANT_BOX_SHADOW
|
|
@@ -149,8 +151,8 @@ const baseItem = css`
|
|
|
149
151
|
font-weight: normal;
|
|
150
152
|
line-height: 20px;
|
|
151
153
|
|
|
152
|
-
color: ${ COLORS.
|
|
153
|
-
border-radius: ${ CONFIG.
|
|
154
|
+
color: ${ COLORS.theme.foreground };
|
|
155
|
+
border-radius: ${ CONFIG.radiusSmall };
|
|
154
156
|
|
|
155
157
|
padding-block: ${ ITEM_PADDING_BLOCK };
|
|
156
158
|
padding-inline: ${ ITEM_PADDING_INLINE };
|
|
@@ -193,8 +195,8 @@ const baseItem = css`
|
|
|
193
195
|
|
|
194
196
|
/* When the item is the trigger of an open submenu */
|
|
195
197
|
${ DropdownMenu }:not(:focus) &:not(:focus)[aria-expanded="true"] {
|
|
196
|
-
background-color: ${
|
|
197
|
-
color: ${ COLORS.
|
|
198
|
+
background-color: ${ LIGHT_BACKGROUND_COLOR };
|
|
199
|
+
color: ${ COLORS.theme.foreground };
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
svg {
|
|
@@ -238,7 +240,7 @@ export const ItemPrefixWrapper = styled.span`
|
|
|
238
240
|
align-items: center;
|
|
239
241
|
justify-content: center;
|
|
240
242
|
|
|
241
|
-
color: ${
|
|
243
|
+
color: ${ LIGHTER_TEXT_COLOR };
|
|
242
244
|
|
|
243
245
|
/*
|
|
244
246
|
* When the parent menu item is active, except when it's a non-focused/hovered
|
|
@@ -284,7 +286,7 @@ export const ItemSuffixWrapper = styled.span`
|
|
|
284
286
|
justify-content: center;
|
|
285
287
|
gap: ${ space( 3 ) };
|
|
286
288
|
|
|
287
|
-
color: ${
|
|
289
|
+
color: ${ LIGHTER_TEXT_COLOR };
|
|
288
290
|
|
|
289
291
|
/*
|
|
290
292
|
* When the parent menu item is active, except when it's a non-focused/hovered
|
|
@@ -343,7 +345,7 @@ export const DropdownMenuItemLabel = styled( Truncate )`
|
|
|
343
345
|
export const DropdownMenuItemHelpText = styled( Truncate )`
|
|
344
346
|
font-size: ${ font( 'helpText.fontSize' ) };
|
|
345
347
|
line-height: 16px;
|
|
346
|
-
color: ${
|
|
348
|
+
color: ${ LIGHTER_TEXT_COLOR };
|
|
347
349
|
word-break: break-all;
|
|
348
350
|
|
|
349
351
|
[data-active-item]:not( [data-focus-visible] ) *:not( ${ DropdownMenu } ) &,
|
|
@@ -100,10 +100,18 @@ Callback which is called at the start of drag operations.
|
|
|
100
100
|
|
|
101
101
|
Function which is called before internal updates to the value state. It receives the upcoming value and may return a modified one.
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
### `__next40pxDefaultSize`
|
|
104
|
+
|
|
105
|
+
- Type: `Boolean`
|
|
106
|
+
- Required: No
|
|
107
|
+
- Default: `false`
|
|
104
108
|
|
|
105
109
|
Start opting into the new margin-free styles that will become the default in a future version.
|
|
106
110
|
|
|
111
|
+
### `__nextHasNoMarginBottom`
|
|
112
|
+
|
|
107
113
|
- Type: `Boolean`
|
|
108
114
|
- Required: No
|
|
109
115
|
- Default: `false`
|
|
116
|
+
|
|
117
|
+
Start opting into the new margin-free styles that will become the default in a future version.
|
|
@@ -23,7 +23,6 @@ const noop = () => {};
|
|
|
23
23
|
|
|
24
24
|
export default function FocalPointPickerControls( {
|
|
25
25
|
__nextHasNoMarginBottom,
|
|
26
|
-
__next40pxDefaultSize,
|
|
27
26
|
hasHelpText,
|
|
28
27
|
onChange = noop,
|
|
29
28
|
point = {
|
|
@@ -57,7 +56,6 @@ export default function FocalPointPickerControls( {
|
|
|
57
56
|
gap={ 4 }
|
|
58
57
|
>
|
|
59
58
|
<FocalPointUnitControl
|
|
60
|
-
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
61
59
|
label={ __( 'Left' ) }
|
|
62
60
|
aria-label={ __( 'Focal point left position' ) }
|
|
63
61
|
value={ [ valueX, '%' ].join( '' ) }
|
|
@@ -71,7 +69,6 @@ export default function FocalPointPickerControls( {
|
|
|
71
69
|
dragDirection="e"
|
|
72
70
|
/>
|
|
73
71
|
<FocalPointUnitControl
|
|
74
|
-
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
75
72
|
label={ __( 'Top' ) }
|
|
76
73
|
aria-label={ __( 'Focal point top position' ) }
|
|
77
74
|
value={ [ valueY, '%' ].join( '' ) }
|
|
@@ -91,6 +88,7 @@ export default function FocalPointPickerControls( {
|
|
|
91
88
|
function FocalPointUnitControl( props: UnitControlProps ) {
|
|
92
89
|
return (
|
|
93
90
|
<StyledUnitControl
|
|
91
|
+
__next40pxDefaultSize
|
|
94
92
|
className="focal-point-picker__controls-position-unit-control"
|
|
95
93
|
labelPosition="top"
|
|
96
94
|
max={ TEXTCONTROL_MAX }
|
|
@@ -85,7 +85,6 @@ const GRID_OVERLAY_TIMEOUT = 600;
|
|
|
85
85
|
*/
|
|
86
86
|
export function FocalPointPicker( {
|
|
87
87
|
__nextHasNoMarginBottom,
|
|
88
|
-
__next40pxDefaultSize = false,
|
|
89
88
|
autoPlay = true,
|
|
90
89
|
className,
|
|
91
90
|
help,
|
|
@@ -251,6 +250,7 @@ export function FocalPointPicker( {
|
|
|
251
250
|
<BaseControl
|
|
252
251
|
{ ...restProps }
|
|
253
252
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
253
|
+
__associatedWPComponentName="FocalPointPicker"
|
|
254
254
|
label={ label }
|
|
255
255
|
id={ id }
|
|
256
256
|
help={ help }
|
|
@@ -285,7 +285,6 @@ export function FocalPointPicker( {
|
|
|
285
285
|
</MediaWrapper>
|
|
286
286
|
<Controls
|
|
287
287
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
288
|
-
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
289
288
|
hasHelpText={ !! help }
|
|
290
289
|
point={ { x, y } }
|
|
291
290
|
onChange={ ( value ) => {
|
|
@@ -22,7 +22,7 @@ export const MediaWrapper = styled.div`
|
|
|
22
22
|
|
|
23
23
|
export const MediaContainer = styled.div`
|
|
24
24
|
align-items: center;
|
|
25
|
-
border-radius: ${ CONFIG.
|
|
25
|
+
border-radius: ${ CONFIG.radiusSmall };
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
display: inline-flex;
|
|
28
28
|
justify-content: center;
|
|
@@ -7,12 +7,16 @@ import userEvent from '@testing-library/user-event';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
10
|
+
import _Picker from '..';
|
|
11
11
|
import type { FocalPointPickerProps } from '../types';
|
|
12
12
|
|
|
13
13
|
type Log = { name: string; args: unknown[] };
|
|
14
14
|
type EventLogger = ( name: string, args: unknown[] ) => void;
|
|
15
15
|
|
|
16
|
+
const Picker = ( props: React.ComponentProps< typeof _Picker > ) => {
|
|
17
|
+
return <_Picker { ...props } __nextHasNoMarginBottom />;
|
|
18
|
+
};
|
|
19
|
+
|
|
16
20
|
const props: FocalPointPickerProps = {
|
|
17
21
|
onChange: jest.fn(),
|
|
18
22
|
url: 'test-url',
|
|
@@ -29,7 +29,8 @@ export type FocalPointPickerProps = Pick<
|
|
|
29
29
|
/**
|
|
30
30
|
* Start opting into the larger default height that will become the default size in a future version.
|
|
31
31
|
*
|
|
32
|
-
* @
|
|
32
|
+
* @deprecated Default behavior since WP 6.7. Prop can be safely removed.
|
|
33
|
+
* @ignore
|
|
33
34
|
*/
|
|
34
35
|
__next40pxDefaultSize?: boolean;
|
|
35
36
|
/**
|
|
@@ -68,7 +69,6 @@ export type FocalPointPickerProps = Pick<
|
|
|
68
69
|
|
|
69
70
|
export type FocalPointPickerControlsProps = {
|
|
70
71
|
__nextHasNoMarginBottom?: boolean;
|
|
71
|
-
__next40pxDefaultSize?: boolean;
|
|
72
72
|
/**
|
|
73
73
|
* A bit of extra bottom margin will be added if a `help` text
|
|
74
74
|
* needs to be rendered under it.
|
|
@@ -113,3 +113,10 @@ If `true`, a slider will be displayed alongside the input field when a custom fo
|
|
|
113
113
|
|
|
114
114
|
- Required: no
|
|
115
115
|
- Default: `false`
|
|
116
|
+
|
|
117
|
+
### `__next40pxDefaultSize`: `boolean`
|
|
118
|
+
|
|
119
|
+
Start opting into the larger default height that will become the default size in a future version.
|
|
120
|
+
|
|
121
|
+
- Required: No
|
|
122
|
+
- Default: `false`
|
|
@@ -85,3 +85,11 @@ Optional callback function used to render the UI. If passed, the component does
|
|
|
85
85
|
|
|
86
86
|
- Type: `Function`
|
|
87
87
|
- Required: No
|
|
88
|
+
|
|
89
|
+
### __next40pxDefaultSize
|
|
90
|
+
|
|
91
|
+
Start opting into the larger default height that will become the default size in a future version.
|
|
92
|
+
|
|
93
|
+
- Type: `Boolean`
|
|
94
|
+
- Required: No
|
|
95
|
+
- Default: `false`
|
|
@@ -10,6 +10,12 @@ import type Icon from '../icon';
|
|
|
10
10
|
|
|
11
11
|
// TODO: Replace `children` and `icon` types with props from Button once Button is typed.
|
|
12
12
|
export type FormFileUploadProps = {
|
|
13
|
+
/**
|
|
14
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
__next40pxDefaultSize?: boolean;
|
|
13
19
|
/**
|
|
14
20
|
* A string passed to `input` element that tells the browser which file types can be
|
|
15
21
|
* upload to the upload by the user use. e.g: `image/*,video/*`.
|
|
@@ -61,6 +61,7 @@ The `value` property is handled in a manner similar to controlled form component
|
|
|
61
61
|
- `__experimentalShowHowTo` - If false, the text on how to use the select (ie: _Separate with commas or the Enter key._) will be hidden.
|
|
62
62
|
- `__experimentalValidateInput` - If passed, all introduced values will be validated before being added as tokens.
|
|
63
63
|
- `__experimentalAutoSelectFirstMatch` - If true, the select the first matching suggestion when the user presses the Enter key (or space when tokenizeOnSpace is true).
|
|
64
|
+
- `__next40pxDefaultSize` - Start opting into the larger default height that will become the default size in a future version.
|
|
64
65
|
- `__nextHasNoMarginBottom` - Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.)
|
|
65
66
|
- `tokenizeOnBlur` - If true, add any incompleteTokenValue as a new token when the field loses focus.
|
|
66
67
|
|
package/src/guide/style.scss
CHANGED
package/src/index.ts
CHANGED
|
@@ -61,7 +61,7 @@ export {
|
|
|
61
61
|
CompositeGroup as __unstableCompositeGroup,
|
|
62
62
|
CompositeItem as __unstableCompositeItem,
|
|
63
63
|
useCompositeState as __unstableUseCompositeState,
|
|
64
|
-
} from './composite';
|
|
64
|
+
} from './composite/legacy';
|
|
65
65
|
export { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';
|
|
66
66
|
export { default as CustomSelectControl } from './custom-select-control';
|
|
67
67
|
export { default as Dashicon } from './dashicon';
|
|
@@ -107,3 +107,11 @@ The current value of the input.
|
|
|
107
107
|
|
|
108
108
|
- Type: `String`
|
|
109
109
|
- Required: No
|
|
110
|
+
|
|
111
|
+
### __next40pxDefaultSize
|
|
112
|
+
|
|
113
|
+
Start opting into the larger default height that will become the default size in a future version.
|
|
114
|
+
|
|
115
|
+
- Type: `Boolean`
|
|
116
|
+
- Required: No
|
|
117
|
+
- Default: `false`
|
package/src/item-group/styles.ts
CHANGED
package/src/modal/style.scss
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
margin: $grid-unit-50 0 0 0;
|
|
21
21
|
width: 100%;
|
|
22
22
|
background: $white;
|
|
23
|
-
box-shadow: $
|
|
24
|
-
border-radius: $
|
|
23
|
+
box-shadow: $elevation-large;
|
|
24
|
+
border-radius: $radius-large $radius-large 0 0;
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
// Have the content element fill the vertical space yet not overflow.
|
|
27
27
|
display: flex;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
// Show a centered modal on bigger screens.
|
|
34
34
|
@include break-small() {
|
|
35
|
-
border-radius: $
|
|
35
|
+
border-radius: $radius-large;
|
|
36
36
|
margin: auto;
|
|
37
37
|
width: auto;
|
|
38
38
|
min-width: $modal-min-width;
|
|
@@ -10,31 +10,27 @@ import type { WordPressComponentProps } from '../../context';
|
|
|
10
10
|
import { useContextSystem } from '../../context';
|
|
11
11
|
import Button from '../../button';
|
|
12
12
|
import useNavigator from '../use-navigator';
|
|
13
|
-
import type {
|
|
13
|
+
import type { NavigatorBackButtonProps } from '../types';
|
|
14
14
|
|
|
15
15
|
export function useNavigatorBackButton(
|
|
16
|
-
props: WordPressComponentProps<
|
|
16
|
+
props: WordPressComponentProps< NavigatorBackButtonProps, 'button' >
|
|
17
17
|
) {
|
|
18
18
|
const {
|
|
19
19
|
onClick,
|
|
20
20
|
as = Button,
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
...otherProps
|
|
23
23
|
} = useContextSystem( props, 'NavigatorBackButton' );
|
|
24
24
|
|
|
25
|
-
const { goBack
|
|
25
|
+
const { goBack } = useNavigator();
|
|
26
26
|
const handleClick: React.MouseEventHandler< HTMLButtonElement > =
|
|
27
27
|
useCallback(
|
|
28
28
|
( e ) => {
|
|
29
29
|
e.preventDefault();
|
|
30
|
-
|
|
31
|
-
goToParent();
|
|
32
|
-
} else {
|
|
33
|
-
goBack();
|
|
34
|
-
}
|
|
30
|
+
goBack();
|
|
35
31
|
onClick?.( e );
|
|
36
32
|
},
|
|
37
|
-
[
|
|
33
|
+
[ goBack, onClick ]
|
|
38
34
|
);
|
|
39
35
|
|
|
40
36
|
return {
|
|
@@ -10,38 +10,42 @@ The `NavigatorProvider` component allows rendering nested views/panels/menus (vi
|
|
|
10
10
|
|
|
11
11
|
```jsx
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
__experimentalNavigatorProvider as NavigatorProvider,
|
|
14
|
+
__experimentalNavigatorScreen as NavigatorScreen,
|
|
15
|
+
__experimentalNavigatorButton as NavigatorButton,
|
|
16
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
18
|
|
|
19
19
|
const MyNavigation = () => (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</NavigatorScreen>
|
|
34
|
-
</NavigatorProvider>
|
|
20
|
+
<NavigatorProvider initialPath="/">
|
|
21
|
+
<NavigatorScreen path="/">
|
|
22
|
+
<p>This is the home screen.</p>
|
|
23
|
+
<NavigatorButton path="/child">
|
|
24
|
+
Navigate to child screen.
|
|
25
|
+
</NavigatorButton>
|
|
26
|
+
</NavigatorScreen>
|
|
27
|
+
|
|
28
|
+
<NavigatorScreen path="/child">
|
|
29
|
+
<p>This is the child screen.</p>
|
|
30
|
+
<NavigatorBackButton>Go back</NavigatorBackButton>
|
|
31
|
+
</NavigatorScreen>
|
|
32
|
+
</NavigatorProvider>
|
|
35
33
|
);
|
|
36
34
|
```
|
|
35
|
+
|
|
37
36
|
**Important note**
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
`Navigator` assumes that screens are organized hierarchically according to their `path`, which should follow a URL-like scheme where each path segment starts with and is separated by the `/` character.
|
|
39
|
+
|
|
40
|
+
`Navigator` will treat "back" navigations as going to the parent screen — it is therefore responsibility of the consumer of the component to create the correct screen hierarchy.
|
|
41
|
+
|
|
40
42
|
For example:
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
43
|
+
|
|
44
|
+
- `/` is the root of all paths. There should always be a screen with `path="/"`.
|
|
45
|
+
- `/parent/child` is a child of `/parent`.
|
|
46
|
+
- `/parent/child/grand-child` is a child of `/parent/child`.
|
|
47
|
+
- `/parent/:param` is a child of `/parent` as well.
|
|
48
|
+
- if the current screen has a `path` with value `/parent/child/grand-child`, when going "back" `Navigator` will try to recursively navigate the path hierarchy until a matching screen (or the root `/`) is found.
|
|
45
49
|
|
|
46
50
|
## Props
|
|
47
51
|
|
|
@@ -65,28 +69,26 @@ The `goTo` function allows navigating to a given path. The second argument can a
|
|
|
65
69
|
|
|
66
70
|
The available options are:
|
|
67
71
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
- `focusTargetSelector`: `string`. An optional property used to specify the CSS selector used to restore focus on the matching element when navigating back;
|
|
73
|
+
- `isBack`: `boolean`. An optional property used to specify whether the navigation should be considered as backwards (thus enabling focus restoration when possible, and causing the animation to be backwards too);
|
|
74
|
+
- `skipFocus`: `boolean`. An optional property used to opt out of `Navigator`'s focus management, useful when the consumer of the component wants to manage focus themselves;
|
|
75
|
+
- `replace`: `boolean`. An optional property used to cause the new location to replace the current location in the stack.
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
### `goBack`: `( path: string, options: NavigateOptions ) => void`
|
|
74
78
|
|
|
75
|
-
Parent/child navigation only works if the
|
|
79
|
+
The `goBack` function allows navigating to the parent screen. Parent/child navigation only works if the paths you define are hierarchical (see note above).
|
|
76
80
|
|
|
77
81
|
When a match is not found, the function will try to recursively navigate the path hierarchy until a matching screen (or the root `/`) are found.
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
The `goBack` function allows navigating to the previous path.
|
|
83
|
+
The available options are the same as for the `goTo` method, except for the `isBack` property, which is not available for the `goBack` method.
|
|
82
84
|
|
|
83
85
|
### `location`: `NavigatorLocation`
|
|
84
86
|
|
|
85
87
|
The `location` object represent the current location, and has a few properties:
|
|
86
88
|
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
89
|
+
- `path`: `string`. The path associated to the location.
|
|
90
|
+
- `isBack`: `boolean`. A flag that is `true` when the current location was reached by navigating backwards in the location history.
|
|
91
|
+
- `isInitial`: `boolean`. A flag that is `true` only for the first (root) location in the location history.
|
|
90
92
|
|
|
91
93
|
### `params`: `Record< string, string | string[] >`
|
|
92
94
|
|