@wordpress/components 32.6.0 → 33.0.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 (208) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/autocomplete/get-autocomplete-match.cjs +11 -2
  3. package/build/autocomplete/get-autocomplete-match.cjs.map +2 -2
  4. package/build/autocomplete/index.cjs +42 -11
  5. package/build/autocomplete/index.cjs.map +2 -2
  6. package/build/external-link/index.cjs +1 -1
  7. package/build/external-link/index.cjs.map +2 -2
  8. package/build/form-token-field/index.cjs +22 -6
  9. package/build/form-token-field/index.cjs.map +3 -3
  10. package/build/form-token-field/token-input.cjs +1 -1
  11. package/build/form-token-field/token-input.cjs.map +2 -2
  12. package/build/menu/popover.cjs +7 -3
  13. package/build/menu/popover.cjs.map +2 -2
  14. package/build/menu/styles.cjs +39 -16
  15. package/build/menu/styles.cjs.map +2 -2
  16. package/build/navigable-container/container.cjs +72 -110
  17. package/build/navigable-container/container.cjs.map +2 -2
  18. package/build/utils/breakpoint.cjs.map +1 -1
  19. package/build/utils/font.cjs.map +1 -1
  20. package/build/visually-hidden/component.cjs +1 -0
  21. package/build/visually-hidden/component.cjs.map +2 -2
  22. package/build-module/autocomplete/get-autocomplete-match.mjs +11 -2
  23. package/build-module/autocomplete/get-autocomplete-match.mjs.map +2 -2
  24. package/build-module/autocomplete/index.mjs +42 -11
  25. package/build-module/autocomplete/index.mjs.map +2 -2
  26. package/build-module/external-link/index.mjs +1 -1
  27. package/build-module/external-link/index.mjs.map +2 -2
  28. package/build-module/form-token-field/index.mjs +22 -6
  29. package/build-module/form-token-field/index.mjs.map +2 -2
  30. package/build-module/form-token-field/token-input.mjs +1 -1
  31. package/build-module/form-token-field/token-input.mjs.map +2 -2
  32. package/build-module/menu/popover.mjs +7 -3
  33. package/build-module/menu/popover.mjs.map +2 -2
  34. package/build-module/menu/styles.mjs +37 -16
  35. package/build-module/menu/styles.mjs.map +2 -2
  36. package/build-module/navigable-container/container.mjs +73 -111
  37. package/build-module/navigable-container/container.mjs.map +2 -2
  38. package/build-module/utils/breakpoint.mjs.map +1 -1
  39. package/build-module/utils/font.mjs.map +1 -1
  40. package/build-module/visually-hidden/component.mjs +1 -0
  41. package/build-module/visually-hidden/component.mjs.map +2 -2
  42. package/build-style/style-rtl.css +26 -2
  43. package/build-style/style.css +26 -2
  44. package/build-types/autocomplete/get-autocomplete-match.d.ts +10 -1
  45. package/build-types/autocomplete/get-autocomplete-match.d.ts.map +1 -1
  46. package/build-types/autocomplete/index.d.ts.map +1 -1
  47. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  48. package/build-types/button/stories/index.story.d.ts.map +1 -1
  49. package/build-types/card/stories/index.story.d.ts +0 -6
  50. package/build-types/card/stories/index.story.d.ts.map +1 -1
  51. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  52. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  53. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  54. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  55. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  56. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  57. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  58. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  59. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  60. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  61. package/build-types/external-link/index.d.ts.map +1 -1
  62. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  63. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  64. package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
  65. package/build-types/form-token-field/index.d.ts.map +1 -1
  66. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  67. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  68. package/build-types/form-token-field/types.d.ts +16 -2
  69. package/build-types/form-token-field/types.d.ts.map +1 -1
  70. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  71. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  72. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  73. package/build-types/menu/popover.d.ts.map +1 -1
  74. package/build-types/menu/styles.d.ts +16 -1
  75. package/build-types/menu/styles.d.ts.map +1 -1
  76. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  77. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  78. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  79. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  80. package/build-types/navigable-container/container.d.ts +3 -8
  81. package/build-types/navigable-container/container.d.ts.map +1 -1
  82. package/build-types/navigable-container/types.d.ts +1 -5
  83. package/build-types/navigable-container/types.d.ts.map +1 -1
  84. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
  85. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  86. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  87. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  88. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  89. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  90. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  91. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  92. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  93. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  94. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  95. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  96. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  97. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  98. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  99. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  100. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  101. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  102. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  103. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  104. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  105. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  106. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  107. package/build-types/utils/breakpoint.d.ts +2 -1
  108. package/build-types/utils/breakpoint.d.ts.map +1 -1
  109. package/build-types/utils/font.d.ts +3 -2
  110. package/build-types/utils/font.d.ts.map +1 -1
  111. package/build-types/visually-hidden/component.d.ts.map +1 -1
  112. package/build-types/visually-hidden/stories/index.story.d.ts +0 -6
  113. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  114. package/package.json +21 -21
  115. package/src/autocomplete/get-autocomplete-match.ts +25 -4
  116. package/src/autocomplete/index.tsx +69 -21
  117. package/src/autocomplete/test/get-autocomplete-match.ts +97 -75
  118. package/src/base-control/stories/index.story.tsx +1 -0
  119. package/src/button/stories/index.story.tsx +1 -0
  120. package/src/button-group/style.scss +1 -2
  121. package/src/card/stories/index.story.tsx +2 -9
  122. package/src/checkbox-control/stories/index.story.tsx +1 -0
  123. package/src/circular-option-picker/style.scss +8 -6
  124. package/src/color-indicator/stories/index.story.tsx +1 -0
  125. package/src/color-palette/stories/index.story.tsx +1 -0
  126. package/src/color-picker/stories/index.story.tsx +1 -0
  127. package/src/combobox-control/stories/index.story.tsx +1 -0
  128. package/src/composite/stories/index.story.tsx +1 -0
  129. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  130. package/src/custom-select-control/stories/index.story.tsx +1 -0
  131. package/src/disabled/stories/index.story.tsx +1 -0
  132. package/src/drop-zone/stories/index.story.tsx +1 -0
  133. package/src/dropdown/stories/index.story.tsx +1 -0
  134. package/src/external-link/index.tsx +1 -6
  135. package/src/external-link/stories/index.story.tsx +2 -1
  136. package/src/external-link/style.scss +30 -2
  137. package/src/form-file-upload/stories/index.story.tsx +1 -0
  138. package/src/form-toggle/stories/index.story.tsx +1 -0
  139. package/src/form-toggle/style.scss +3 -2
  140. package/src/form-token-field/README.md +2 -1
  141. package/src/form-token-field/index.tsx +39 -9
  142. package/src/form-token-field/stories/index.story.tsx +2 -0
  143. package/src/form-token-field/test/index.tsx +70 -10
  144. package/src/form-token-field/token-input.tsx +1 -6
  145. package/src/form-token-field/types.ts +16 -2
  146. package/src/gradient-picker/stories/index.story.tsx +1 -0
  147. package/src/icon/stories/index.story.tsx +1 -0
  148. package/src/input-control/stories/index.story.tsx +1 -1
  149. package/src/item-group/stories/index.story.tsx +1 -1
  150. package/src/keyboard-shortcuts/stories/index.story.tsx +1 -0
  151. package/src/menu/popover.tsx +15 -8
  152. package/src/menu/styles.ts +26 -16
  153. package/src/menu/test/index.tsx +24 -34
  154. package/src/menu-group/stories/index.story.tsx +1 -0
  155. package/src/menu-item/stories/index.story.tsx +1 -0
  156. package/src/menu-items-choice/stories/index.story.tsx +1 -0
  157. package/src/mobile/link-settings/index.native.js +1 -1
  158. package/src/modal/stories/index.story.tsx +1 -0
  159. package/src/navigable-container/container.tsx +120 -141
  160. package/src/navigable-container/test/navigable-menu.tsx +24 -0
  161. package/src/navigable-container/types.ts +1 -5
  162. package/src/navigation/stories/utils/more-examples.tsx +2 -1
  163. package/src/navigator/stories/index.story.tsx +1 -0
  164. package/src/notice/stories/index.story.tsx +1 -0
  165. package/src/notice/test/__snapshots__/index.tsx.snap +1 -0
  166. package/src/number-control/stories/index.story.tsx +1 -1
  167. package/src/panel/stories/index.story.tsx +1 -0
  168. package/src/popover/stories/index.story.tsx +1 -0
  169. package/src/progress-bar/stories/index.story.tsx +1 -0
  170. package/src/radio-control/stories/index.story.tsx +1 -0
  171. package/src/range-control/stories/index.story.tsx +1 -0
  172. package/src/resizable-box/stories/index.story.tsx +1 -0
  173. package/src/resizable-box/style.scss +4 -5
  174. package/src/sandbox/stories/index.story.tsx +1 -0
  175. package/src/scroll-lock/stories/index.story.tsx +1 -0
  176. package/src/search-control/stories/index.story.tsx +1 -0
  177. package/src/select-control/stories/index.story.tsx +1 -0
  178. package/src/shortcut/stories/index.story.tsx +1 -0
  179. package/src/slot-fill/stories/index.story.tsx +1 -0
  180. package/src/snackbar/stories/index.story.tsx +1 -0
  181. package/src/spinner/stories/index.story.tsx +1 -0
  182. package/src/text-control/stories/index.story.tsx +1 -0
  183. package/src/text-highlight/stories/index.story.tsx +1 -0
  184. package/src/textarea-control/stories/index.story.tsx +1 -0
  185. package/src/toggle-control/stories/index.story.tsx +1 -0
  186. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  187. package/src/toolbar/toolbar-group/index.tsx +2 -2
  188. package/src/tooltip/stories/index.story.tsx +1 -0
  189. package/src/tooltip/test/index.tsx +3 -2
  190. package/src/tree-grid/stories/index.story.tsx +1 -1
  191. package/src/tree-select/stories/index.story.tsx +1 -0
  192. package/src/truncate/stories/index.story.tsx +1 -1
  193. package/src/unit-control/stories/index.story.tsx +1 -1
  194. package/src/utils/breakpoint.js +1 -1
  195. package/src/utils/font.js +1 -1
  196. package/src/visually-hidden/component.tsx +1 -0
  197. package/src/visually-hidden/stories/index.story.tsx +2 -8
  198. package/build/card/context.cjs +0 -36
  199. package/build/card/context.cjs.map +0 -7
  200. package/build-module/card/context.mjs +0 -10
  201. package/build-module/card/context.mjs.map +0 -7
  202. package/build-types/card/context.d.ts +0 -3
  203. package/build-types/card/context.d.ts.map +0 -1
  204. package/build-types/visually-hidden/test/index.d.ts +0 -2
  205. package/build-types/visually-hidden/test/index.d.ts.map +0 -1
  206. package/src/card/context.ts +0 -9
  207. package/src/visually-hidden/test/__snapshots__/index.tsx.snap +0 -12
  208. package/src/visually-hidden/test/index.tsx +0 -17
@@ -1,7 +1,6 @@
1
1
  @use "sass:math";
2
2
  @use "@wordpress/base-styles/colors" as *;
3
3
  @use "@wordpress/base-styles/variables" as *;
4
- @use "@wordpress/base-styles/z-index" as *;
5
4
  @use "../utils/theme-variables" as *;
6
5
 
7
6
  $resize-handler-size: 15px;
@@ -15,7 +14,7 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
15
14
  height: $resize-handler-container-size;
16
15
 
17
16
  // Elevate the resize handle above the focus style.
18
- z-index: z-index(".components-resizable-box__handle");
17
+ z-index: 2;
19
18
 
20
19
  // Show the resize handle if set in props
21
20
  .components-resizable-box__container.has-show-handle & {
@@ -26,7 +25,7 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
26
25
  position: relative;
27
26
  width: 100%;
28
27
  height: 100%;
29
- z-index: z-index(".components-resizable-box__handle");
28
+ z-index: 2;
30
29
  outline: none;
31
30
  }
32
31
  }
@@ -77,11 +76,11 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
77
76
 
78
77
  // Show corner handles on top of side handles so they can be used
79
78
  .components-resizable-box__side-handle {
80
- z-index: z-index(".components-resizable-box__side-handle");
79
+ z-index: 2;
81
80
  }
82
81
 
83
82
  .components-resizable-box__corner-handle {
84
- z-index: z-index(".components-resizable-box__corner-handle");
83
+ z-index: 2;
85
84
  }
86
85
 
87
86
  // Make horizontal side-handles full width
@@ -10,6 +10,7 @@ import { fn } from 'storybook/test';
10
10
  import SandBox from '..';
11
11
 
12
12
  const meta: Meta< typeof SandBox > = {
13
+ tags: [ 'manifest' ],
13
14
  component: SandBox,
14
15
  title: 'Components/Utilities/SandBox',
15
16
  id: 'components-sandbox',
@@ -16,6 +16,7 @@ import Button from '../../button';
16
16
  import ScrollLock from '..';
17
17
 
18
18
  const meta: Meta< typeof ScrollLock > = {
19
+ tags: [ 'manifest' ],
19
20
  component: ScrollLock,
20
21
  title: 'Components/Utilities/ScrollLock',
21
22
  id: 'components-scrolllock',
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
14
14
  import SearchControl from '..';
15
15
 
16
16
  const meta: Meta< typeof SearchControl > = {
17
+ tags: [ 'manifest' ],
17
18
  title: 'Components/Selection & Input/Common/SearchControl',
18
19
  id: 'components-searchcontrol',
19
20
  component: SearchControl,
@@ -16,6 +16,7 @@ import SelectControl from '../';
16
16
  import { InputControlPrefixWrapper } from '../../input-control/input-prefix-wrapper';
17
17
 
18
18
  const meta: Meta< typeof SelectControl > = {
19
+ tags: [ 'manifest' ],
19
20
  title: 'Components/Selection & Input/Common/SelectControl',
20
21
  id: 'components-selectcontrol',
21
22
  component: SelectControl,
@@ -9,6 +9,7 @@ import type { Meta, StoryFn } from '@storybook/react-vite';
9
9
  import Shortcut from '../';
10
10
 
11
11
  const meta: Meta< typeof Shortcut > = {
12
+ tags: [ 'manifest' ],
12
13
  component: Shortcut,
13
14
  title: 'Components/Utilities/Shortcut',
14
15
  id: 'components-shortcut',
@@ -14,6 +14,7 @@ import { createContext, useContext } from '@wordpress/element';
14
14
  import { Slot, Fill, Provider as SlotFillProvider } from '../';
15
15
 
16
16
  const meta: Meta< typeof Slot > = {
17
+ tags: [ 'manifest' ],
17
18
  component: Slot,
18
19
  title: 'Components/Utilities/SlotFill',
19
20
  id: 'components-slotfill',
@@ -15,6 +15,7 @@ import Icon from '../../icon';
15
15
  import Snackbar from '..';
16
16
 
17
17
  const meta: Meta< typeof Snackbar > = {
18
+ tags: [ 'manifest' ],
18
19
  title: 'Components/Feedback/Snackbar',
19
20
  id: 'components-snackbar',
20
21
  component: Snackbar,
@@ -10,6 +10,7 @@ import Spinner from '../';
10
10
  import { space } from '../../utils/space';
11
11
 
12
12
  const meta: Meta< typeof Spinner > = {
13
+ tags: [ 'manifest' ],
13
14
  title: 'Components/Feedback/Spinner',
14
15
  id: 'components-spinner',
15
16
  component: Spinner,
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
14
14
  import TextControl from '..';
15
15
 
16
16
  const meta: Meta< typeof TextControl > = {
17
+ tags: [ 'manifest' ],
17
18
  component: TextControl,
18
19
  title: 'Components/Selection & Input/Common/TextControl',
19
20
  id: 'components-textcontrol',
@@ -9,6 +9,7 @@ import type { Meta, StoryFn } from '@storybook/react-vite';
9
9
  import TextHighlight from '..';
10
10
 
11
11
  const meta: Meta< typeof TextHighlight > = {
12
+ tags: [ 'manifest' ],
12
13
  component: TextHighlight,
13
14
  title: 'Components/Typography/TextHighlight',
14
15
  id: 'components-texthighlight',
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
14
14
  import TextareaControl from '..';
15
15
 
16
16
  const meta: Meta< typeof TextareaControl > = {
17
+ tags: [ 'manifest' ],
17
18
  component: TextareaControl,
18
19
  title: 'Components/Selection & Input/Common/TextareaControl',
19
20
  id: 'components-textareacontrol',
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
14
14
  import ToggleControl from '..';
15
15
 
16
16
  const meta: Meta< typeof ToggleControl > = {
17
+ tags: [ 'manifest' ],
17
18
  title: 'Components/Selection & Input/Common/ToggleControl',
18
19
  id: 'components-togglecontrol',
19
20
  component: ToggleControl,
@@ -33,7 +33,7 @@ const meta: Meta< typeof ToggleGroupControl > = {
33
33
  onChange: { action: 'onChange' },
34
34
  value: { control: false },
35
35
  },
36
- tags: [ 'status-experimental' ],
36
+ tags: [ 'status-experimental', 'manifest' ],
37
37
  parameters: {
38
38
  controls: { expanded: true },
39
39
  docs: { canvas: { sourceState: 'shown' } },
@@ -17,7 +17,7 @@ import ToolbarGroupCollapsed from './toolbar-group-collapsed';
17
17
  import ToolbarContext from '../toolbar-context';
18
18
  import type { ToolbarGroupProps, ToolbarGroupControls } from './types';
19
19
 
20
- function isNestedArray< T = any >( arr: T[] | T[][] ): arr is T[][] {
20
+ function isNestedArray< T >( arr: T | T[] ): arr is T[] {
21
21
  return Array.isArray( arr ) && Array.isArray( arr[ 0 ] );
22
22
  }
23
23
 
@@ -78,7 +78,7 @@ function ToolbarGroup( {
78
78
 
79
79
  // Normalize controls to nested array of objects (sets of controls)
80
80
  let controlSets: ToolbarGroupControls[][];
81
- if ( isNestedArray( controls ) ) {
81
+ if ( isNestedArray< ToolbarGroupControls[] >( controls ) ) {
82
82
  controlSets = controls;
83
83
  } else {
84
84
  controlSets = [ controls ];
@@ -15,6 +15,7 @@ import Tooltip from '..';
15
15
  import Button from '../../button';
16
16
 
17
17
  const meta: Meta< typeof Tooltip > = {
18
+ tags: [ 'manifest' ],
18
19
  title: 'Components/Overlays/Tooltip',
19
20
  id: 'components-tooltip',
20
21
  component: Tooltip,
@@ -286,7 +286,7 @@ describe( 'Tooltip', () => {
286
286
 
287
287
  describe( 'delay', () => {
288
288
  it( 'should respect custom delay prop when showing tooltip', async () => {
289
- const ADDITIONAL_DELAY = 100;
289
+ const ADDITIONAL_DELAY = 500;
290
290
 
291
291
  render(
292
292
  <Tooltip
@@ -304,7 +304,8 @@ describe( 'Tooltip', () => {
304
304
  await hover( anchor );
305
305
  expectTooltipToBeHidden();
306
306
 
307
- // Advance time by default delay
307
+ // Advance time by default delay, which is still well before the
308
+ // custom delay even when CI is slow to resolve the hover event.
308
309
  await sleep( TOOLTIP_DELAY );
309
310
 
310
311
  // Tooltip hasn't appeared yet
@@ -24,7 +24,7 @@ const meta: Meta< typeof TreeGrid > = {
24
24
  argTypes: {
25
25
  children: { control: false },
26
26
  },
27
- tags: [ 'status-experimental' ],
27
+ tags: [ 'status-experimental', 'manifest' ],
28
28
  args: {
29
29
  onExpandRow: fn(),
30
30
  onCollapseRow: fn(),
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
14
14
  import TreeSelect from '../';
15
15
 
16
16
  const meta: Meta< typeof TreeSelect > = {
17
+ tags: [ 'manifest' ],
17
18
  title: 'Components/Selection & Input/Common/TreeSelect',
18
19
  id: 'components-treeselect',
19
20
  component: TreeSelect,
@@ -16,7 +16,7 @@ const meta: Meta< typeof Truncate > = {
16
16
  children: { control: { type: 'text' } },
17
17
  as: { control: { type: 'text' } },
18
18
  },
19
- tags: [ 'status-experimental' ],
19
+ tags: [ 'status-experimental', 'manifest' ],
20
20
  parameters: {
21
21
  controls: {
22
22
  expanded: true,
@@ -27,7 +27,7 @@ const meta: Meta< typeof UnitControl > = {
27
27
  prefix: { control: { type: 'text' } },
28
28
  value: { control: false },
29
29
  },
30
- tags: [ 'status-experimental' ],
30
+ tags: [ 'status-experimental', 'manifest' ],
31
31
  args: {
32
32
  onChange: fn(),
33
33
  onUnitChange: fn(),
@@ -4,7 +4,7 @@
4
4
  import breakpoints from './breakpoint-values';
5
5
 
6
6
  /**
7
- * @param {keyof breakpoints} point
7
+ * @param {keyof typeof breakpoints} point
8
8
  * @return {string} Media query declaration.
9
9
  */
10
10
  export const breakpoint = ( point ) =>
package/src/utils/font.js CHANGED
@@ -5,7 +5,7 @@ import FONT from './font-values';
5
5
 
6
6
  /**
7
7
  *
8
- * @param {keyof FONT} value Path of value from `FONT`
8
+ * @param {keyof typeof FONT} value Path of value from `FONT`
9
9
  * @return {string} Font rule value
10
10
  */
11
11
  export function font( value ) {
@@ -24,6 +24,7 @@ function UnconnectedVisuallyHidden(
24
24
  <View
25
25
  ref={ forwardedRef }
26
26
  { ...contextProps }
27
+ data-visually-hidden=""
27
28
  style={ { ...visuallyHidden, ...( styleProp || {} ) } }
28
29
  />
29
30
  );
@@ -1,11 +1,4 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import type { Meta, StoryFn } from '@storybook/react-vite';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
2
  import { VisuallyHidden } from '..';
10
3
 
11
4
  const meta: Meta< typeof VisuallyHidden > = {
@@ -22,8 +15,9 @@ const meta: Meta< typeof VisuallyHidden > = {
22
15
  },
23
16
  docs: { canvas: { sourceState: 'shown' } },
24
17
  componentStatus: {
25
- status: 'stable',
18
+ status: 'not-recommended',
26
19
  whereUsed: 'global',
20
+ notes: 'Use `VisuallyHidden` from `@wordpress/ui` instead.',
27
21
  },
28
22
  },
29
23
  };
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/components/src/card/context.ts
21
- var context_exports = {};
22
- __export(context_exports, {
23
- CardContext: () => CardContext,
24
- useCardContext: () => useCardContext
25
- });
26
- module.exports = __toCommonJS(context_exports);
27
- var import_element = require("@wordpress/element");
28
- var CardContext = (0, import_element.createContext)({});
29
- CardContext.displayName = "CardContext";
30
- var useCardContext = () => (0, import_element.useContext)(CardContext);
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- CardContext,
34
- useCardContext
35
- });
36
- //# sourceMappingURL=context.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/card/context.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nexport const CardContext = createContext({});\nCardContext.displayName = 'CardContext';\nexport const useCardContext = () => useContext(CardContext);"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AACnC,IAAM,kBAAc,8BAAc,CAAC,CAAC;AAC3C,YAAY,cAAc;AACnB,IAAM,iBAAiB,UAAM,2BAAW,WAAW;",
6
- "names": []
7
- }
@@ -1,10 +0,0 @@
1
- // packages/components/src/card/context.ts
2
- import { createContext, useContext } from "@wordpress/element";
3
- var CardContext = createContext({});
4
- CardContext.displayName = "CardContext";
5
- var useCardContext = () => useContext(CardContext);
6
- export {
7
- CardContext,
8
- useCardContext
9
- };
10
- //# sourceMappingURL=context.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/card/context.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nexport const CardContext = createContext({});\nCardContext.displayName = 'CardContext';\nexport const useCardContext = () => useContext(CardContext);"],
5
- "mappings": ";AAGA,SAAS,eAAe,kBAAkB;AACnC,IAAM,cAAc,cAAc,CAAC,CAAC;AAC3C,YAAY,cAAc;AACnB,IAAM,iBAAiB,MAAM,WAAW,WAAW;",
6
- "names": []
7
- }
@@ -1,3 +0,0 @@
1
- export declare const CardContext: import("react").Context<{}>;
2
- export declare const useCardContext: () => {};
3
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/card/context.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,6BAAsB,CAAC;AAG/C,eAAO,MAAM,cAAc,UAAkC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/visually-hidden/test/index.tsx"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createContext, useContext } from '@wordpress/element';
5
-
6
- export const CardContext = createContext( {} );
7
- CardContext.displayName = 'CardContext';
8
-
9
- export const useCardContext = () => useContext( CardContext );
@@ -1,12 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`VisuallyHidden should render correctly 1`] = `
4
- <div
5
- class="components-visually-hidden css-1ragr82-PolymorphicDiv emotion-0"
6
- data-wp-c16t="true"
7
- data-wp-component="VisuallyHidden"
8
- style="border: 0px; clip: rect(1px, 1px, 1px, 1px); clip-path: inset( 50% ); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-wrap: normal; word-break: normal;"
9
- >
10
- This is hidden
11
- </div>
12
- `;
@@ -1,17 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { render, screen } from '@testing-library/react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { VisuallyHidden } from '..';
10
-
11
- describe( 'VisuallyHidden', () => {
12
- it( 'should render correctly', () => {
13
- const text = 'This is hidden';
14
- render( <VisuallyHidden>{ text }</VisuallyHidden> );
15
- expect( screen.getByText( text ) ).toMatchSnapshot();
16
- } );
17
- } );