@wordpress/components 32.3.1-next.v.202602271551.0 → 32.4.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 (220) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/build/alignment-matrix-control/cell.cjs +2 -2
  3. package/build/alignment-matrix-control/cell.cjs.map +1 -1
  4. package/build/alignment-matrix-control/index.cjs +2 -2
  5. package/build/alignment-matrix-control/index.cjs.map +1 -1
  6. package/build/angle-picker-control/angle-circle.cjs +2 -2
  7. package/build/angle-picker-control/angle-circle.cjs.map +1 -1
  8. package/build/calendar/utils/constants.cjs +1 -0
  9. package/build/calendar/utils/constants.cjs.map +2 -2
  10. package/build/date-time/date/styles.cjs +9 -9
  11. package/build/date-time/date/styles.cjs.map +2 -2
  12. package/build/date-time/time/index.cjs +1 -1
  13. package/build/date-time/time/index.cjs.map +2 -2
  14. package/build/date-time/utils.cjs +9 -0
  15. package/build/date-time/utils.cjs.map +2 -2
  16. package/build/menu/radio-item.cjs +1 -1
  17. package/build/menu/radio-item.cjs.map +2 -2
  18. package/build/private-apis.cjs +0 -4
  19. package/build/private-apis.cjs.map +3 -3
  20. package/build/tooltip/index.cjs +1 -1
  21. package/build/tooltip/index.cjs.map +1 -1
  22. package/build/visually-hidden/styles.cjs +2 -1
  23. package/build/visually-hidden/styles.cjs.map +2 -2
  24. package/build-module/alignment-matrix-control/cell.mjs +2 -2
  25. package/build-module/alignment-matrix-control/cell.mjs.map +1 -1
  26. package/build-module/alignment-matrix-control/index.mjs +2 -2
  27. package/build-module/alignment-matrix-control/index.mjs.map +1 -1
  28. package/build-module/angle-picker-control/angle-circle.mjs +2 -2
  29. package/build-module/angle-picker-control/angle-circle.mjs.map +1 -1
  30. package/build-module/calendar/utils/constants.mjs +1 -0
  31. package/build-module/calendar/utils/constants.mjs.map +2 -2
  32. package/build-module/date-time/date/styles.mjs +9 -9
  33. package/build-module/date-time/date/styles.mjs.map +2 -2
  34. package/build-module/date-time/time/index.mjs +2 -2
  35. package/build-module/date-time/time/index.mjs.map +2 -2
  36. package/build-module/date-time/utils.mjs +8 -0
  37. package/build-module/date-time/utils.mjs.map +2 -2
  38. package/build-module/menu/radio-item.mjs +1 -1
  39. package/build-module/menu/radio-item.mjs.map +2 -2
  40. package/build-module/private-apis.mjs +0 -4
  41. package/build-module/private-apis.mjs.map +2 -2
  42. package/build-module/tooltip/index.mjs +1 -1
  43. package/build-module/tooltip/index.mjs.map +1 -1
  44. package/build-module/visually-hidden/styles.mjs +2 -1
  45. package/build-module/visually-hidden/styles.mjs.map +2 -2
  46. package/build-style/style-rtl.css +11 -184
  47. package/build-style/style.css +11 -184
  48. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  49. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  50. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  51. package/build-types/animate/stories/index.story.d.ts +7 -7
  52. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  53. package/build-types/base-control/stories/index.story.d.ts +1 -1
  54. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  55. package/build-types/border-control/stories/index.story.d.ts +5 -5
  56. package/build-types/box-control/stories/index.story.d.ts +7 -7
  57. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  58. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  59. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  60. package/build-types/button/stories/index.story.d.ts +7 -7
  61. package/build-types/button/stories/index.story.d.ts.map +1 -1
  62. package/build-types/calendar/stories/date-calendar.story.d.ts +5 -0
  63. package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
  64. package/build-types/calendar/stories/date-range-calendar.story.d.ts +5 -0
  65. package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
  66. package/build-types/calendar/types.d.ts +12 -0
  67. package/build-types/calendar/types.d.ts.map +1 -1
  68. package/build-types/calendar/utils/constants.d.ts +1 -0
  69. package/build-types/calendar/utils/constants.d.ts.map +1 -1
  70. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  71. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  72. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  73. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  74. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  75. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  76. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  77. package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
  78. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  79. package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
  80. package/build-types/date-time/date/styles.d.ts.map +1 -1
  81. package/build-types/date-time/stories/time.story.d.ts +1 -1
  82. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  83. package/build-types/date-time/time/index.d.ts.map +1 -1
  84. package/build-types/date-time/utils.d.ts +9 -0
  85. package/build-types/date-time/utils.d.ts.map +1 -1
  86. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  87. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  88. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  89. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  90. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  91. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  92. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  93. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  94. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  95. package/build-types/guide/stories/index.story.d.ts +1 -1
  96. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  97. package/build-types/icon/stories/index.story.d.ts +4 -4
  98. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  99. package/build-types/input-control/stories/index.story.d.ts +7 -7
  100. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  101. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  102. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  103. package/build-types/menu/radio-item.d.ts.map +1 -1
  104. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  105. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  106. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  107. package/build-types/navigation/stories/index.story.d.ts +6 -6
  108. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  109. package/build-types/notice/stories/index.story.d.ts +5 -5
  110. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  111. package/build-types/number-control/stories/index.story.d.ts +1 -1
  112. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  113. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  114. package/build-types/private-apis.d.ts.map +1 -1
  115. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  116. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  117. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  118. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  119. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  120. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  121. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  122. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  123. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  124. package/build-types/search-control/stories/index.story.d.ts +1 -1
  125. package/build-types/select-control/stories/index.story.d.ts +5 -5
  126. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  127. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  128. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  129. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  130. package/build-types/tabs/stories/index.story.d.ts +7 -7
  131. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  132. package/build-types/text/stories/index.story.d.ts +3 -3
  133. package/build-types/theme/stories/index.story.d.ts +1 -1
  134. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  135. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  136. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  137. package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
  138. package/build-types/tools-panel/types.d.ts +1 -1
  139. package/build-types/tools-panel/types.d.ts.map +1 -1
  140. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  141. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  142. package/build-types/tooltip/types.d.ts +2 -2
  143. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  144. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  145. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  146. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  147. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  148. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  149. package/package.json +25 -25
  150. package/src/button-group/stories/index.story.tsx +1 -1
  151. package/src/calendar/stories/date-calendar.story.tsx +11 -0
  152. package/src/calendar/stories/date-range-calendar.story.tsx +11 -0
  153. package/src/calendar/style.scss +5 -0
  154. package/src/calendar/types.ts +12 -0
  155. package/src/calendar/utils/constants.ts +1 -0
  156. package/src/composite/legacy/stories/index.story.tsx +1 -1
  157. package/src/date-time/date/styles.ts +1 -0
  158. package/src/date-time/test/utils.test.ts +8 -11
  159. package/src/date-time/time/index.tsx +2 -12
  160. package/src/date-time/time/test/index.tsx +69 -0
  161. package/src/date-time/utils.ts +18 -0
  162. package/src/guide/style.scss +3 -0
  163. package/src/menu/radio-item.tsx +1 -1
  164. package/src/modal/style.scss +4 -7
  165. package/src/navigation/stories/index.story.tsx +1 -1
  166. package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
  167. package/src/private-apis.ts +0 -4
  168. package/src/radio-group/stories/index.story.tsx +1 -1
  169. package/src/snackbar/style.scss +1 -0
  170. package/src/style.scss +0 -2
  171. package/src/tools-panel/types.ts +4 -1
  172. package/src/tooltip/README.md +2 -2
  173. package/src/tooltip/index.tsx +2 -2
  174. package/src/tooltip/types.ts +2 -2
  175. package/src/visually-hidden/styles.ts +1 -0
  176. package/src/visually-hidden/test/__snapshots__/index.tsx.snap +1 -1
  177. package/build/avatar/component.cjs +0 -99
  178. package/build/avatar/component.cjs.map +0 -7
  179. package/build/avatar/index.cjs +0 -37
  180. package/build/avatar/index.cjs.map +0 -7
  181. package/build/avatar/types.cjs +0 -19
  182. package/build/avatar/types.cjs.map +0 -7
  183. package/build/avatar-group/component.cjs +0 -60
  184. package/build/avatar-group/component.cjs.map +0 -7
  185. package/build/avatar-group/index.cjs +0 -37
  186. package/build/avatar-group/index.cjs.map +0 -7
  187. package/build/avatar-group/types.cjs +0 -19
  188. package/build/avatar-group/types.cjs.map +0 -7
  189. package/build-module/avatar/component.mjs +0 -68
  190. package/build-module/avatar/component.mjs.map +0 -7
  191. package/build-module/avatar/index.mjs +0 -6
  192. package/build-module/avatar/index.mjs.map +0 -7
  193. package/build-module/avatar/types.mjs +0 -1
  194. package/build-module/avatar/types.mjs.map +0 -7
  195. package/build-module/avatar-group/component.mjs +0 -29
  196. package/build-module/avatar-group/component.mjs.map +0 -7
  197. package/build-module/avatar-group/index.mjs +0 -6
  198. package/build-module/avatar-group/index.mjs.map +0 -7
  199. package/build-module/avatar-group/types.mjs +0 -1
  200. package/build-module/avatar-group/types.mjs.map +0 -7
  201. package/build-types/avatar/component.d.ts +0 -5
  202. package/build-types/avatar/component.d.ts.map +0 -1
  203. package/build-types/avatar/index.d.ts +0 -3
  204. package/build-types/avatar/index.d.ts.map +0 -1
  205. package/build-types/avatar/types.d.ts +0 -59
  206. package/build-types/avatar/types.d.ts.map +0 -1
  207. package/build-types/avatar-group/component.d.ts +0 -8
  208. package/build-types/avatar-group/component.d.ts.map +0 -1
  209. package/build-types/avatar-group/index.d.ts +0 -3
  210. package/build-types/avatar-group/index.d.ts.map +0 -1
  211. package/build-types/avatar-group/types.d.ts +0 -14
  212. package/build-types/avatar-group/types.d.ts.map +0 -1
  213. package/src/avatar/component.tsx +0 -82
  214. package/src/avatar/index.ts +0 -2
  215. package/src/avatar/styles.scss +0 -152
  216. package/src/avatar/types.ts +0 -59
  217. package/src/avatar-group/component.tsx +0 -46
  218. package/src/avatar-group/index.ts +0 -2
  219. package/src/avatar-group/styles.scss +0 -32
  220. package/src/avatar-group/types.ts +0 -13
@@ -1,59 +0,0 @@
1
- import type { IconType } from '../icon';
2
-
3
- export type AvatarProps = {
4
- /**
5
- * URL of the avatar image.
6
- *
7
- * When not provided, initials derived from `name` are shown.
8
- */
9
- src?: string;
10
- /**
11
- * Name of the user. Used as an accessible label and to generate
12
- * initials when no image is provided.
13
- */
14
- name?: string;
15
- /**
16
- * Visible text shown in the hover badge. When not provided, `name`
17
- * is used instead. Use this to provide contextual labels like "You"
18
- * without affecting the accessible name or initials.
19
- */
20
- label?: string;
21
- /**
22
- * Whether to show the hover-expand badge that reveals the user's
23
- * name (or `label`) on hover. Requires `name` to be set.
24
- *
25
- * @default false
26
- */
27
- badge?: boolean;
28
- /**
29
- * Size of the avatar.
30
- *
31
- * - `'default'`: 32px
32
- * - `'small'`: 24px
33
- *
34
- * @default 'default'
35
- */
36
- size?: 'default' | 'small';
37
- /**
38
- * CSS color value for an accent border ring around the avatar.
39
- *
40
- * When not provided, no border is rendered and the hover badge
41
- * and avatar status uses the admin theme color as its background.
42
- */
43
- borderColor?: string;
44
- /**
45
- * A status string applied to the avatar. When set, the image is
46
- * dimmed to indicate a non-default state. A corresponding
47
- * `is-{status}` class is added for custom styling.
48
- */
49
- status?: string;
50
- /**
51
- * An icon or custom component rendered as a centered overlay on the
52
- * avatar image. Only visible when `status` is set.
53
- *
54
- * Accepts any value supported by the `Icon` component: an icon from
55
- * `@wordpress/icons`, a Dashicon name string, a component, or a
56
- * JSX element.
57
- */
58
- statusIndicator?: IconType | null;
59
- };
@@ -1,46 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { Children } from '@wordpress/element';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import type { AvatarGroupProps } from './types';
15
- import type { WordPressComponentProps } from '../context';
16
-
17
- function AvatarGroup( {
18
- className,
19
- max = 3,
20
- children,
21
- ...props
22
- }: WordPressComponentProps< AvatarGroupProps, 'div', false > ) {
23
- const childArray = Children.toArray( children );
24
- const visible = childArray.slice( 0, max );
25
- const overflowCount = childArray.length - max;
26
-
27
- return (
28
- <div
29
- role="group"
30
- className={ clsx( 'components-avatar-group', className ) }
31
- { ...props }
32
- >
33
- { visible }
34
- { overflowCount > 0 && (
35
- <span
36
- className="components-avatar-group__overflow"
37
- aria-label={ `${ overflowCount } more` }
38
- >
39
- { `+${ overflowCount }` }
40
- </span>
41
- ) }
42
- </div>
43
- );
44
- }
45
-
46
- export default AvatarGroup;
@@ -1,2 +0,0 @@
1
- export { default } from './component';
2
- export type { AvatarGroupProps } from './types';
@@ -1,32 +0,0 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
- @use "@wordpress/base-styles/variables" as *;
3
-
4
- .components-avatar-group {
5
- display: flex;
6
- align-items: center;
7
-
8
- // Overlap subsequent avatars.
9
- > .components-avatar + .components-avatar {
10
- margin-inline-start: -$grid-unit-10;
11
- }
12
-
13
- // Stack earlier avatars on top of later ones so the overlap
14
- // is visually correct, and elevate on hover for badge expansion.
15
- > .components-avatar {
16
- position: relative;
17
-
18
- @for $i from 1 through 10 {
19
- &:nth-child(#{$i}) {
20
- z-index: #{11 - $i};
21
- }
22
- }
23
- }
24
- }
25
-
26
- .components-avatar-group__overflow {
27
- margin-inline-start: $grid-unit-05;
28
- font-size: $font-size-small;
29
- line-height: $font-line-height-small;
30
- color: $gray-900;
31
- white-space: nowrap;
32
- }
@@ -1,13 +0,0 @@
1
- export type AvatarGroupProps = {
2
- /**
3
- * Maximum number of avatars to display before showing an
4
- * overflow indicator.
5
- *
6
- * @default 3
7
- */
8
- max?: number;
9
- /**
10
- * Avatar elements to display in the group.
11
- */
12
- children: React.ReactNode;
13
- };