@wordpress/components 32.3.1-next.v.202602241322.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 (236) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/build/alignment-matrix-control/cell.cjs +2 -2
  3. package/build/alignment-matrix-control/cell.cjs.map +2 -2
  4. package/build/alignment-matrix-control/index.cjs +2 -2
  5. package/build/alignment-matrix-control/index.cjs.map +2 -2
  6. package/build/angle-picker-control/angle-circle.cjs +2 -2
  7. package/build/angle-picker-control/angle-circle.cjs.map +2 -2
  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/select-control/styles/select-control-styles.cjs +8 -8
  21. package/build/select-control/styles/select-control-styles.cjs.map +2 -2
  22. package/build/tooltip/index.cjs +1 -1
  23. package/build/tooltip/index.cjs.map +1 -1
  24. package/build/visually-hidden/styles.cjs +2 -1
  25. package/build/visually-hidden/styles.cjs.map +2 -2
  26. package/build-module/alignment-matrix-control/cell.mjs +2 -2
  27. package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
  28. package/build-module/alignment-matrix-control/index.mjs +2 -2
  29. package/build-module/alignment-matrix-control/index.mjs.map +2 -2
  30. package/build-module/angle-picker-control/angle-circle.mjs +2 -2
  31. package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
  32. package/build-module/calendar/utils/constants.mjs +1 -0
  33. package/build-module/calendar/utils/constants.mjs.map +2 -2
  34. package/build-module/date-time/date/styles.mjs +9 -9
  35. package/build-module/date-time/date/styles.mjs.map +2 -2
  36. package/build-module/date-time/time/index.mjs +2 -2
  37. package/build-module/date-time/time/index.mjs.map +2 -2
  38. package/build-module/date-time/utils.mjs +8 -0
  39. package/build-module/date-time/utils.mjs.map +2 -2
  40. package/build-module/menu/radio-item.mjs +1 -1
  41. package/build-module/menu/radio-item.mjs.map +2 -2
  42. package/build-module/private-apis.mjs +0 -4
  43. package/build-module/private-apis.mjs.map +2 -2
  44. package/build-module/select-control/styles/select-control-styles.mjs +8 -8
  45. package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
  46. package/build-module/tooltip/index.mjs +1 -1
  47. package/build-module/tooltip/index.mjs.map +1 -1
  48. package/build-module/visually-hidden/styles.mjs +2 -1
  49. package/build-module/visually-hidden/styles.mjs.map +2 -2
  50. package/build-style/style-rtl.css +12 -184
  51. package/build-style/style.css +12 -184
  52. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  53. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  54. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  55. package/build-types/animate/stories/index.story.d.ts +7 -7
  56. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  57. package/build-types/base-control/stories/index.story.d.ts +1 -1
  58. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  59. package/build-types/border-control/stories/index.story.d.ts +5 -5
  60. package/build-types/box-control/stories/index.story.d.ts +7 -7
  61. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  62. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  63. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  64. package/build-types/button/stories/index.story.d.ts +7 -7
  65. package/build-types/button/stories/index.story.d.ts.map +1 -1
  66. package/build-types/calendar/stories/date-calendar.story.d.ts +5 -0
  67. package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
  68. package/build-types/calendar/stories/date-range-calendar.story.d.ts +5 -0
  69. package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
  70. package/build-types/calendar/types.d.ts +12 -0
  71. package/build-types/calendar/types.d.ts.map +1 -1
  72. package/build-types/calendar/utils/constants.d.ts +1 -0
  73. package/build-types/calendar/utils/constants.d.ts.map +1 -1
  74. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  75. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  76. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  77. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  78. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  79. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  80. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  81. package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
  82. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  83. package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
  84. package/build-types/date-time/date/styles.d.ts.map +1 -1
  85. package/build-types/date-time/stories/time.story.d.ts +1 -1
  86. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  87. package/build-types/date-time/time/index.d.ts.map +1 -1
  88. package/build-types/date-time/utils.d.ts +9 -0
  89. package/build-types/date-time/utils.d.ts.map +1 -1
  90. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  91. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  92. package/build-types/dropdown/types.d.ts +9 -13
  93. package/build-types/dropdown/types.d.ts.map +1 -1
  94. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  95. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  96. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  97. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  98. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  99. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  100. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  101. package/build-types/guide/stories/index.story.d.ts +1 -1
  102. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  103. package/build-types/icon/stories/index.story.d.ts +4 -4
  104. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  105. package/build-types/input-control/stories/index.story.d.ts +7 -7
  106. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  107. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  108. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  109. package/build-types/menu/radio-item.d.ts.map +1 -1
  110. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  111. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  112. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  113. package/build-types/modal/types.d.ts +9 -3
  114. package/build-types/modal/types.d.ts.map +1 -1
  115. package/build-types/navigation/stories/index.story.d.ts +6 -6
  116. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  117. package/build-types/notice/stories/index.story.d.ts +5 -5
  118. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  119. package/build-types/number-control/stories/index.story.d.ts +1 -1
  120. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  121. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  122. package/build-types/popover/types.d.ts +10 -10
  123. package/build-types/popover/types.d.ts.map +1 -1
  124. package/build-types/private-apis.d.ts.map +1 -1
  125. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  126. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  127. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  128. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  129. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  130. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  131. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  132. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  133. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  134. package/build-types/search-control/stories/index.story.d.ts +1 -1
  135. package/build-types/select-control/stories/index.story.d.ts +5 -5
  136. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  137. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  138. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  139. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  140. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  141. package/build-types/tabs/stories/index.story.d.ts +7 -7
  142. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  143. package/build-types/text/stories/index.story.d.ts +3 -3
  144. package/build-types/theme/stories/index.story.d.ts +1 -1
  145. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  146. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  147. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  148. package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
  149. package/build-types/tools-panel/types.d.ts +1 -1
  150. package/build-types/tools-panel/types.d.ts.map +1 -1
  151. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  152. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  153. package/build-types/tooltip/types.d.ts +2 -2
  154. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  155. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  156. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  157. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  158. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  159. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  160. package/package.json +25 -25
  161. package/src/button-group/stories/index.story.tsx +1 -1
  162. package/src/calendar/stories/date-calendar.story.tsx +11 -0
  163. package/src/calendar/stories/date-range-calendar.story.tsx +11 -0
  164. package/src/calendar/style.scss +5 -0
  165. package/src/calendar/types.ts +12 -0
  166. package/src/calendar/utils/constants.ts +1 -0
  167. package/src/composite/legacy/stories/index.story.tsx +1 -1
  168. package/src/date-time/date/styles.ts +1 -0
  169. package/src/date-time/test/utils.test.ts +8 -11
  170. package/src/date-time/time/index.tsx +2 -12
  171. package/src/date-time/time/test/index.tsx +69 -0
  172. package/src/date-time/utils.ts +18 -0
  173. package/src/dropdown/types.ts +9 -14
  174. package/src/form-token-field/style.scss +1 -0
  175. package/src/guide/style.scss +3 -0
  176. package/src/menu/radio-item.tsx +1 -1
  177. package/src/modal/style.scss +4 -7
  178. package/src/modal/types.ts +9 -5
  179. package/src/navigation/stories/index.story.tsx +1 -1
  180. package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
  181. package/src/popover/types.ts +10 -10
  182. package/src/private-apis.ts +0 -4
  183. package/src/radio-group/stories/index.story.tsx +1 -1
  184. package/src/select-control/styles/select-control-styles.ts +1 -0
  185. package/src/snackbar/style.scss +1 -0
  186. package/src/style.scss +0 -2
  187. package/src/tools-panel/types.ts +4 -1
  188. package/src/tooltip/README.md +2 -2
  189. package/src/tooltip/index.tsx +2 -2
  190. package/src/tooltip/types.ts +2 -2
  191. package/src/visually-hidden/styles.ts +1 -0
  192. package/src/visually-hidden/test/__snapshots__/index.tsx.snap +1 -1
  193. package/build/avatar/component.cjs +0 -99
  194. package/build/avatar/component.cjs.map +0 -7
  195. package/build/avatar/index.cjs +0 -37
  196. package/build/avatar/index.cjs.map +0 -7
  197. package/build/avatar/types.cjs +0 -19
  198. package/build/avatar/types.cjs.map +0 -7
  199. package/build/avatar-group/component.cjs +0 -60
  200. package/build/avatar-group/component.cjs.map +0 -7
  201. package/build/avatar-group/index.cjs +0 -37
  202. package/build/avatar-group/index.cjs.map +0 -7
  203. package/build/avatar-group/types.cjs +0 -19
  204. package/build/avatar-group/types.cjs.map +0 -7
  205. package/build-module/avatar/component.mjs +0 -68
  206. package/build-module/avatar/component.mjs.map +0 -7
  207. package/build-module/avatar/index.mjs +0 -6
  208. package/build-module/avatar/index.mjs.map +0 -7
  209. package/build-module/avatar/types.mjs +0 -1
  210. package/build-module/avatar/types.mjs.map +0 -7
  211. package/build-module/avatar-group/component.mjs +0 -29
  212. package/build-module/avatar-group/component.mjs.map +0 -7
  213. package/build-module/avatar-group/index.mjs +0 -6
  214. package/build-module/avatar-group/index.mjs.map +0 -7
  215. package/build-module/avatar-group/types.mjs +0 -1
  216. package/build-module/avatar-group/types.mjs.map +0 -7
  217. package/build-types/avatar/component.d.ts +0 -5
  218. package/build-types/avatar/component.d.ts.map +0 -1
  219. package/build-types/avatar/index.d.ts +0 -3
  220. package/build-types/avatar/index.d.ts.map +0 -1
  221. package/build-types/avatar/types.d.ts +0 -59
  222. package/build-types/avatar/types.d.ts.map +0 -1
  223. package/build-types/avatar-group/component.d.ts +0 -8
  224. package/build-types/avatar-group/component.d.ts.map +0 -1
  225. package/build-types/avatar-group/index.d.ts +0 -3
  226. package/build-types/avatar-group/index.d.ts.map +0 -1
  227. package/build-types/avatar-group/types.d.ts +0 -14
  228. package/build-types/avatar-group/types.d.ts.map +0 -1
  229. package/src/avatar/component.tsx +0 -82
  230. package/src/avatar/index.ts +0 -2
  231. package/src/avatar/styles.scss +0 -152
  232. package/src/avatar/types.ts +0 -59
  233. package/src/avatar-group/component.tsx +0 -46
  234. package/src/avatar-group/index.ts +0 -2
  235. package/src/avatar-group/styles.scss +0 -32
  236. package/src/avatar-group/types.ts +0 -13
@@ -1,19 +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 __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // packages/components/src/avatar-group/types.ts
17
- var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
19
- //# sourceMappingURL=types.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/avatar-group/types.ts"],
4
- "sourcesContent": ["export {};"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,68 +0,0 @@
1
- // packages/components/src/avatar/component.tsx
2
- import clsx from "clsx";
3
- import Icon from "../icon/index.mjs";
4
- import Tooltip from "../tooltip/index.mjs";
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- function Avatar({
7
- className,
8
- src,
9
- name,
10
- label,
11
- badge = false,
12
- size = "default",
13
- borderColor,
14
- status,
15
- statusIndicator,
16
- style,
17
- ...props
18
- }) {
19
- const showBadge = badge && !!name;
20
- const initials = name ? name.split(/\s+/).slice(0, 2).map((word) => word[0]).join("").toUpperCase() : void 0;
21
- const customProperties = {
22
- ...style,
23
- ...src ? {
24
- "--components-avatar-url": `url(${src})`
25
- } : {},
26
- ...borderColor ? {
27
- "--components-avatar-outline-color": borderColor
28
- } : {}
29
- };
30
- const avatar = /* @__PURE__ */ _jsxs("div", {
31
- className: clsx("components-avatar", className, {
32
- "has-avatar-border-color": !!borderColor,
33
- "has-src": !!src,
34
- "has-badge": showBadge,
35
- "is-small": size === "small",
36
- "has-status": !!status,
37
- [`is-${status}`]: !!status
38
- }),
39
- style: customProperties,
40
- role: "img",
41
- "aria-label": name,
42
- ...props,
43
- children: [/* @__PURE__ */ _jsxs("span", {
44
- className: "components-avatar__image",
45
- children: [!src && initials, !!status && !!statusIndicator && /* @__PURE__ */ _jsx("span", {
46
- className: "components-avatar__status-indicator",
47
- children: /* @__PURE__ */ _jsx(Icon, {
48
- icon: statusIndicator
49
- })
50
- })]
51
- }), showBadge && /* @__PURE__ */ _jsx("span", {
52
- className: "components-avatar__name",
53
- children: label || name
54
- })]
55
- });
56
- if (name && (!showBadge || label)) {
57
- return /* @__PURE__ */ _jsx(Tooltip, {
58
- text: name,
59
- children: avatar
60
- });
61
- }
62
- return avatar;
63
- }
64
- var component_default = Avatar;
65
- export {
66
- component_default as default
67
- };
68
- //# sourceMappingURL=component.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/avatar/component.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\nimport Tooltip from '../tooltip';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction Avatar({\n className,\n src,\n name,\n label,\n badge = false,\n size = 'default',\n borderColor,\n status,\n statusIndicator,\n style,\n ...props\n}) {\n const showBadge = badge && !!name;\n const initials = name ? name.split(/\\s+/).slice(0, 2).map(word => word[0]).join('').toUpperCase() : undefined;\n const customProperties = {\n ...style,\n ...(src ? {\n '--components-avatar-url': `url(${src})`\n } : {}),\n ...(borderColor ? {\n '--components-avatar-outline-color': borderColor\n } : {})\n };\n const avatar = /*#__PURE__*/_jsxs(\"div\", {\n className: clsx('components-avatar', className, {\n 'has-avatar-border-color': !!borderColor,\n 'has-src': !!src,\n 'has-badge': showBadge,\n 'is-small': size === 'small',\n 'has-status': !!status,\n [`is-${status}`]: !!status\n }),\n style: customProperties,\n role: \"img\",\n \"aria-label\": name,\n ...props,\n children: [/*#__PURE__*/_jsxs(\"span\", {\n className: \"components-avatar__image\",\n children: [!src && initials, !!status && !!statusIndicator && /*#__PURE__*/_jsx(\"span\", {\n className: \"components-avatar__status-indicator\",\n children: /*#__PURE__*/_jsx(Icon, {\n icon: statusIndicator\n })\n })]\n }), showBadge && /*#__PURE__*/_jsx(\"span\", {\n className: \"components-avatar__name\",\n children: label || name\n })]\n });\n if (name && (!showBadge || label)) {\n return /*#__PURE__*/_jsx(Tooltip, {\n text: name,\n children: avatar\n });\n }\n return avatar;\n}\nexport default Avatar;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,YAAY,SAAS,CAAC,CAAC;AAC7B,QAAM,WAAW,OAAO,KAAK,MAAM,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,UAAQ,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,IAAI;AACpG,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,IACH,GAAI,MAAM;AAAA,MACR,2BAA2B,OAAO,GAAG;AAAA,IACvC,IAAI,CAAC;AAAA,IACL,GAAI,cAAc;AAAA,MAChB,qCAAqC;AAAA,IACvC,IAAI,CAAC;AAAA,EACP;AACA,QAAM,SAAsB,sBAAM,OAAO;AAAA,IACvC,WAAW,KAAK,qBAAqB,WAAW;AAAA,MAC9C,2BAA2B,CAAC,CAAC;AAAA,MAC7B,WAAW,CAAC,CAAC;AAAA,MACb,aAAa;AAAA,MACb,YAAY,SAAS;AAAA,MACrB,cAAc,CAAC,CAAC;AAAA,MAChB,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,CAAC;AAAA,IACtB,CAAC;AAAA,IACD,OAAO;AAAA,IACP,MAAM;AAAA,IACN,cAAc;AAAA,IACd,GAAG;AAAA,IACH,UAAU,CAAc,sBAAM,QAAQ;AAAA,MACpC,WAAW;AAAA,MACX,UAAU,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,mBAAgC,qBAAK,QAAQ;AAAA,QACtF,WAAW;AAAA,QACX,UAAuB,qBAAK,MAAM;AAAA,UAChC,MAAM;AAAA,QACR,CAAC;AAAA,MACH,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,aAA0B,qBAAK,QAAQ;AAAA,MACzC,WAAW;AAAA,MACX,UAAU,SAAS;AAAA,IACrB,CAAC,CAAC;AAAA,EACJ,CAAC;AACD,MAAI,SAAS,CAAC,aAAa,QAAQ;AACjC,WAAoB,qBAAK,SAAS;AAAA,MAChC,MAAM;AAAA,MACN,UAAU;AAAA,IACZ,CAAC;AAAA,EACH;AACA,SAAO;AACT;AACA,IAAO,oBAAQ;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- // packages/components/src/avatar/index.ts
2
- import { default as default2 } from "./component.mjs";
3
- export {
4
- default2 as default
5
- };
6
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/avatar/index.ts"],
4
- "sourcesContent": ["export { default } from './component';"],
5
- "mappings": ";AAAA,SAAS,WAAAA,gBAAe;",
6
- "names": ["default"]
7
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,29 +0,0 @@
1
- // packages/components/src/avatar-group/component.tsx
2
- import clsx from "clsx";
3
- import { Children } from "@wordpress/element";
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- function AvatarGroup({
6
- className,
7
- max = 3,
8
- children,
9
- ...props
10
- }) {
11
- const childArray = Children.toArray(children);
12
- const visible = childArray.slice(0, max);
13
- const overflowCount = childArray.length - max;
14
- return /* @__PURE__ */ _jsxs("div", {
15
- role: "group",
16
- className: clsx("components-avatar-group", className),
17
- ...props,
18
- children: [visible, overflowCount > 0 && /* @__PURE__ */ _jsx("span", {
19
- className: "components-avatar-group__overflow",
20
- "aria-label": `${overflowCount} more`,
21
- children: `+${overflowCount}`
22
- })]
23
- });
24
- }
25
- var component_default = AvatarGroup;
26
- export {
27
- component_default as default
28
- };
29
- //# sourceMappingURL=component.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/avatar-group/component.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction AvatarGroup({\n className,\n max = 3,\n children,\n ...props\n}) {\n const childArray = Children.toArray(children);\n const visible = childArray.slice(0, max);\n const overflowCount = childArray.length - max;\n return /*#__PURE__*/_jsxs(\"div\", {\n role: \"group\",\n className: clsx('components-avatar-group', className),\n ...props,\n children: [visible, overflowCount > 0 && /*#__PURE__*/_jsx(\"span\", {\n className: \"components-avatar-group__overflow\",\n \"aria-label\": `${overflowCount} more`,\n children: `+${overflowCount}`\n })]\n });\n}\nexport default AvatarGroup;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,gBAAgB;AAKzB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,aAAa,SAAS,QAAQ,QAAQ;AAC5C,QAAM,UAAU,WAAW,MAAM,GAAG,GAAG;AACvC,QAAM,gBAAgB,WAAW,SAAS;AAC1C,SAAoB,sBAAM,OAAO;AAAA,IAC/B,MAAM;AAAA,IACN,WAAW,KAAK,2BAA2B,SAAS;AAAA,IACpD,GAAG;AAAA,IACH,UAAU,CAAC,SAAS,gBAAgB,KAAkB,qBAAK,QAAQ;AAAA,MACjE,WAAW;AAAA,MACX,cAAc,GAAG,aAAa;AAAA,MAC9B,UAAU,IAAI,aAAa;AAAA,IAC7B,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,oBAAQ;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- // packages/components/src/avatar-group/index.ts
2
- import { default as default2 } from "./component.mjs";
3
- export {
4
- default2 as default
5
- };
6
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/avatar-group/index.ts"],
4
- "sourcesContent": ["export { default } from './component';"],
5
- "mappings": ";AAAA,SAAS,WAAAA,gBAAe;",
6
- "names": ["default"]
7
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
1
- import type { AvatarProps } from './types';
2
- import type { WordPressComponentProps } from '../context';
3
- declare function Avatar({ className, src, name, label, badge, size, borderColor, status, statusIndicator, style, ...props }: WordPressComponentProps<AvatarProps, 'div', false>): import("react").JSX.Element;
4
- export default Avatar;
5
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/avatar/component.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,iBAAS,MAAM,CAAE,EAChB,SAAS,EACT,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAa,EACb,IAAgB,EAChB,WAAW,EACX,MAAM,EACN,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,WAAW,EAAE,KAAK,EAAE,KAAK,CAAE,+BAsDtD;AAED,eAAe,MAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- export { default } from './component';
2
- export type { AvatarProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -1,59 +0,0 @@
1
- import type { IconType } from '../icon';
2
- export type AvatarProps = {
3
- /**
4
- * URL of the avatar image.
5
- *
6
- * When not provided, initials derived from `name` are shown.
7
- */
8
- src?: string;
9
- /**
10
- * Name of the user. Used as an accessible label and to generate
11
- * initials when no image is provided.
12
- */
13
- name?: string;
14
- /**
15
- * Visible text shown in the hover badge. When not provided, `name`
16
- * is used instead. Use this to provide contextual labels like "You"
17
- * without affecting the accessible name or initials.
18
- */
19
- label?: string;
20
- /**
21
- * Whether to show the hover-expand badge that reveals the user's
22
- * name (or `label`) on hover. Requires `name` to be set.
23
- *
24
- * @default false
25
- */
26
- badge?: boolean;
27
- /**
28
- * Size of the avatar.
29
- *
30
- * - `'default'`: 32px
31
- * - `'small'`: 24px
32
- *
33
- * @default 'default'
34
- */
35
- size?: 'default' | 'small';
36
- /**
37
- * CSS color value for an accent border ring around the avatar.
38
- *
39
- * When not provided, no border is rendered and the hover badge
40
- * and avatar status uses the admin theme color as its background.
41
- */
42
- borderColor?: string;
43
- /**
44
- * A status string applied to the avatar. When set, the image is
45
- * dimmed to indicate a non-default state. A corresponding
46
- * `is-{status}` class is added for custom styling.
47
- */
48
- status?: string;
49
- /**
50
- * An icon or custom component rendered as a centered overlay on the
51
- * avatar image. Only visible when `status` is set.
52
- *
53
- * Accepts any value supported by the `Icon` component: an icon from
54
- * `@wordpress/icons`, a Dashicon name string, a component, or a
55
- * JSX element.
56
- */
57
- statusIndicator?: IconType | null;
58
- };
59
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import type { AvatarGroupProps } from './types';
5
- import type { WordPressComponentProps } from '../context';
6
- declare function AvatarGroup({ className, max, children, ...props }: WordPressComponentProps<AvatarGroupProps, 'div', false>): import("react").JSX.Element;
7
- export default AvatarGroup;
8
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/avatar-group/component.tsx"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,iBAAS,WAAW,CAAE,EACrB,SAAS,EACT,GAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAE,+BAsB3D;AAED,eAAe,WAAW,CAAC"}
@@ -1,3 +0,0 @@
1
- export { default } from './component';
2
- export type { AvatarGroupProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,14 +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
- };
14
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/avatar-group/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC"}
@@ -1,82 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import Icon from '../icon';
10
- import Tooltip from '../tooltip';
11
- import type { AvatarProps } from './types';
12
- import type { WordPressComponentProps } from '../context';
13
-
14
- function Avatar( {
15
- className,
16
- src,
17
- name,
18
- label,
19
- badge = false,
20
- size = 'default',
21
- borderColor,
22
- status,
23
- statusIndicator,
24
- style,
25
- ...props
26
- }: WordPressComponentProps< AvatarProps, 'div', false > ) {
27
- const showBadge = badge && !! name;
28
- const initials = name
29
- ? name
30
- .split( /\s+/ )
31
- .slice( 0, 2 )
32
- .map( ( word ) => word[ 0 ] )
33
- .join( '' )
34
- .toUpperCase()
35
- : undefined;
36
- const customProperties = {
37
- ...style,
38
- ...( src ? { '--components-avatar-url': `url(${ src })` } : {} ),
39
- ...( borderColor
40
- ? { '--components-avatar-outline-color': borderColor }
41
- : {} ),
42
- } as React.CSSProperties;
43
-
44
- const avatar = (
45
- <div
46
- className={ clsx( 'components-avatar', className, {
47
- 'has-avatar-border-color': !! borderColor,
48
- 'has-src': !! src,
49
- 'has-badge': showBadge,
50
- 'is-small': size === 'small',
51
- 'has-status': !! status,
52
- [ `is-${ status }` ]: !! status,
53
- } ) }
54
- style={ customProperties }
55
- role="img"
56
- aria-label={ name }
57
- { ...props }
58
- >
59
- <span className="components-avatar__image">
60
- { ! src && initials }
61
- { !! status && !! statusIndicator && (
62
- <span className="components-avatar__status-indicator">
63
- <Icon icon={ statusIndicator } />
64
- </span>
65
- ) }
66
- </span>
67
- { showBadge && (
68
- <span className="components-avatar__name">
69
- { label || name }
70
- </span>
71
- ) }
72
- </div>
73
- );
74
-
75
- if ( name && ( ! showBadge || label ) ) {
76
- return <Tooltip text={ name }>{ avatar }</Tooltip>;
77
- }
78
-
79
- return avatar;
80
- }
81
-
82
- export default Avatar;
@@ -1,2 +0,0 @@
1
- export { default } from './component';
2
- export type { AvatarProps } from './types';
@@ -1,152 +0,0 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
- @use "@wordpress/base-styles/variables" as *;
3
- @use "../utils/theme-variables" as *;
4
-
5
- .components-avatar {
6
- display: inline-flex;
7
- align-items: center;
8
- border-radius: $radius-full;
9
- overflow: clip;
10
- flex-shrink: 0;
11
- background-color: $components-color-accent;
12
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $white, $elevation-x-small;
13
- }
14
-
15
- .components-avatar__image {
16
- box-sizing: border-box;
17
- position: relative;
18
- width: $button-size-compact;
19
- height: $button-size-compact;
20
- border-radius: $radius-full;
21
- border: 0;
22
- background-color: $components-color-accent;
23
- overflow: clip;
24
- flex-shrink: 0;
25
- font-size: 0;
26
- color: $white;
27
-
28
- .is-small > & {
29
- width: $button-size-small;
30
- height: $button-size-small;
31
- }
32
-
33
- .has-src > & {
34
- background-image: var(--components-avatar-url);
35
- background-size: cover;
36
- background-position: center;
37
- }
38
-
39
- .has-avatar-border-color > & {
40
- border: var(--wp-admin-border-width-focus) solid var(--components-avatar-outline-color);
41
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $white;
42
- background-clip: padding-box;
43
- }
44
- }
45
-
46
- // Initials fallback: show name characters when no image.
47
- .components-avatar:not(.has-src) > .components-avatar__image {
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- font-size: $font-size-x-small;
52
- font-weight: $font-weight-medium;
53
- border: 0;
54
- box-shadow: none;
55
- background-clip: border-box;
56
- }
57
-
58
- .components-avatar:not(.has-src).has-avatar-border-color > .components-avatar__image {
59
- background-color: var(--components-avatar-outline-color);
60
- }
61
-
62
- .components-avatar__name {
63
- font-size: $font-size-medium;
64
- line-height: $font-line-height-small;
65
- color: $white;
66
- min-width: 0;
67
- padding-bottom: calc($grid-unit-05 / 2);
68
- overflow: hidden;
69
- opacity: 0;
70
- white-space: nowrap;
71
- transition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);
72
- }
73
-
74
- // Badge mode: use grid so the name column animates from 0 to natural width.
75
- // Spacing is on the container (column-gap + padding-inline-end) so it
76
- // transitions alongside grid-template-columns instead of causing a bump.
77
- .components-avatar.has-badge {
78
- display: inline-grid;
79
- grid-template-columns: min-content 0fr;
80
- column-gap: 0;
81
- padding-inline-end: 0;
82
- transition:
83
- grid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),
84
- column-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),
85
- padding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);
86
-
87
- &:hover {
88
- grid-template-columns: min-content 1fr;
89
- column-gap: $grid-unit-05;
90
- padding-inline-end: $grid-unit-10;
91
- transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
92
- }
93
-
94
- &:hover .components-avatar__name {
95
- opacity: 1;
96
- transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
97
- }
98
- }
99
-
100
- .components-avatar.has-badge.has-avatar-border-color {
101
- background-color: var(--components-avatar-outline-color);
102
- }
103
-
104
- // Status: dim and desaturate content so the background color shows through.
105
- // Images: move to ::before with luminosity blend over the solid bg color.
106
- // Initials: reduce text opacity.
107
- .components-avatar.has-status.has-src > .components-avatar__image {
108
- background-image: none;
109
-
110
- &::before {
111
- content: "";
112
- position: absolute;
113
- inset: 0;
114
- border-radius: inherit;
115
- background-image: var(--components-avatar-url);
116
- background-size: cover;
117
- background-position: center;
118
- mix-blend-mode: luminosity;
119
- opacity: 0.3;
120
- }
121
- }
122
-
123
- .components-avatar.has-status:not(.has-src) > .components-avatar__image {
124
- color: rgba($white, 0.3);
125
- }
126
-
127
- .components-avatar.has-status.has-avatar-border-color > .components-avatar__image {
128
- background-color: var(--components-avatar-outline-color);
129
- }
130
-
131
- .components-avatar__status-indicator {
132
- position: absolute;
133
- inset: 0;
134
- display: flex;
135
- align-items: center;
136
- justify-content: center;
137
- z-index: 1;
138
- color: $white;
139
- fill: $white;
140
-
141
- svg {
142
- width: 75%;
143
- height: 75%;
144
- }
145
- }
146
-
147
- @media (prefers-reduced-motion: reduce) {
148
- .components-avatar.has-badge,
149
- .components-avatar__name {
150
- transition: none;
151
- }
152
- }
@@ -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
- };