@wordpress/components 29.4.0 → 29.5.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/build/border-control/border-control-dropdown/component.js +19 -21
  3. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  4. package/build/border-control/border-control-dropdown/hook.js +3 -3
  5. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  6. package/build/border-control/styles.js +24 -19
  7. package/build/border-control/styles.js.map +1 -1
  8. package/build/circular-option-picker/circular-option-picker.js +1 -0
  9. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  10. package/build/circular-option-picker/index.js +7 -0
  11. package/build/circular-option-picker/index.js.map +1 -1
  12. package/build/circular-option-picker/types.js.map +1 -1
  13. package/build/circular-option-picker/utils.js +31 -0
  14. package/build/circular-option-picker/utils.js.map +1 -0
  15. package/build/color-palette/index.js +9 -29
  16. package/build/color-palette/index.js.map +1 -1
  17. package/build/duotone-picker/duotone-picker.js +8 -28
  18. package/build/duotone-picker/duotone-picker.js.map +1 -1
  19. package/build/font-size-picker/types.js.map +1 -1
  20. package/build/gradient-picker/index.js +8 -28
  21. package/build/gradient-picker/index.js.map +1 -1
  22. package/build/input-control/styles/input-control-styles.js +22 -22
  23. package/build/input-control/styles/input-control-styles.js.map +1 -1
  24. package/build/mobile/bottom-sheet/switch-cell.native.js +1 -1
  25. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  26. package/build/number-control/index.js +2 -2
  27. package/build/number-control/index.js.map +1 -1
  28. package/build/textarea-control/styles/textarea-control-styles.js +3 -3
  29. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  30. package/build-module/border-control/border-control-dropdown/component.js +19 -21
  31. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  32. package/build-module/border-control/border-control-dropdown/hook.js +3 -3
  33. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  34. package/build-module/border-control/styles.js +22 -13
  35. package/build-module/border-control/styles.js.map +1 -1
  36. package/build-module/circular-option-picker/circular-option-picker.js +1 -0
  37. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  38. package/build-module/circular-option-picker/index.js +1 -0
  39. package/build-module/circular-option-picker/index.js.map +1 -1
  40. package/build-module/circular-option-picker/types.js.map +1 -1
  41. package/build-module/circular-option-picker/utils.js +25 -0
  42. package/build-module/circular-option-picker/utils.js.map +1 -0
  43. package/build-module/color-palette/index.js +7 -29
  44. package/build-module/color-palette/index.js.map +1 -1
  45. package/build-module/duotone-picker/duotone-picker.js +6 -28
  46. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  47. package/build-module/font-size-picker/types.js.map +1 -1
  48. package/build-module/gradient-picker/index.js +6 -28
  49. package/build-module/gradient-picker/index.js.map +1 -1
  50. package/build-module/input-control/styles/input-control-styles.js +22 -22
  51. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  52. package/build-module/mobile/bottom-sheet/switch-cell.native.js +1 -1
  53. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  54. package/build-module/number-control/index.js +2 -2
  55. package/build-module/number-control/index.js.map +1 -1
  56. package/build-module/textarea-control/styles/textarea-control-styles.js +3 -3
  57. package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
  58. package/build-style/style-rtl.css +6 -6
  59. package/build-style/style.css +7 -6
  60. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  61. package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -1
  62. package/build-types/border-control/styles.d.ts +1 -1
  63. package/build-types/border-control/styles.d.ts.map +1 -1
  64. package/build-types/circular-option-picker/index.d.ts +1 -0
  65. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  66. package/build-types/circular-option-picker/types.d.ts +11 -7
  67. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  68. package/build-types/circular-option-picker/utils.d.ts +17 -0
  69. package/build-types/circular-option-picker/utils.d.ts.map +1 -0
  70. package/build-types/color-palette/index.d.ts.map +1 -1
  71. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  72. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  73. package/build-types/font-size-picker/types.d.ts +4 -0
  74. package/build-types/font-size-picker/types.d.ts.map +1 -1
  75. package/build-types/gradient-picker/index.d.ts.map +1 -1
  76. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  77. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
  78. package/package.json +19 -19
  79. package/src/border-box-control/test/index.tsx +1 -1
  80. package/src/border-control/border-control-dropdown/component.tsx +8 -12
  81. package/src/border-control/border-control-dropdown/hook.ts +3 -3
  82. package/src/border-control/styles.ts +4 -10
  83. package/src/border-control/test/index.js +1 -1
  84. package/src/circular-option-picker/README.md +13 -0
  85. package/src/circular-option-picker/circular-option-picker.tsx +1 -1
  86. package/src/circular-option-picker/index.tsx +1 -0
  87. package/src/circular-option-picker/stories/index.story.tsx +1 -1
  88. package/src/circular-option-picker/test/index.tsx +1 -0
  89. package/src/circular-option-picker/types.ts +11 -10
  90. package/src/circular-option-picker/utils.tsx +27 -0
  91. package/src/color-palette/index.tsx +11 -29
  92. package/src/color-palette/test/index.tsx +1 -1
  93. package/src/duotone-picker/duotone-picker.tsx +10 -28
  94. package/src/font-size-picker/README.md +2 -0
  95. package/src/font-size-picker/stories/index.story.tsx +4 -0
  96. package/src/font-size-picker/types.ts +4 -0
  97. package/src/gradient-picker/index.tsx +10 -28
  98. package/src/input-control/styles/input-control-styles.tsx +9 -1
  99. package/src/mobile/bottom-sheet/switch-cell.native.js +1 -1
  100. package/src/notice/README.md +1 -1
  101. package/src/notice/style.scss +1 -0
  102. package/src/number-control/README.md +1 -1
  103. package/src/number-control/index.tsx +2 -2
  104. package/src/text-control/style.scss +6 -0
  105. package/src/textarea-control/styles/textarea-control-styles.ts +0 -2
  106. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gradient-picker/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACX,4BAA4B,EAI5B,MAAM,SAAS,CAAC;AAoJjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,cAAc,CAAE,EAC/B,SAAS,EACT,SAAc,EACd,QAAQ,EACR,KAAK,EACL,SAAgB,EAChB,WAAkB,EAClB,sBAA8B,EAC9B,iCAAiC,EACjC,YAAgB,EAChB,GAAG,eAAe,EAClB,EAAE,4BAA4B,+BA2C9B;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gradient-picker/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,4BAA4B,EAI5B,MAAM,SAAS,CAAC;AAgIjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,cAAc,CAAE,EAC/B,SAAS,EACT,SAAc,EACd,QAAQ,EACR,KAAK,EACL,SAAgB,EAChB,WAAkB,EAClB,sBAA8B,EAC9B,iCAAiC,EACjC,YAAgB,EAChB,GAAG,eAAe,EAClB,EAAE,4BAA4B,+BA2C9B;AAED,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input-control-styles.d.ts","sourceRoot":"","sources":["../../../src/input-control/styles/input-control-styles.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE9E,KAAK,cAAc,GAAG;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,aAAa,CAAE,OAAO,CAAE,CAAC;IAChD,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,MAAM;;SATuC,MAAO,WAAW;2GAY3E,CAAC;AAEF,eAAO,MAAM,MAAM;;SAduC,MAAO,WAAW;2GAmB3E,CAAC;AAEF,KAAK,aAAa,GAAG;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAiBF,eAAO,MAAM,UAAU;;SAzCmC,MAAO,WAAW;yHA2D3E,CAAC;AAEF,eAAO,MAAM,IAAI;;;;UAgBhB,CAAC;AA+BF,eAAO,MAAM,SAAS;;SA5GoC,MAAO,WAAW;0HAsH3E,CAAC;AAEF,KAAK,UAAU,GAAG;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,aAAa,CAAE,QAAQ,CAAE,CAAC;IACvC,kBAAkB,CAAC,EAAE,aAAa,CAAE,oBAAoB,CAAE,CAAC;IAC3D,gBAAgB,CAAC,EAAE,aAAa,CAAE,kBAAkB,CAAE,CAAC;CACvD,CAAC;AAYF,eAAO,MAAM,cAAc,wBAA0B,UAAU,0BAsB9D,CAAC;AAEF,eAAO,MAAM,aAAa,gDAGvB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;CAsCZ,CAAC;AA+CF,eAAO,MAAM,KAAK;;SA5PwC,MAAO,WAAW;+HAyR3E,CAAC;AAmBF,eAAO,MAAM,KAAK,UACV,uBAAuB,CAC7B;IAAE,aAAa,CAAC,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,EACtD,OAAO,EACP,KAAK,CACL,gCACwC,CAAC;AAE3C,eAAO,MAAM,YAAY;;;;UAExB,CAAC;AA8BF,eAAO,MAAM,mBAAmB;;SApV0B,MAAO,WAAW;;eA6TjC,OAAO;yGAyBjD,CAAC"}
1
+ {"version":3,"file":"input-control-styles.d.ts","sourceRoot":"","sources":["../../../src/input-control/styles/input-control-styles.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE9E,KAAK,cAAc,GAAG;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,aAAa,CAAE,OAAO,CAAE,CAAC;IAChD,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,MAAM;;SATuC,MAAO,WAAW;2GAY3E,CAAC;AAEF,eAAO,MAAM,MAAM;;SAduC,MAAO,WAAW;2GAmB3E,CAAC;AAEF,KAAK,aAAa,GAAG;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAiBF,eAAO,MAAM,UAAU;;SAzCmC,MAAO,WAAW;yHA2D3E,CAAC;AAEF,eAAO,MAAM,IAAI;;;;UAgBhB,CAAC;AA+BF,eAAO,MAAM,SAAS;;SA5GoC,MAAO,WAAW;0HAsH3E,CAAC;AAEF,KAAK,UAAU,GAAG;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,aAAa,CAAE,QAAQ,CAAE,CAAC;IACvC,kBAAkB,CAAC,EAAE,aAAa,CAAE,oBAAoB,CAAE,CAAC;IAC3D,gBAAgB,CAAC,EAAE,aAAa,CAAE,kBAAkB,CAAE,CAAC;CACvD,CAAC;AAYF,eAAO,MAAM,cAAc,wBAA0B,UAAU,0BAsB9D,CAAC;AAEF,eAAO,MAAM,aAAa,gDAGvB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;CAsCZ,CAAC;AA+CF,eAAO,MAAM,KAAK;;SA5PwC,MAAO,WAAW;+HAiS3E,CAAC;AAmBF,eAAO,MAAM,KAAK,UACV,uBAAuB,CAC7B;IAAE,aAAa,CAAC,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,EACtD,OAAO,EACP,KAAK,CACL,gCACwC,CAAC;AAE3C,eAAO,MAAM,YAAY;;;;UAExB,CAAC;AA8BF,eAAO,MAAM,mBAAmB;;SA5V0B,MAAO,WAAW;;eAqUjC,OAAO;yGAyBjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"textarea-control-styles.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/styles/textarea-control-styles.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,cAAc;;SAfI,MAAQ,WAC/B;2HAkEP,CAAC"}
1
+ {"version":3,"file":"textarea-control-styles.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/styles/textarea-control-styles.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,cAAc;;SAfI,MAAQ,WAC/B;2HAgEP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "29.4.0",
3
+ "version": "29.5.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -44,23 +44,23 @@
44
44
  "@types/gradient-parser": "0.1.3",
45
45
  "@types/highlight-words-core": "1.2.1",
46
46
  "@use-gesture/react": "^10.3.1",
47
- "@wordpress/a11y": "^4.18.0",
48
- "@wordpress/compose": "^7.18.0",
49
- "@wordpress/date": "^5.18.0",
50
- "@wordpress/deprecated": "^4.18.0",
51
- "@wordpress/dom": "^4.18.0",
52
- "@wordpress/element": "^6.18.0",
53
- "@wordpress/escape-html": "^3.18.0",
54
- "@wordpress/hooks": "^4.18.0",
55
- "@wordpress/html-entities": "^4.18.0",
56
- "@wordpress/i18n": "^5.18.0",
57
- "@wordpress/icons": "^10.18.0",
58
- "@wordpress/is-shallow-equal": "^5.18.0",
59
- "@wordpress/keycodes": "^4.18.0",
60
- "@wordpress/primitives": "^4.18.0",
61
- "@wordpress/private-apis": "^1.18.0",
62
- "@wordpress/rich-text": "^7.18.0",
63
- "@wordpress/warning": "^3.18.0",
47
+ "@wordpress/a11y": "^4.19.0",
48
+ "@wordpress/compose": "^7.19.0",
49
+ "@wordpress/date": "^5.19.0",
50
+ "@wordpress/deprecated": "^4.19.0",
51
+ "@wordpress/dom": "^4.19.0",
52
+ "@wordpress/element": "^6.19.0",
53
+ "@wordpress/escape-html": "^3.19.0",
54
+ "@wordpress/hooks": "^4.19.0",
55
+ "@wordpress/html-entities": "^4.19.0",
56
+ "@wordpress/i18n": "^5.19.0",
57
+ "@wordpress/icons": "^10.19.0",
58
+ "@wordpress/is-shallow-equal": "^5.19.0",
59
+ "@wordpress/keycodes": "^4.19.0",
60
+ "@wordpress/primitives": "^4.19.0",
61
+ "@wordpress/private-apis": "^1.19.0",
62
+ "@wordpress/rich-text": "^7.19.0",
63
+ "@wordpress/warning": "^3.19.0",
64
64
  "change-case": "^4.1.2",
65
65
  "clsx": "^2.1.1",
66
66
  "colord": "^2.7.0",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "afe4fb333177642180ac020f1030c5685eab7183"
88
+ "gitHead": "d6b0b20fa927b110140dc7fdd906a7e0bf662004"
89
89
  }
@@ -202,7 +202,7 @@ describe( 'BorderBoxControl', () => {
202
202
  await waitFor( () =>
203
203
  expect(
204
204
  screen.getByRole( 'button', {
205
- name: 'Custom color picker.',
205
+ name: 'Custom color picker',
206
206
  } )
207
207
  ).toBeVisible()
208
208
  );
@@ -157,7 +157,7 @@ const BorderControlDropdown = (
157
157
  onStyleChange,
158
158
  popoverContentClassName,
159
159
  popoverControlsClassName,
160
- resetButtonClassName,
160
+ resetButtonWrapperClassName,
161
161
  size,
162
162
  __unstablePopoverProps,
163
163
  ...otherProps
@@ -173,7 +173,7 @@ const BorderControlDropdown = (
173
173
  enableStyle
174
174
  );
175
175
 
176
- const showResetButton = color || ( style && style !== 'none' );
176
+ const enableResetButton = color || ( style && style !== 'none' );
177
177
  const dropdownPosition = __experimentalIsRenderedInSidebar
178
178
  ? 'bottom left'
179
179
  : undefined;
@@ -199,9 +199,7 @@ const BorderControlDropdown = (
199
199
  </Button>
200
200
  );
201
201
 
202
- const renderContent: DropdownComponentProps[ 'renderContent' ] = ( {
203
- onClose,
204
- } ) => (
202
+ const renderContent: DropdownComponentProps[ 'renderContent' ] = () => (
205
203
  <>
206
204
  <DropdownContentWrapper paddingSize="medium">
207
205
  <VStack className={ popoverControlsClassName } spacing={ 6 }>
@@ -224,22 +222,20 @@ const BorderControlDropdown = (
224
222
  />
225
223
  ) }
226
224
  </VStack>
227
- </DropdownContentWrapper>
228
- { showResetButton && (
229
- <DropdownContentWrapper paddingSize="none">
225
+ <div className={ resetButtonWrapperClassName }>
230
226
  <Button
231
- className={ resetButtonClassName }
232
227
  variant="tertiary"
233
228
  onClick={ () => {
234
229
  onReset();
235
- onClose();
236
230
  } }
231
+ disabled={ ! enableResetButton }
232
+ accessibleWhenDisabled
237
233
  __next40pxDefaultSize
238
234
  >
239
235
  { __( 'Reset' ) }
240
236
  </Button>
241
- </DropdownContentWrapper>
242
- ) }
237
+ </div>
238
+ </DropdownContentWrapper>
243
239
  </>
244
240
  );
245
241
 
@@ -76,8 +76,8 @@ export function useBorderControlDropdown(
76
76
  return cx( styles.borderControlPopoverContent );
77
77
  }, [ cx ] );
78
78
 
79
- const resetButtonClassName = useMemo( () => {
80
- return cx( styles.resetButton );
79
+ const resetButtonWrapperClassName = useMemo( () => {
80
+ return cx( styles.resetButtonWrapper );
81
81
  }, [ cx ] );
82
82
 
83
83
  return {
@@ -94,7 +94,7 @@ export function useBorderControlDropdown(
94
94
  onReset,
95
95
  popoverContentClassName,
96
96
  popoverControlsClassName,
97
- resetButtonClassName,
97
+ resetButtonWrapperClassName,
98
98
  size,
99
99
  __experimentalIsRenderedInSidebar,
100
100
  };
@@ -147,16 +147,10 @@ export const borderControlPopoverControls = css`
147
147
  export const borderControlPopoverContent = css``;
148
148
  export const borderColorIndicator = css``;
149
149
 
150
- export const resetButton = css`
151
- justify-content: center;
152
- width: 100%;
153
-
154
- /* Override button component styling */
155
- && {
156
- border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };
157
- border-top-left-radius: 0;
158
- border-top-right-radius: 0;
159
- }
150
+ export const resetButtonWrapper = css`
151
+ display: flex;
152
+ justify-content: flex-end;
153
+ margin-top: 12px;
160
154
  `;
161
155
 
162
156
  export const borderSlider = () => css`
@@ -138,7 +138,7 @@ describe( 'BorderControl', () => {
138
138
 
139
139
  const customColorPicker = getButton( /Custom color picker/ );
140
140
  const circularOptionPicker = screen.getByRole( 'listbox', {
141
- name: 'Custom color picker.',
141
+ name: 'Custom color picker',
142
142
  } );
143
143
  const colorSwatchButtons =
144
144
  within( circularOptionPicker ).getAllByRole( 'option' );
@@ -93,6 +93,19 @@ Prevents keyboard interaction from wrapping around. Only used when `asButtons` i
93
93
  - Required: No
94
94
  - Default: `true`
95
95
 
96
+ ### `aria-labelledby`: `string`
97
+
98
+ The ID reference list of one or more elements that label the wrapper element.
99
+
100
+ - Required: No
101
+
102
+ ### `aria-label`: `string`
103
+
104
+ The label for the wrapper element. Not used if an 'aria-labelledby' is provided.
105
+
106
+ - Required: No
107
+ - Default: `Custom color picker`
108
+
96
109
  ## Subcomponents
97
110
 
98
111
  ### `CircularOptionPicker.ButtonAction`
@@ -132,7 +132,7 @@ function ButtonsCircularOptionPicker(
132
132
  );
133
133
 
134
134
  return (
135
- <div { ...additionalProps } id={ baseId }>
135
+ <div { ...additionalProps } role="group" id={ baseId }>
136
136
  <CircularOptionPickerContext.Provider value={ contextValue }>
137
137
  { options }
138
138
  { children }
@@ -9,5 +9,6 @@ export {
9
9
  ButtonAction,
10
10
  DropdownLinkAction,
11
11
  } from './circular-option-picker-actions';
12
+ export { getComputeCircularOptionPickerCommonProps } from './utils';
12
13
 
13
14
  export default CircularOptionPicker;
@@ -131,7 +131,7 @@ WithLoopingDisabled.parameters = {
131
131
  docs: {
132
132
  source: {
133
133
  code: `<CircularOptionPicker
134
- aria-label="${ WithLoopingDisabled.args[ 'aria-label' ] }"
134
+ 'aria-label': 'Circular Option Picker',
135
135
  loop={false}
136
136
  options={<DefaultOptions />}
137
137
  />`,
@@ -57,6 +57,7 @@ describe( 'CircularOptionPicker', () => {
57
57
 
58
58
  expect( screen.queryByRole( 'listbox' ) ).not.toBeInTheDocument();
59
59
  expect( screen.queryByRole( 'option' ) ).not.toBeInTheDocument();
60
+ expect( screen.getByRole( 'group' ) ).toBeInTheDocument();
60
61
  expect( screen.getByRole( 'button' ) ).toBeInTheDocument();
61
62
  } );
62
63
  } );
@@ -40,6 +40,16 @@ type CommonCircularOptionPickerProps = {
40
40
  * The child elements.
41
41
  */
42
42
  children?: ReactNode;
43
+ /**
44
+ * The ID reference list of one or more elements that label the wrapper
45
+ * element.
46
+ */
47
+ 'aria-labelledby'?: string;
48
+ /**
49
+ * The label for the wrapper element. Defaults to 'Custom color picker'. Not
50
+ * used if an 'aria-labelledby' is provided.
51
+ */
52
+ 'aria-label'?: string;
43
53
  };
44
54
 
45
55
  type WithBaseId = {
@@ -59,16 +69,7 @@ type FullListboxCircularOptionPickerProps = CommonCircularOptionPickerProps & {
59
69
  * @default true
60
70
  */
61
71
  loop?: boolean;
62
- } & (
63
- | {
64
- 'aria-label': string;
65
- 'aria-labelledby'?: never;
66
- }
67
- | {
68
- 'aria-label'?: never;
69
- 'aria-labelledby': string;
70
- }
71
- );
72
+ };
72
73
 
73
74
  export type ListboxCircularOptionPickerProps = WithBaseId &
74
75
  Omit< FullListboxCircularOptionPickerProps, 'asButtons' >;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Computes the common props for the CircularOptionPicker.
8
+ */
9
+ export function getComputeCircularOptionPickerCommonProps(
10
+ asButtons?: boolean,
11
+ loop?: boolean,
12
+ ariaLabel?: string,
13
+ ariaLabelledby?: string
14
+ ) {
15
+ const metaProps = asButtons
16
+ ? { asButtons: true }
17
+ : { asButtons: false, loop };
18
+
19
+ const labelProps = {
20
+ 'aria-labelledby': ariaLabelledby,
21
+ 'aria-label': ariaLabelledby
22
+ ? undefined
23
+ : ariaLabel || __( 'Custom color picker' ),
24
+ };
25
+
26
+ return { metaProps, labelProps };
27
+ }
@@ -19,7 +19,9 @@ import { useCallback, useMemo, useState, forwardRef } from '@wordpress/element';
19
19
  */
20
20
  import Dropdown from '../dropdown';
21
21
  import { ColorPicker } from '../color-picker';
22
- import CircularOptionPicker from '../circular-option-picker';
22
+ import CircularOptionPicker, {
23
+ getComputeCircularOptionPickerCommonProps,
24
+ } from '../circular-option-picker';
23
25
  import { VStack } from '../v-stack';
24
26
  import { Truncate } from '../truncate';
25
27
  import { ColorHeading } from './styles';
@@ -233,7 +235,7 @@ function UnforwardedColorPalette(
233
235
  buttonLabelName,
234
236
  displayValue
235
237
  )
236
- : __( 'Custom color picker.' );
238
+ : __( 'Custom color picker' );
237
239
 
238
240
  const paletteCommonProps = {
239
241
  clearColor,
@@ -251,33 +253,12 @@ function UnforwardedColorPalette(
251
253
  </CircularOptionPicker.ButtonAction>
252
254
  );
253
255
 
254
- let metaProps:
255
- | { asButtons: false; loop?: boolean; 'aria-label': string }
256
- | { asButtons: false; loop?: boolean; 'aria-labelledby': string }
257
- | { asButtons: true };
258
-
259
- if ( asButtons ) {
260
- metaProps = { asButtons: true };
261
- } else {
262
- const _metaProps: { asButtons: false; loop?: boolean } = {
263
- asButtons: false,
264
- loop,
265
- };
266
-
267
- if ( ariaLabel ) {
268
- metaProps = { ..._metaProps, 'aria-label': ariaLabel };
269
- } else if ( ariaLabelledby ) {
270
- metaProps = {
271
- ..._metaProps,
272
- 'aria-labelledby': ariaLabelledby,
273
- };
274
- } else {
275
- metaProps = {
276
- ..._metaProps,
277
- 'aria-label': __( 'Custom color picker.' ),
278
- };
279
- }
280
- }
256
+ const { metaProps, labelProps } = getComputeCircularOptionPickerCommonProps(
257
+ asButtons,
258
+ loop,
259
+ ariaLabel,
260
+ ariaLabelledby
261
+ );
281
262
 
282
263
  return (
283
264
  <VStack spacing={ 3 } ref={ forwardedRef } { ...additionalProps }>
@@ -335,6 +316,7 @@ function UnforwardedColorPalette(
335
316
  { ( colors.length > 0 || actions ) && (
336
317
  <CircularOptionPicker
337
318
  { ...metaProps }
319
+ { ...labelProps }
338
320
  actions={ actions }
339
321
  options={
340
322
  hasMultipleColorOrigins ? (
@@ -258,7 +258,7 @@ describe( 'ColorPalette', () => {
258
258
  expect( screen.queryByText( colorCode ) ).not.toBeInTheDocument();
259
259
  expect(
260
260
  screen.getByRole( 'button', {
261
- name: /^Custom color picker.$/,
261
+ name: /^Custom color picker$/,
262
262
  } )
263
263
  ).toBeInTheDocument();
264
264
  } );
@@ -13,7 +13,9 @@ import { __, sprintf } from '@wordpress/i18n';
13
13
  * Internal dependencies
14
14
  */
15
15
  import ColorListPicker from './color-list-picker';
16
- import CircularOptionPicker from '../circular-option-picker';
16
+ import CircularOptionPicker, {
17
+ getComputeCircularOptionPickerCommonProps,
18
+ } from '../circular-option-picker';
17
19
  import { VStack } from '../v-stack';
18
20
 
19
21
  import CustomDuotoneBar from './custom-duotone-bar';
@@ -127,33 +129,12 @@ function DuotonePicker( {
127
129
  );
128
130
  } );
129
131
 
130
- let metaProps:
131
- | { asButtons: false; loop?: boolean; 'aria-label': string }
132
- | { asButtons: false; loop?: boolean; 'aria-labelledby': string }
133
- | { asButtons: true };
134
-
135
- if ( asButtons ) {
136
- metaProps = { asButtons: true };
137
- } else {
138
- const _metaProps: { asButtons: false; loop?: boolean } = {
139
- asButtons: false,
140
- loop,
141
- };
142
-
143
- if ( ariaLabel ) {
144
- metaProps = { ..._metaProps, 'aria-label': ariaLabel };
145
- } else if ( ariaLabelledby ) {
146
- metaProps = {
147
- ..._metaProps,
148
- 'aria-labelledby': ariaLabelledby,
149
- };
150
- } else {
151
- metaProps = {
152
- ..._metaProps,
153
- 'aria-label': __( 'Custom color picker.' ),
154
- };
155
- }
156
- }
132
+ const { metaProps, labelProps } = getComputeCircularOptionPickerCommonProps(
133
+ asButtons,
134
+ loop,
135
+ ariaLabel,
136
+ ariaLabelledby
137
+ );
157
138
 
158
139
  const options = unsetable
159
140
  ? [ unsetOption, ...duotoneOptions ]
@@ -163,6 +144,7 @@ function DuotonePicker( {
163
144
  <CircularOptionPicker
164
145
  { ...otherProps }
165
146
  { ...metaProps }
147
+ { ...labelProps }
166
148
  options={ options }
167
149
  actions={
168
150
  !! clearable && (
@@ -99,6 +99,8 @@ Available units for custom font size selection.
99
99
 
100
100
  The current font size value.
101
101
 
102
+ **Note**: For the `units` property to work, the current font size value must be specified as strings with units (e.g., `'12px'` instead of `12`). When the font size is provided as a number, the component operates in "unitless mode" where the `units` property has no effect.
103
+
102
104
  - Required: No
103
105
 
104
106
  ### `withReset`: `boolean`
@@ -18,6 +18,10 @@ const meta: Meta< typeof FontSizePicker > = {
18
18
  component: FontSizePicker,
19
19
  argTypes: {
20
20
  value: { control: false },
21
+ units: {
22
+ control: 'inline-check',
23
+ options: [ 'px', 'em', 'rem', 'vw', 'vh' ],
24
+ },
21
25
  },
22
26
  parameters: {
23
27
  actions: { argTypesRegex: '^on.*' },
@@ -34,6 +34,10 @@ export type FontSizePickerProps = {
34
34
  units?: string[];
35
35
  /**
36
36
  * The current font size value.
37
+ *
38
+ * Note: For the `units` property to work, the current font size value must be specified
39
+ * as strings with units (e.g., '12px' instead of 12). When the font size is provided
40
+ * as a number, the component operates in "unitless mode" where the `units` property has no effect.
37
41
  */
38
42
  value?: number | string;
39
43
  /**
@@ -8,7 +8,9 @@ import { useCallback, useMemo } from '@wordpress/element';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
11
- import CircularOptionPicker from '../circular-option-picker';
11
+ import CircularOptionPicker, {
12
+ getComputeCircularOptionPickerCommonProps,
13
+ } from '../circular-option-picker';
12
14
  import CustomGradientPicker from '../custom-gradient-picker';
13
15
  import { VStack } from '../v-stack';
14
16
  import { ColorHeading } from '../color-palette/styles';
@@ -128,37 +130,17 @@ function Component( props: PickerProps< any > ) {
128
130
  <SingleOrigin { ...additionalProps } />
129
131
  );
130
132
 
131
- let metaProps:
132
- | { asButtons: false; loop?: boolean; 'aria-label': string }
133
- | { asButtons: false; loop?: boolean; 'aria-labelledby': string }
134
- | { asButtons: true };
135
-
136
- if ( asButtons ) {
137
- metaProps = { asButtons: true };
138
- } else {
139
- const _metaProps: { asButtons: false; loop?: boolean } = {
140
- asButtons: false,
141
- loop,
142
- };
143
-
144
- if ( ariaLabel ) {
145
- metaProps = { ..._metaProps, 'aria-label': ariaLabel };
146
- } else if ( ariaLabelledby ) {
147
- metaProps = {
148
- ..._metaProps,
149
- 'aria-labelledby': ariaLabelledby,
150
- };
151
- } else {
152
- metaProps = {
153
- ..._metaProps,
154
- 'aria-label': __( 'Custom color picker.' ),
155
- };
156
- }
157
- }
133
+ const { metaProps, labelProps } = getComputeCircularOptionPickerCommonProps(
134
+ asButtons,
135
+ loop,
136
+ ariaLabel,
137
+ ariaLabelledby
138
+ );
158
139
 
159
140
  return (
160
141
  <CircularOptionPicker
161
142
  { ...metaProps }
143
+ { ...labelProps }
162
144
  actions={ actions }
163
145
  options={ options }
164
146
  />
@@ -285,7 +285,15 @@ export const Input = styled.input< InputProps >`
285
285
  ${ customPaddings }
286
286
 
287
287
  &::-webkit-input-placeholder {
288
- line-height: normal;
288
+ color: ${ COLORS.ui.darkGrayPlaceholder };
289
+ }
290
+
291
+ &::-moz-placeholder {
292
+ color: ${ COLORS.ui.darkGrayPlaceholder };
293
+ }
294
+
295
+ &:-ms-input-placeholder {
296
+ color: ${ COLORS.ui.darkGrayPlaceholder };
289
297
  }
290
298
 
291
299
  &[type='email'],
@@ -57,7 +57,7 @@ export default function BottomSheetSwitchCell( props ) {
57
57
  accessibilityRole="none"
58
58
  accessibilityHint={
59
59
  /* translators: accessibility text (hint for switches) */
60
- __( 'Double tap to toggle setting' )
60
+ __( 'Double tap to change setting' )
61
61
  }
62
62
  onPress={ onPress }
63
63
  editable={ false }
@@ -19,7 +19,7 @@ Notices are color-coded to indicate the type of message being communicated:
19
19
  - **Informational** notices are **blue** by default.
20
20
  - If there is a parent `Theme` component with an `accent` color prop, informational notices will take on that color instead.
21
21
  - **Success** notices are **green.**
22
- - **Warning** notices are **yellow\*\***.\*\*
22
+ - **Warning** notices are **yellow.**
23
23
  - **Error** notices are **red.**
24
24
 
25
25
  If an icon is included in the Notice, it should be color-coded to match the Notice state.
@@ -6,6 +6,7 @@
6
6
  border-left: 4px solid $components-color-accent;
7
7
  padding: 8px 12px;
8
8
  align-items: center;
9
+ color: $gray-900;
9
10
 
10
11
  &.is-dismissible {
11
12
  position: relative;
@@ -4,7 +4,7 @@
4
4
  This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
5
5
  </div>
6
6
 
7
- NumberControl is an enhanced HTML [`input[type="number]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) element.
7
+ NumberControl is an enhanced HTML [`input[type="number"]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) element.
8
8
 
9
9
  ## Usage
10
10
 
@@ -229,8 +229,8 @@ function UnforwardedNumberControl(
229
229
  hideHTMLArrows={ spinControls !== 'native' }
230
230
  isDragEnabled={ isDragEnabled }
231
231
  label={ label }
232
- max={ max }
233
- min={ min }
232
+ max={ max === Infinity ? undefined : max }
233
+ min={ min === -Infinity ? undefined : min }
234
234
  ref={ mergedRef }
235
235
  required={ required }
236
236
  step={ step }
@@ -28,3 +28,9 @@
28
28
  padding-right: $grid-unit-15;
29
29
  }
30
30
  }
31
+
32
+ .components-text-control__input[type="email"],
33
+ .components-text-control__input[type="url"] {
34
+ /* rtl:ignore */
35
+ direction: ltr;
36
+ }
@@ -62,7 +62,6 @@ export const StyledTextarea = styled.textarea`
62
62
  }
63
63
 
64
64
  &::-moz-placeholder {
65
- opacity: 1; // Necessary because Firefox reduces this from 1.
66
65
  color: ${ COLORS.ui.darkGrayPlaceholder };
67
66
  }
68
67
 
@@ -76,7 +75,6 @@ export const StyledTextarea = styled.textarea`
76
75
  }
77
76
 
78
77
  &::-moz-placeholder {
79
- opacity: 1; // Necessary because Firefox reduces this from 1.
80
78
  color: ${ COLORS.ui.lightGrayPlaceholder };
81
79
  }
82
80