@wordpress/components 29.1.1 → 29.3.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 (246) hide show
  1. package/CHANGELOG.md +29 -6
  2. package/CONTRIBUTING.md +4 -4
  3. package/README.md +1 -1
  4. package/build/badge/index.js +26 -22
  5. package/build/badge/index.js.map +1 -1
  6. package/build/border-box-control/border-box-control-linked-button/component.js +8 -15
  7. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  8. package/build/box-control/index.js +6 -0
  9. package/build/box-control/index.js.map +1 -1
  10. package/build/box-control/linked-button.js +7 -11
  11. package/build/box-control/linked-button.js.map +1 -1
  12. package/build/box-control/types.js.map +1 -1
  13. package/build/circular-option-picker/circular-option-picker-option.js +9 -7
  14. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  15. package/build/circular-option-picker/circular-option-picker.js +0 -1
  16. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  17. package/build/color-palette/index.js +1 -6
  18. package/build/color-palette/index.js.map +1 -1
  19. package/build/font-size-picker/index.native.js +1 -1
  20. package/build/font-size-picker/index.native.js.map +1 -1
  21. package/build/higher-order/with-focus-return/index.js +1 -1
  22. package/build/higher-order/with-focus-return/index.js.map +1 -1
  23. package/build/input-control/styles/input-control-styles.js +22 -22
  24. package/build/input-control/styles/input-control-styles.js.map +1 -1
  25. package/build/menu/checkbox-item.js +6 -6
  26. package/build/menu/checkbox-item.js.map +1 -1
  27. package/build/menu/context.js +2 -2
  28. package/build/menu/context.js.map +1 -1
  29. package/build/menu/group-label.js +4 -4
  30. package/build/menu/group-label.js.map +1 -1
  31. package/build/menu/group.js +4 -4
  32. package/build/menu/group.js.map +1 -1
  33. package/build/menu/index.js +87 -14
  34. package/build/menu/index.js.map +1 -1
  35. package/build/menu/item-help-text.js +4 -4
  36. package/build/menu/item-help-text.js.map +1 -1
  37. package/build/menu/item-label.js +4 -4
  38. package/build/menu/item-label.js.map +1 -1
  39. package/build/menu/item.js +6 -6
  40. package/build/menu/item.js.map +1 -1
  41. package/build/menu/popover.js +5 -5
  42. package/build/menu/popover.js.map +1 -1
  43. package/build/menu/radio-item.js +6 -6
  44. package/build/menu/radio-item.js.map +1 -1
  45. package/build/menu/separator.js +4 -4
  46. package/build/menu/separator.js.map +1 -1
  47. package/build/menu/styles.js +41 -41
  48. package/build/menu/styles.js.map +1 -1
  49. package/build/menu/submenu-trigger-item.js +5 -5
  50. package/build/menu/submenu-trigger-item.js.map +1 -1
  51. package/build/menu/trigger-button.js +3 -3
  52. package/build/menu/trigger-button.js.map +1 -1
  53. package/build/menu/types.js.map +1 -1
  54. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  55. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  56. package/build/mobile/utils/get-px-from-css-unit.native.js +3 -3
  57. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  58. package/build/notice/types.js.map +1 -1
  59. package/build/search-control/index.js +1 -1
  60. package/build/search-control/index.js.map +1 -1
  61. package/build/text/hook.js +8 -6
  62. package/build/text/hook.js.map +1 -1
  63. package/build/text/utils.js +1 -1
  64. package/build/text/utils.js.map +1 -1
  65. package/build-module/badge/index.js +28 -22
  66. package/build-module/badge/index.js.map +1 -1
  67. package/build-module/border-box-control/border-box-control-linked-button/component.js +8 -15
  68. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  69. package/build-module/box-control/index.js +6 -0
  70. package/build-module/box-control/index.js.map +1 -1
  71. package/build-module/box-control/linked-button.js +7 -11
  72. package/build-module/box-control/linked-button.js.map +1 -1
  73. package/build-module/box-control/types.js.map +1 -1
  74. package/build-module/circular-option-picker/circular-option-picker-option.js +9 -7
  75. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  76. package/build-module/circular-option-picker/circular-option-picker.js +0 -1
  77. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  78. package/build-module/color-palette/index.js +1 -6
  79. package/build-module/color-palette/index.js.map +1 -1
  80. package/build-module/font-size-picker/index.native.js +1 -1
  81. package/build-module/font-size-picker/index.native.js.map +1 -1
  82. package/build-module/higher-order/with-focus-return/index.js +1 -1
  83. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  84. package/build-module/input-control/styles/input-control-styles.js +22 -22
  85. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  86. package/build-module/menu/checkbox-item.js +6 -6
  87. package/build-module/menu/checkbox-item.js.map +1 -1
  88. package/build-module/menu/context.js +1 -1
  89. package/build-module/menu/context.js.map +1 -1
  90. package/build-module/menu/group-label.js +4 -4
  91. package/build-module/menu/group-label.js.map +1 -1
  92. package/build-module/menu/group.js +4 -4
  93. package/build-module/menu/group.js.map +1 -1
  94. package/build-module/menu/index.js +99 -26
  95. package/build-module/menu/index.js.map +1 -1
  96. package/build-module/menu/item-help-text.js +4 -4
  97. package/build-module/menu/item-help-text.js.map +1 -1
  98. package/build-module/menu/item-label.js +4 -4
  99. package/build-module/menu/item-label.js.map +1 -1
  100. package/build-module/menu/item.js +6 -6
  101. package/build-module/menu/item.js.map +1 -1
  102. package/build-module/menu/popover.js +5 -5
  103. package/build-module/menu/popover.js.map +1 -1
  104. package/build-module/menu/radio-item.js +6 -6
  105. package/build-module/menu/radio-item.js.map +1 -1
  106. package/build-module/menu/separator.js +4 -4
  107. package/build-module/menu/separator.js.map +1 -1
  108. package/build-module/menu/styles.js +40 -40
  109. package/build-module/menu/styles.js.map +1 -1
  110. package/build-module/menu/submenu-trigger-item.js +6 -6
  111. package/build-module/menu/submenu-trigger-item.js.map +1 -1
  112. package/build-module/menu/trigger-button.js +3 -3
  113. package/build-module/menu/trigger-button.js.map +1 -1
  114. package/build-module/menu/types.js.map +1 -1
  115. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  116. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  117. package/build-module/mobile/utils/get-px-from-css-unit.native.js +3 -3
  118. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  119. package/build-module/notice/types.js.map +1 -1
  120. package/build-module/search-control/index.js +1 -1
  121. package/build-module/search-control/index.js.map +1 -1
  122. package/build-module/text/hook.js +8 -6
  123. package/build-module/text/hook.js.map +1 -1
  124. package/build-module/text/utils.js +1 -1
  125. package/build-module/text/utils.js.map +1 -1
  126. package/build-style/style-rtl.css +89 -170
  127. package/build-style/style.css +89 -170
  128. package/build-types/badge/index.d.ts.map +1 -1
  129. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  130. package/build-types/box-control/index.d.ts.map +1 -1
  131. package/build-types/box-control/linked-button.d.ts.map +1 -1
  132. package/build-types/box-control/stories/index.story.d.ts +7 -2331
  133. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  134. package/build-types/box-control/types.d.ts +15 -3
  135. package/build-types/box-control/types.d.ts.map +1 -1
  136. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  137. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  138. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  139. package/build-types/color-palette/index.d.ts.map +1 -1
  140. package/build-types/higher-order/with-focus-return/index.d.ts +1 -1
  141. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  142. package/build-types/menu/checkbox-item.d.ts +2 -2
  143. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  144. package/build-types/menu/context.d.ts +2 -2
  145. package/build-types/menu/context.d.ts.map +1 -1
  146. package/build-types/menu/group-label.d.ts +2 -2
  147. package/build-types/menu/group-label.d.ts.map +1 -1
  148. package/build-types/menu/group.d.ts +2 -2
  149. package/build-types/menu/group.d.ts.map +1 -1
  150. package/build-types/menu/index.d.ts +84 -12
  151. package/build-types/menu/index.d.ts.map +1 -1
  152. package/build-types/menu/item-help-text.d.ts +1 -1
  153. package/build-types/menu/item-help-text.d.ts.map +1 -1
  154. package/build-types/menu/item-label.d.ts +1 -1
  155. package/build-types/menu/item-label.d.ts.map +1 -1
  156. package/build-types/menu/item.d.ts +2 -2
  157. package/build-types/menu/item.d.ts.map +1 -1
  158. package/build-types/menu/popover.d.ts +2 -2
  159. package/build-types/menu/popover.d.ts.map +1 -1
  160. package/build-types/menu/radio-item.d.ts +2 -2
  161. package/build-types/menu/radio-item.d.ts.map +1 -1
  162. package/build-types/menu/separator.d.ts +2 -2
  163. package/build-types/menu/separator.d.ts.map +1 -1
  164. package/build-types/menu/styles.d.ts +15 -15
  165. package/build-types/menu/styles.d.ts.map +1 -1
  166. package/build-types/menu/submenu-trigger-item.d.ts +2 -2
  167. package/build-types/menu/submenu-trigger-item.d.ts.map +1 -1
  168. package/build-types/menu/trigger-button.d.ts +2 -2
  169. package/build-types/menu/trigger-button.d.ts.map +1 -1
  170. package/build-types/menu/types.d.ts +10 -10
  171. package/build-types/menu/types.d.ts.map +1 -1
  172. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  173. package/build-types/notice/types.d.ts +1 -1
  174. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  175. package/build-types/tabs/stories/index.story.d.ts +0 -3
  176. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  177. package/build-types/text/hook.d.ts.map +1 -1
  178. package/build-types/text/utils.d.ts +1 -1
  179. package/package.json +19 -19
  180. package/src/animate/style.scss +16 -12
  181. package/src/badge/index.tsx +28 -27
  182. package/src/border-box-control/border-box-control-linked-button/component.tsx +9 -14
  183. package/src/border-control/test/index.js +12 -4
  184. package/src/box-control/index.tsx +9 -0
  185. package/src/box-control/linked-button.tsx +8 -11
  186. package/src/box-control/test/index.tsx +9 -2
  187. package/src/box-control/types.ts +26 -11
  188. package/src/button/style.scss +15 -12
  189. package/src/checkbox-control/style.scss +4 -2
  190. package/src/circular-option-picker/README.md +1 -2
  191. package/src/circular-option-picker/circular-option-picker-option.tsx +17 -10
  192. package/src/circular-option-picker/circular-option-picker.tsx +0 -1
  193. package/src/circular-option-picker/stories/index.story.tsx +0 -1
  194. package/src/circular-option-picker/style.scss +10 -5
  195. package/src/color-palette/index.tsx +0 -7
  196. package/src/color-palette/test/index.tsx +2 -8
  197. package/src/combobox-control/test/index.tsx +1 -1
  198. package/src/drop-zone/style.scss +6 -9
  199. package/src/font-size-picker/index.native.js +1 -1
  200. package/src/form-toggle/style.scss +17 -10
  201. package/src/form-token-field/style.scss +9 -4
  202. package/src/higher-order/navigate-regions/style.scss +2 -2
  203. package/src/higher-order/with-focus-return/index.tsx +1 -1
  204. package/src/input-control/styles/input-control-styles.tsx +6 -0
  205. package/src/menu/README.md +421 -174
  206. package/src/menu/checkbox-item.tsx +12 -12
  207. package/src/menu/context.tsx +2 -4
  208. package/src/menu/docs-manifest.json +62 -0
  209. package/src/menu/group-label.tsx +7 -7
  210. package/src/menu/group.tsx +7 -11
  211. package/src/menu/index.tsx +101 -31
  212. package/src/menu/item-help-text.tsx +5 -7
  213. package/src/menu/item-label.tsx +5 -7
  214. package/src/menu/item.tsx +12 -12
  215. package/src/menu/popover.tsx +9 -9
  216. package/src/menu/radio-item.tsx +12 -12
  217. package/src/menu/separator.tsx +7 -7
  218. package/src/menu/stories/best-practices.mdx +38 -0
  219. package/src/menu/stories/index.story.tsx +8 -8
  220. package/src/menu/styles.ts +24 -24
  221. package/src/menu/submenu-trigger-item.tsx +9 -9
  222. package/src/menu/trigger-button.tsx +6 -6
  223. package/src/menu/types.ts +10 -10
  224. package/src/menu-group/stories/index.story.tsx +2 -2
  225. package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  226. package/src/mobile/utils/get-px-from-css-unit.native.js +3 -3
  227. package/src/modal/style.scss +4 -2
  228. package/src/modal/test/index.tsx +5 -4
  229. package/src/notice/README.md +3 -3
  230. package/src/notice/types.ts +1 -1
  231. package/src/palette-edit/test/index.tsx +1 -1
  232. package/src/panel/style.scss +14 -6
  233. package/src/placeholder/style.scss +5 -3
  234. package/src/progress-bar/stories/index.story.tsx +1 -1
  235. package/src/resizable-box/style.scss +14 -9
  236. package/src/search-control/index.tsx +1 -1
  237. package/src/tab-panel/style.scss +6 -4
  238. package/src/tabs/stories/index.story.tsx +0 -131
  239. package/src/text/README.md +1 -1
  240. package/src/text/hook.ts +3 -2
  241. package/src/text/stories/index.story.tsx +2 -2
  242. package/src/text/test/index.tsx +1 -1
  243. package/src/text/utils.ts +1 -1
  244. package/src/text-highlight/test/index.tsx +3 -3
  245. package/src/toolbar/toolbar/style.scss +4 -3
  246. package/tsconfig.tsbuildinfo +1 -1
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import type * as Ariakit from '@ariakit/react';
5
- export interface MenuContext {
5
+ export interface ContextProps {
6
6
  /**
7
7
  * The ariakit store shared across all Menu subcomponents.
8
8
  */
@@ -12,7 +12,7 @@ export interface MenuContext {
12
12
  */
13
13
  variant?: 'toolbar';
14
14
  }
15
- export interface MenuProps {
15
+ export interface Props {
16
16
  /**
17
17
  * The elements, which should include one instance of the `Menu.TriggerButton`
18
18
  * component and one instance of the `Menu.Popover` component.
@@ -47,7 +47,7 @@ export interface MenuProps {
47
47
  */
48
48
  placement?: Ariakit.MenuProviderProps['placement'];
49
49
  }
50
- export interface MenuPopoverProps {
50
+ export interface PopoverProps {
51
51
  /**
52
52
  * The contents of the menu popover, which should include instances of the
53
53
  * `Menu.Item`, `Menu.CheckboxItem`, `Menu.RadioItem`, `Menu.Group`, and
@@ -94,7 +94,7 @@ export interface MenuPopoverProps {
94
94
  */
95
95
  hideOnEscape?: Ariakit.MenuProps['hideOnEscape'];
96
96
  }
97
- export interface MenuTriggerButtonProps {
97
+ export interface TriggerButtonProps {
98
98
  /**
99
99
  * The contents of the menu trigger button.
100
100
  */
@@ -134,7 +134,7 @@ export interface MenuTriggerButtonProps {
134
134
  */
135
135
  accessibleWhenDisabled?: Ariakit.MenuButtonProps['accessibleWhenDisabled'];
136
136
  }
137
- export interface MenuGroupProps {
137
+ export interface GroupProps {
138
138
  /**
139
139
  * The contents of the menu group, which should include one instance of the
140
140
  * `Menu.GroupLabel` component and one or more instances of `Menu.Item`,
@@ -142,14 +142,14 @@ export interface MenuGroupProps {
142
142
  */
143
143
  children: Ariakit.MenuGroupProps['children'];
144
144
  }
145
- export interface MenuGroupLabelProps {
145
+ export interface GroupLabelProps {
146
146
  /**
147
147
  * The contents of the menu group label, which should provide an accessible
148
148
  * label for the menu group.
149
149
  */
150
150
  children: Ariakit.MenuGroupLabelProps['children'];
151
151
  }
152
- export interface MenuItemProps {
152
+ export interface ItemProps {
153
153
  /**
154
154
  * The contents of the menu item, which could include one instance of the
155
155
  * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`
@@ -195,7 +195,7 @@ export interface MenuItemProps {
195
195
  */
196
196
  store?: Ariakit.MenuItemProps['store'];
197
197
  }
198
- export interface MenuCheckboxItemProps {
198
+ export interface CheckboxItemProps {
199
199
  /**
200
200
  * The contents of the menu item, which could include one instance of the
201
201
  * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`
@@ -258,7 +258,7 @@ export interface MenuCheckboxItemProps {
258
258
  */
259
259
  onChange?: Ariakit.MenuItemCheckboxProps['onChange'];
260
260
  }
261
- export interface MenuRadioItemProps {
261
+ export interface RadioItemProps {
262
262
  /**
263
263
  * The contents of the menu item, which could include one instance of the
264
264
  * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`
@@ -320,6 +320,6 @@ export interface MenuRadioItemProps {
320
320
  */
321
321
  onChange?: Ariakit.MenuItemRadioProps['onChange'];
322
322
  }
323
- export interface MenuSeparatorProps {
323
+ export interface SeparatorProps {
324
324
  }
325
325
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/menu/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,KAAK,EAAE,O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OAAO,CAAC,kBAAkB,CAAE,QAAQ,CAAE,CAAC;IAChD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAE,MAAM,CAAE,CAAC;IAC3C;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAE,OAAO,CAAE,CAAC;IAC7C;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAE,SAAS,CAAE,CAAC;IAClD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAE,gBAAgB,CAAE,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAE,UAAU,CAAE,CAAC;CACpD;AAED,MAAM,WAAW,cAAc;CAAG"}
@@ -13,5 +13,5 @@ export declare const Default: StoryFn<typeof MenuGroup>;
13
13
  * When other menu items exist above or below a MenuGroup, the group
14
14
  * should have a divider line between it and the adjacent item.
15
15
  */
16
- export declare const WithSeperator: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").MenuGroupProps>;
16
+ export declare const WithSeparator: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").MenuGroupProps>;
17
17
  //# sourceMappingURL=index.story.d.ts.map
@@ -76,7 +76,7 @@ export type NoticeProps = {
76
76
  isDismissible?: boolean;
77
77
  /**
78
78
  * A deprecated alternative to `onRemove`. This prop is kept for
79
- * compatibilty reasons but should be avoided.
79
+ * compatibility reasons but should be avoided.
80
80
  *
81
81
  * @default noop
82
82
  */
@@ -15,7 +15,7 @@ export declare const Default: StoryFn<typeof ProgressBar>;
15
15
  * You can override the default `width` by passing a custom CSS class via the
16
16
  * `className` prop.
17
17
  *
18
- * This example shows a progress bar with an overriden `width` of `100%` which
18
+ * This example shows a progress bar with an overridden `width` of `100%` which
19
19
  * makes it fit all available horizontal space of the parent element. The CSS
20
20
  * class looks like this:
21
21
  *
@@ -16,7 +16,4 @@ export declare const WithTabIconsAndTooltips: import("@storybook/csf").Annotated
16
16
  export declare const ManualActivation: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
17
17
  export declare const UsingSlotFill: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
18
18
  export declare const InsertCustomElements: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
19
- export declare const ControlledMode: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
20
- export declare const TabBecomesDisabled: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
21
- export declare const TabGetsRemoved: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
22
19
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tabs/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAStD;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAO1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAwB5B,CAAC;AACF,eAAe,IAAI,CAAC;AA+BpB,eAAO,MAAM,OAAO,mHAAsB,CAAC;AAE3C,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAE,OAAO,IAAI,CAqG3D,CAAC;AAiBF,eAAO,MAAM,QAAQ,mHAA8B,CAAC;AAwBpD,eAAO,MAAM,WAAW,mHAAiC,CAAC;AA0C1D,eAAO,MAAM,uBAAuB,mHAEnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,mHAAsB,CAAC;AA0CpD,eAAO,MAAM,aAAa,mHAAmC,CAAC;AA0D9D,eAAO,MAAM,oBAAoB,mHAAiC,CAAC;AA6DnE,eAAO,MAAM,cAAc,mHAAoC,CAAC;AAqChE,eAAO,MAAM,kBAAkB,mHAAwC,CAAC;AAgCxE,eAAO,MAAM,cAAc,mHAAoC,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tabs/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAStD;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAM1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAwB5B,CAAC;AACF,eAAe,IAAI,CAAC;AA+BpB,eAAO,MAAM,OAAO,mHAAsB,CAAC;AAE3C,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAE,OAAO,IAAI,CAqG3D,CAAC;AAiBF,eAAO,MAAM,QAAQ,mHAA8B,CAAC;AAwBpD,eAAO,MAAM,WAAW,mHAAiC,CAAC;AA0C1D,eAAO,MAAM,uBAAuB,mHAEnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,mHAAsB,CAAC;AA0CpD,eAAO,MAAM,aAAa,mHAAmC,CAAC;AA0D9D,eAAO,MAAM,oBAAoB,mHAAiC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/text/hook.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAU1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC9B,KAAK,EAAE,uBAAuB,CAAE,KAAK,EAAE,MAAM,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6J/C"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/text/hook.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAU1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC9B,KAAK,EAAE,uBAAuB,CAAE,KAAK,EAAE,MAAM,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8J/C"}
@@ -15,7 +15,7 @@ import type { FindAllArgs } from 'highlight-words-core';
15
15
  * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).
16
16
  * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text.
17
17
  * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text.
18
- * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`.
18
+ * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `sanitize` function to pass to `highlight-words-core`.
19
19
  * @property {string[]} [searchWords=[]] Words to search for and highlight.
20
20
  * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text.
21
21
  * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "29.1.1",
3
+ "version": "29.3.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.15.1",
48
- "@wordpress/compose": "^7.15.1",
49
- "@wordpress/date": "^5.15.1",
50
- "@wordpress/deprecated": "^4.15.1",
51
- "@wordpress/dom": "^4.15.1",
52
- "@wordpress/element": "^6.15.1",
53
- "@wordpress/escape-html": "^3.15.0",
54
- "@wordpress/hooks": "^4.15.0",
55
- "@wordpress/html-entities": "^4.15.0",
56
- "@wordpress/i18n": "^5.15.1",
57
- "@wordpress/icons": "^10.15.1",
58
- "@wordpress/is-shallow-equal": "^5.15.0",
59
- "@wordpress/keycodes": "^4.15.1",
60
- "@wordpress/primitives": "^4.15.1",
61
- "@wordpress/private-apis": "^1.15.0",
62
- "@wordpress/rich-text": "^7.15.1",
63
- "@wordpress/warning": "^3.15.0",
47
+ "@wordpress/a11y": "^4.17.0",
48
+ "@wordpress/compose": "^7.17.0",
49
+ "@wordpress/date": "^5.17.0",
50
+ "@wordpress/deprecated": "^4.17.0",
51
+ "@wordpress/dom": "^4.17.0",
52
+ "@wordpress/element": "^6.17.0",
53
+ "@wordpress/escape-html": "^3.17.0",
54
+ "@wordpress/hooks": "^4.17.0",
55
+ "@wordpress/html-entities": "^4.17.0",
56
+ "@wordpress/i18n": "^5.17.0",
57
+ "@wordpress/icons": "^10.17.0",
58
+ "@wordpress/is-shallow-equal": "^5.17.0",
59
+ "@wordpress/keycodes": "^4.17.0",
60
+ "@wordpress/primitives": "^4.17.0",
61
+ "@wordpress/private-apis": "^1.17.0",
62
+ "@wordpress/rich-text": "^7.17.0",
63
+ "@wordpress/warning": "^3.17.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": "0d4503ecc364cf4ca16024673baf5a84dacf212f"
88
+ "gitHead": "68a831c3178197fe87db284d4b94e5743bfb6b6c"
89
89
  }
@@ -1,7 +1,8 @@
1
1
  .components-animate__appear {
2
- animation: components-animate__appear-animation 0.1s cubic-bezier(0, 0, 0.2, 1) 0s;
3
- animation-fill-mode: forwards;
4
- @include reduce-motion("animation");
2
+ @media not (prefers-reduced-motion) {
3
+ animation: components-animate__appear-animation 0.1s cubic-bezier(0, 0, 0.2, 1) 0s;
4
+ animation-fill-mode: forwards;
5
+ }
5
6
 
6
7
  &.is-from-top,
7
8
  &.is-from-top.is-from-left {
@@ -29,16 +30,17 @@
29
30
  }
30
31
 
31
32
  .components-animate__slide-in {
32
- animation: components-animate__slide-in-animation 0.1s cubic-bezier(0, 0, 0.2, 1);
33
- animation-fill-mode: forwards;
34
- @include reduce-motion("animation");
33
+ @media not (prefers-reduced-motion) {
34
+ animation: components-animate__slide-in-animation 0.1s cubic-bezier(0, 0, 0.2, 1);
35
+ animation-fill-mode: forwards;
35
36
 
36
- &.is-from-left {
37
- transform: translateX(+100%);
38
- }
37
+ &.is-from-left {
38
+ transform: translateX(+100%);
39
+ }
39
40
 
40
- &.is-from-right {
41
- transform: translateX(-100%);
41
+ &.is-from-right {
42
+ transform: translateX(-100%);
43
+ }
42
44
  }
43
45
  }
44
46
 
@@ -49,7 +51,9 @@
49
51
  }
50
52
 
51
53
  .components-animate__loading {
52
- animation: components-animate__loading 1.6s ease-in-out infinite;
54
+ @media not (prefers-reduced-motion) {
55
+ animation: components-animate__loading 1.6s ease-in-out infinite;
56
+ }
53
57
  }
54
58
 
55
59
  @keyframes components-animate__loading {
@@ -15,45 +15,46 @@ import type { BadgeProps } from './types';
15
15
  import type { WordPressComponentProps } from '../context';
16
16
  import Icon from '../icon';
17
17
 
18
+ /**
19
+ * Returns an icon based on the badge context.
20
+ *
21
+ * @return The corresponding icon for the provided context.
22
+ */
23
+ function contextBasedIcon( intent: BadgeProps[ 'intent' ] = 'default' ) {
24
+ switch ( intent ) {
25
+ case 'info':
26
+ return info;
27
+ case 'success':
28
+ return published;
29
+ case 'warning':
30
+ return caution;
31
+ case 'error':
32
+ return error;
33
+ default:
34
+ return null;
35
+ }
36
+ }
37
+
18
38
  function Badge( {
19
39
  className,
20
40
  intent = 'default',
21
41
  children,
22
42
  ...props
23
43
  }: WordPressComponentProps< BadgeProps, 'span', false > ) {
24
- /**
25
- * Returns an icon based on the badge context.
26
- *
27
- * @return The corresponding icon for the provided context.
28
- */
29
- function contextBasedIcon() {
30
- switch ( intent ) {
31
- case 'info':
32
- return info;
33
- case 'success':
34
- return published;
35
- case 'warning':
36
- return caution;
37
- case 'error':
38
- return error;
39
- default:
40
- return null;
41
- }
42
- }
44
+ const icon = contextBasedIcon( intent );
45
+ const hasIcon = !! icon;
43
46
 
44
47
  return (
45
48
  <span
46
- className={ clsx(
47
- 'components-badge',
48
- `is-${ intent }`,
49
- intent !== 'default' && 'has-icon',
50
- className
51
- ) }
49
+ className={ clsx( 'components-badge', className, {
50
+ [ `is-${ intent }` ]: intent,
51
+ 'has-icon': hasIcon,
52
+ } ) }
52
53
  { ...props }
53
54
  >
54
- { intent !== 'default' && (
55
+ { hasIcon && (
55
56
  <Icon
56
- icon={ contextBasedIcon() }
57
+ icon={ icon }
57
58
  size={ 16 }
58
59
  fill="currentColor"
59
60
  className="components-badge__icon"
@@ -8,8 +8,6 @@ import { __ } from '@wordpress/i18n';
8
8
  * Internal dependencies
9
9
  */
10
10
  import Button from '../../button';
11
- import Tooltip from '../../tooltip';
12
- import { View } from '../../view';
13
11
  import type { WordPressComponentProps } from '../../context';
14
12
  import { contextConnect } from '../../context';
15
13
  import { useBorderBoxControlLinkedButton } from './hook';
@@ -25,18 +23,15 @@ const BorderBoxControlLinkedButton = (
25
23
  const label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );
26
24
 
27
25
  return (
28
- <Tooltip text={ label }>
29
- <View className={ className }>
30
- <Button
31
- { ...buttonProps }
32
- size="small"
33
- icon={ isLinked ? link : linkOff }
34
- iconSize={ 24 }
35
- aria-label={ label }
36
- ref={ forwardedRef }
37
- />
38
- </View>
39
- </Tooltip>
26
+ <Button
27
+ { ...buttonProps }
28
+ size="small"
29
+ icon={ isLinked ? link : linkOff }
30
+ iconSize={ 24 }
31
+ label={ label }
32
+ ref={ forwardedRef }
33
+ className={ className }
34
+ />
40
35
  );
41
36
  };
42
37
 
@@ -1,7 +1,13 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { fireEvent, render, screen, waitFor } from '@testing-library/react';
4
+ import {
5
+ fireEvent,
6
+ render,
7
+ screen,
8
+ waitFor,
9
+ within,
10
+ } from '@testing-library/react';
5
11
  import userEvent from '@testing-library/user-event';
6
12
 
7
13
  /**
@@ -56,7 +62,7 @@ const getButton = ( name ) => {
56
62
  };
57
63
 
58
64
  const getColorOption = ( color ) => {
59
- return screen.getByRole( 'option', { name: `Color: ${ color }` } );
65
+ return screen.getByRole( 'option', { name: `${ color }` } );
60
66
  };
61
67
 
62
68
  const queryButton = ( name ) => {
@@ -131,9 +137,11 @@ describe( 'BorderControl', () => {
131
137
  await openPopover( user );
132
138
 
133
139
  const customColorPicker = getButton( /Custom color picker/ );
134
- const colorSwatchButtons = screen.getAllByRole( 'option', {
135
- name: /^Color:/,
140
+ const circularOptionPicker = screen.getByRole( 'listbox', {
141
+ name: 'Custom color picker.',
136
142
  } );
143
+ const colorSwatchButtons =
144
+ within( circularOptionPicker ).getAllByRole( 'option' );
137
145
  const styleLabel = screen.getByText( 'Style' );
138
146
  const solidButton = getButton( 'Solid' );
139
147
  const dashedButton = getButton( 'Dashed' );
@@ -4,6 +4,7 @@
4
4
  import { useInstanceId } from '@wordpress/compose';
5
5
  import { useState } from '@wordpress/element';
6
6
  import { __ } from '@wordpress/i18n';
7
+ import warning from '@wordpress/warning';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -166,6 +167,14 @@ function BoxControl( {
166
167
  } );
167
168
  const sidesToRender = getAllowedSides( sides );
168
169
 
170
+ if ( ( presets && ! presetKey ) || ( ! presets && presetKey ) ) {
171
+ const definedProp = presets ? 'presets' : 'presetKey';
172
+ const missingProp = presets ? 'presetKey' : 'presets';
173
+ warning(
174
+ `wp.components.BoxControl: the '${ missingProp }' prop is required when the '${ definedProp }' prop is defined.`
175
+ );
176
+ }
177
+
169
178
  return (
170
179
  <Grid
171
180
  id={ id }
@@ -8,7 +8,6 @@ import { __ } from '@wordpress/i18n';
8
8
  * Internal dependencies
9
9
  */
10
10
  import Button from '../button';
11
- import Tooltip from '../tooltip';
12
11
 
13
12
  export default function LinkedButton( {
14
13
  isLinked,
@@ -17,15 +16,13 @@ export default function LinkedButton( {
17
16
  const label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );
18
17
 
19
18
  return (
20
- <Tooltip text={ label }>
21
- <Button
22
- { ...props }
23
- className="component-box-control__linked-button"
24
- size="small"
25
- icon={ isLinked ? link : linkOff }
26
- iconSize={ 24 }
27
- aria-label={ label }
28
- />
29
- </Tooltip>
19
+ <Button
20
+ { ...props }
21
+ className="component-box-control__linked-button"
22
+ size="small"
23
+ icon={ isLinked ? link : linkOff }
24
+ iconSize={ 24 }
25
+ label={ label }
26
+ />
30
27
  );
31
28
  }
@@ -15,8 +15,15 @@ import { useState } from '@wordpress/element';
15
15
  import BoxControl from '..';
16
16
  import type { BoxControlProps, BoxControlValue } from '../types';
17
17
 
18
+ // Since `BoxControlProps` is a the result of type unions, we need to use
19
+ // a distributive version of the standard `Omit` utility.
20
+ // See https://stackoverflow.com/a/57103940
21
+ type DistributiveOmit< T, K extends keyof any > = T extends any
22
+ ? Omit< T, K >
23
+ : never;
24
+
18
25
  const ControlledBoxControl = (
19
- extraProps: Omit< BoxControlProps, 'onChange' >
26
+ extraProps: DistributiveOmit< BoxControlProps, 'onChange' >
20
27
  ) => {
21
28
  const [ state, setState ] = useState< BoxControlValue >();
22
29
 
@@ -33,7 +40,7 @@ const ControlledBoxControl = (
33
40
  const UncontrolledBoxControl = ( {
34
41
  onChange = () => {},
35
42
  ...props
36
- }: Omit< BoxControlProps, 'onChange' > & {
43
+ }: DistributiveOmit< BoxControlProps, 'onChange' > & {
37
44
  onChange?: BoxControlProps[ 'onChange' ];
38
45
  } ) => <BoxControl __next40pxDefaultSize onChange={ onChange } { ...props } />;
39
46
 
@@ -100,17 +100,32 @@ export type BoxControlProps = Pick< UnitControlProps, 'units' > &
100
100
  * @default false
101
101
  */
102
102
  __next40pxDefaultSize?: boolean;
103
- /**
104
- * Available presets to pick from.
105
- */
106
- presets?: Preset[];
107
- /**
108
- * The key of the preset to apply.
109
- * If you provide a list of presets, you must provide a preset key to use.
110
- * The format of preset selected values is going to be `var:preset|${ presetKey }|${ presetSlug }`
111
- */
112
- presetKey?: string;
113
- };
103
+ } & (
104
+ | {
105
+ /**
106
+ * Available presets to pick from.
107
+ */
108
+ presets?: never;
109
+ /**
110
+ * The key of the preset to apply.
111
+ * If you provide a list of presets, you must provide a preset key to use.
112
+ * The format of preset selected values is going to be `var:preset|${ presetKey }|${ presetSlug }`
113
+ */
114
+ presetKey?: never;
115
+ }
116
+ | {
117
+ /**
118
+ * Available presets to pick from.
119
+ */
120
+ presets: Preset[];
121
+ /**
122
+ * The key of the preset to apply.
123
+ * If you provide a list of presets, you must provide a preset key to use.
124
+ * The format of preset selected values is going to be `var:preset|${ presetKey }|${ presetSlug }`
125
+ */
126
+ presetKey: string;
127
+ }
128
+ );
114
129
 
115
130
  export type BoxControlInputControlProps = UnitControlPassthroughProps & {
116
131
  onChange?: ( nextValues: BoxControlValue ) => void;
@@ -15,8 +15,11 @@
15
15
  cursor: pointer;
16
16
  -webkit-appearance: none;
17
17
  background: none;
18
- transition: box-shadow 0.1s linear;
19
- @include reduce-motion("transition");
18
+
19
+ @media not (prefers-reduced-motion) {
20
+ transition: box-shadow 0.1s linear;
21
+ }
22
+
20
23
  height: $button-size;
21
24
  align-items: center;
22
25
  box-sizing: border-box;
@@ -245,10 +248,13 @@
245
248
  text-align: left;
246
249
  color: $components-color-accent;
247
250
  text-decoration: underline;
248
- transition-property: border, background, color;
249
- transition-duration: 0.05s;
250
- transition-timing-function: ease-in-out;
251
- @include reduce-motion("transition");
251
+
252
+ @media not (prefers-reduced-motion) {
253
+ transition-property: border, background, color;
254
+ transition-duration: 0.05s;
255
+ transition-timing-function: ease-in-out;
256
+ }
257
+
252
258
  height: auto;
253
259
 
254
260
  &:focus {
@@ -275,11 +281,8 @@
275
281
  &.is-secondary.is-busy,
276
282
  &.is-secondary.is-busy:disabled,
277
283
  &.is-secondary.is-busy[aria-disabled="true"] {
278
- animation: components-button__busy-animation 2500ms infinite linear;
279
- // This should be refactored to use the reduce-motion("animation") mixin
280
- // as soon as https://github.com/WordPress/gutenberg/issues/55566 is closed.
281
- @media (prefers-reduced-motion: reduce) {
282
- animation-duration: 0s;
284
+ @media not (prefers-reduced-motion) {
285
+ animation: components-button__busy-animation 2500ms infinite linear;
283
286
  }
284
287
  background-size: 100px 100%;
285
288
  /* stylelint-disable -- Disable reason: This function call looks nicer when each argument is on its own line. */
@@ -376,7 +379,7 @@
376
379
  fill: currentColor;
377
380
  outline: none;
378
381
 
379
- // Optimizate for high contrast modes.
382
+ // Optimize for high contrast modes.
380
383
  // See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
381
384
  @media (forced-colors: active) {
382
385
  fill: CanvasText;
@@ -32,8 +32,10 @@
32
32
  height: var(--checkbox-input-size);
33
33
 
34
34
  appearance: none;
35
- transition: 0.1s border-color ease-in-out;
36
- @include reduce-motion("transition");
35
+
36
+ @media not (prefers-reduced-motion) {
37
+ transition: 0.1s border-color ease-in-out;
38
+ }
37
39
 
38
40
  &:focus {
39
41
  @include button-style-outset__focus(var(--wp-admin-theme-color));
@@ -29,7 +29,6 @@ const Example = () => {
29
29
  style={ { backgroundColor: color, color } }
30
30
  isSelected={ index === currentColor }
31
31
  onClick={ () => setCurrentColor( index ) }
32
- aria-label={ name }
33
32
  />
34
33
  );
35
34
  } ) }
@@ -150,6 +149,6 @@ Inherits all of the [`Dropdown` props](/packages/components/src/dropdown/README.
150
149
 
151
150
  Props for the underlying `Button` component.
152
151
 
153
- Inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`, `target`, and `children`.
152
+ Inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`, `target`, and `children`.
154
153
 
155
154
  - Required: No