@wordpress/components 30.9.0 → 31.0.1-next.6deb34194.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 (214) hide show
  1. package/CHANGELOG.md +25 -4
  2. package/build/alignment-matrix-control/cell.js +131 -3
  3. package/build/alignment-matrix-control/cell.js.map +4 -4
  4. package/build/alignment-matrix-control/index.js +134 -6
  5. package/build/alignment-matrix-control/index.js.map +3 -3
  6. package/build/angle-picker-control/angle-circle.js +119 -15
  7. package/build/angle-picker-control/angle-circle.js.map +4 -4
  8. package/build/angle-picker-control/index.js +12 -7
  9. package/build/angle-picker-control/index.js.map +3 -3
  10. package/build/dropdown-menu/index.js +1 -1
  11. package/build/dropdown-menu/index.js.map +2 -2
  12. package/build/menu/styles.js +17 -17
  13. package/build/menu/styles.js.map +2 -2
  14. package/build/menu-item/index.js +1 -1
  15. package/build/menu-item/index.js.map +2 -2
  16. package/build/notice/index.js +1 -1
  17. package/build/notice/index.js.map +2 -2
  18. package/build/snackbar/index.js +1 -1
  19. package/build/snackbar/index.js.map +1 -1
  20. package/build/validated-form-controls/components/checkbox-control.js +0 -10
  21. package/build/validated-form-controls/components/checkbox-control.js.map +2 -2
  22. package/build/validated-form-controls/components/combobox-control.js +1 -11
  23. package/build/validated-form-controls/components/combobox-control.js.map +2 -2
  24. package/build/validated-form-controls/components/custom-select-control.js +0 -10
  25. package/build/validated-form-controls/components/custom-select-control.js.map +2 -2
  26. package/build/validated-form-controls/components/form-token-field.js +2 -12
  27. package/build/validated-form-controls/components/form-token-field.js.map +2 -2
  28. package/build/validated-form-controls/components/input-control.js +0 -10
  29. package/build/validated-form-controls/components/input-control.js.map +2 -2
  30. package/build/validated-form-controls/components/number-control.js +0 -10
  31. package/build/validated-form-controls/components/number-control.js.map +2 -2
  32. package/build/validated-form-controls/components/radio-control.js +0 -10
  33. package/build/validated-form-controls/components/radio-control.js.map +2 -2
  34. package/build/validated-form-controls/components/range-control.js +0 -10
  35. package/build/validated-form-controls/components/range-control.js.map +2 -2
  36. package/build/validated-form-controls/components/select-control.js +0 -10
  37. package/build/validated-form-controls/components/select-control.js.map +2 -2
  38. package/build/validated-form-controls/components/text-control.js +0 -10
  39. package/build/validated-form-controls/components/text-control.js.map +2 -2
  40. package/build/validated-form-controls/components/textarea-control.js +0 -10
  41. package/build/validated-form-controls/components/textarea-control.js.map +2 -2
  42. package/build/validated-form-controls/components/toggle-control.js +0 -10
  43. package/build/validated-form-controls/components/toggle-control.js.map +2 -2
  44. package/build/validated-form-controls/components/toggle-group-control.js +0 -10
  45. package/build/validated-form-controls/components/toggle-group-control.js.map +2 -2
  46. package/build/validated-form-controls/control-with-error.js +53 -58
  47. package/build/validated-form-controls/control-with-error.js.map +2 -2
  48. package/build-module/alignment-matrix-control/cell.js +131 -3
  49. package/build-module/alignment-matrix-control/cell.js.map +3 -3
  50. package/build-module/alignment-matrix-control/index.js +134 -6
  51. package/build-module/alignment-matrix-control/index.js.map +3 -3
  52. package/build-module/angle-picker-control/angle-circle.js +109 -15
  53. package/build-module/angle-picker-control/angle-circle.js.map +3 -3
  54. package/build-module/angle-picker-control/index.js +12 -7
  55. package/build-module/angle-picker-control/index.js.map +2 -2
  56. package/build-module/dropdown-menu/index.js +1 -1
  57. package/build-module/dropdown-menu/index.js.map +2 -2
  58. package/build-module/menu/styles.js +17 -17
  59. package/build-module/menu/styles.js.map +2 -2
  60. package/build-module/menu-item/index.js +1 -1
  61. package/build-module/menu-item/index.js.map +2 -2
  62. package/build-module/notice/index.js +1 -1
  63. package/build-module/notice/index.js.map +2 -2
  64. package/build-module/snackbar/index.js +1 -1
  65. package/build-module/snackbar/index.js.map +1 -1
  66. package/build-module/validated-form-controls/components/checkbox-control.js +0 -10
  67. package/build-module/validated-form-controls/components/checkbox-control.js.map +2 -2
  68. package/build-module/validated-form-controls/components/combobox-control.js +1 -11
  69. package/build-module/validated-form-controls/components/combobox-control.js.map +2 -2
  70. package/build-module/validated-form-controls/components/custom-select-control.js +0 -10
  71. package/build-module/validated-form-controls/components/custom-select-control.js.map +2 -2
  72. package/build-module/validated-form-controls/components/form-token-field.js +2 -12
  73. package/build-module/validated-form-controls/components/form-token-field.js.map +2 -2
  74. package/build-module/validated-form-controls/components/input-control.js +0 -10
  75. package/build-module/validated-form-controls/components/input-control.js.map +2 -2
  76. package/build-module/validated-form-controls/components/number-control.js +0 -10
  77. package/build-module/validated-form-controls/components/number-control.js.map +2 -2
  78. package/build-module/validated-form-controls/components/radio-control.js +0 -10
  79. package/build-module/validated-form-controls/components/radio-control.js.map +2 -2
  80. package/build-module/validated-form-controls/components/range-control.js +0 -10
  81. package/build-module/validated-form-controls/components/range-control.js.map +2 -2
  82. package/build-module/validated-form-controls/components/select-control.js +0 -10
  83. package/build-module/validated-form-controls/components/select-control.js.map +2 -2
  84. package/build-module/validated-form-controls/components/text-control.js +0 -10
  85. package/build-module/validated-form-controls/components/text-control.js.map +2 -2
  86. package/build-module/validated-form-controls/components/textarea-control.js +0 -10
  87. package/build-module/validated-form-controls/components/textarea-control.js.map +2 -2
  88. package/build-module/validated-form-controls/components/toggle-control.js +0 -10
  89. package/build-module/validated-form-controls/components/toggle-control.js.map +2 -2
  90. package/build-module/validated-form-controls/components/toggle-group-control.js +0 -10
  91. package/build-module/validated-form-controls/components/toggle-group-control.js.map +2 -2
  92. package/build-module/validated-form-controls/control-with-error.js +53 -58
  93. package/build-module/validated-form-controls/control-with-error.js.map +2 -2
  94. package/build-style/style-rtl.css +21 -33
  95. package/build-style/style.css +21 -33
  96. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  97. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  98. package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
  99. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  100. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  101. package/build-types/notice/index.d.ts.map +1 -1
  102. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  103. package/build-types/validated-form-controls/components/checkbox-control.d.ts +1 -1
  104. package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -1
  105. package/build-types/validated-form-controls/components/combobox-control.d.ts +2 -3
  106. package/build-types/validated-form-controls/components/combobox-control.d.ts.map +1 -1
  107. package/build-types/validated-form-controls/components/custom-select-control.d.ts +1 -2
  108. package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
  109. package/build-types/validated-form-controls/components/form-token-field.d.ts +1 -2
  110. package/build-types/validated-form-controls/components/form-token-field.d.ts.map +1 -1
  111. package/build-types/validated-form-controls/components/input-control.d.ts +1 -2
  112. package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
  113. package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
  114. package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
  115. package/build-types/validated-form-controls/components/radio-control.d.ts +1 -1
  116. package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
  117. package/build-types/validated-form-controls/components/range-control.d.ts +1 -1
  118. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  119. package/build-types/validated-form-controls/components/select-control.d.ts +2 -3
  120. package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -1
  121. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -1
  122. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -1
  123. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -1
  124. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +1 -1
  125. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -1
  126. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -1
  127. package/build-types/validated-form-controls/components/stories/overview.story.d.ts +7 -0
  128. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
  129. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -1
  130. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -1
  131. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -1
  132. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -1
  133. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -1
  134. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -1
  135. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -1
  136. package/build-types/validated-form-controls/components/text-control.d.ts +1 -1
  137. package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -1
  138. package/build-types/validated-form-controls/components/textarea-control.d.ts +1 -1
  139. package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
  140. package/build-types/validated-form-controls/components/toggle-control.d.ts +1 -1
  141. package/build-types/validated-form-controls/components/toggle-control.d.ts.map +1 -1
  142. package/build-types/validated-form-controls/components/toggle-group-control.d.ts +1 -1
  143. package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -1
  144. package/build-types/validated-form-controls/components/types.d.ts +1 -9
  145. package/build-types/validated-form-controls/components/types.d.ts.map +1 -1
  146. package/build-types/validated-form-controls/control-with-error.d.ts +4 -5
  147. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
  148. package/package.json +20 -20
  149. package/src/alignment-matrix-control/cell.tsx +14 -3
  150. package/src/alignment-matrix-control/index.tsx +15 -6
  151. package/src/alignment-matrix-control/style.module.scss +84 -0
  152. package/src/angle-picker-control/angle-circle.tsx +27 -12
  153. package/src/angle-picker-control/index.tsx +8 -7
  154. package/src/angle-picker-control/style.module.scss +40 -0
  155. package/src/button/style.scss +1 -1
  156. package/src/dropdown-menu/index.tsx +1 -1
  157. package/src/dropdown-menu/style.scss +1 -1
  158. package/src/guide/style.scss +3 -3
  159. package/src/menu/styles.ts +2 -2
  160. package/src/menu-item/index.tsx +1 -1
  161. package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
  162. package/src/modal/style.scss +5 -5
  163. package/src/notice/index.tsx +53 -46
  164. package/src/notice/stories/index.story.tsx +17 -1
  165. package/src/notice/style.scss +3 -20
  166. package/src/snackbar/index.tsx +1 -1
  167. package/src/validated-form-controls/components/checkbox-control.tsx +1 -14
  168. package/src/validated-form-controls/components/combobox-control.tsx +1 -14
  169. package/src/validated-form-controls/components/custom-select-control.tsx +1 -19
  170. package/src/validated-form-controls/components/form-token-field.tsx +2 -15
  171. package/src/validated-form-controls/components/input-control.tsx +1 -14
  172. package/src/validated-form-controls/components/number-control.tsx +1 -16
  173. package/src/validated-form-controls/components/radio-control.tsx +2 -18
  174. package/src/validated-form-controls/components/range-control.tsx +1 -14
  175. package/src/validated-form-controls/components/select-control.tsx +1 -23
  176. package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +11 -20
  177. package/src/validated-form-controls/components/stories/combobox-control.story.tsx +8 -17
  178. package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +8 -17
  179. package/src/validated-form-controls/components/stories/form-token-field.story.tsx +14 -26
  180. package/src/validated-form-controls/components/stories/input-control.story.tsx +25 -50
  181. package/src/validated-form-controls/components/stories/number-control.story.tsx +10 -19
  182. package/src/validated-form-controls/components/stories/overview.mdx +3 -3
  183. package/src/validated-form-controls/components/stories/overview.story.tsx +94 -79
  184. package/src/validated-form-controls/components/stories/radio-control.story.tsx +11 -20
  185. package/src/validated-form-controls/components/stories/range-control.story.tsx +8 -17
  186. package/src/validated-form-controls/components/stories/select-control.story.tsx +9 -18
  187. package/src/validated-form-controls/components/stories/text-control.story.tsx +11 -17
  188. package/src/validated-form-controls/components/stories/textarea-control.story.tsx +12 -16
  189. package/src/validated-form-controls/components/stories/toggle-control.story.tsx +11 -20
  190. package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +8 -17
  191. package/src/validated-form-controls/components/text-control.tsx +1 -14
  192. package/src/validated-form-controls/components/textarea-control.tsx +1 -14
  193. package/src/validated-form-controls/components/toggle-control.tsx +1 -14
  194. package/src/validated-form-controls/components/toggle-group-control.tsx +1 -14
  195. package/src/validated-form-controls/components/types.ts +1 -9
  196. package/src/validated-form-controls/control-with-error.tsx +57 -84
  197. package/src/validated-form-controls/style.scss +7 -7
  198. package/src/validated-form-controls/test/control-with-error.tsx +66 -5
  199. package/tsconfig.json +1 -0
  200. package/tsconfig.tsbuildinfo +1 -1
  201. package/build/alignment-matrix-control/styles.js +0 -105
  202. package/build/alignment-matrix-control/styles.js.map +0 -7
  203. package/build/angle-picker-control/styles/angle-picker-control-styles.js +0 -88
  204. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +0 -7
  205. package/build-module/alignment-matrix-control/styles.js +0 -67
  206. package/build-module/alignment-matrix-control/styles.js.map +0 -7
  207. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +0 -50
  208. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +0 -7
  209. package/build-types/alignment-matrix-control/styles.d.ts +0 -21
  210. package/build-types/alignment-matrix-control/styles.d.ts.map +0 -1
  211. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +0 -18
  212. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +0 -1
  213. package/src/alignment-matrix-control/styles.ts +0 -113
  214. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +0 -58
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
1
4
  import type { ValidatedControlProps } from './components/types';
2
5
  /**
3
6
  * HTML elements that support the Constraint Validation API.
@@ -17,11 +20,7 @@ export declare const ControlWithError: import("react").ForwardRefExoticComponent
17
20
  * Label the control as "optional" when _not_ `required`, instead of the inverse.
18
21
  */
19
22
  markWhenOptional?: boolean;
20
- /**
21
- * The callback to run when the input should be validated.
22
- */
23
- onValidate?: () => void;
24
- customValidity?: ValidatedControlProps<unknown>["customValidity"];
23
+ customValidity?: ValidatedControlProps["customValidity"];
25
24
  /**
26
25
  * A function that returns the actual element on which the validity data should be applied.
27
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/control-with-error.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAyBhE;;;;;;;GAOG;AACH,KAAK,cAAc,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,CAAC;AAyMvB,eAAO,MAAM,gBAAgB;IA9L3B;;OAEG;eACQ,OAAO;IAClB;;OAEG;uBACgB,OAAO;IAC1B;;OAEG;iBACU,MAAM,IAAI;qBACN,qBAAqB,CAAE,OAAO,CAAE,CAAE,gBAAgB,CAAE;IACrE;;OAEG;uBACgB,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS;IAC1D;;;;;;;OAOG;;kDAsKoE,CAAC"}
1
+ {"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/control-with-error.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AA0BhE;;;;;;;GAOG;AACH,KAAK,cAAc,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,CAAC;AA+KvB,eAAO,MAAM,gBAAgB;IArK3B;;OAEG;eACQ,OAAO;IAClB;;OAEG;uBACgB,OAAO;qBACT,qBAAqB,CAAE,gBAAgB,CAAE;IAC1D;;OAEG;uBACgB,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS;IAC1D;;;;;;;OAOG;;kDAiJoE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "30.9.0",
3
+ "version": "31.0.1-next.6deb34194.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -55,24 +55,24 @@
55
55
  "@types/gradient-parser": "1.1.0",
56
56
  "@types/highlight-words-core": "1.2.1",
57
57
  "@use-gesture/react": "^10.3.1",
58
- "@wordpress/a11y": "^4.36.0",
59
- "@wordpress/base-styles": "^6.12.0",
60
- "@wordpress/compose": "^7.36.0",
61
- "@wordpress/date": "^5.36.0",
62
- "@wordpress/deprecated": "^4.36.0",
63
- "@wordpress/dom": "^4.36.0",
64
- "@wordpress/element": "^6.36.0",
65
- "@wordpress/escape-html": "^3.36.0",
66
- "@wordpress/hooks": "^4.36.0",
67
- "@wordpress/html-entities": "^4.36.0",
68
- "@wordpress/i18n": "^6.9.0",
69
- "@wordpress/icons": "^11.3.0",
70
- "@wordpress/is-shallow-equal": "^5.36.0",
71
- "@wordpress/keycodes": "^4.36.0",
72
- "@wordpress/primitives": "^4.36.0",
73
- "@wordpress/private-apis": "^1.36.0",
74
- "@wordpress/rich-text": "^7.36.0",
75
- "@wordpress/warning": "^3.36.0",
58
+ "@wordpress/a11y": "^4.36.1-next.6deb34194.0",
59
+ "@wordpress/base-styles": "^6.12.1-next.6deb34194.0",
60
+ "@wordpress/compose": "^7.36.1-next.6deb34194.0",
61
+ "@wordpress/date": "^5.36.1-next.6deb34194.0",
62
+ "@wordpress/deprecated": "^4.36.1-next.6deb34194.0",
63
+ "@wordpress/dom": "^4.36.1-next.6deb34194.0",
64
+ "@wordpress/element": "^6.36.1-next.6deb34194.0",
65
+ "@wordpress/escape-html": "^3.36.1-next.6deb34194.0",
66
+ "@wordpress/hooks": "^4.36.1-next.6deb34194.0",
67
+ "@wordpress/html-entities": "^4.36.1-next.6deb34194.0",
68
+ "@wordpress/i18n": "^6.9.1-next.6deb34194.0",
69
+ "@wordpress/icons": "^11.3.1-next.6deb34194.0",
70
+ "@wordpress/is-shallow-equal": "^5.36.1-next.6deb34194.0",
71
+ "@wordpress/keycodes": "^4.36.1-next.6deb34194.0",
72
+ "@wordpress/primitives": "^4.36.1-next.6deb34194.0",
73
+ "@wordpress/private-apis": "^1.36.1-next.6deb34194.0",
74
+ "@wordpress/rich-text": "^7.36.1-next.6deb34194.0",
75
+ "@wordpress/warning": "^3.36.1-next.6deb34194.0",
76
76
  "change-case": "^4.1.2",
77
77
  "clsx": "^2.1.1",
78
78
  "colord": "^2.7.0",
@@ -101,5 +101,5 @@
101
101
  "publishConfig": {
102
102
  "access": "public"
103
103
  },
104
- "gitHead": "b35cf1a2dce04665e99fd6b9c2891c0b336361b9"
104
+ "gitHead": "457096e9e9b3896d2d4fe54fc19d7fb571ee9a44"
105
105
  }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
@@ -9,9 +14,9 @@ import { VisuallyHidden } from '../visually-hidden';
9
14
  * Internal dependencies
10
15
  */
11
16
  import { ALIGNMENT_LABEL } from './utils';
12
- import { Cell as CellView, Point } from './styles';
13
17
  import type { AlignmentMatrixControlCellProps } from './types';
14
18
  import type { WordPressComponentProps } from '../context';
19
+ import styles from './style.module.scss';
15
20
 
16
21
  export default function Cell( {
17
22
  id,
@@ -22,13 +27,19 @@ export default function Cell( {
22
27
  <Tooltip text={ ALIGNMENT_LABEL[ value ] }>
23
28
  <Composite.Item
24
29
  id={ id }
25
- render={ <CellView { ...props } role="gridcell" /> }
30
+ render={
31
+ <span
32
+ { ...props }
33
+ className={ clsx( styles.cell, props.className ) }
34
+ role="gridcell"
35
+ />
36
+ }
26
37
  >
27
38
  { /* VoiceOver needs a text content to be rendered within grid cell,
28
39
  otherwise it'll announce the content as "blank". So we use a visually
29
40
  hidden element instead of aria-label. */ }
30
41
  <VisuallyHidden>{ value }</VisuallyHidden>
31
- <Point role="presentation" />
42
+ <span className={ styles.point } role="presentation" />
32
43
  </Composite.Item>
33
44
  </Tooltip>
34
45
  );
@@ -15,11 +15,11 @@ import { useCallback } from '@wordpress/element';
15
15
  */
16
16
  import Cell from './cell';
17
17
  import { Composite } from '../composite';
18
- import { GridContainer, GridRow } from './styles';
19
18
  import AlignmentMatrixControlIcon from './icon';
20
19
  import { GRID, getItemId, getItemValue } from './utils';
21
20
  import type { WordPressComponentProps } from '../context';
22
21
  import type { AlignmentMatrixControlProps } from './types';
22
+ import styles from './style.module.scss';
23
23
 
24
24
  function UnforwardedAlignmentMatrixControl( {
25
25
  className,
@@ -49,7 +49,11 @@ function UnforwardedAlignmentMatrixControl( {
49
49
  [ baseId, onChange ]
50
50
  );
51
51
 
52
- const classes = clsx( 'component-alignment-matrix-control', className );
52
+ const classes = clsx(
53
+ 'component-alignment-matrix-control',
54
+ styles[ 'grid-container' ],
55
+ className
56
+ );
53
57
 
54
58
  return (
55
59
  <Composite
@@ -58,18 +62,23 @@ function UnforwardedAlignmentMatrixControl( {
58
62
  setActiveId={ setActiveId }
59
63
  rtl={ isRTL() }
60
64
  render={
61
- <GridContainer
65
+ <div
62
66
  { ...props }
63
- aria-label={ label }
64
67
  className={ classes }
68
+ aria-label={ label }
65
69
  id={ baseId }
66
70
  role="grid"
67
- size={ width }
71
+ style={ { width: `${ width }px` } }
68
72
  />
69
73
  }
70
74
  >
71
75
  { GRID.map( ( cells, index ) => (
72
- <Composite.Row render={ <GridRow role="row" /> } key={ index }>
76
+ <Composite.Row
77
+ render={
78
+ <div className={ styles[ 'grid-row' ] } role="row" />
79
+ }
80
+ key={ index }
81
+ >
73
82
  { cells.map( ( cell ) => (
74
83
  <Cell
75
84
  id={ getItemId( baseId, cell ) }
@@ -0,0 +1,84 @@
1
+ @use "@wordpress/base-styles/variables" as *;
2
+ @use "../utils/theme-variables" as *;
3
+
4
+ .grid-container {
5
+ direction: ltr;
6
+
7
+ display: grid;
8
+ grid-template-columns: repeat(3, 1fr);
9
+ grid-template-rows: repeat(3, 1fr);
10
+
11
+ box-sizing: border-box;
12
+ aspect-ratio: 1;
13
+
14
+ border: 1px solid transparent;
15
+ border-radius: $radius-medium;
16
+ outline: none;
17
+
18
+ cursor: pointer;
19
+ }
20
+
21
+ .grid-row {
22
+ grid-column: 1 / -1;
23
+
24
+ box-sizing: border-box;
25
+ display: grid;
26
+ grid-template-columns: repeat(3, 1fr);
27
+ }
28
+
29
+ .cell {
30
+ position: relative;
31
+
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+
36
+ box-sizing: border-box;
37
+ margin: 0;
38
+ padding: 0;
39
+
40
+ appearance: none;
41
+ border: none;
42
+ outline: none;
43
+ }
44
+
45
+ .point {
46
+ display: block;
47
+ contain: strict;
48
+
49
+ box-sizing: border-box;
50
+ width: 6px;
51
+ aspect-ratio: 1;
52
+
53
+ margin: auto;
54
+
55
+ color: $components-color-gray-400;
56
+
57
+ /* Use border instead of background color so that the point shows
58
+ in Windows High Contrast Mode */
59
+ border: 3px solid currentColor;
60
+
61
+ /* Highlight active item */
62
+ .cell[data-active-item] & {
63
+ color: $components-color-foreground;
64
+ transform: scale(calc(5 / 3));
65
+ }
66
+
67
+ /* Hover styles for non-active items */
68
+ .cell:not([data-active-item]):hover & {
69
+ color: $components-color-accent;
70
+ }
71
+
72
+ /* Show an outline only when interacting with keyboard */
73
+ .cell[data-focus-visible] & {
74
+ outline: 1px solid $components-color-accent;
75
+ outline-offset: 1px;
76
+ }
77
+
78
+ @media not (prefers-reduced-motion) {
79
+ transition-property: color, transform;
80
+ transition-duration: 120ms;
81
+ transition-timing-function: linear;
82
+ }
83
+ }
84
+
@@ -1,3 +1,8 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
@@ -7,11 +12,7 @@ import { __experimentalUseDragging as useDragging } from '@wordpress/compose';
7
12
  /**
8
13
  * Internal dependencies
9
14
  */
10
- import {
11
- CircleRoot,
12
- CircleIndicatorWrapper,
13
- CircleIndicator,
14
- } from './styles/angle-picker-control-styles';
15
+ import styles from './style.module.scss';
15
16
 
16
17
  import type { WordPressComponentProps } from '../context';
17
18
  import type { AngleCircleProps } from './types';
@@ -25,6 +26,7 @@ type UseDraggingCallbackEvent =
25
26
  function AngleCircle( {
26
27
  value,
27
28
  onChange,
29
+ className,
28
30
  ...props
29
31
  }: WordPressComponentProps< AngleCircleProps, 'div' > ) {
30
32
  const angleCircleRef = useRef< HTMLDivElement | null >( null );
@@ -89,22 +91,35 @@ function AngleCircle( {
89
91
  }, [ isDragging ] );
90
92
 
91
93
  return (
92
- <CircleRoot
94
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
95
+ <div
93
96
  ref={ angleCircleRef }
94
97
  onMouseDown={ startDrag }
95
- className="components-angle-picker-control__angle-circle"
98
+ className={ clsx(
99
+ 'components-angle-picker-control__angle-circle',
100
+ styles[ 'circle-root' ],
101
+ className
102
+ ) }
96
103
  { ...props }
97
104
  >
98
- <CircleIndicatorWrapper
105
+ <div
99
106
  style={
100
107
  value ? { transform: `rotate(${ value }deg)` } : undefined
101
108
  }
102
- className="components-angle-picker-control__angle-circle-indicator-wrapper"
109
+ className={ clsx(
110
+ 'components-angle-picker-control__angle-circle-indicator-wrapper',
111
+ styles[ 'circle-indicator-wrapper' ]
112
+ ) }
103
113
  tabIndex={ -1 }
104
114
  >
105
- <CircleIndicator className="components-angle-picker-control__angle-circle-indicator" />
106
- </CircleIndicatorWrapper>
107
- </CircleRoot>
115
+ <div
116
+ className={ clsx(
117
+ 'components-angle-picker-control__angle-circle-indicator',
118
+ styles[ 'circle-indicator' ]
119
+ ) }
120
+ />
121
+ </div>
122
+ </div>
108
123
  );
109
124
  }
110
125
 
@@ -16,8 +16,9 @@ import { isRTL, __ } from '@wordpress/i18n';
16
16
  import { Flex, FlexBlock } from '../flex';
17
17
  import { Spacer } from '../spacer';
18
18
  import NumberControl from '../number-control';
19
+ import InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';
20
+ import InputControlSuffixWrapper from '../input-control/input-suffix-wrapper';
19
21
  import AngleCircle from './angle-circle';
20
- import { UnitText } from './styles/angle-picker-control-styles';
21
22
 
22
23
  import type { WordPressComponentProps } from '../context';
23
24
  import type { AnglePickerControlProps } from './types';
@@ -48,10 +49,11 @@ function UnforwardedAnglePickerControl(
48
49
 
49
50
  const classes = clsx( 'components-angle-picker-control', className );
50
51
 
51
- const unitText = <UnitText>°</UnitText>;
52
- const [ prefixedUnitText, suffixedUnitText ] = isRTL()
53
- ? [ unitText, null ]
54
- : [ null, unitText ];
52
+ // Override the default behavior and position the degree symbol to the
53
+ // right of the number, regardless of the language direction.
54
+ const prefixOrSuffixProp = isRTL()
55
+ ? { prefix: <InputControlPrefixWrapper>°</InputControlPrefixWrapper> }
56
+ : { suffix: <InputControlSuffixWrapper>°</InputControlSuffixWrapper> };
55
57
 
56
58
  return (
57
59
  <Flex { ...restProps } ref={ ref } className={ classes } gap={ 2 }>
@@ -66,8 +68,7 @@ function UnforwardedAnglePickerControl(
66
68
  step="1"
67
69
  value={ value }
68
70
  spinControls="none"
69
- prefix={ prefixedUnitText }
70
- suffix={ suffixedUnitText }
71
+ { ...prefixOrSuffixProp }
71
72
  />
72
73
  </FlexBlock>
73
74
  <Spacer marginBottom="1" marginTop="auto">
@@ -0,0 +1,40 @@
1
+ @use "@wordpress/base-styles/variables" as *;
2
+ @use "../utils/theme-variables" as *;
3
+
4
+ .circle-root {
5
+ border-radius: $radius-round;
6
+ border: $border-width solid $components-color-border;
7
+ box-sizing: border-box;
8
+ cursor: grab;
9
+ height: 32px;
10
+ overflow: hidden;
11
+ width: 32px;
12
+
13
+ &:active {
14
+ cursor: grabbing;
15
+ }
16
+ }
17
+
18
+ .circle-indicator-wrapper {
19
+ box-sizing: border-box;
20
+ position: relative;
21
+ width: 100%;
22
+ height: 100%;
23
+
24
+ &:focus-visible {
25
+ outline: none;
26
+ }
27
+ }
28
+
29
+ .circle-indicator {
30
+ background: $components-color-accent;
31
+ border-radius: $radius-round;
32
+ box-sizing: border-box;
33
+ display: block;
34
+ left: 50%;
35
+ top: 4px;
36
+ transform: translateX(-50%);
37
+ position: absolute;
38
+ width: 6px;
39
+ height: 6px;
40
+ }
@@ -29,7 +29,7 @@
29
29
  height: $button-size;
30
30
  align-items: center;
31
31
  box-sizing: border-box;
32
- padding: 6px 12px;
32
+ padding: 4px 12px; // Allows 32px min-height.
33
33
  border-radius: $radius-small;
34
34
  color: $components-color-foreground;
35
35
 
@@ -164,7 +164,7 @@ function UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {
164
164
  { controlSets?.flatMap( ( controlSet, indexOfSet ) =>
165
165
  controlSet.map( ( control, indexOfControl ) => (
166
166
  <Button
167
- __next40pxDefaultSize
167
+ size="compact"
168
168
  key={ [
169
169
  indexOfSet,
170
170
  indexOfControl,
@@ -57,7 +57,7 @@
57
57
 
58
58
  .components-menu-item__button,
59
59
  .components-menu-item__button.components-button {
60
- min-height: $button-size-next-default-40px;
60
+ min-height: $grid-unit-40;
61
61
  height: auto;
62
62
  text-align: left;
63
63
  padding-left: $grid-unit-10;
@@ -59,7 +59,7 @@
59
59
  height: $button-size;
60
60
  justify-content: center;
61
61
  margin: 0 0 $grid-unit-30 0;
62
- padding: 0 $grid-unit-40;
62
+ padding: 0 $grid-unit-30;
63
63
  position: relative;
64
64
  width: 100%;
65
65
  }
@@ -103,11 +103,11 @@
103
103
  }
104
104
 
105
105
  &.components-guide__back-button {
106
- left: $grid-unit-40;
106
+ left: $grid-unit-30;
107
107
  }
108
108
 
109
109
  &.components-guide__forward-button,
110
110
  &.components-guide__finish-button {
111
- right: $grid-unit-40;
111
+ right: $grid-unit-30;
112
112
  }
113
113
  }
@@ -25,7 +25,7 @@ const ANIMATION_PARAMS = {
25
25
  };
26
26
 
27
27
  const CONTENT_WRAPPER_PADDING = space( 1 );
28
- const ITEM_PADDING_BLOCK = space( 2 );
28
+ const ITEM_PADDING_BLOCK = space( 1 );
29
29
  const ITEM_PADDING_INLINE = space( 3 );
30
30
 
31
31
  // TODO:
@@ -152,7 +152,7 @@ const baseItem = css`
152
152
  all: unset;
153
153
 
154
154
  position: relative;
155
- min-height: ${ space( 10 ) };
155
+ min-height: ${ space( 8 ) };
156
156
  box-sizing: border-box;
157
157
 
158
158
  /* Occupy the width of all grid columns (ie. full width) */
@@ -56,7 +56,7 @@ function UnforwardedMenuItem(
56
56
 
57
57
  return (
58
58
  <Button
59
- __next40pxDefaultSize
59
+ size="compact"
60
60
  ref={ ref }
61
61
  // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
62
62
  aria-checked={
@@ -3,7 +3,7 @@
3
3
  exports[`MenuItem should match snapshot when all props provided 1`] = `
4
4
  <button
5
5
  aria-checked="true"
6
- class="components-button components-menu-item__button my-class is-next-40px-default-size"
6
+ class="components-button components-menu-item__button my-class is-compact"
7
7
  role="menuitemcheckbox"
8
8
  type="button"
9
9
  >
@@ -35,7 +35,7 @@ exports[`MenuItem should match snapshot when all props provided 1`] = `
35
35
 
36
36
  exports[`MenuItem should match snapshot when info is provided 1`] = `
37
37
  <button
38
- class="components-button components-menu-item__button is-next-40px-default-size"
38
+ class="components-button components-menu-item__button is-compact"
39
39
  role="menuitem"
40
40
  type="button"
41
41
  >
@@ -62,7 +62,7 @@ exports[`MenuItem should match snapshot when info is provided 1`] = `
62
62
 
63
63
  exports[`MenuItem should match snapshot when isSelected and role are optionally provided 1`] = `
64
64
  <button
65
- class="components-button components-menu-item__button my-class is-next-40px-default-size"
65
+ class="components-button components-menu-item__button my-class is-compact"
66
66
  role="menuitem"
67
67
  type="button"
68
68
  >
@@ -94,7 +94,7 @@ exports[`MenuItem should match snapshot when isSelected and role are optionally
94
94
 
95
95
  exports[`MenuItem should match snapshot when only label provided 1`] = `
96
96
  <button
97
- class="components-button components-menu-item__button is-next-40px-default-size"
97
+ class="components-button components-menu-item__button is-compact"
98
98
  role="menuitem"
99
99
  type="button"
100
100
  >
@@ -109,10 +109,10 @@
109
109
 
110
110
  &.is-full-screen {
111
111
  // When full screen, make sure the children container is full height.
112
- .components-modal__content {
112
+ :where(.components-modal__content) {
113
113
  display: flex;
114
114
  // If this container is scrollable, bottom padding won't apply so we use margin instead.
115
- margin-bottom: $grid-unit-40;
115
+ margin-bottom: $grid-unit-30;
116
116
  padding-bottom: 0;
117
117
 
118
118
  > :last-child {
@@ -152,7 +152,7 @@
152
152
  .components-modal__header {
153
153
  box-sizing: border-box;
154
154
  border-bottom: $border-width solid transparent;
155
- padding: $grid-unit-30 $grid-unit-40 $grid-unit-10;
155
+ padding: $grid-unit-30;
156
156
  display: flex;
157
157
  flex-direction: row;
158
158
  justify-content: space-between;
@@ -206,12 +206,12 @@
206
206
  flex: 1;
207
207
  margin-top: $header-height + $grid-unit-10;
208
208
  // Small top padding required to avoid cutting off the visible outline when the first child element is focusable.
209
- padding: $grid-unit-05 $grid-unit-40 $grid-unit-40;
209
+ padding: $grid-unit-05 $grid-unit-30 $grid-unit-30;
210
210
  overflow: auto;
211
211
 
212
212
  &.hide-header {
213
213
  margin-top: 0;
214
- padding-top: $grid-unit-40;
214
+ padding-top: $grid-unit-30;
215
215
  }
216
216
 
217
217
  &.is-scrollable:focus-visible {