@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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,115 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 28.6.0 (2024-08-21)
|
|
6
|
+
|
|
7
|
+
### Deprecations
|
|
8
|
+
|
|
9
|
+
- Deprecate bottom margin on the following `BaseControl`-based components. Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version ([#64408](https://github.com/WordPress/gutenberg/pull/64408)).
|
|
10
|
+
- `BaseControl`
|
|
11
|
+
- `CheckboxControl`
|
|
12
|
+
- `ComboboxControl`
|
|
13
|
+
- `DimensionControl`
|
|
14
|
+
- `FocalPointPicker`
|
|
15
|
+
- `RangeControl`
|
|
16
|
+
- `SearchControl`
|
|
17
|
+
- `SelectControl`
|
|
18
|
+
- `TextControl`
|
|
19
|
+
- `TextareaControl`
|
|
20
|
+
- `ToggleControl`
|
|
21
|
+
- `ToggleGroupControl`
|
|
22
|
+
- `TreeSelect`
|
|
23
|
+
- Deprecate `NavigatorToParentButton` and `useNavigator().goToParent()` in favor of `NavigatorBackButton` and `useNavigator().goBack()` ([#63317](https://github.com/WordPress/gutenberg/pull/63317)).
|
|
24
|
+
|
|
25
|
+
### Enhancements
|
|
26
|
+
|
|
27
|
+
- `Placeholder`: Temporarily rewind radius scale ([#64672](https://github.com/WordPress/gutenberg/pull/64672)).
|
|
28
|
+
- `Composite`: improve Storybook examples and add interactive controls ([#64397](https://github.com/WordPress/gutenberg/pull/64397)).
|
|
29
|
+
- `Composite`: use internal context to forward the composite store to sub-components ([#64493](https://github.com/WordPress/gutenberg/pull/64493)).
|
|
30
|
+
- `QueryControls`: Default to new 40px size ([#64457](https://github.com/WordPress/gutenberg/pull/64457)).
|
|
31
|
+
- `TimePicker`: add `hideLabelFromVision` prop ([#64267](https://github.com/WordPress/gutenberg/pull/64267)).
|
|
32
|
+
- `FocalPointPicker`: Default to new 40px size ([#64456](https://github.com/WordPress/gutenberg/pull/64456)).
|
|
33
|
+
- `DropdownMenuV2`: adopt elevation scale ([#64432](https://github.com/WordPress/gutenberg/pull/64432)).
|
|
34
|
+
- `AlignmentMatrixControl`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
35
|
+
- `AnglePickerControl`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
36
|
+
- `BorderControl`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
37
|
+
- `ButtonGroup`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
38
|
+
- `Button`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
39
|
+
- `CircularOptionPicker`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
40
|
+
- `ColorIndicator`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
41
|
+
- `ColorPalette`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
42
|
+
- `CustomGradientPicker`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
43
|
+
- `DropZone`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
44
|
+
- `DropdownMenuV2`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
45
|
+
- `FocalPointPicker`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
46
|
+
- `Guide`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
47
|
+
- `Modal`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
48
|
+
- `Placeholder`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
49
|
+
- `Popover`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
50
|
+
- `ProgressBar`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
51
|
+
- `RadioControl`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
52
|
+
- `Snackbar`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
53
|
+
- `TabPanel`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
54
|
+
- `Text`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
55
|
+
- `ToggleGroupControl`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
56
|
+
- `ToolbarGroup`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
57
|
+
- `Toolbar`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
58
|
+
- `Tooltip`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
59
|
+
- `UnitControl`: Adopt radius scale ([#64368](https://github.com/WordPress/gutenberg/pull/64368)).
|
|
60
|
+
- `Popover`: allow `style` prop usage ([#64489](https://github.com/WordPress/gutenberg/pull/64489)).
|
|
61
|
+
- `ToolsPanel`: sets column-gap to 16px for ToolsPanel grid ([#64497](https://github.com/WordPress/gutenberg/pull/64497)).
|
|
62
|
+
- `Modal`: Replace references to deprecated styling variables ([#64655](https://github.com/WordPress/gutenberg/pull/64655)).
|
|
63
|
+
- `Popover`: Replace references to deprecated styling variables ([#64655](https://github.com/WordPress/gutenberg/pull/64655)).
|
|
64
|
+
- `Snackbar`: Replace references to deprecated styling variables ([#64655](https://github.com/WordPress/gutenberg/pull/64655)).
|
|
65
|
+
- `TextareaControl`: Update styles ([#64586](https://github.com/WordPress/gutenberg/pull/64586)).
|
|
66
|
+
- `CircularOptionPicker`: Update hard-coded border-width value ([#64680](https://github.com/WordPress/gutenberg/pull/64680)).
|
|
67
|
+
- `CustomGradientPicker`: Update hard-coded border-width value ([#64680](https://github.com/WordPress/gutenberg/pull/64680)).
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
- `RangeControl`: disable reset button when the current value is equal to the reset value ([#64579](https://github.com/WordPress/gutenberg/pull/64579)).
|
|
72
|
+
- `RangeControl`: tweak mark and label absolute positioning ([#64487](https://github.com/WordPress/gutenberg/pull/64487)).
|
|
73
|
+
- `RadioGroup`: use fieldset and legend to group radio inputs ([#64582](https://github.com/WordPress/gutenberg/pull/64582)).
|
|
74
|
+
|
|
75
|
+
### Internal
|
|
76
|
+
|
|
77
|
+
- `Composite` v2: add `Hover` and `Typeahead` subcomponents ([#64399](https://github.com/WordPress/gutenberg/pull/64399)).
|
|
78
|
+
- `Composite` v2: add focus-related props to `Composite`and`Composite.Item` subcomponents ([#64450](https://github.com/WordPress/gutenberg/pull/64450)).
|
|
79
|
+
- `Composite` v2: add `Context` subcomponent ([#64493](https://github.com/WordPress/gutenberg/pull/64493)).
|
|
80
|
+
- `DropdownMenu` v2: use themed color variables ([#64647](https://github.com/WordPress/gutenberg/pull/64647)).
|
|
81
|
+
- `CustomSelectControl`: Improve type inferring ([#64412](https://github.com/WordPress/gutenberg/pull/64412)).
|
|
82
|
+
- Update `ariakit` to version `0.4.10` ([#64637](https://github.com/WordPress/gutenberg/pull/64637)).
|
|
83
|
+
- Ariakit: Use `useStoreState()` instead of `store.useState()` ([#64648](https://github.com/WordPress/gutenberg/pull/64648)).
|
|
84
|
+
|
|
85
|
+
## 28.5.0 (2024-08-07)
|
|
86
|
+
|
|
87
|
+
### Bug Fixes
|
|
88
|
+
|
|
89
|
+
- `ColorPalette`: Remove extra bottom margin when `CircularOptionPicker` is unneeded ([#63961](https://github.com/WordPress/gutenberg/pull/63961)).
|
|
90
|
+
- `CustomSelectControl`: Restore `describedBy` functionality ([#63957](https://github.com/WordPress/gutenberg/pull/63957)).
|
|
91
|
+
- `Button`: Improve the aria-disabled focus style ([#62480](https://github.com/WordPress/gutenberg/pull/62480)).
|
|
92
|
+
- `Modal`: Fix the dismissal logic for React development mode ([#64132](https://github.com/WordPress/gutenberg/pull/64132)).
|
|
93
|
+
- `Button`: Fix tertiary destructive hover style ([#64152](https://github.com/WordPress/gutenberg/pull/64152)).
|
|
94
|
+
- `Autocompleter UI`: Fix text color when hovering selected item ([#64294](https://github.com/WordPress/gutenberg/pull/64294)).
|
|
95
|
+
- `Heading`: Add the missing `size` prop to the component's props type ([#64299](https://github.com/WordPress/gutenberg/pull/64299)).
|
|
96
|
+
- `TextControl`: Fix the padding of the component to be consistent with the rest of the controls. ([#64326](https://github.com/WordPress/gutenberg/pull/64326)).
|
|
97
|
+
|
|
98
|
+
### Enhancements
|
|
99
|
+
|
|
100
|
+
- `ColorPalette`: partial support of `color-mix()` CSS colors ([#64224](https://github.com/WordPress/gutenberg/pull/64224)).
|
|
101
|
+
- `TimeInput`: Expose as subcomponent of `TimePicker` ([#63145](https://github.com/WordPress/gutenberg/pull/63145)).
|
|
102
|
+
- `RadioControl`: add support for option help text ([#63751](https://github.com/WordPress/gutenberg/pull/63751)).
|
|
103
|
+
- `SelectControl`: Infer `value` type from `options` ([#64069](https://github.com/WordPress/gutenberg/pull/64069)).
|
|
104
|
+
- `Guide`: Add `__next40pxDefaultSize` to buttons ([#64181](https://github.com/WordPress/gutenberg/pull/64181)).
|
|
105
|
+
- `SelectControl`: Pass through `options` props ([#64211](https://github.com/WordPress/gutenberg/pull/64211)).
|
|
106
|
+
- `DimensionControl`: Add `__nextHasNoMarginBottom` prop to remove bottom margin ([#64346](https://github.com/WordPress/gutenberg/pull/64346)).
|
|
107
|
+
|
|
108
|
+
### Internal
|
|
109
|
+
|
|
110
|
+
- Upgraded `@ariakit/react` (v0.4.7) and `@ariakit/test` (v0.4.0) ([#64066](https://github.com/WordPress/gutenberg/pull/64066)).
|
|
111
|
+
- `DropdownMenuV2`: break menu item help text on multiple lines for better truncation. ([#63916](https://github.com/WordPress/gutenberg/pull/63916)).
|
|
112
|
+
- `CustomSelectControl`: Support generic props type ([#63985](https://github.com/WordPress/gutenberg/pull/63985)).
|
|
113
|
+
|
|
5
114
|
## 28.4.0 (2024-07-24)
|
|
6
115
|
|
|
7
116
|
### Deprecations
|
|
@@ -10,9 +119,11 @@
|
|
|
10
119
|
|
|
11
120
|
### Bug Fixes
|
|
12
121
|
|
|
122
|
+
- `BaseControl`: change label's `display` to `block`. ([#63911](https://github.com/WordPress/gutenberg/pull/63911))
|
|
13
123
|
- `ComboboxControl`: Fix ComboboxControl reset button when using the keyboard. ([#63410](https://github.com/WordPress/gutenberg/pull/63410))
|
|
14
124
|
- `Button`: Never apply `aria-disabled` to anchor ([#63376](https://github.com/WordPress/gutenberg/pull/63376)).
|
|
15
125
|
- `SelectControl`: Fix hover/focus color in wp-admin ([#63855](https://github.com/WordPress/gutenberg/pull/63855)).
|
|
126
|
+
- `ToggleControl`: Fix indentation ([#63903](https://github.com/WordPress/gutenberg/pull/63903)).
|
|
16
127
|
|
|
17
128
|
### Enhancements
|
|
18
129
|
|
|
@@ -35,6 +146,7 @@
|
|
|
35
146
|
- `Tabs`: Vertical Tabs should be 40px min height. ([#63446](https://github.com/WordPress/gutenberg/pull/63446)).
|
|
36
147
|
- `ColorPicker`: Use `minimal` variant for `SelectControl` ([#63676](https://github.com/WordPress/gutenberg/pull/63676)).
|
|
37
148
|
- `Tabs`: keep full opacity of focus ring and remove hover styles on disabled tabs ([#63754](https://github.com/WordPress/gutenberg/pull/63754)).
|
|
149
|
+
- `Placeholder`: Remove unnecssary `placeholder-style` Sass mixin ([#63885](https://github.com/WordPress/gutenberg/pull/63885)).
|
|
38
150
|
|
|
39
151
|
### Documentation
|
|
40
152
|
|
|
@@ -69,7 +181,7 @@
|
|
|
69
181
|
|
|
70
182
|
### Internal
|
|
71
183
|
|
|
72
|
-
-
|
|
184
|
+
- Allow ariakit and framer motion imports in the components package. ([#63123](https://github.com/WordPress/gutenberg/pull/63123))
|
|
73
185
|
- `CustomSelectControlV2`: prevent keyboard event propagation in legacy wrapper. ([#62907](https://github.com/WordPress/gutenberg/pull/62907))
|
|
74
186
|
- `CustomSelectControlV2`: expose legacy wrapper through private APIs. ([#62936](https://github.com/WordPress/gutenberg/pull/62936))
|
|
75
187
|
- `CustomSelectControlV2`: fix item styles ([#62825](https://github.com/WordPress/gutenberg/pull/62825))
|
package/CONTRIBUTING.md
CHANGED
|
@@ -6,20 +6,20 @@ The following is a set of guidelines for contributing to the `@wordpress/compone
|
|
|
6
6
|
|
|
7
7
|
This set of guidelines should apply especially to newly introduced components. In fact, while these guidelines should also be retroactively applied to existing components, it is sometimes impossible to do so for legacy/compatibility reasons.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
9
|
+
- [Introducing new components](#introducing-new-components)
|
|
10
|
+
- [Compatibility](#compatibility)
|
|
11
|
+
- [Compound components](#compound-components)
|
|
12
|
+
- [Components & Hooks](#components--hooks)
|
|
13
|
+
- [Naming Conventions](#naming-conventions)
|
|
14
|
+
- [TypeScript](#typescript)
|
|
15
|
+
- [Styling](#styling)
|
|
16
|
+
- [Context system](#context-system)
|
|
17
|
+
- [Unit tests](#unit-tests)
|
|
18
|
+
- [Storybook](#storybook)
|
|
19
|
+
- [Documentation](#documentation)
|
|
20
|
+
- [README example](#README-example)
|
|
21
|
+
- [Folder structure](#folder-structure)
|
|
22
|
+
- [Component versioning](#component-versioning)
|
|
23
23
|
|
|
24
24
|
## Introducing new components
|
|
25
25
|
|
|
@@ -95,13 +95,13 @@ In these situations, one possible approach is to "soft-deprecate" a given legacy
|
|
|
95
95
|
2. Updating all places in Gutenberg that use that API.
|
|
96
96
|
3. Adding deprecation warnings (only after the previous point is completed, otherwise the Browser Console will be polluted by all those warnings and some e2e tests may fail).
|
|
97
97
|
|
|
98
|
-
When adding new components or new props to existing components, it's recommended to
|
|
98
|
+
When adding new components or new props to existing components, it's recommended to create a [private version](/packages/private-apis/README.md)) of the component until the changes are stable enough to be exposed as part of the public API.
|
|
99
99
|
|
|
100
100
|
### Learn more
|
|
101
101
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
102
|
+
- [How to preserve backward compatibility for a React Component](/docs/contributors/code/backward-compatibility.md#how-to-preserve-backward-compatibility-for-a-react-component)
|
|
103
|
+
- [Experimental and Unstable APIs](/docs/contributors/code/coding-guidelines.md#legacy-experimental-apis-plugin-only-apis-and-private-apis)
|
|
104
|
+
- [Deprecating styles](#deprecating-styles)
|
|
105
105
|
|
|
106
106
|
<!-- ## Polymorphic Components (i.e. the `as` prop)
|
|
107
107
|
|
|
@@ -121,20 +121,16 @@ When creating components that render a list of subcomponents, prefer to expose t
|
|
|
121
121
|
```jsx
|
|
122
122
|
// ❌ Don't:
|
|
123
123
|
<List
|
|
124
|
-
items={ [
|
|
125
|
-
{ value: 'Item 1' },
|
|
126
|
-
{ value: 'Item 2' },
|
|
127
|
-
{ value: 'Item 3' },
|
|
128
|
-
] }
|
|
124
|
+
items={ [ { value: 'Item 1' }, { value: 'Item 2' }, { value: 'Item 3' } ] }
|
|
129
125
|
/>
|
|
130
126
|
```
|
|
131
127
|
|
|
132
128
|
```jsx
|
|
133
129
|
// ✅ Do:
|
|
134
130
|
<List>
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
<
|
|
131
|
+
<List.Item value="Item 1" />
|
|
132
|
+
<List.Item value="Item 2" />
|
|
133
|
+
<List.Item value="Item 3" />
|
|
138
134
|
</List>
|
|
139
135
|
```
|
|
140
136
|
|
|
@@ -185,25 +181,25 @@ One way to enable reusability and composition is to extract a component's underl
|
|
|
185
181
|
|
|
186
182
|
```tsx
|
|
187
183
|
// in `hook.ts`
|
|
188
|
-
function useExampleComponent(
|
|
184
|
+
function useExampleComponent(
|
|
185
|
+
props: PolymorphicComponentProps< ExampleProps, 'div' >
|
|
186
|
+
) {
|
|
189
187
|
// Merge received props with the context system.
|
|
190
|
-
const { isVisible, className, ...otherProps } = useContextSystem(
|
|
188
|
+
const { isVisible, className, ...otherProps } = useContextSystem(
|
|
189
|
+
props,
|
|
190
|
+
'Example'
|
|
191
|
+
);
|
|
191
192
|
|
|
192
193
|
// Any other reusable rendering logic (e.g. computing className, state, event listeners...)
|
|
193
194
|
const cx = useCx();
|
|
194
195
|
const classes = useMemo(
|
|
195
|
-
() =>
|
|
196
|
-
cx(
|
|
197
|
-
styles.example,
|
|
198
|
-
isVisible && styles.visible,
|
|
199
|
-
className
|
|
200
|
-
),
|
|
196
|
+
() => cx( styles.example, isVisible && styles.visible, className ),
|
|
201
197
|
[ className, isVisible ]
|
|
202
198
|
);
|
|
203
199
|
|
|
204
200
|
return {
|
|
205
201
|
...otherProps,
|
|
206
|
-
className: classes
|
|
202
|
+
className: classes,
|
|
207
203
|
};
|
|
208
204
|
}
|
|
209
205
|
|
|
@@ -220,8 +216,8 @@ function Example(
|
|
|
220
216
|
|
|
221
217
|
A couple of good examples of how hooks are used for composition are:
|
|
222
218
|
|
|
223
|
-
-
|
|
224
|
-
-
|
|
219
|
+
- the `Card` component, which builds on top of the `Surface` component by [calling the `useSurface` hook inside its own hook](/packages/components/src/card/card/hook.ts);
|
|
220
|
+
- the `HStack` component, which builds on top of the `Flex` component and [calls the `useFlex` hook inside its own hook](/packages/components/src/h-stack/hook.tsx).
|
|
225
221
|
|
|
226
222
|
<!-- ## API Consinstency
|
|
227
223
|
|
|
@@ -236,6 +232,95 @@ A couple of good examples of how hooks are used for composition are:
|
|
|
236
232
|
|
|
237
233
|
TDB -->
|
|
238
234
|
|
|
235
|
+
## Naming Conventions
|
|
236
|
+
|
|
237
|
+
It is recommended that compound components use dot notation to separate the namespace from the individual component names. The top-level compound component should be called the namespace (no dot notation).
|
|
238
|
+
|
|
239
|
+
Dedicated React context should also use dot notation, while hooks should not.
|
|
240
|
+
|
|
241
|
+
When exporting compound components and preparing them to be consumed, it is important that:
|
|
242
|
+
|
|
243
|
+
- the JSDocs appear correctly in IntelliSense;
|
|
244
|
+
- the top-level component's JSDoc appears in the Storybook docs page;
|
|
245
|
+
- the top-level and subcomponent's prop types appear correctly in the Storybook props table.
|
|
246
|
+
|
|
247
|
+
To meet the above requirements, we recommend:
|
|
248
|
+
|
|
249
|
+
- using `Object.assign()` to add subcomponents as properties of the top-level component;
|
|
250
|
+
- using named functions for all components;
|
|
251
|
+
- setting explicitly the `displayName` on all subcomponents;
|
|
252
|
+
- adding the top-level JSDoc to the result of the `Object.assign` call;
|
|
253
|
+
- adding inline subcomponent JSDocs inside the `Object.assign` call.
|
|
254
|
+
|
|
255
|
+
The following example implements all of the above recommendations.
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
//=======================
|
|
259
|
+
// Component.tsx
|
|
260
|
+
//=======================
|
|
261
|
+
import { forwardRef, createContext } from '@wordpress/element';
|
|
262
|
+
|
|
263
|
+
function UnforwardedTopLevelComponent( props, ref ) {
|
|
264
|
+
/* ... */
|
|
265
|
+
}
|
|
266
|
+
const TopLevelComponent = forwardRef( UnforwardedTopLevelComponent );
|
|
267
|
+
|
|
268
|
+
function UnforwardedSubComponent( props, ref ) {
|
|
269
|
+
/* ... */
|
|
270
|
+
}
|
|
271
|
+
const SubComponent = forwardRef( UnforwardedSubComponent );
|
|
272
|
+
SubComponent.displayName = 'Component.SubComponent';
|
|
273
|
+
|
|
274
|
+
const Context = createContext();
|
|
275
|
+
|
|
276
|
+
/** The top-level component's JSDoc. */
|
|
277
|
+
export const Component = Object.assign( TopLevelComponent, {
|
|
278
|
+
/** The subcomponent's JSDoc. */
|
|
279
|
+
SubComponent,
|
|
280
|
+
/** The context's JSDoc. */
|
|
281
|
+
Context,
|
|
282
|
+
} );
|
|
283
|
+
|
|
284
|
+
/** The hook's JSDoc. */
|
|
285
|
+
export function useComponent() {
|
|
286
|
+
/* ... */
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
//=======================
|
|
290
|
+
// App.tsx
|
|
291
|
+
//=======================
|
|
292
|
+
import { Component, useComponent } from '@wordpress/components';
|
|
293
|
+
import { useContext } from '@wordpress/element';
|
|
294
|
+
|
|
295
|
+
function CompoundComponentExample() {
|
|
296
|
+
return (
|
|
297
|
+
<Component>
|
|
298
|
+
<Component.SubComponent />
|
|
299
|
+
</Component>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function ContextProviderExample() {
|
|
304
|
+
return (
|
|
305
|
+
<Component.Context.Provider value={ /* ... */ }>
|
|
306
|
+
{ /* React tree */ }
|
|
307
|
+
</Component.Context.Provider>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function ContextConsumerExample() {
|
|
312
|
+
const componentContext = useContext( Component.Context );
|
|
313
|
+
|
|
314
|
+
// etc
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function HookExample() {
|
|
318
|
+
const hookReturnValue = useComponent();
|
|
319
|
+
|
|
320
|
+
// etc.
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
239
324
|
## TypeScript
|
|
240
325
|
|
|
241
326
|
We strongly encourage using TypeScript for all new components.
|
|
@@ -278,8 +363,10 @@ function UnconnectedMyComponent(
|
|
|
278
363
|
// parameter (`div` in this example)
|
|
279
364
|
// - the special `as` prop (which marks the component as polymorphic),
|
|
280
365
|
// unless the third parameter is `false`
|
|
281
|
-
props:
|
|
282
|
-
) {
|
|
366
|
+
props: WordPressComponentProps< ComponentOwnProps, 'div', true >
|
|
367
|
+
) {
|
|
368
|
+
/* ... */
|
|
369
|
+
}
|
|
283
370
|
```
|
|
284
371
|
|
|
285
372
|
### Considerations for the docgen
|
|
@@ -287,10 +374,15 @@ function UnconnectedMyComponent(
|
|
|
287
374
|
Make sure you have a **named** export for the component, not just the default export ([example](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/divider/component.tsx)). This ensures that the docgen can properly extract the types data. The naming should be so that the connected/forwarded component has the plain component name (`MyComponent`), and the raw component is prefixed (`UnconnectedMyComponent` or `UnforwardedMyComponent`). This makes the component's `displayName` look nicer in React devtools and in the autogenerated Storybook code snippets.
|
|
288
375
|
|
|
289
376
|
```js
|
|
290
|
-
function UnconnectedMyComponent() {
|
|
377
|
+
function UnconnectedMyComponent() {
|
|
378
|
+
/* ... */
|
|
379
|
+
}
|
|
291
380
|
|
|
292
381
|
// 👇 Without this named export, the docgen will not work!
|
|
293
|
-
export const MyComponent = contextConnect(
|
|
382
|
+
export const MyComponent = contextConnect(
|
|
383
|
+
UnconnectedMyComponent,
|
|
384
|
+
'MyComponent'
|
|
385
|
+
);
|
|
294
386
|
export default MyComponent;
|
|
295
387
|
```
|
|
296
388
|
|
|
@@ -314,16 +406,15 @@ Changing the styles of a non-experimental component must be done with care. To p
|
|
|
314
406
|
import deprecated from '@wordpress/deprecated';
|
|
315
407
|
import { Wrapper } from './styles.ts';
|
|
316
408
|
|
|
317
|
-
function MyComponent({ __nextHasNoOuterMargins = false }) {
|
|
409
|
+
function MyComponent( { __nextHasNoOuterMargins = false } ) {
|
|
318
410
|
if ( ! __nextHasNoOuterMargins ) {
|
|
319
411
|
deprecated( 'Outer margin styles for wp.components.MyComponent', {
|
|
320
412
|
since: '6.0',
|
|
321
413
|
version: '6.2', // Set a reasonable grace period depending on impact
|
|
322
|
-
hint:
|
|
323
|
-
'Set the `__nextHasNoOuterMargins` prop to true to start opting into the new styles, which will become the default in a future version.',
|
|
414
|
+
hint: 'Set the `__nextHasNoOuterMargins` prop to true to start opting into the new styles, which will become the default in a future version.',
|
|
324
415
|
} );
|
|
325
416
|
}
|
|
326
|
-
return <Wrapper __nextHasNoOuterMargins={__nextHasNoOuterMargins}
|
|
417
|
+
return <Wrapper __nextHasNoOuterMargins={ __nextHasNoOuterMargins } />;
|
|
327
418
|
}
|
|
328
419
|
```
|
|
329
420
|
|
|
@@ -331,7 +422,7 @@ Styles should be structured so the deprecated styles are cleanly encapsulated, a
|
|
|
331
422
|
|
|
332
423
|
```js
|
|
333
424
|
// styles.ts
|
|
334
|
-
const deprecatedMargins = ({ __nextHasNoOuterMargins }) => {
|
|
425
|
+
const deprecatedMargins = ( { __nextHasNoOuterMargins } ) => {
|
|
335
426
|
if ( ! __nextHasNoOuterMargins ) {
|
|
336
427
|
return css`
|
|
337
428
|
margin: 8px;
|
|
@@ -342,7 +433,7 @@ const deprecatedMargins = ({ __nextHasNoOuterMargins }) => {
|
|
|
342
433
|
export const Wrapper = styled.div`
|
|
343
434
|
margin: 0;
|
|
344
435
|
|
|
345
|
-
${deprecatedMargins}
|
|
436
|
+
${ deprecatedMargins }
|
|
346
437
|
`;
|
|
347
438
|
```
|
|
348
439
|
|
|
@@ -358,14 +449,14 @@ Not all style changes justify a formal deprecation process. The main thing to lo
|
|
|
358
449
|
|
|
359
450
|
##### DOES need formal deprecation
|
|
360
451
|
|
|
361
|
-
-
|
|
362
|
-
-
|
|
452
|
+
- Removing an outer margin.
|
|
453
|
+
- Substantial changes to width/height, such as adding or removing a size restriction.
|
|
363
454
|
|
|
364
455
|
##### DOES NOT need formal deprecation
|
|
365
456
|
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
-
|
|
457
|
+
- Breakage only occurs in non-standard usage, such as when the consumer is overriding component internals.
|
|
458
|
+
- Minor layout shifts of a few pixels.
|
|
459
|
+
- Internal layout changes of a higher-level component.
|
|
369
460
|
|
|
370
461
|
## Context system
|
|
371
462
|
|
|
@@ -373,9 +464,9 @@ The `@wordpress/components` context system is based on [React's `Context` API](h
|
|
|
373
464
|
|
|
374
465
|
Components can use this system via a couple of functions:
|
|
375
466
|
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
467
|
+
- they can provide values using a shared `ContextSystemProvider` component
|
|
468
|
+
- they can connect to the Context via `contextConnect`
|
|
469
|
+
- they can read the "computed" values from the context via `useContextSystem`
|
|
379
470
|
|
|
380
471
|
An example of how this is used can be found in the [`Card` component family](/packages/components/src/card). For example, this is how the `Card` component injects the `size` and `isBorderless` props down to its `CardBody` subcomponent — which makes it use the correct spacing and border settings "auto-magically".
|
|
381
472
|
|
|
@@ -400,11 +491,7 @@ export function useCard( props ) {
|
|
|
400
491
|
import { contextConnect, ContextSystemProvider } from '../../context';
|
|
401
492
|
|
|
402
493
|
function Card( props, forwardedRef ) {
|
|
403
|
-
const {
|
|
404
|
-
size,
|
|
405
|
-
isBorderless,
|
|
406
|
-
...otherComputedHookProps
|
|
407
|
-
} = useCard( props );
|
|
494
|
+
const { size, isBorderless, ...otherComputedHookProps } = useCard( props );
|
|
408
495
|
|
|
409
496
|
// [...]
|
|
410
497
|
|
|
@@ -441,7 +528,10 @@ export function useCardBody( props ) {
|
|
|
441
528
|
// If a `CardBody` component is rendered as a child of a `Card` component, the value of
|
|
442
529
|
// the `size` prop will be the one set by the parent `Card` component via the Context
|
|
443
530
|
// System (unless the prop gets explicitely set on the `CardBody` component).
|
|
444
|
-
const { size = 'medium', ...otherDerivedProps } = useContextSystem(
|
|
531
|
+
const { size = 'medium', ...otherDerivedProps } = useContextSystem(
|
|
532
|
+
props,
|
|
533
|
+
'CardBody'
|
|
534
|
+
);
|
|
445
535
|
|
|
446
536
|
// [...]
|
|
447
537
|
|
|
@@ -457,7 +547,7 @@ Please refer to the [JavaScript Testing Overview docs](/docs/contributors/code/t
|
|
|
457
547
|
|
|
458
548
|
All new components should add stories to the project's [Storybook](https://storybook.js.org/). Each [story](https://storybook.js.org/docs/react/get-started/whats-a-story) captures the rendered state of a UI component in isolation. This greatly simplifies working on a given component, while also serving as an interactive form of documentation.
|
|
459
549
|
|
|
460
|
-
A component's story should be showcasing its different states — for example, the different variants of a
|
|
550
|
+
A component's story should be showcasing its different states — for example, the different variants of a `Button`:
|
|
461
551
|
|
|
462
552
|
```jsx
|
|
463
553
|
import Button from '../';
|
|
@@ -543,6 +633,7 @@ Prop description. With a new line before and after the description and before an
|
|
|
543
633
|
Add this section when there are props that are drilled down into an internal component. See [ClipboardButton](/packages/components/src/clipboard-button/README.md) for an example.
|
|
544
634
|
|
|
545
635
|
<!-- Only add the next section if the component relies on the [Context System](#context-system) -->
|
|
636
|
+
|
|
546
637
|
## Context
|
|
547
638
|
|
|
548
639
|
See examples for this section for the [ItemGroup](/packages/components/src/item-group/item-group/README.md#context) and [`Card`](/packages/components/src/card/card/README.md#context) components.
|
|
@@ -601,8 +692,8 @@ As the needs of the package evolve with time, sometimes we may opt to fully rewr
|
|
|
601
692
|
|
|
602
693
|
Here is some terminology that will be used in the upcoming sections:
|
|
603
694
|
|
|
604
|
-
-
|
|
605
|
-
-
|
|
695
|
+
- "Legacy" component: the version(s) of the component that existsted on `trunk` before the rewrite;
|
|
696
|
+
- API surface: the component's public APIs. It includes the list of components (and subcomponents) exported from the package, their props, any associated React context. It does not include internal classnames and internal DOM structure of the components.
|
|
606
697
|
|
|
607
698
|
### Approaches
|
|
608
699
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = Cell;
|
|
8
|
-
var
|
|
8
|
+
var _composite = require("../composite");
|
|
9
9
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
10
10
|
var _visuallyHidden = require("../visually-hidden");
|
|
11
11
|
var _utils = require("./utils");
|
|
@@ -28,7 +28,7 @@ function Cell({
|
|
|
28
28
|
const tooltipText = _utils.ALIGNMENT_LABEL[value];
|
|
29
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
|
30
30
|
text: tooltipText,
|
|
31
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_composite.Composite.Item, {
|
|
32
32
|
id: id,
|
|
33
33
|
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(_alignmentMatrixControlStyles.Cell, {
|
|
34
34
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_composite","require","_tooltip","_interopRequireDefault","_visuallyHidden","_utils","_alignmentMatrixControlStyles","_jsxRuntime","Cell","id","isActive","value","props","tooltipText","ALIGNMENT_LABEL","jsx","default","text","children","jsxs","Composite","Item","render","role","VisuallyHidden","Point"],"sources":["@wordpress/components/src/alignment-matrix-control/cell.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { Composite } from '../composite';\nimport Tooltip from '../tooltip';\nimport { VisuallyHidden } from '../visually-hidden';\n\n/**\n * Internal dependencies\n */\nimport { ALIGNMENT_LABEL } from './utils';\nimport {\n\tCell as CellView,\n\tPoint,\n} from './styles/alignment-matrix-control-styles';\nimport type { AlignmentMatrixControlCellProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function Cell( {\n\tid,\n\tisActive = false,\n\tvalue,\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlCellProps, 'span', false > ) {\n\tconst tooltipText = ALIGNMENT_LABEL[ value ];\n\n\treturn (\n\t\t<Tooltip text={ tooltipText }>\n\t\t\t<Composite.Item\n\t\t\t\tid={ id }\n\t\t\t\trender={ <CellView { ...props } role=\"gridcell\" /> }\n\t\t\t>\n\t\t\t\t{ /* VoiceOver needs a text content to be rendered within grid cell,\n\t\t\totherwise it'll announce the content as \"blank\". So we use a visually\n\t\t\thidden element instead of aria-label. */ }\n\t\t\t\t<VisuallyHidden>{ value }</VisuallyHidden>\n\t\t\t\t<Point isActive={ isActive } role=\"presentation\" />\n\t\t\t</Composite.Item>\n\t\t</Tooltip>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,6BAAA,GAAAL,OAAA;AAGkD,IAAAM,WAAA,GAAAN,OAAA;AAdlD;AACA;AACA;;AAKA;AACA;AACA;;AASe,SAASO,IAAIA,CAAE;EAC7BC,EAAE;EACFC,QAAQ,GAAG,KAAK;EAChBC,KAAK;EACL,GAAGC;AACuE,CAAC,EAAG;EAC9E,MAAMC,WAAW,GAAGC,sBAAe,CAAEH,KAAK,CAAE;EAE5C,oBACC,IAAAJ,WAAA,CAAAQ,GAAA,EAACb,QAAA,CAAAc,OAAO;IAACC,IAAI,EAAGJ,WAAa;IAAAK,QAAA,eAC5B,IAAAX,WAAA,CAAAY,IAAA,EAACnB,UAAA,CAAAoB,SAAS,CAACC,IAAI;MACdZ,EAAE,EAAGA,EAAI;MACTa,MAAM,eAAG,IAAAf,WAAA,CAAAQ,GAAA,EAACT,6BAAA,CAAAE,IAAQ;QAAA,GAAMI,KAAK;QAAGW,IAAI,EAAC;MAAU,CAAE,CAAG;MAAAL,QAAA,gBAKpD,IAAAX,WAAA,CAAAQ,GAAA,EAACX,eAAA,CAAAoB,cAAc;QAAAN,QAAA,EAAGP;MAAK,CAAkB,CAAC,eAC1C,IAAAJ,WAAA,CAAAQ,GAAA,EAACT,6BAAA,CAAAmB,KAAK;QAACf,QAAQ,EAAGA,QAAU;QAACa,IAAI,EAAC;MAAc,CAAE,CAAC;IAAA,CACpC;EAAC,CACT,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -7,10 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.AlignmentMatrixControl = AlignmentMatrixControl;
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
|
+
var _react = require("@ariakit/react");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _compose = require("@wordpress/compose");
|
|
12
13
|
var _cell = _interopRequireDefault(require("./cell"));
|
|
13
|
-
var
|
|
14
|
+
var _composite = require("../composite");
|
|
14
15
|
var _alignmentMatrixControlStyles = require("./styles/alignment-matrix-control-styles");
|
|
15
16
|
var _icon = _interopRequireDefault(require("./icon"));
|
|
16
17
|
var _utils = require("./utils");
|
|
@@ -58,7 +59,7 @@ function AlignmentMatrixControl({
|
|
|
58
59
|
...props
|
|
59
60
|
}) {
|
|
60
61
|
const baseId = (0, _compose.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control', id);
|
|
61
|
-
const compositeStore = (0,
|
|
62
|
+
const compositeStore = (0, _composite.useCompositeStore)({
|
|
62
63
|
defaultActiveId: (0, _utils.getItemId)(baseId, defaultValue),
|
|
63
64
|
activeId: (0, _utils.getItemId)(baseId, value),
|
|
64
65
|
setActiveId: nextActiveId => {
|
|
@@ -69,9 +70,9 @@ function AlignmentMatrixControl({
|
|
|
69
70
|
},
|
|
70
71
|
rtl: (0, _i18n.isRTL)()
|
|
71
72
|
});
|
|
72
|
-
const activeId =
|
|
73
|
+
const activeId = (0, _react.useStoreState)(compositeStore, 'activeId');
|
|
73
74
|
const classes = (0, _clsx.default)('component-alignment-matrix-control', className);
|
|
74
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_composite.Composite, {
|
|
75
76
|
store: compositeStore,
|
|
76
77
|
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(_alignmentMatrixControlStyles.Root, {
|
|
77
78
|
...props,
|
|
@@ -81,7 +82,7 @@ function AlignmentMatrixControl({
|
|
|
81
82
|
role: "grid",
|
|
82
83
|
size: width
|
|
83
84
|
}),
|
|
84
|
-
children: _utils.GRID.map((cells, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
85
|
+
children: _utils.GRID.map((cells, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_composite.Composite.Row, {
|
|
85
86
|
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(_alignmentMatrixControlStyles.Row, {
|
|
86
87
|
role: "row"
|
|
87
88
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_compose","_cell","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_react","_i18n","_compose","_cell","_composite","_alignmentMatrixControlStyles","_icon","_utils","_jsxRuntime","AlignmentMatrixControl","className","id","label","__","defaultValue","value","onChange","width","props","baseId","useInstanceId","compositeStore","useCompositeStore","defaultActiveId","getItemId","activeId","setActiveId","nextActiveId","nextValue","getItemValue","rtl","isRTL","useStoreState","classes","clsx","jsx","Composite","store","render","Root","role","size","children","GRID","map","cells","index","Row","cell","cellId","isActive","default","Icon","AlignmentMatrixControlIcon","_default","exports"],"sources":["@wordpress/components/src/alignment-matrix-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite, useCompositeStore } from '../composite';\nimport { Root, Row } from './styles/alignment-matrix-control-styles';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId, getItemValue } from './utils';\nimport type { WordPressComponentProps } from '../context';\nimport type { AlignmentMatrixControlProps } from './types';\n\n/**\n *\n * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.\n *\n * ```jsx\n * import { __experimentalAlignmentMatrixControl as AlignmentMatrixControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ alignment, setAlignment ] = useState( 'center center' );\n *\n * \treturn (\n * \t\t<AlignmentMatrixControl\n * \t\t\tvalue={ alignment }\n * \t\t\tonChange={ setAlignment }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport function AlignmentMatrixControl( {\n\tclassName,\n\tid,\n\tlabel = __( 'Alignment Matrix Control' ),\n\tdefaultValue = 'center center',\n\tvalue,\n\tonChange,\n\twidth = 92,\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlProps, 'div', false > ) {\n\tconst baseId = useInstanceId(\n\t\tAlignmentMatrixControl,\n\t\t'alignment-matrix-control',\n\t\tid\n\t);\n\n\tconst compositeStore = useCompositeStore( {\n\t\tdefaultActiveId: getItemId( baseId, defaultValue ),\n\t\tactiveId: getItemId( baseId, value ),\n\t\tsetActiveId: ( nextActiveId ) => {\n\t\t\tconst nextValue = getItemValue( baseId, nextActiveId );\n\t\t\tif ( nextValue ) {\n\t\t\t\tonChange?.( nextValue );\n\t\t\t}\n\t\t},\n\t\trtl: isRTL(),\n\t} );\n\n\tconst activeId = useStoreState( compositeStore, 'activeId' );\n\n\tconst classes = clsx( 'component-alignment-matrix-control', className );\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trender={\n\t\t\t\t<Root\n\t\t\t\t\t{ ...props }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName={ classes }\n\t\t\t\t\tid={ baseId }\n\t\t\t\t\trole=\"grid\"\n\t\t\t\t\tsize={ width }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ GRID.map( ( cells, index ) => (\n\t\t\t\t<Composite.Row render={ <Row role=\"row\" /> } key={ index }>\n\t\t\t\t\t{ cells.map( ( cell ) => {\n\t\t\t\t\t\tconst cellId = getItemId( baseId, cell );\n\t\t\t\t\t\tconst isActive = cellId === activeId;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Cell\n\t\t\t\t\t\t\t\tid={ cellId }\n\t\t\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\t\t\tkey={ cell }\n\t\t\t\t\t\t\t\tvalue={ cell }\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</Composite.Row>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nAlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;\n\nexport default AlignmentMatrixControl;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,6BAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAwD,IAAAS,WAAA,GAAAT,OAAA;AAnBxD;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,sBAAsBA,CAAE;EACvCC,SAAS;EACTC,EAAE;EACFC,KAAK,GAAG,IAAAC,QAAE,EAAE,0BAA2B,CAAC;EACxCC,YAAY,GAAG,eAAe;EAC9BC,KAAK;EACLC,QAAQ;EACRC,KAAK,GAAG,EAAE;EACV,GAAGC;AACkE,CAAC,EAAG;EACzE,MAAMC,MAAM,GAAG,IAAAC,sBAAa,EAC3BX,sBAAsB,EACtB,0BAA0B,EAC1BE,EACD,CAAC;EAED,MAAMU,cAAc,GAAG,IAAAC,4BAAiB,EAAE;IACzCC,eAAe,EAAE,IAAAC,gBAAS,EAAEL,MAAM,EAAEL,YAAa,CAAC;IAClDW,QAAQ,EAAE,IAAAD,gBAAS,EAAEL,MAAM,EAAEJ,KAAM,CAAC;IACpCW,WAAW,EAAIC,YAAY,IAAM;MAChC,MAAMC,SAAS,GAAG,IAAAC,mBAAY,EAAEV,MAAM,EAAEQ,YAAa,CAAC;MACtD,IAAKC,SAAS,EAAG;QAChBZ,QAAQ,GAAIY,SAAU,CAAC;MACxB;IACD,CAAC;IACDE,GAAG,EAAE,IAAAC,WAAK,EAAC;EACZ,CAAE,CAAC;EAEH,MAAMN,QAAQ,GAAG,IAAAO,oBAAa,EAAEX,cAAc,EAAE,UAAW,CAAC;EAE5D,MAAMY,OAAO,GAAG,IAAAC,aAAI,EAAE,oCAAoC,EAAExB,SAAU,CAAC;EAEvE,oBACC,IAAAF,WAAA,CAAA2B,GAAA,EAAC/B,UAAA,CAAAgC,SAAS;IACTC,KAAK,EAAGhB,cAAgB;IACxBiB,MAAM,eACL,IAAA9B,WAAA,CAAA2B,GAAA,EAAC9B,6BAAA,CAAAkC,IAAI;MAAA,GACCrB,KAAK;MACV,cAAaN,KAAO;MACpBF,SAAS,EAAGuB,OAAS;MACrBtB,EAAE,EAAGQ,MAAQ;MACbqB,IAAI,EAAC,MAAM;MACXC,IAAI,EAAGxB;IAAO,CACd,CACD;IAAAyB,QAAA,EAECC,WAAI,CAACC,GAAG,CAAE,CAAEC,KAAK,EAAEC,KAAK,kBACzB,IAAAtC,WAAA,CAAA2B,GAAA,EAAC/B,UAAA,CAAAgC,SAAS,CAACW,GAAG;MAACT,MAAM,eAAG,IAAA9B,WAAA,CAAA2B,GAAA,EAAC9B,6BAAA,CAAA0C,GAAG;QAACP,IAAI,EAAC;MAAK,CAAE,CAAG;MAAAE,QAAA,EACzCG,KAAK,CAACD,GAAG,CAAII,IAAI,IAAM;QACxB,MAAMC,MAAM,GAAG,IAAAzB,gBAAS,EAAEL,MAAM,EAAE6B,IAAK,CAAC;QACxC,MAAME,QAAQ,GAAGD,MAAM,KAAKxB,QAAQ;QAEpC,oBACC,IAAAjB,WAAA,CAAA2B,GAAA,EAAChC,KAAA,CAAAgD,OAAI;UACJxC,EAAE,EAAGsC,MAAQ;UACbC,QAAQ,EAAGA,QAAU;UAErBnC,KAAK,EAAGiC;QAAM,GADRA,IAEN,CAAC;MAEJ,CAAE;IAAC,GAb+CF,KAcpC,CACd;EAAC,CACO,CAAC;AAEd;AAEArC,sBAAsB,CAAC2C,IAAI,GAAGC,aAA0B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAE1C1C,sBAAsB","ignoreList":[]}
|