@wordpress/components 28.11.0 → 28.12.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 (142) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/build/border-control/border-control-dropdown/component.js +1 -1
  3. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  4. package/build/form-file-upload/index.js +5 -1
  5. package/build/form-file-upload/index.js.map +1 -1
  6. package/build/form-token-field/token.js +1 -0
  7. package/build/form-token-field/token.js.map +1 -1
  8. package/build/guide/page-control.js +1 -0
  9. package/build/guide/page-control.js.map +1 -1
  10. package/build/menu-item/index.js +1 -0
  11. package/build/menu-item/index.js.map +1 -1
  12. package/build/notice/index.js +2 -0
  13. package/build/notice/index.js.map +1 -1
  14. package/build/palette-edit/index.js +5 -0
  15. package/build/palette-edit/index.js.map +1 -1
  16. package/build/panel/body.js +1 -0
  17. package/build/panel/body.js.map +1 -1
  18. package/build/popover/index.js +4 -1
  19. package/build/popover/index.js.map +1 -1
  20. package/build/radio-group/radio.js +6 -0
  21. package/build/radio-group/radio.js.map +1 -1
  22. package/build/radio-group/types.js.map +1 -1
  23. package/build/snackbar/index.js +2 -1
  24. package/build/snackbar/index.js.map +1 -1
  25. package/build/tabs/tablist.js +13 -2
  26. package/build/tabs/tablist.js.map +1 -1
  27. package/build/toggle-group-control/toggle-group-control/component.js +1 -1
  28. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  29. package/build/utils/deprecated-36px-size.js +1 -1
  30. package/build/utils/deprecated-36px-size.js.map +1 -1
  31. package/build-module/border-control/border-control-dropdown/component.js +1 -1
  32. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  33. package/build-module/form-file-upload/index.js +5 -1
  34. package/build-module/form-file-upload/index.js.map +1 -1
  35. package/build-module/form-token-field/token.js +1 -0
  36. package/build-module/form-token-field/token.js.map +1 -1
  37. package/build-module/guide/page-control.js +1 -0
  38. package/build-module/guide/page-control.js.map +1 -1
  39. package/build-module/menu-item/index.js +1 -0
  40. package/build-module/menu-item/index.js.map +1 -1
  41. package/build-module/notice/index.js +2 -0
  42. package/build-module/notice/index.js.map +1 -1
  43. package/build-module/palette-edit/index.js +5 -0
  44. package/build-module/palette-edit/index.js.map +1 -1
  45. package/build-module/panel/body.js +1 -0
  46. package/build-module/panel/body.js.map +1 -1
  47. package/build-module/popover/index.js +4 -1
  48. package/build-module/popover/index.js.map +1 -1
  49. package/build-module/radio-group/radio.js +6 -0
  50. package/build-module/radio-group/radio.js.map +1 -1
  51. package/build-module/radio-group/types.js.map +1 -1
  52. package/build-module/snackbar/index.js +2 -1
  53. package/build-module/snackbar/index.js.map +1 -1
  54. package/build-module/tabs/tablist.js +13 -2
  55. package/build-module/tabs/tablist.js.map +1 -1
  56. package/build-module/toggle-group-control/toggle-group-control/component.js +1 -1
  57. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  58. package/build-module/utils/deprecated-36px-size.js +1 -1
  59. package/build-module/utils/deprecated-36px-size.js.map +1 -1
  60. package/build-style/style-rtl.css +15 -29
  61. package/build-style/style.css +15 -29
  62. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  63. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  64. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  65. package/build-types/form-file-upload/index.d.ts.map +1 -1
  66. package/build-types/form-token-field/token.d.ts.map +1 -1
  67. package/build-types/guide/page-control.d.ts.map +1 -1
  68. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  69. package/build-types/lock-unlock.d.ts +2 -2
  70. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  71. package/build-types/menu-item/index.d.ts.map +1 -1
  72. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  73. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  74. package/build-types/notice/index.d.ts.map +1 -1
  75. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  76. package/build-types/palette-edit/index.d.ts.map +1 -1
  77. package/build-types/panel/body.d.ts.map +1 -1
  78. package/build-types/popover/index.d.ts.map +1 -1
  79. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  80. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  81. package/build-types/radio-group/radio.d.ts +4 -2
  82. package/build-types/radio-group/radio.d.ts.map +1 -1
  83. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  84. package/build-types/radio-group/types.d.ts +5 -1
  85. package/build-types/radio-group/types.d.ts.map +1 -1
  86. package/build-types/snackbar/index.d.ts.map +1 -1
  87. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  88. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  89. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  90. package/build-types/tabs/tablist.d.ts.map +1 -1
  91. package/build-types/text/stories/index.story.d.ts.map +1 -1
  92. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  93. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  94. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  95. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  96. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  97. package/build-types/utils/deprecated-36px-size.d.ts +1 -1
  98. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
  99. package/package.json +4 -4
  100. package/src/border-control/border-control-dropdown/component.tsx +1 -1
  101. package/src/confirm-dialog/stories/index.story.tsx +2 -1
  102. package/src/dropdown/stories/index.story.tsx +2 -1
  103. package/src/external-link/stories/index.story.tsx +2 -1
  104. package/src/form-file-upload/index.tsx +7 -1
  105. package/src/form-token-field/style.scss +8 -12
  106. package/src/form-token-field/token.tsx +1 -0
  107. package/src/guide/page-control.tsx +1 -0
  108. package/src/guide/style.scss +4 -6
  109. package/src/heading/stories/index.story.tsx +2 -1
  110. package/src/menu/stories/index.story.tsx +2 -1
  111. package/src/menu-item/index.tsx +1 -0
  112. package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
  113. package/src/modal/stories/index.story.tsx +2 -1
  114. package/src/navigator/stories/index.story.tsx +2 -1
  115. package/src/notice/index.tsx +2 -0
  116. package/src/notice/stories/index.story.tsx +7 -2
  117. package/src/notice/test/__snapshots__/index.tsx.snap +4 -4
  118. package/src/palette-edit/index.tsx +5 -0
  119. package/src/panel/body.tsx +1 -0
  120. package/src/popover/index.tsx +3 -0
  121. package/src/popover/stories/index.story.tsx +2 -1
  122. package/src/progress-bar/stories/index.story.tsx +2 -1
  123. package/src/radio-group/README.md +8 -8
  124. package/src/radio-group/radio.tsx +7 -0
  125. package/src/radio-group/stories/index.story.tsx +16 -4
  126. package/src/radio-group/types.ts +6 -1
  127. package/src/snackbar/index.tsx +2 -1
  128. package/src/snackbar/stories/index.story.tsx +2 -1
  129. package/src/snackbar/stories/list.story.tsx +2 -1
  130. package/src/snackbar/style.scss +7 -16
  131. package/src/spinner/stories/index.story.tsx +2 -1
  132. package/src/tabs/tablist.tsx +13 -2
  133. package/src/text/stories/index.story.tsx +2 -1
  134. package/src/text-highlight/stories/index.story.tsx +2 -1
  135. package/src/tip/stories/index.story.tsx +2 -1
  136. package/src/toggle-group-control/toggle-group-control/component.tsx +1 -1
  137. package/src/tooltip/stories/index.story.tsx +2 -1
  138. package/src/tree-grid/stories/index.story.tsx +2 -1
  139. package/src/truncate/stories/index.story.tsx +2 -1
  140. package/src/utils/deprecated-36px-size.ts +5 -2
  141. package/src/visually-hidden/stories/index.story.tsx +1 -1
  142. package/tsconfig.tsbuildinfo +1 -1
@@ -22,7 +22,8 @@ import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
22
22
  import { ContextSystemProvider } from '../../context';
23
23
 
24
24
  const meta: Meta< typeof Menu > = {
25
- title: 'Components (Experimental)/Menu',
25
+ id: 'components-experimental-menu',
26
+ title: 'Components (Experimental)/Actions/Menu',
26
27
  component: Menu,
27
28
  subcomponents: {
28
29
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
@@ -56,6 +56,7 @@ function UnforwardedMenuItem(
56
56
 
57
57
  return (
58
58
  <Button
59
+ __next40pxDefaultSize
59
60
  ref={ ref }
60
61
  // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
61
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"
6
+ class="components-button components-menu-item__button my-class is-next-40px-default-size"
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"
38
+ class="components-button components-menu-item__button is-next-40px-default-size"
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"
65
+ class="components-button components-menu-item__button my-class is-next-40px-default-size"
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"
97
+ class="components-button components-menu-item__button is-next-40px-default-size"
98
98
  role="menuitem"
99
99
  type="button"
100
100
  >
@@ -19,7 +19,8 @@ import type { ModalProps } from '../types';
19
19
 
20
20
  const meta: Meta< typeof Modal > = {
21
21
  component: Modal,
22
- title: 'Components/Modal',
22
+ title: 'Components/Overlays/Modal',
23
+ id: 'components-modal',
23
24
  argTypes: {
24
25
  children: {
25
26
  control: { type: null },
@@ -21,7 +21,8 @@ const meta: Meta< typeof Navigator > = {
21
21
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
22
22
  BackButton: Navigator.BackButton,
23
23
  },
24
- title: 'Components/Navigator',
24
+ title: 'Components/Navigation/Navigator',
25
+ id: 'components-navigator',
25
26
  argTypes: {
26
27
  as: { control: { type: null } },
27
28
  children: { control: { type: null } },
@@ -142,6 +142,7 @@ function Notice( {
142
142
 
143
143
  return (
144
144
  <Button
145
+ __next40pxDefaultSize
145
146
  key={ index }
146
147
  href={ url }
147
148
  variant={ computedVariant }
@@ -160,6 +161,7 @@ function Notice( {
160
161
  </div>
161
162
  { isDismissible && (
162
163
  <Button
164
+ size="small"
163
165
  className="components-notice__dismiss"
164
166
  icon={ close }
165
167
  label={ __( 'Close' ) }
@@ -17,7 +17,8 @@ import NoticeList from '../list';
17
17
  import type { NoticeListProps } from '../types';
18
18
 
19
19
  const meta: Meta< typeof Notice > = {
20
- title: 'Components/Notice',
20
+ title: 'Components/Feedback/Notice',
21
+ id: 'components-notice',
21
22
  component: Notice,
22
23
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
23
24
  subcomponents: { NoticeList },
@@ -109,7 +110,11 @@ export const NoticeListSubcomponent: StoryFn< typeof NoticeList > = () => {
109
110
  return (
110
111
  <>
111
112
  <NoticeList notices={ notices } onRemove={ removeNotice } />
112
- <Button variant="primary" onClick={ resetNotices }>
113
+ <Button
114
+ __next40pxDefaultSize
115
+ variant="primary"
116
+ onClick={ resetNotices }
117
+ >
113
118
  Reset Notices
114
119
  </Button>
115
120
  </>
@@ -21,19 +21,19 @@ exports[`Notice should match snapshot 1`] = `
21
21
  class="components-notice__actions"
22
22
  >
23
23
  <a
24
- class="components-button components-notice__action is-link"
24
+ class="components-button components-notice__action is-next-40px-default-size is-link"
25
25
  href="https://example.com"
26
26
  >
27
27
  More information
28
28
  </a>
29
29
  <button
30
- class="components-button components-notice__action is-secondary"
30
+ class="components-button components-notice__action is-next-40px-default-size is-secondary"
31
31
  type="button"
32
32
  >
33
33
  Cancel
34
34
  </button>
35
35
  <button
36
- class="components-button components-notice__action is-primary"
36
+ class="components-button components-notice__action is-next-40px-default-size is-primary"
37
37
  type="button"
38
38
  >
39
39
  Submit
@@ -42,7 +42,7 @@ exports[`Notice should match snapshot 1`] = `
42
42
  </div>
43
43
  <button
44
44
  aria-label="Close"
45
- class="components-button components-notice__dismiss has-icon"
45
+ class="components-button components-notice__dismiss is-small has-icon"
46
46
  type="button"
47
47
  >
48
48
  <svg
@@ -215,6 +215,7 @@ function Option< T extends PaletteElement >( {
215
215
  <Item ref={ setPopoverAnchor } size="small">
216
216
  <HStack justify="flex-start">
217
217
  <Button
218
+ size="small"
218
219
  onClick={ () => {
219
220
  setIsEditingColor( true );
220
221
  } }
@@ -501,6 +502,7 @@ export function PaletteEdit( {
501
502
  <NavigableMenu role="menu">
502
503
  { ! isEditing && (
503
504
  <Button
505
+ __next40pxDefaultSize
504
506
  variant="tertiary"
505
507
  onClick={ () => {
506
508
  setIsEditing( true );
@@ -513,6 +515,7 @@ export function PaletteEdit( {
513
515
  ) }
514
516
  { ! canOnlyChangeValues && (
515
517
  <Button
518
+ __next40pxDefaultSize
516
519
  variant="tertiary"
517
520
  onClick={ () => {
518
521
  setEditingElement(
@@ -535,6 +538,8 @@ export function PaletteEdit( {
535
538
  ) }
536
539
  { canReset && (
537
540
  <Button
541
+ __next40pxDefaultSize
542
+ className="components-palette-edit__menu-button"
538
543
  variant="tertiary"
539
544
  onClick={ () => {
540
545
  setEditingElement(
@@ -116,6 +116,7 @@ const PanelBodyTitle = forwardRef(
116
116
  return (
117
117
  <h2 className="components-panel__body-title">
118
118
  <Button
119
+ __next40pxDefaultSize
119
120
  className="components-panel__body-toggle"
120
121
  aria-expanded={ isOpened }
121
122
  ref={ ref }
@@ -39,6 +39,7 @@ import {
39
39
  import { close } from '@wordpress/icons';
40
40
  import deprecated from '@wordpress/deprecated';
41
41
  import { Path, SVG } from '@wordpress/primitives';
42
+ import { __ } from '@wordpress/i18n';
42
43
 
43
44
  /**
44
45
  * Internal dependencies
@@ -419,8 +420,10 @@ const UnforwardedPopover = (
419
420
  </span>
420
421
  <Button
421
422
  className="components-popover__close"
423
+ size="small"
422
424
  icon={ close }
423
425
  onClick={ onClose }
426
+ label={ __( 'Close' ) }
424
427
  />
425
428
  </div>
426
429
  ) }
@@ -33,7 +33,8 @@ const AVAILABLE_PLACEMENTS: PopoverProps[ 'placement' ][] = [
33
33
  ];
34
34
 
35
35
  const meta: Meta< typeof Popover > = {
36
- title: 'Components/Popover',
36
+ title: 'Components/Overlays/Popover',
37
+ id: 'components-popover',
37
38
  component: Popover,
38
39
  argTypes: {
39
40
  anchor: { control: { type: null } },
@@ -10,7 +10,8 @@ import { ProgressBar } from '..';
10
10
 
11
11
  const meta: Meta< typeof ProgressBar > = {
12
12
  component: ProgressBar,
13
- title: 'Components/ProgressBar',
13
+ title: 'Components/Feedback/ProgressBar',
14
+ id: 'components-progressbar',
14
15
  argTypes: {
15
16
  value: { control: { type: 'number', min: 0, max: 100, step: 1 } },
16
17
  },
@@ -57,10 +57,10 @@ const MyControlledRadioRadioGroup = () => {
57
57
  const [ checked, setChecked ] = useState( '25' );
58
58
  return (
59
59
  <RadioGroup label="Width" onChange={ setChecked } checked={ checked }>
60
- <Radio value="25">25%</Radio>
61
- <Radio value="50">50%</Radio>
62
- <Radio value="75">75%</Radio>
63
- <Radio value="100">100%</Radio>
60
+ <Radio __next40pxDefaultSize value="25">25%</Radio>
61
+ <Radio __next40pxDefaultSize value="50">50%</Radio>
62
+ <Radio __next40pxDefaultSize value="75">75%</Radio>
63
+ <Radio __next40pxDefaultSize value="100">100%</Radio>
64
64
  </RadioGroup>
65
65
  );
66
66
  };
@@ -80,10 +80,10 @@ import {
80
80
  const MyUncontrolledRadioRadioGroup = () => {
81
81
  return (
82
82
  <RadioGroup label="Width" defaultChecked="25">
83
- <Radio value="25">25%</Radio>
84
- <Radio value="50">50%</Radio>
85
- <Radio value="75">75%</Radio>
86
- <Radio value="100">100%</Radio>
83
+ <Radio __next40pxDefaultSize value="25">25%</Radio>
84
+ <Radio __next40pxDefaultSize value="50">50%</Radio>
85
+ <Radio __next40pxDefaultSize value="75">75%</Radio>
86
+ <Radio __next40pxDefaultSize value="100">100%</Radio>
87
87
  </RadioGroup>
88
88
  );
89
89
  };
@@ -16,6 +16,7 @@ import Button from '../button';
16
16
  import { RadioGroupContext } from './context';
17
17
  import type { WordPressComponentProps } from '../context';
18
18
  import type { RadioProps } from './types';
19
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
19
20
 
20
21
  function UnforwardedRadio(
21
22
  {
@@ -30,6 +31,12 @@ function UnforwardedRadio(
30
31
  const selectedValue = useStoreState( store, 'value' );
31
32
  const isChecked = selectedValue !== undefined && selectedValue === value;
32
33
 
34
+ maybeWarnDeprecated36pxSize( {
35
+ componentName: 'Radio',
36
+ size: undefined,
37
+ __next40pxDefaultSize: props.__next40pxDefaultSize,
38
+ } );
39
+
33
40
  return (
34
41
  <Ariakit.Radio
35
42
  disabled={ disabled }
@@ -28,7 +28,13 @@ const meta: Meta< typeof RadioGroup > = {
28
28
  parameters: {
29
29
  actions: { argTypesRegex: '^on.*' },
30
30
  controls: { expanded: true },
31
- docs: { canvas: { sourceState: 'shown' } },
31
+ docs: {
32
+ canvas: { sourceState: 'shown' },
33
+ description: {
34
+ component:
35
+ 'This component is deprecated. Use `RadioControl` or `ToggleGroupControl` instead.',
36
+ },
37
+ },
32
38
  },
33
39
  };
34
40
  export default meta;
@@ -44,9 +50,15 @@ Default.args = {
44
50
  defaultChecked: 'option2',
45
51
  children: (
46
52
  <>
47
- <Radio value="option1">Option 1</Radio>
48
- <Radio value="option2">Option 2</Radio>
49
- <Radio value="option3">Option 3</Radio>
53
+ <Radio __next40pxDefaultSize value="option1">
54
+ Option 1
55
+ </Radio>
56
+ <Radio __next40pxDefaultSize value="option2">
57
+ Option 2
58
+ </Radio>
59
+ <Radio __next40pxDefaultSize value="option3">
60
+ Option 3
61
+ </Radio>
50
62
  </>
51
63
  ),
52
64
  };
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { ButtonProps } from '../button/types';
5
+
1
6
  export type RadioGroupProps = {
2
7
  /**
3
8
  * Accessible label for the radio group
@@ -27,7 +32,7 @@ export type RadioGroupProps = {
27
32
  children: React.ReactNode;
28
33
  };
29
34
 
30
- export type RadioProps = {
35
+ export type RadioProps = Pick< ButtonProps, '__next40pxDefaultSize' > & {
31
36
  /**
32
37
  * The actual value of the radio element.
33
38
  */
@@ -150,9 +150,10 @@ function UnforwardedSnackbar(
150
150
  { actions.map( ( { label, onClick, url }, index ) => {
151
151
  return (
152
152
  <Button
153
+ __next40pxDefaultSize
153
154
  key={ index }
154
155
  href={ url }
155
- variant="tertiary"
156
+ variant="link"
156
157
  onClick={ (
157
158
  event: MouseEvent< HTMLButtonElement >
158
159
  ) => onActionClick( event, onClick ) }
@@ -15,7 +15,8 @@ import Icon from '../../icon';
15
15
  import Snackbar from '..';
16
16
 
17
17
  const meta: Meta< typeof Snackbar > = {
18
- title: 'Components/Snackbar',
18
+ title: 'Components/Feedback/Snackbar',
19
+ id: 'components-snackbar',
19
20
  component: Snackbar,
20
21
  argTypes: {
21
22
  as: { control: { type: null } },
@@ -14,7 +14,8 @@ import { useState } from '@wordpress/element';
14
14
  import SnackbarList from '../list';
15
15
 
16
16
  const meta: Meta< typeof SnackbarList > = {
17
- title: 'Components/SnackbarList',
17
+ title: 'Components/Feedback/SnackbarList',
18
+ id: 'components-snackbarlist',
18
19
  component: SnackbarList,
19
20
  argTypes: {
20
21
  as: { control: { type: null } },
@@ -48,25 +48,16 @@
48
48
  .components-snackbar__action.components-button {
49
49
  margin-left: $grid-unit-40;
50
50
  color: $white;
51
- height: auto;
52
51
  flex-shrink: 0;
53
- line-height: $default-line-height;
54
- padding: 0;
55
-
56
- &:not(:disabled):not([aria-disabled="true"]):not(.is-secondary) {
57
- text-decoration: underline;
58
- background-color: transparent;
59
52
 
60
- &:focus {
61
- color: $white;
62
- box-shadow: none;
63
- outline: 1px dotted $white;
64
- }
53
+ &:focus {
54
+ box-shadow: none;
55
+ outline: 1px dotted $white;
56
+ }
65
57
 
66
- &:hover {
67
- text-decoration: none;
68
- color: $white;
69
- }
58
+ &:hover {
59
+ text-decoration: none;
60
+ color: currentColor;
70
61
  }
71
62
  }
72
63
 
@@ -10,7 +10,8 @@ import Spinner from '../';
10
10
  import { space } from '../../utils/space';
11
11
 
12
12
  const meta: Meta< typeof Spinner > = {
13
- title: 'Components/Spinner',
13
+ title: 'Components/Feedback/Spinner',
14
+ id: 'components-spinner',
14
15
  component: Spinner,
15
16
  parameters: {
16
17
  controls: {
@@ -48,10 +48,21 @@ function useScrollRectIntoView(
48
48
  const childRightEdge = childLeft + childWidth;
49
49
  const rightOverflow = childRightEdge + margin - parentRightEdge;
50
50
  const leftOverflow = parentScroll - ( childLeft - margin );
51
+
52
+ let scrollLeft = null;
51
53
  if ( leftOverflow > 0 ) {
52
- parent.scrollLeft = parentScroll - leftOverflow;
54
+ scrollLeft = parentScroll - leftOverflow;
53
55
  } else if ( rightOverflow > 0 ) {
54
- parent.scrollLeft = parentScroll + rightOverflow;
56
+ scrollLeft = parentScroll + rightOverflow;
57
+ }
58
+
59
+ if ( scrollLeft !== null ) {
60
+ /**
61
+ * The optional chaining is used here to avoid unit test failures.
62
+ * It can be removed when JSDOM supports `Element` scroll methods.
63
+ * See: https://github.com/WordPress/gutenberg/pull/66498#issuecomment-2441146096
64
+ */
65
+ parent.scroll?.( { left: scrollLeft } );
55
66
  }
56
67
  }, [ margin, parent, rect ] );
57
68
  }
@@ -10,7 +10,8 @@ import { Text } from '../component';
10
10
 
11
11
  const meta: Meta< typeof Text > = {
12
12
  component: Text,
13
- title: 'Components (Experimental)/Text',
13
+ title: 'Components (Experimental)/Typography/Text',
14
+ id: 'components-experimental-text',
14
15
  argTypes: {
15
16
  as: { control: { type: 'text' } },
16
17
  color: { control: { type: 'color' } },
@@ -10,7 +10,8 @@ import TextHighlight from '..';
10
10
 
11
11
  const meta: Meta< typeof TextHighlight > = {
12
12
  component: TextHighlight,
13
- title: 'Components/TextHighlight',
13
+ title: 'Components/Typography/TextHighlight',
14
+ id: 'components-texthighlight',
14
15
  parameters: {
15
16
  controls: {
16
17
  expanded: true,
@@ -10,7 +10,8 @@ import Tip from '..';
10
10
 
11
11
  const meta: Meta< typeof Tip > = {
12
12
  component: Tip,
13
- title: 'Components/Tip',
13
+ title: 'Components/Feedback/Tip',
14
+ id: 'components-tip',
14
15
  argTypes: {
15
16
  children: { control: { type: 'text' } },
16
17
  },
@@ -52,7 +52,7 @@ function UnconnectedToggleGroupControl(
52
52
  const [ controlElement, setControlElement ] = useState< HTMLElement >();
53
53
  const refs = useMergeRefs( [ setControlElement, forwardedRef ] );
54
54
  const selectedRect = useTrackElementOffsetRect(
55
- value ? selectedElement : undefined
55
+ value || value === 0 ? selectedElement : undefined
56
56
  );
57
57
  useAnimatedOffsetRect( controlElement, selectedRect, {
58
58
  prefix: 'selected',
@@ -15,7 +15,8 @@ import Tooltip from '..';
15
15
  import Button from '../../button';
16
16
 
17
17
  const meta: Meta< typeof Tooltip > = {
18
- title: 'Components/Tooltip',
18
+ title: 'Components/Overlays/Tooltip',
19
+ id: 'components-tooltip',
19
20
  component: Tooltip,
20
21
  argTypes: {
21
22
  children: { control: { type: null } },
@@ -16,7 +16,8 @@ import { Button } from '../../button';
16
16
  import InputControl from '../../input-control';
17
17
 
18
18
  const meta: Meta< typeof TreeGrid > = {
19
- title: 'Components (Experimental)/TreeGrid',
19
+ title: 'Components (Experimental)/Navigation/TreeGrid',
20
+ id: 'components-experimental-treegrid',
20
21
  component: TreeGrid,
21
22
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
22
23
  subcomponents: { TreeGridRow, TreeGridCell },
@@ -10,7 +10,8 @@ import { Truncate } from '..';
10
10
 
11
11
  const meta: Meta< typeof Truncate > = {
12
12
  component: Truncate,
13
- title: 'Components (Experimental)/Truncate',
13
+ title: 'Components (Experimental)/Typography/Truncate',
14
+ id: 'components-experimental-truncate',
14
15
  argTypes: {
15
16
  children: { control: { type: 'text' } },
16
17
  as: { control: { type: 'text' } },
@@ -10,9 +10,12 @@ export function maybeWarnDeprecated36pxSize( {
10
10
  }: {
11
11
  componentName: string;
12
12
  __next40pxDefaultSize: boolean | undefined;
13
- size: string;
13
+ size: string | undefined;
14
14
  } ) {
15
- if ( __next40pxDefaultSize || size !== 'default' ) {
15
+ if (
16
+ __next40pxDefaultSize ||
17
+ ( size !== undefined && size !== 'default' )
18
+ ) {
16
19
  return;
17
20
  }
18
21
 
@@ -10,7 +10,7 @@ import { VisuallyHidden } from '..';
10
10
 
11
11
  const meta: Meta< typeof VisuallyHidden > = {
12
12
  component: VisuallyHidden,
13
- title: 'Components/Utilities/VisuallyHidden',
13
+ title: 'Components/Typography/VisuallyHidden',
14
14
  id: 'components-visuallyhidden',
15
15
  argTypes: {
16
16
  children: { control: { type: null } },