@wordpress/components 25.12.0 → 25.14.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 +65 -0
- package/build/angle-picker-control/index.js +0 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +4 -2
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +3 -2
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +17 -17
- package/build/border-control/styles.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/checkbox-control/types.js.map +1 -1
- package/build/custom-select-control-v2/index.js +87 -0
- package/build/custom-select-control-v2/index.js.map +1 -0
- package/build/custom-select-control-v2/styles.js +85 -0
- package/build/custom-select-control-v2/styles.js.map +1 -0
- package/build/custom-select-control-v2/types.js +6 -0
- package/build/custom-select-control-v2/types.js.map +1 -0
- package/build/date-time/time/timezone.js +11 -2
- package/build/date-time/time/timezone.js.map +1 -1
- package/build/dimension-control/index.js +2 -0
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/types.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/index.js +49 -20
- package/build/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/styles.js +82 -59
- package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build/focal-point-picker/controls.js +5 -1
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/index.js +2 -0
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +15 -15
- 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/font-size-picker/font-size-picker-select.js +2 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/font-size-picker-toggle-group.js +2 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build/font-size-picker/index.js +6 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/types.js.map +1 -1
- package/build/form-token-field/index.js +6 -2
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/types.js.map +1 -1
- package/build/heading/hook.js +6 -3
- package/build/heading/hook.js.map +1 -1
- package/build/heading/types.js.map +1 -1
- package/build/index.native.js +0 -16
- package/build/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +13 -0
- package/build/mobile/global-styles-context/utils.native.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/palette-edit/index.js +21 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/query-controls/author-select.js +3 -1
- package/build/query-controls/author-select.js.map +1 -1
- package/build/query-controls/category-select.js +3 -1
- package/build/query-controls/category-select.js.map +1 -1
- package/build/query-controls/index.js +6 -1
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/types.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/tabs/index.js +24 -5
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/tab.js +4 -4
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tabpanel.js +4 -3
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/text/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/utils.js +17 -17
- package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +16 -12
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/angle-picker-control/index.js +0 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +4 -2
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +3 -2
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +17 -17
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/checkbox-control/types.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +74 -0
- package/build-module/custom-select-control-v2/index.js.map +1 -0
- package/build-module/custom-select-control-v2/styles.js +71 -0
- package/build-module/custom-select-control-v2/styles.js.map +1 -0
- package/build-module/custom-select-control-v2/types.js +2 -0
- package/build-module/custom-select-control-v2/types.js.map +1 -0
- package/build-module/date-time/time/timezone.js +11 -2
- package/build-module/date-time/time/timezone.js.map +1 -1
- package/build-module/dimension-control/index.js +2 -0
- 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-ariakit/index.js +46 -18
- package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/styles.js +69 -40
- package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +5 -1
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/index.js +2 -0
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +15 -15
- 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/font-size-picker/font-size-picker-select.js +2 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +2 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build-module/font-size-picker/index.js +6 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/types.js.map +1 -1
- package/build-module/form-token-field/index.js +6 -2
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/types.js.map +1 -1
- package/build-module/heading/hook.js +6 -3
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/heading/types.js.map +1 -1
- package/build-module/index.native.js +0 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +13 -0
- package/build-module/mobile/global-styles-context/utils.native.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/palette-edit/index.js +20 -3
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +4 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/query-controls/author-select.js +3 -1
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/query-controls/category-select.js +3 -1
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/query-controls/index.js +6 -1
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/types.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/tabs/index.js +25 -6
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/tab.js +6 -6
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tabpanel.js +6 -5
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/text/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js +17 -17
- package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +17 -13
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-style/style-rtl.css +32 -6
- package/build-style/style.css +32 -6
- package/build-types/angle-picker-control/index.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -0
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +1944 -0
- package/build-types/box-control/stories/index.story.d.ts.map +1 -0
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/types.d.ts +3 -2
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +4 -1
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +6 -0
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +19 -0
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/styles.d.ts +47 -0
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/types.d.ts +57 -0
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +4 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/time/timezone.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/types.d.ts +6 -0
- package/build-types/dimension-control/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -2
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +26 -18
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts +0 -6
- package/build-types/dropdown-menu-v2-ariakit/types.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 +8 -4
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/types.d.ts +7 -0
- package/build-types/focal-point-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +8 -1
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +4 -1
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/heading/types.d.ts +20 -1
- package/build-types/heading/types.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +4 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +6 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +4 -1
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/query-controls/category-select.d.ts +1 -1
- package/build-types/query-controls/category-select.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 +9 -0
- package/build-types/query-controls/types.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts +16 -6
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +3 -2
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +2 -1
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tabpanel.d.ts +2 -1
- package/build-types/tabs/tabpanel.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +8 -3
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/text/types.d.ts +15 -2
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/angle-picker-control/index.tsx +0 -1
- package/src/border-control/border-control-dropdown/component.tsx +3 -1
- package/src/border-control/border-control-dropdown/hook.ts +3 -2
- package/src/border-control/styles.ts +2 -9
- package/src/box-control/stories/index.story.tsx +82 -0
- package/src/button/style.scss +10 -2
- package/src/checkbox-control/README.md +2 -1
- package/src/checkbox-control/index.tsx +8 -6
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +3 -8
- package/src/checkbox-control/test/index.tsx +7 -0
- package/src/checkbox-control/types.ts +3 -2
- package/src/combobox-control/README.md +1 -3
- package/src/custom-select-control/test/index.js +367 -35
- package/src/custom-select-control-v2/README.md +73 -0
- package/src/custom-select-control-v2/index.tsx +99 -0
- package/src/custom-select-control-v2/stories/index.story.tsx +149 -0
- package/src/custom-select-control-v2/styles.ts +76 -0
- package/src/custom-select-control-v2/types.ts +63 -0
- package/src/date-time/time/timezone.tsx +15 -3
- package/src/dimension-control/index.tsx +2 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +2 -2
- package/src/dimension-control/types.ts +6 -0
- package/src/dropdown-menu-v2-ariakit/README.md +19 -5
- package/src/dropdown-menu-v2-ariakit/index.tsx +85 -36
- package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +204 -90
- package/src/dropdown-menu-v2-ariakit/styles.ts +165 -117
- package/src/dropdown-menu-v2-ariakit/test/index.tsx +5 -10
- package/src/dropdown-menu-v2-ariakit/types.ts +0 -7
- package/src/focal-point-picker/controls.tsx +4 -0
- package/src/focal-point-picker/index.tsx +2 -0
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
- package/src/focal-point-picker/types.ts +7 -0
- package/src/font-size-picker/font-size-picker-select.tsx +2 -0
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +9 -1
- package/src/font-size-picker/index.tsx +11 -3
- package/src/font-size-picker/types.ts +8 -1
- package/src/form-toggle/style.scss +40 -8
- package/src/form-token-field/index.tsx +11 -3
- package/src/form-token-field/token-input.tsx +1 -3
- package/src/form-token-field/types.ts +1 -0
- package/src/heading/README.md +6 -1
- package/src/heading/hook.ts +6 -3
- package/src/heading/types.ts +23 -1
- package/src/index.native.js +0 -2
- package/src/mobile/global-styles-context/test/utils.native.js +22 -0
- package/src/mobile/global-styles-context/utils.native.js +14 -0
- package/src/mobile/link-settings/style.native.scss +0 -17
- package/src/mobile/utils/alignments.native.js +1 -0
- package/src/navigable-container/README.md +1 -1
- package/src/palette-edit/index.tsx +22 -8
- package/src/palette-edit/style.scss +2 -2
- package/src/palette-edit/test/index.tsx +75 -1
- package/src/private-apis.ts +4 -2
- package/src/query-controls/author-select.tsx +2 -0
- package/src/query-controls/category-select.tsx +2 -0
- package/src/query-controls/index.tsx +6 -1
- package/src/query-controls/types.ts +9 -0
- package/src/search-control/README.md +2 -0
- package/src/slot-fill/README.md +1 -1
- package/src/slot-fill/types.ts +18 -6
- package/src/spinner/README.md +2 -0
- package/src/tabs/README.md +4 -4
- package/src/tabs/index.tsx +34 -3
- package/src/tabs/stories/index.story.tsx +56 -48
- package/src/tabs/tab.tsx +7 -7
- package/src/tabs/tabpanel.tsx +10 -6
- package/src/tabs/test/index.tsx +180 -87
- package/src/tabs/types.ts +8 -3
- package/src/text/README.md +5 -1
- package/src/text/types.ts +15 -2
- package/src/toggle-control/README.md +2 -2
- package/src/toggle-group-control/test/index.tsx +54 -1
- package/src/toggle-group-control/toggle-group-control/utils.ts +15 -20
- package/src/tools-panel/tools-panel-item/hook.ts +21 -23
- package/tsconfig.tsbuildinfo +1 -1
- package/build/mobile/inserter-button/index.native.js +0 -98
- package/build/mobile/inserter-button/index.native.js.map +0 -1
- package/build/mobile/inserter-button/sparkles.js +0 -23
- package/build/mobile/inserter-button/sparkles.js.map +0 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js +0 -119
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +0 -1
- package/build-module/mobile/inserter-button/index.native.js +0 -89
- package/build-module/mobile/inserter-button/index.native.js.map +0 -1
- package/build-module/mobile/inserter-button/sparkles.js +0 -15
- package/build-module/mobile/inserter-button/sparkles.js.map +0 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +0 -110
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +0 -1
- package/build-types/mobile/inserter-button/sparkles.d.ts +0 -3
- package/build-types/mobile/inserter-button/sparkles.d.ts.map +0 -1
- package/src/box-control/stories/index.story.js +0 -75
- package/src/mobile/inserter-button/README.md +0 -62
- package/src/mobile/inserter-button/index.native.js +0 -116
- package/src/mobile/inserter-button/sparkles.js +0 -15
- package/src/mobile/inserter-button/style.native.scss +0 -72
- package/src/mobile/link-settings/image-link-destinations-screen.native.js +0 -152
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
|
|
1
3
|
$toggle-width: 36px;
|
|
2
4
|
$toggle-height: 18px;
|
|
3
5
|
$toggle-border-width: 1px;
|
|
6
|
+
$thumb-size: $toggle-height - ($toggle-border-width * 6);
|
|
7
|
+
|
|
8
|
+
$transition-duration: 0.2s;
|
|
4
9
|
|
|
5
10
|
.components-form-toggle {
|
|
6
11
|
position: relative;
|
|
@@ -8,6 +13,7 @@ $toggle-border-width: 1px;
|
|
|
8
13
|
|
|
9
14
|
// Unchecked state.
|
|
10
15
|
.components-form-toggle__track {
|
|
16
|
+
position: relative;
|
|
11
17
|
content: "";
|
|
12
18
|
display: inline-block;
|
|
13
19
|
box-sizing: border-box;
|
|
@@ -16,9 +22,27 @@ $toggle-border-width: 1px;
|
|
|
16
22
|
border: $toggle-border-width solid $gray-900;
|
|
17
23
|
width: $toggle-width;
|
|
18
24
|
height: $toggle-height;
|
|
19
|
-
border-radius: $toggle-height
|
|
20
|
-
transition:
|
|
25
|
+
border-radius: math.div($toggle-height, 2);
|
|
26
|
+
transition:
|
|
27
|
+
$transition-duration background-color ease,
|
|
28
|
+
$transition-duration border-color ease;
|
|
21
29
|
@include reduce-motion("transition");
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
|
|
32
|
+
// Windows High Contrast Mode
|
|
33
|
+
&::after {
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
// Expand the border to fake a solid in Windows High Contrast Mode.
|
|
39
|
+
border-top: #{ $toggle-height } solid transparent;
|
|
40
|
+
|
|
41
|
+
transition: $transition-duration opacity ease;
|
|
42
|
+
@include reduce-motion("transition");
|
|
43
|
+
|
|
44
|
+
opacity: 0;
|
|
45
|
+
}
|
|
22
46
|
}
|
|
23
47
|
|
|
24
48
|
.components-form-toggle__thumb {
|
|
@@ -27,20 +51,28 @@ $toggle-border-width: 1px;
|
|
|
27
51
|
box-sizing: border-box;
|
|
28
52
|
top: $toggle-border-width * 3;
|
|
29
53
|
left: $toggle-border-width * 3;
|
|
30
|
-
width: $
|
|
31
|
-
height: $
|
|
54
|
+
width: $thumb-size;
|
|
55
|
+
height: $thumb-size;
|
|
32
56
|
border-radius: 50%;
|
|
33
|
-
transition:
|
|
57
|
+
transition:
|
|
58
|
+
$transition-duration transform ease,
|
|
59
|
+
$transition-duration background-color ease-out;
|
|
34
60
|
@include reduce-motion("transition");
|
|
35
61
|
background-color: $gray-900;
|
|
36
|
-
|
|
62
|
+
|
|
63
|
+
// Transparent border acts as a fill in Windows High Contrast Mode.
|
|
64
|
+
border: math.div($thumb-size, 2) solid transparent;
|
|
37
65
|
}
|
|
38
66
|
|
|
39
67
|
// Checked state.
|
|
40
68
|
&.is-checked .components-form-toggle__track {
|
|
41
69
|
background-color: $components-color-accent;
|
|
42
|
-
border: $
|
|
43
|
-
|
|
70
|
+
border-color: $components-color-accent;
|
|
71
|
+
|
|
72
|
+
// Windows High Contrast Mode
|
|
73
|
+
&::after {
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}
|
|
44
76
|
}
|
|
45
77
|
|
|
46
78
|
.components-form-toggle__input:focus + .components-form-toggle__track {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import type { KeyboardEvent, MouseEvent, TouchEvent } from 'react';
|
|
5
|
+
import type { KeyboardEvent, MouseEvent, TouchEvent, FocusEvent } from 'react';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -162,7 +162,7 @@ export function FormTokenField( props: FormTokenFieldProps ) {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
function onBlur() {
|
|
165
|
+
function onBlur( event: FocusEvent ) {
|
|
166
166
|
if (
|
|
167
167
|
inputHasValidValue() &&
|
|
168
168
|
__experimentalValidateInput( incompleteTokenValue )
|
|
@@ -176,7 +176,15 @@ export function FormTokenField( props: FormTokenFieldProps ) {
|
|
|
176
176
|
setIncompleteTokenValue( '' );
|
|
177
177
|
setInputOffsetFromEnd( 0 );
|
|
178
178
|
setIsActive( false );
|
|
179
|
-
|
|
179
|
+
|
|
180
|
+
// If `__experimentalExpandOnFocus` is true, don't close the suggestions list when
|
|
181
|
+
// the user clicks on it (`tokensAndInput` will be the element that caused the blur).
|
|
182
|
+
const shouldKeepSuggestionsExpanded =
|
|
183
|
+
! __experimentalExpandOnFocus ||
|
|
184
|
+
( __experimentalExpandOnFocus &&
|
|
185
|
+
event.relatedTarget === tokensAndInput.current );
|
|
186
|
+
setIsExpanded( shouldKeepSuggestionsExpanded );
|
|
187
|
+
|
|
180
188
|
setSelectedSuggestionIndex( -1 );
|
|
181
189
|
setSelectedSuggestionScroll( false );
|
|
182
190
|
}
|
|
@@ -48,9 +48,7 @@ export function UnForwardedTokenInput(
|
|
|
48
48
|
onFocus?.( e );
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const onBlurHandler:
|
|
52
|
-
e
|
|
53
|
-
) => {
|
|
51
|
+
const onBlurHandler: FocusEventHandler< HTMLInputElement > = ( e ) => {
|
|
54
52
|
setHasFocus( false );
|
|
55
53
|
onBlur?.( e );
|
|
56
54
|
};
|
package/src/heading/README.md
CHANGED
|
@@ -18,7 +18,12 @@ function Example() {
|
|
|
18
18
|
|
|
19
19
|
## Props
|
|
20
20
|
|
|
21
|
-
`Heading` uses `Text` underneath, so we have access to all of `Text`'s props except for
|
|
21
|
+
`Heading` uses `Text` underneath, so we have access to all of `Text`'s props except for:
|
|
22
|
+
|
|
23
|
+
- `size` which is replaced by `level`;
|
|
24
|
+
- `isBlock`'s default value, which is `true` for the `Heading` component.
|
|
25
|
+
|
|
26
|
+
For a complete list of those props, check out [`Text`](/packages/components/src/text/README.md#props).
|
|
22
27
|
|
|
23
28
|
##### `level`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
24
29
|
|
package/src/heading/hook.ts
CHANGED
|
@@ -14,6 +14,9 @@ export function useHeading(
|
|
|
14
14
|
const {
|
|
15
15
|
as: asProp,
|
|
16
16
|
level = 2,
|
|
17
|
+
color = COLORS.gray[ 900 ],
|
|
18
|
+
isBlock = true,
|
|
19
|
+
weight = CONFIG.fontWeightHeading as import('react').CSSProperties[ 'fontWeight' ],
|
|
17
20
|
...otherProps
|
|
18
21
|
} = useContextSystem( props, 'Heading' );
|
|
19
22
|
|
|
@@ -31,10 +34,10 @@ export function useHeading(
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
const textProps = useText( {
|
|
34
|
-
color
|
|
37
|
+
color,
|
|
38
|
+
isBlock,
|
|
39
|
+
weight,
|
|
35
40
|
size: getHeadingFontSize( level ),
|
|
36
|
-
isBlock: true,
|
|
37
|
-
weight: CONFIG.fontWeightHeading as import('react').CSSProperties[ 'fontWeight' ],
|
|
38
41
|
...otherProps,
|
|
39
42
|
} );
|
|
40
43
|
|
package/src/heading/types.ts
CHANGED
|
@@ -17,7 +17,10 @@ export type HeadingSize =
|
|
|
17
17
|
| '5'
|
|
18
18
|
| '6';
|
|
19
19
|
|
|
20
|
-
export type HeadingProps = Omit<
|
|
20
|
+
export type HeadingProps = Omit<
|
|
21
|
+
TextProps,
|
|
22
|
+
'size' | 'isBlock' | 'color' | 'weight'
|
|
23
|
+
> & {
|
|
21
24
|
/**
|
|
22
25
|
* Passing any of the heading levels to `level` will both render the correct
|
|
23
26
|
* typographic text size as well as the semantic element corresponding to
|
|
@@ -26,4 +29,23 @@ export type HeadingProps = Omit< TextProps, 'size' > & {
|
|
|
26
29
|
* @default 2
|
|
27
30
|
*/
|
|
28
31
|
level?: HeadingSize;
|
|
32
|
+
/**
|
|
33
|
+
* Sets `Heading` to have `display: block`. Note: text truncation only works
|
|
34
|
+
* when `isBlock` is `false`.
|
|
35
|
+
*
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
isBlock?: TextProps[ 'isBlock' ];
|
|
39
|
+
/**
|
|
40
|
+
* Adjusts the text color.
|
|
41
|
+
*
|
|
42
|
+
* @default '#1e1e1e'
|
|
43
|
+
*/
|
|
44
|
+
color?: TextProps[ 'color' ];
|
|
45
|
+
/**
|
|
46
|
+
* Adjusts font-weight of the text.
|
|
47
|
+
*
|
|
48
|
+
* @default '600'
|
|
49
|
+
*/
|
|
50
|
+
weight?: TextProps[ 'weight' ];
|
|
29
51
|
};
|
package/src/index.native.js
CHANGED
|
@@ -106,11 +106,9 @@ export { default as LinkPickerScreen } from './mobile/link-picker/link-picker-sc
|
|
|
106
106
|
export { default as LinkSettings } from './mobile/link-settings';
|
|
107
107
|
export { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';
|
|
108
108
|
export { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';
|
|
109
|
-
export { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';
|
|
110
109
|
export { default as SegmentedControl } from './mobile/segmented-control';
|
|
111
110
|
export { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';
|
|
112
111
|
export { default as ImageEditingButton } from './mobile/image/image-editing-button';
|
|
113
|
-
export { default as InserterButton } from './mobile/inserter-button';
|
|
114
112
|
export { setClipboard, getClipboard } from './mobile/clipboard';
|
|
115
113
|
export { default as AudioPlayer } from './mobile/audio-player';
|
|
116
114
|
export { default as Badge } from './mobile/badge';
|
|
@@ -108,6 +108,28 @@ describe( 'parseStylesVariables', () => {
|
|
|
108
108
|
expect.objectContaining( PARSED_GLOBAL_STYLES )
|
|
109
109
|
);
|
|
110
110
|
} );
|
|
111
|
+
|
|
112
|
+
it( 'returns the parsed custom color values correctly', () => {
|
|
113
|
+
const defaultStyles = {
|
|
114
|
+
...DEFAULT_GLOBAL_STYLES,
|
|
115
|
+
color: {
|
|
116
|
+
text: 'var(--wp--custom--color--blue)',
|
|
117
|
+
background: 'var(--wp--custom--color--green)',
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
const customValues = parseStylesVariables(
|
|
121
|
+
JSON.stringify( RAW_FEATURES.custom ),
|
|
122
|
+
MAPPED_VALUES
|
|
123
|
+
);
|
|
124
|
+
const styles = parseStylesVariables(
|
|
125
|
+
JSON.stringify( defaultStyles ),
|
|
126
|
+
MAPPED_VALUES,
|
|
127
|
+
customValues
|
|
128
|
+
);
|
|
129
|
+
expect( styles ).toEqual(
|
|
130
|
+
expect.objectContaining( PARSED_GLOBAL_STYLES )
|
|
131
|
+
);
|
|
132
|
+
} );
|
|
111
133
|
} );
|
|
112
134
|
|
|
113
135
|
describe( 'getGlobalStyles', () => {
|
|
@@ -248,6 +248,20 @@ export function parseStylesVariables( styles, mappedValues, customValues ) {
|
|
|
248
248
|
const customValuesData = customValues ?? JSON.parse( stylesBase );
|
|
249
249
|
stylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {
|
|
250
250
|
const path = $2.split( '--' );
|
|
251
|
+
|
|
252
|
+
// Supports cases for variables like var(--wp--custom--color--background)
|
|
253
|
+
if ( path[ 0 ] === 'color' ) {
|
|
254
|
+
const colorKey = path[ path.length - 1 ];
|
|
255
|
+
if ( mappedValues?.color ) {
|
|
256
|
+
const matchedValue = mappedValues.color?.values?.find(
|
|
257
|
+
( { slug } ) => slug === colorKey
|
|
258
|
+
);
|
|
259
|
+
if ( matchedValue ) {
|
|
260
|
+
return `${ matchedValue?.color }`;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
251
265
|
if (
|
|
252
266
|
path.reduce(
|
|
253
267
|
( prev, curr ) => prev && prev[ curr ],
|
|
@@ -2,20 +2,3 @@
|
|
|
2
2
|
padding-left: 0;
|
|
3
3
|
padding-right: 0;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
// used in both light and dark modes
|
|
7
|
-
.placeholderTextColor {
|
|
8
|
-
color: #87a6bc;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.optionIcon {
|
|
12
|
-
color: $blue-50;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.optionIconDark {
|
|
16
|
-
color: $blue-30;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.unselectedOptionIcon {
|
|
20
|
-
opacity: 0;
|
|
21
|
-
}
|
|
@@ -60,7 +60,7 @@ import type {
|
|
|
60
60
|
PaletteElement,
|
|
61
61
|
} from './types';
|
|
62
62
|
|
|
63
|
-
const DEFAULT_COLOR = '#000';
|
|
63
|
+
export const DEFAULT_COLOR = '#000';
|
|
64
64
|
|
|
65
65
|
function NameInput( { value, onChange, label }: NameInputProps ) {
|
|
66
66
|
return (
|
|
@@ -261,16 +261,30 @@ function Option< T extends Color | Gradient >( {
|
|
|
261
261
|
);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
/**
|
|
265
|
+
* Checks if a color or gradient is a temporary element by testing against default values.
|
|
266
|
+
*/
|
|
267
|
+
export function isTemporaryElement(
|
|
265
268
|
slugPrefix: string,
|
|
266
269
|
{ slug, color, gradient }: Color | Gradient
|
|
267
|
-
) {
|
|
270
|
+
): Boolean {
|
|
268
271
|
const regex = new RegExp( `^${ slugPrefix }color-([\\d]+)$` );
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
|
|
273
|
+
// If the slug matches the temporary name regex,
|
|
274
|
+
// check if the color or gradient matches the default value.
|
|
275
|
+
if ( regex.test( slug ) ) {
|
|
276
|
+
// The order is important as gradient elements
|
|
277
|
+
// contain a color property.
|
|
278
|
+
if ( !! gradient ) {
|
|
279
|
+
return gradient === DEFAULT_GRADIENT;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if ( !! color ) {
|
|
283
|
+
return color === DEFAULT_COLOR;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return false;
|
|
274
288
|
}
|
|
275
289
|
|
|
276
290
|
function PaletteEditListView< T extends Color | Gradient >( {
|
|
@@ -6,8 +6,13 @@ import { render, fireEvent, screen } from '@testing-library/react';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import PaletteEdit, {
|
|
9
|
+
import PaletteEdit, {
|
|
10
|
+
getNameForPosition,
|
|
11
|
+
isTemporaryElement,
|
|
12
|
+
DEFAULT_COLOR,
|
|
13
|
+
} from '..';
|
|
10
14
|
import type { PaletteElement } from '../types';
|
|
15
|
+
import { DEFAULT_GRADIENT } from '../../custom-gradient-picker/constants';
|
|
11
16
|
|
|
12
17
|
describe( 'getNameForPosition', () => {
|
|
13
18
|
test( 'should return 1 by default', () => {
|
|
@@ -80,6 +85,75 @@ describe( 'getNameForPosition', () => {
|
|
|
80
85
|
} );
|
|
81
86
|
} );
|
|
82
87
|
|
|
88
|
+
describe( 'isTemporaryElement', () => {
|
|
89
|
+
[
|
|
90
|
+
{
|
|
91
|
+
message: 'identifies temporary color',
|
|
92
|
+
slug: 'test-',
|
|
93
|
+
obj: {
|
|
94
|
+
name: '',
|
|
95
|
+
slug: 'test-color-1',
|
|
96
|
+
color: DEFAULT_COLOR,
|
|
97
|
+
},
|
|
98
|
+
expected: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
message: 'identifies temporary gradient',
|
|
102
|
+
slug: 'test-',
|
|
103
|
+
obj: {
|
|
104
|
+
name: '',
|
|
105
|
+
slug: 'test-color-1',
|
|
106
|
+
gradient: DEFAULT_GRADIENT,
|
|
107
|
+
},
|
|
108
|
+
expected: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
message: 'identifies custom color slug',
|
|
112
|
+
slug: 'test-',
|
|
113
|
+
obj: {
|
|
114
|
+
name: '',
|
|
115
|
+
slug: 'test-color-happy',
|
|
116
|
+
color: DEFAULT_COLOR,
|
|
117
|
+
},
|
|
118
|
+
expected: false,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
message: 'identifies custom color value',
|
|
122
|
+
slug: 'test-',
|
|
123
|
+
obj: {
|
|
124
|
+
name: '',
|
|
125
|
+
slug: 'test-color-1',
|
|
126
|
+
color: '#ccc',
|
|
127
|
+
},
|
|
128
|
+
expected: false,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
message: 'identifies custom gradient slug',
|
|
132
|
+
slug: 'test-',
|
|
133
|
+
obj: {
|
|
134
|
+
name: '',
|
|
135
|
+
slug: 'test-gradient-joy',
|
|
136
|
+
color: DEFAULT_GRADIENT,
|
|
137
|
+
},
|
|
138
|
+
expected: false,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
message: 'identifies custom gradient value',
|
|
142
|
+
slug: 'test-',
|
|
143
|
+
obj: {
|
|
144
|
+
name: '',
|
|
145
|
+
slug: 'test-color-3',
|
|
146
|
+
color: 'linear-gradient(90deg, rgba(22, 22, 22, 1) 0%, rgb(155, 81, 224) 100%)',
|
|
147
|
+
},
|
|
148
|
+
expected: false,
|
|
149
|
+
},
|
|
150
|
+
].forEach( ( { message, slug, obj, expected } ) => {
|
|
151
|
+
it( `should ${ message }`, () => {
|
|
152
|
+
expect( isTemporaryElement( slug, obj ) ).toBe( expected );
|
|
153
|
+
} );
|
|
154
|
+
} );
|
|
155
|
+
} );
|
|
156
|
+
|
|
83
157
|
describe( 'PaletteEdit', () => {
|
|
84
158
|
const defaultProps = {
|
|
85
159
|
colors: [ { color: '#ffffff', name: 'Base', slug: 'base' } ],
|
package/src/private-apis.ts
CHANGED
|
@@ -32,11 +32,12 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
DropdownMenu as DropdownMenuV2Ariakit,
|
|
34
34
|
DropdownMenuGroup as DropdownMenuGroupV2Ariakit,
|
|
35
|
-
DropdownMenuGroupLabel as DropdownMenuGroupLabelV2Ariakit,
|
|
36
35
|
DropdownMenuItem as DropdownMenuItemV2Ariakit,
|
|
37
36
|
DropdownMenuCheckboxItem as DropdownMenuCheckboxItemV2Ariakit,
|
|
38
37
|
DropdownMenuRadioItem as DropdownMenuRadioItemV2Ariakit,
|
|
39
38
|
DropdownMenuSeparator as DropdownMenuSeparatorV2Ariakit,
|
|
39
|
+
DropdownMenuItemLabel as DropdownMenuItemLabelV2Ariakit,
|
|
40
|
+
DropdownMenuItemHelpText as DropdownMenuItemHelpTextV2Ariakit,
|
|
40
41
|
} from './dropdown-menu-v2-ariakit';
|
|
41
42
|
import { ComponentsContext } from './context/context-system-provider';
|
|
42
43
|
import Theme from './theme';
|
|
@@ -74,9 +75,10 @@ lock( privateApis, {
|
|
|
74
75
|
Theme,
|
|
75
76
|
DropdownMenuV2Ariakit,
|
|
76
77
|
DropdownMenuGroupV2Ariakit,
|
|
77
|
-
DropdownMenuGroupLabelV2Ariakit,
|
|
78
78
|
DropdownMenuItemV2Ariakit,
|
|
79
79
|
DropdownMenuCheckboxItemV2Ariakit,
|
|
80
80
|
DropdownMenuRadioItemV2Ariakit,
|
|
81
81
|
DropdownMenuSeparatorV2Ariakit,
|
|
82
|
+
DropdownMenuItemLabelV2Ariakit,
|
|
83
|
+
DropdownMenuItemHelpTextV2Ariakit,
|
|
82
84
|
} );
|
|
@@ -6,6 +6,7 @@ import TreeSelect from '../tree-select';
|
|
|
6
6
|
import type { AuthorSelectProps } from './types';
|
|
7
7
|
|
|
8
8
|
export default function AuthorSelect( {
|
|
9
|
+
__next40pxDefaultSize,
|
|
9
10
|
label,
|
|
10
11
|
noOptionLabel,
|
|
11
12
|
authorList,
|
|
@@ -28,6 +29,7 @@ export default function AuthorSelect( {
|
|
|
28
29
|
: undefined
|
|
29
30
|
}
|
|
30
31
|
__nextHasNoMarginBottom
|
|
32
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
31
33
|
/>
|
|
32
34
|
);
|
|
33
35
|
}
|
|
@@ -11,6 +11,7 @@ import { useMemo } from '@wordpress/element';
|
|
|
11
11
|
import type { CategorySelectProps } from './types';
|
|
12
12
|
|
|
13
13
|
export default function CategorySelect( {
|
|
14
|
+
__next40pxDefaultSize,
|
|
14
15
|
label,
|
|
15
16
|
noOptionLabel,
|
|
16
17
|
categoriesList,
|
|
@@ -37,6 +38,7 @@ export default function CategorySelect( {
|
|
|
37
38
|
}
|
|
38
39
|
{ ...props }
|
|
39
40
|
__nextHasNoMarginBottom
|
|
41
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
40
42
|
/>
|
|
41
43
|
);
|
|
42
44
|
}
|
|
@@ -60,6 +60,7 @@ function isMultipleCategorySelection(
|
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
62
|
export function QueryControls( {
|
|
63
|
+
__next40pxDefaultSize = false,
|
|
63
64
|
authorList,
|
|
64
65
|
selectedAuthorId,
|
|
65
66
|
numberOfItems,
|
|
@@ -81,6 +82,7 @@ export function QueryControls( {
|
|
|
81
82
|
onOrderChange && onOrderByChange && (
|
|
82
83
|
<SelectControl
|
|
83
84
|
__nextHasNoMarginBottom
|
|
85
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
84
86
|
key="query-controls-order-select"
|
|
85
87
|
label={ __( 'Order by' ) }
|
|
86
88
|
value={ `${ orderBy }/${ order }` }
|
|
@@ -131,6 +133,7 @@ export function QueryControls( {
|
|
|
131
133
|
props.categoriesList &&
|
|
132
134
|
props.onCategoryChange && (
|
|
133
135
|
<CategorySelect
|
|
136
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
134
137
|
key="query-controls-category-select"
|
|
135
138
|
categoriesList={ props.categoriesList }
|
|
136
139
|
label={ __( 'Category' ) }
|
|
@@ -143,6 +146,7 @@ export function QueryControls( {
|
|
|
143
146
|
props.categorySuggestions &&
|
|
144
147
|
props.onCategoryChange && (
|
|
145
148
|
<FormTokenField
|
|
149
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
146
150
|
__nextHasNoMarginBottom
|
|
147
151
|
key="query-controls-categories-select"
|
|
148
152
|
label={ __( 'Categories' ) }
|
|
@@ -166,6 +170,7 @@ export function QueryControls( {
|
|
|
166
170
|
),
|
|
167
171
|
onAuthorChange && (
|
|
168
172
|
<AuthorSelect
|
|
173
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
169
174
|
key="query-controls-author-select"
|
|
170
175
|
authorList={ authorList }
|
|
171
176
|
label={ __( 'Author' ) }
|
|
@@ -177,7 +182,7 @@ export function QueryControls( {
|
|
|
177
182
|
onNumberOfItemsChange && (
|
|
178
183
|
<RangeControl
|
|
179
184
|
__nextHasNoMarginBottom
|
|
180
|
-
__next40pxDefaultSize
|
|
185
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
181
186
|
key="query-controls-range-control"
|
|
182
187
|
label={ __( 'Number of items' ) }
|
|
183
188
|
value={ numberOfItems }
|
|
@@ -31,6 +31,7 @@ export type CategorySelectProps = Pick<
|
|
|
31
31
|
categoriesList: Category[];
|
|
32
32
|
onChange: ( newCategory: string ) => void;
|
|
33
33
|
selectedCategoryId?: Category[ 'id' ];
|
|
34
|
+
__next40pxDefaultSize: boolean;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export type AuthorSelectProps = Pick<
|
|
@@ -40,6 +41,7 @@ export type AuthorSelectProps = Pick<
|
|
|
40
41
|
authorList?: Author[];
|
|
41
42
|
onChange: ( newAuthor: string ) => void;
|
|
42
43
|
selectedAuthorId?: Author[ 'id' ];
|
|
44
|
+
__next40pxDefaultSize: boolean;
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
type Order = 'asc' | 'desc';
|
|
@@ -101,6 +103,13 @@ type BaseQueryControlsProps = {
|
|
|
101
103
|
* The selected author ID.
|
|
102
104
|
*/
|
|
103
105
|
selectedAuthorId?: AuthorSelectProps[ 'selectedAuthorId' ];
|
|
106
|
+
/**
|
|
107
|
+
* Start opting into the larger default height that will become the
|
|
108
|
+
* default size in a future version.
|
|
109
|
+
*
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
__next40pxDefaultSize?: boolean;
|
|
104
113
|
};
|
|
105
114
|
|
|
106
115
|
export type QueryControlsWithSingleCategorySelectionProps =
|
|
@@ -8,6 +8,8 @@ SearchControl components let users display a search control.
|
|
|
8
8
|
1. [Development guidelines](#development-guidelines)
|
|
9
9
|
2. [Related components](#related-components)
|
|
10
10
|
|
|
11
|
+
Check out the [Storybook page](https://wordpress.github.io/gutenberg/?path=/docs/components-searchcontrol--docs) for a visual exploration of this component.
|
|
12
|
+
|
|
11
13
|
## Development guidelines
|
|
12
14
|
|
|
13
15
|
### Usage
|
package/src/slot-fill/README.md
CHANGED
|
@@ -68,7 +68,7 @@ Both `Slot` and `Fill` accept a `name` string prop, where a `Slot` with a given
|
|
|
68
68
|
- By default, events will bubble to their parents on the DOM hierarchy (native event bubbling)
|
|
69
69
|
- If `bubblesVirtually` is set to true, events will bubble to their virtual parent in the React elements hierarchy instead.
|
|
70
70
|
|
|
71
|
-
`Slot` with `bubblesVirtually` set to true also accept
|
|
71
|
+
`Slot` with `bubblesVirtually` set to true also accept optional `className` and `style` props to add to the slot container.
|
|
72
72
|
|
|
73
73
|
`Slot` **without** `bubblesVirtually` accepts an optional `children` function prop, which takes `fills` as a param. It allows you to perform additional processing and wrap `fills` conditionally.
|
|
74
74
|
|
package/src/slot-fill/types.ts
CHANGED
|
@@ -36,15 +36,21 @@ export type SlotComponentProps =
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* A function that returns nodes to be rendered.
|
|
39
|
-
*
|
|
39
|
+
* Supported only when `bubblesVirtually` is `false`.
|
|
40
40
|
*/
|
|
41
41
|
children?: never;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* className.
|
|
45
|
-
*
|
|
44
|
+
* Additional className for the `Slot` component.
|
|
45
|
+
* Supported only when `bubblesVirtually` is `true`.
|
|
46
46
|
*/
|
|
47
47
|
className?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Additional styles for the `Slot` component.
|
|
51
|
+
* Supported only when `bubblesVirtually` is `true`.
|
|
52
|
+
*/
|
|
53
|
+
style?: React.CSSProperties;
|
|
48
54
|
} )
|
|
49
55
|
| ( SlotPropBase & {
|
|
50
56
|
/**
|
|
@@ -56,15 +62,21 @@ export type SlotComponentProps =
|
|
|
56
62
|
|
|
57
63
|
/**
|
|
58
64
|
* A function that returns nodes to be rendered.
|
|
59
|
-
*
|
|
65
|
+
* Supported only when `bubblesVirtually` is `false`.
|
|
60
66
|
*/
|
|
61
67
|
children?: ( fills: ReactNode ) => ReactNode;
|
|
62
68
|
|
|
63
69
|
/**
|
|
64
|
-
* className.
|
|
65
|
-
*
|
|
70
|
+
* Additional className for the `Slot` component.
|
|
71
|
+
* Supported only when `bubblesVirtually` is `true`.
|
|
66
72
|
*/
|
|
67
73
|
className?: never;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Additional styles for the `Slot` component.
|
|
77
|
+
* Supported only when `bubblesVirtually` is `true`.
|
|
78
|
+
*/
|
|
79
|
+
style?: never;
|
|
68
80
|
} );
|
|
69
81
|
|
|
70
82
|
export type FillComponentProps = {
|