@eui/eds-react 22.0.0-alpha.10

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 (313) hide show
  1. package/eds-accordion/eds-accordion-item.css +108 -0
  2. package/eds-accordion/eds-accordion-item.d.ts +47 -0
  3. package/eds-accordion/eds-accordion-item.d.ts.map +1 -0
  4. package/eds-accordion/eds-accordion-item.js +87 -0
  5. package/eds-accordion/eds-accordion-item.js.map +1 -0
  6. package/eds-accordion/eds-accordion.css +7 -0
  7. package/eds-accordion/eds-accordion.d.ts +54 -0
  8. package/eds-accordion/eds-accordion.d.ts.map +1 -0
  9. package/eds-accordion/eds-accordion.js +79 -0
  10. package/eds-accordion/eds-accordion.js.map +1 -0
  11. package/eds-accordion/index.d.ts +5 -0
  12. package/eds-accordion/index.d.ts.map +1 -0
  13. package/eds-accordion/index.js +3 -0
  14. package/eds-accordion/index.js.map +1 -0
  15. package/eds-alert/eds-alert-title.css +5 -0
  16. package/eds-alert/eds-alert-title.d.ts +12 -0
  17. package/eds-alert/eds-alert-title.d.ts.map +1 -0
  18. package/eds-alert/eds-alert-title.js +12 -0
  19. package/eds-alert/eds-alert-title.js.map +1 -0
  20. package/eds-alert/eds-alert.css +62 -0
  21. package/eds-alert/eds-alert.d.ts +38 -0
  22. package/eds-alert/eds-alert.d.ts.map +1 -0
  23. package/eds-alert/eds-alert.js +29 -0
  24. package/eds-alert/eds-alert.js.map +1 -0
  25. package/eds-alert/index.d.ts +5 -0
  26. package/eds-alert/index.d.ts.map +1 -0
  27. package/eds-alert/index.js +3 -0
  28. package/eds-alert/index.js.map +1 -0
  29. package/eds-avatar/eds-avatar-badge.css +34 -0
  30. package/eds-avatar/eds-avatar-badge.d.ts +20 -0
  31. package/eds-avatar/eds-avatar-badge.d.ts.map +1 -0
  32. package/eds-avatar/eds-avatar-badge.js +13 -0
  33. package/eds-avatar/eds-avatar-badge.js.map +1 -0
  34. package/eds-avatar/eds-avatar-content-label.css +5 -0
  35. package/eds-avatar/eds-avatar-content-label.d.ts +13 -0
  36. package/eds-avatar/eds-avatar-content-label.d.ts.map +1 -0
  37. package/eds-avatar/eds-avatar-content-label.js +12 -0
  38. package/eds-avatar/eds-avatar-content-label.js.map +1 -0
  39. package/eds-avatar/eds-avatar-content-sublabel.css +5 -0
  40. package/eds-avatar/eds-avatar-content-sublabel.d.ts +13 -0
  41. package/eds-avatar/eds-avatar-content-sublabel.d.ts.map +1 -0
  42. package/eds-avatar/eds-avatar-content-sublabel.js +12 -0
  43. package/eds-avatar/eds-avatar-content-sublabel.js.map +1 -0
  44. package/eds-avatar/eds-avatar-content.css +6 -0
  45. package/eds-avatar/eds-avatar-content.d.ts +17 -0
  46. package/eds-avatar/eds-avatar-content.d.ts.map +1 -0
  47. package/eds-avatar/eds-avatar-content.js +12 -0
  48. package/eds-avatar/eds-avatar-content.js.map +1 -0
  49. package/eds-avatar/eds-avatar-icon.css +13 -0
  50. package/eds-avatar/eds-avatar-icon.d.ts +14 -0
  51. package/eds-avatar/eds-avatar-icon.d.ts.map +1 -0
  52. package/eds-avatar/eds-avatar-icon.js +13 -0
  53. package/eds-avatar/eds-avatar-icon.js.map +1 -0
  54. package/eds-avatar/eds-avatar-image.css +24 -0
  55. package/eds-avatar/eds-avatar-image.d.ts +19 -0
  56. package/eds-avatar/eds-avatar-image.d.ts.map +1 -0
  57. package/eds-avatar/eds-avatar-image.js +16 -0
  58. package/eds-avatar/eds-avatar-image.js.map +1 -0
  59. package/eds-avatar/eds-avatar-list.css +21 -0
  60. package/eds-avatar/eds-avatar-list.d.ts +14 -0
  61. package/eds-avatar/eds-avatar-list.d.ts.map +1 -0
  62. package/eds-avatar/eds-avatar-list.js +13 -0
  63. package/eds-avatar/eds-avatar-list.js.map +1 -0
  64. package/eds-avatar/eds-avatar-text.css +7 -0
  65. package/eds-avatar/eds-avatar-text.d.ts +14 -0
  66. package/eds-avatar/eds-avatar-text.d.ts.map +1 -0
  67. package/eds-avatar/eds-avatar-text.js +13 -0
  68. package/eds-avatar/eds-avatar-text.js.map +1 -0
  69. package/eds-avatar/eds-avatar.css +128 -0
  70. package/eds-avatar/eds-avatar.d.ts +38 -0
  71. package/eds-avatar/eds-avatar.d.ts.map +1 -0
  72. package/eds-avatar/eds-avatar.js +48 -0
  73. package/eds-avatar/eds-avatar.js.map +1 -0
  74. package/eds-avatar/index.d.ts +19 -0
  75. package/eds-avatar/index.d.ts.map +1 -0
  76. package/eds-avatar/index.js +10 -0
  77. package/eds-avatar/index.js.map +1 -0
  78. package/eds-badge/eds-badge.css +174 -0
  79. package/eds-badge/eds-badge.d.ts +46 -0
  80. package/eds-badge/eds-badge.d.ts.map +1 -0
  81. package/eds-badge/eds-badge.js +39 -0
  82. package/eds-badge/eds-badge.js.map +1 -0
  83. package/eds-badge/index.d.ts +3 -0
  84. package/eds-badge/index.d.ts.map +1 -0
  85. package/eds-badge/index.js +2 -0
  86. package/eds-badge/index.js.map +1 -0
  87. package/eds-button/eds-button.css +233 -0
  88. package/eds-button/eds-button.d.ts +65 -0
  89. package/eds-button/eds-button.d.ts.map +1 -0
  90. package/eds-button/eds-button.js +33 -0
  91. package/eds-button/eds-button.js.map +1 -0
  92. package/eds-button/index.d.ts +3 -0
  93. package/eds-button/index.d.ts.map +1 -0
  94. package/eds-button/index.js +2 -0
  95. package/eds-button/index.js.map +1 -0
  96. package/eds-chip/eds-chip.css +171 -0
  97. package/eds-chip/eds-chip.d.ts +71 -0
  98. package/eds-chip/eds-chip.d.ts.map +1 -0
  99. package/eds-chip/eds-chip.js +95 -0
  100. package/eds-chip/eds-chip.js.map +1 -0
  101. package/eds-chip/index.d.ts +3 -0
  102. package/eds-chip/index.d.ts.map +1 -0
  103. package/eds-chip/index.js +2 -0
  104. package/eds-chip/index.js.map +1 -0
  105. package/eds-chip-list/eds-chip-list.css +32 -0
  106. package/eds-chip-list/eds-chip-list.d.ts +68 -0
  107. package/eds-chip-list/eds-chip-list.d.ts.map +1 -0
  108. package/eds-chip-list/eds-chip-list.js +69 -0
  109. package/eds-chip-list/eds-chip-list.js.map +1 -0
  110. package/eds-chip-list/index.d.ts +3 -0
  111. package/eds-chip-list/index.d.ts.map +1 -0
  112. package/eds-chip-list/index.js +2 -0
  113. package/eds-chip-list/index.js.map +1 -0
  114. package/eds-icon/eds-icon.css +80 -0
  115. package/eds-icon/eds-icon.d.ts +44 -0
  116. package/eds-icon/eds-icon.d.ts.map +1 -0
  117. package/eds-icon/eds-icon.js +26 -0
  118. package/eds-icon/eds-icon.js.map +1 -0
  119. package/eds-icon/index.d.ts +3 -0
  120. package/eds-icon/index.d.ts.map +1 -0
  121. package/eds-icon/index.js +2 -0
  122. package/eds-icon/index.js.map +1 -0
  123. package/eds-icon-button/eds-icon-button.css +83 -0
  124. package/eds-icon-button/eds-icon-button.d.ts +33 -0
  125. package/eds-icon-button/eds-icon-button.d.ts.map +1 -0
  126. package/eds-icon-button/eds-icon-button.js +15 -0
  127. package/eds-icon-button/eds-icon-button.js.map +1 -0
  128. package/eds-icon-button/index.d.ts +3 -0
  129. package/eds-icon-button/index.d.ts.map +1 -0
  130. package/eds-icon-button/index.js +2 -0
  131. package/eds-icon-button/index.js.map +1 -0
  132. package/eds-icon-state/eds-icon-state.css +5 -0
  133. package/eds-icon-state/eds-icon-state.d.ts +24 -0
  134. package/eds-icon-state/eds-icon-state.d.ts.map +1 -0
  135. package/eds-icon-state/eds-icon-state.js +21 -0
  136. package/eds-icon-state/eds-icon-state.js.map +1 -0
  137. package/eds-icon-state/index.d.ts +3 -0
  138. package/eds-icon-state/index.d.ts.map +1 -0
  139. package/eds-icon-state/index.js +2 -0
  140. package/eds-icon-state/index.js.map +1 -0
  141. package/eds-link/eds-link.css +83 -0
  142. package/eds-link/eds-link.d.ts +32 -0
  143. package/eds-link/eds-link.d.ts.map +1 -0
  144. package/eds-link/eds-link.js +15 -0
  145. package/eds-link/eds-link.js.map +1 -0
  146. package/eds-link/index.d.ts +3 -0
  147. package/eds-link/index.d.ts.map +1 -0
  148. package/eds-link/index.js +2 -0
  149. package/eds-link/index.js.map +1 -0
  150. package/eds-menu/eds-menu-item-view.d.ts +31 -0
  151. package/eds-menu/eds-menu-item-view.d.ts.map +1 -0
  152. package/eds-menu/eds-menu-item-view.js +65 -0
  153. package/eds-menu/eds-menu-item-view.js.map +1 -0
  154. package/eds-menu/eds-menu-item.css +221 -0
  155. package/eds-menu/eds-menu-item.model.d.ts +69 -0
  156. package/eds-menu/eds-menu-item.model.d.ts.map +1 -0
  157. package/eds-menu/eds-menu-item.model.js +2 -0
  158. package/eds-menu/eds-menu-item.model.js.map +1 -0
  159. package/eds-menu/eds-menu.css +83 -0
  160. package/eds-menu/eds-menu.d.ts +52 -0
  161. package/eds-menu/eds-menu.d.ts.map +1 -0
  162. package/eds-menu/eds-menu.js +145 -0
  163. package/eds-menu/eds-menu.js.map +1 -0
  164. package/eds-menu/index.d.ts +6 -0
  165. package/eds-menu/index.d.ts.map +1 -0
  166. package/eds-menu/index.js +3 -0
  167. package/eds-menu/index.js.map +1 -0
  168. package/eds-shell/eds-shell-content.css +11 -0
  169. package/eds-shell/eds-shell-content.d.ts +11 -0
  170. package/eds-shell/eds-shell-content.d.ts.map +1 -0
  171. package/eds-shell/eds-shell-content.js +10 -0
  172. package/eds-shell/eds-shell-content.js.map +1 -0
  173. package/eds-shell/eds-shell-context.d.ts +20 -0
  174. package/eds-shell/eds-shell-context.d.ts.map +1 -0
  175. package/eds-shell/eds-shell-context.js +7 -0
  176. package/eds-shell/eds-shell-context.js.map +1 -0
  177. package/eds-shell/eds-shell-footer.css +25 -0
  178. package/eds-shell/eds-shell-footer.d.ts +12 -0
  179. package/eds-shell/eds-shell-footer.d.ts.map +1 -0
  180. package/eds-shell/eds-shell-footer.js +9 -0
  181. package/eds-shell/eds-shell-footer.js.map +1 -0
  182. package/eds-shell/eds-shell-header-app.css +23 -0
  183. package/eds-shell/eds-shell-header-app.d.ts +16 -0
  184. package/eds-shell/eds-shell-header-app.d.ts.map +1 -0
  185. package/eds-shell/eds-shell-header-app.js +11 -0
  186. package/eds-shell/eds-shell-header-app.js.map +1 -0
  187. package/eds-shell/eds-shell-header-end.css +5 -0
  188. package/eds-shell/eds-shell-header-end.d.ts +11 -0
  189. package/eds-shell/eds-shell-header-end.d.ts.map +1 -0
  190. package/eds-shell/eds-shell-header-end.js +10 -0
  191. package/eds-shell/eds-shell-header-end.js.map +1 -0
  192. package/eds-shell/eds-shell-header-environment.css +21 -0
  193. package/eds-shell/eds-shell-header-environment.d.ts +11 -0
  194. package/eds-shell/eds-shell-header-environment.d.ts.map +1 -0
  195. package/eds-shell/eds-shell-header-environment.js +10 -0
  196. package/eds-shell/eds-shell-header-environment.js.map +1 -0
  197. package/eds-shell/eds-shell-header-logo.css +14 -0
  198. package/eds-shell/eds-shell-header-logo.d.ts +20 -0
  199. package/eds-shell/eds-shell-header-logo.d.ts.map +1 -0
  200. package/eds-shell/eds-shell-header-logo.js +10 -0
  201. package/eds-shell/eds-shell-header-logo.js.map +1 -0
  202. package/eds-shell/eds-shell-header-start.css +5 -0
  203. package/eds-shell/eds-shell-header-start.d.ts +11 -0
  204. package/eds-shell/eds-shell-header-start.d.ts.map +1 -0
  205. package/eds-shell/eds-shell-header-start.js +10 -0
  206. package/eds-shell/eds-shell-header-start.js.map +1 -0
  207. package/eds-shell/eds-shell-header.css +33 -0
  208. package/eds-shell/eds-shell-header.d.ts +25 -0
  209. package/eds-shell/eds-shell-header.d.ts.map +1 -0
  210. package/eds-shell/eds-shell-header.js +14 -0
  211. package/eds-shell/eds-shell-header.js.map +1 -0
  212. package/eds-shell/eds-shell-menu-toggle.css +4 -0
  213. package/eds-shell/eds-shell-menu-toggle.d.ts +16 -0
  214. package/eds-shell/eds-shell-menu-toggle.d.ts.map +1 -0
  215. package/eds-shell/eds-shell-menu-toggle.js +20 -0
  216. package/eds-shell/eds-shell-menu-toggle.js.map +1 -0
  217. package/eds-shell/eds-shell-sidebar-bottom-nav.css +8 -0
  218. package/eds-shell/eds-shell-sidebar-bottom-nav.d.ts +20 -0
  219. package/eds-shell/eds-shell-sidebar-bottom-nav.d.ts.map +1 -0
  220. package/eds-shell/eds-shell-sidebar-bottom-nav.js +11 -0
  221. package/eds-shell/eds-shell-sidebar-bottom-nav.js.map +1 -0
  222. package/eds-shell/eds-shell-sidebar-footer.css +10 -0
  223. package/eds-shell/eds-shell-sidebar-footer.d.ts +10 -0
  224. package/eds-shell/eds-shell-sidebar-footer.d.ts.map +1 -0
  225. package/eds-shell/eds-shell-sidebar-footer.js +10 -0
  226. package/eds-shell/eds-shell-sidebar-footer.js.map +1 -0
  227. package/eds-shell/eds-shell-sidebar-header.css +33 -0
  228. package/eds-shell/eds-shell-sidebar-header.d.ts +16 -0
  229. package/eds-shell/eds-shell-sidebar-header.d.ts.map +1 -0
  230. package/eds-shell/eds-shell-sidebar-header.js +10 -0
  231. package/eds-shell/eds-shell-sidebar-header.js.map +1 -0
  232. package/eds-shell/eds-shell-sidebar-nav.css +9 -0
  233. package/eds-shell/eds-shell-sidebar-nav.d.ts +20 -0
  234. package/eds-shell/eds-shell-sidebar-nav.d.ts.map +1 -0
  235. package/eds-shell/eds-shell-sidebar-nav.js +11 -0
  236. package/eds-shell/eds-shell-sidebar-nav.js.map +1 -0
  237. package/eds-shell/eds-shell-sidebar.css +5 -0
  238. package/eds-shell/eds-shell-sidebar.d.ts +25 -0
  239. package/eds-shell/eds-shell-sidebar.d.ts.map +1 -0
  240. package/eds-shell/eds-shell-sidebar.js +15 -0
  241. package/eds-shell/eds-shell-sidebar.js.map +1 -0
  242. package/eds-shell/eds-shell-toolbar-app.css +23 -0
  243. package/eds-shell/eds-shell-toolbar-app.d.ts +16 -0
  244. package/eds-shell/eds-shell-toolbar-app.d.ts.map +1 -0
  245. package/eds-shell/eds-shell-toolbar-app.js +11 -0
  246. package/eds-shell/eds-shell-toolbar-app.js.map +1 -0
  247. package/eds-shell/eds-shell-toolbar-center.css +6 -0
  248. package/eds-shell/eds-shell-toolbar-center.d.ts +11 -0
  249. package/eds-shell/eds-shell-toolbar-center.d.ts.map +1 -0
  250. package/eds-shell/eds-shell-toolbar-center.js +10 -0
  251. package/eds-shell/eds-shell-toolbar-center.js.map +1 -0
  252. package/eds-shell/eds-shell-toolbar-end.css +23 -0
  253. package/eds-shell/eds-shell-toolbar-end.d.ts +11 -0
  254. package/eds-shell/eds-shell-toolbar-end.d.ts.map +1 -0
  255. package/eds-shell/eds-shell-toolbar-end.js +10 -0
  256. package/eds-shell/eds-shell-toolbar-end.js.map +1 -0
  257. package/eds-shell/eds-shell-toolbar-environment.css +21 -0
  258. package/eds-shell/eds-shell-toolbar-environment.d.ts +11 -0
  259. package/eds-shell/eds-shell-toolbar-environment.d.ts.map +1 -0
  260. package/eds-shell/eds-shell-toolbar-environment.js +10 -0
  261. package/eds-shell/eds-shell-toolbar-environment.js.map +1 -0
  262. package/eds-shell/eds-shell-toolbar-logo.css +11 -0
  263. package/eds-shell/eds-shell-toolbar-logo.d.ts +8 -0
  264. package/eds-shell/eds-shell-toolbar-logo.d.ts.map +1 -0
  265. package/eds-shell/eds-shell-toolbar-logo.js +10 -0
  266. package/eds-shell/eds-shell-toolbar-logo.js.map +1 -0
  267. package/eds-shell/eds-shell-toolbar-start.css +5 -0
  268. package/eds-shell/eds-shell-toolbar-start.d.ts +11 -0
  269. package/eds-shell/eds-shell-toolbar-start.d.ts.map +1 -0
  270. package/eds-shell/eds-shell-toolbar-start.js +10 -0
  271. package/eds-shell/eds-shell-toolbar-start.js.map +1 -0
  272. package/eds-shell/eds-shell-toolbar.css +37 -0
  273. package/eds-shell/eds-shell-toolbar.d.ts +27 -0
  274. package/eds-shell/eds-shell-toolbar.d.ts.map +1 -0
  275. package/eds-shell/eds-shell-toolbar.js +12 -0
  276. package/eds-shell/eds-shell-toolbar.js.map +1 -0
  277. package/eds-shell/eds-shell-top-message.css +48 -0
  278. package/eds-shell/eds-shell-top-message.d.ts +22 -0
  279. package/eds-shell/eds-shell-top-message.d.ts.map +1 -0
  280. package/eds-shell/eds-shell-top-message.js +24 -0
  281. package/eds-shell/eds-shell-top-message.js.map +1 -0
  282. package/eds-shell/eds-shell.css +105 -0
  283. package/eds-shell/eds-shell.d.ts +41 -0
  284. package/eds-shell/eds-shell.d.ts.map +1 -0
  285. package/eds-shell/eds-shell.js +116 -0
  286. package/eds-shell/eds-shell.js.map +1 -0
  287. package/eds-shell/index.d.ts +50 -0
  288. package/eds-shell/index.d.ts.map +1 -0
  289. package/eds-shell/index.js +25 -0
  290. package/eds-shell/index.js.map +1 -0
  291. package/eds-tag/eds-tag.css +83 -0
  292. package/eds-tag/eds-tag.d.ts +29 -0
  293. package/eds-tag/eds-tag.d.ts.map +1 -0
  294. package/eds-tag/eds-tag.js +14 -0
  295. package/eds-tag/eds-tag.js.map +1 -0
  296. package/eds-tag/index.d.ts +3 -0
  297. package/eds-tag/index.d.ts.map +1 -0
  298. package/eds-tag/index.js +2 -0
  299. package/eds-tag/index.js.map +1 -0
  300. package/eds-tooltip/eds-tooltip.css +140 -0
  301. package/eds-tooltip/eds-tooltip.d.ts +53 -0
  302. package/eds-tooltip/eds-tooltip.d.ts.map +1 -0
  303. package/eds-tooltip/eds-tooltip.js +179 -0
  304. package/eds-tooltip/eds-tooltip.js.map +1 -0
  305. package/eds-tooltip/index.d.ts +3 -0
  306. package/eds-tooltip/index.d.ts.map +1 -0
  307. package/eds-tooltip/index.js +2 -0
  308. package/eds-tooltip/index.js.map +1 -0
  309. package/index.d.ts +46 -0
  310. package/index.d.ts.map +1 -0
  311. package/index.js +31 -0
  312. package/index.js.map +1 -0
  313. package/package.json +115 -0
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { EdsAvatarIcon } from './eds-avatar-icon.js';
4
+ import { EdsAvatarText } from './eds-avatar-text.js';
5
+ import { EdsAvatarImage } from './eds-avatar-image.js';
6
+ import { EdsAvatarBadge } from './eds-avatar-badge.js';
7
+ import { EdsAvatarContent } from './eds-avatar-content.js';
8
+ /** Types that project into the round `.eds-avatar-wrapper` (mirrors the Angular select slots). */
9
+ const WRAPPER_TYPES = [EdsAvatarIcon, EdsAvatarText, EdsAvatarImage, EdsAvatarBadge];
10
+ /** Whether a projected child (at any depth of the surface slots) is / contains an `EdsAvatarImage`. */
11
+ function containsImage(node) {
12
+ return React.Children.toArray(node).some((child) => {
13
+ if (!React.isValidElement(child))
14
+ return false;
15
+ if (child.type === EdsAvatarImage)
16
+ return true;
17
+ return containsImage(child.props.children);
18
+ });
19
+ }
20
+ /**
21
+ * `EdsAvatar` — pure React port of the Angular `eds-avatar`.
22
+ *
23
+ * A round identity surface with a color palette and six sizes, holding a projected icon /
24
+ * text / image and an optional overlay badge, plus an optional label column beside it. The
25
+ * Angular template splits projection into a round `.eds-avatar-wrapper` (icon / text / image
26
+ * / badge) and a sibling content slot (`eds-avatar-content`); here `children` are split by
27
+ * element type into the same two regions. `size` / `color` reflect as `data-*`; `data-image`
28
+ * is set when an `EdsAvatarImage` is present (mirroring the Angular `contentChild` query).
29
+ */
30
+ export const EdsAvatar = React.forwardRef(function EdsAvatar({ e2eAttr = 'eds-avatar', size = 'm', ariaLabel = null, color = '', children, className, ...rest }, ref) {
31
+ const wrapperChildren = [];
32
+ const contentChildren = [];
33
+ React.Children.forEach(children, (child) => {
34
+ if (React.isValidElement(child) && child.type === EdsAvatarContent) {
35
+ contentChildren.push(child);
36
+ }
37
+ else if (React.isValidElement(child) && WRAPPER_TYPES.includes(child.type)) {
38
+ wrapperChildren.push(child);
39
+ }
40
+ else {
41
+ // Bare content (e.g. a plain EdsAvatarImage / EdsBadge composition) → wrapper slot.
42
+ wrapperChildren.push(child);
43
+ }
44
+ });
45
+ const hasImage = containsImage(children);
46
+ return (_jsxs("div", { ref: ref, className: className ? `eds-avatar ${className}` : 'eds-avatar', role: "img", "data-size": size, "data-color": color || undefined, "data-image": hasImage ? '' : undefined, "data-e2e": e2eAttr, "aria-label": ariaLabel ?? undefined, ...rest, children: [_jsx("div", { className: "eds-avatar-wrapper", children: wrapperChildren }), contentChildren] }));
47
+ });
48
+ //# sourceMappingURL=eds-avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-avatar.js","sourceRoot":"","sources":["../../src/eds-avatar/eds-avatar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA6B3D,kGAAkG;AAClG,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAErF,uGAAuG;AACvG,SAAS,aAAa,CAAC,IAAqB;IACxC,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc;YAAE,OAAO,IAAI,CAAC;QAC/C,OAAO,aAAa,CAAE,KAAK,CAAC,KAAwC,CAAC,QAAQ,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAiC,SAAS,SAAS,CACxF,EAAE,OAAO,GAAG,YAAY,EAAE,IAAI,GAAG,GAAG,EAAE,SAAS,GAAG,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAClG,GAAG;IAEH,MAAM,eAAe,GAAsB,EAAE,CAAC;IAC9C,MAAM,eAAe,GAAsB,EAAE,CAAC;IAE9C,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;YACjE,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;aAAM,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAa,CAAC,EAAE,CAAC;YACpF,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACJ,oFAAoF;YACpF,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEzC,OAAO,CACH,eACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,YAAY,EAC/D,IAAI,EAAC,KAAK,eACC,IAAI,gBACH,KAAK,IAAI,SAAS,gBAClB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,cAC3B,OAAO,gBACL,SAAS,IAAI,SAAS,KAC9B,IAAI,aAER,cAAK,SAAS,EAAC,oBAAoB,YAAE,eAAe,GAAO,EAC1D,eAAe,IACd,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ export { EdsAvatar } from './eds-avatar.js';
2
+ export type { EdsAvatarProps, EdsAvatarSize } from './eds-avatar.js';
3
+ export { EdsAvatarIcon } from './eds-avatar-icon.js';
4
+ export type { EdsAvatarIconProps } from './eds-avatar-icon.js';
5
+ export { EdsAvatarText } from './eds-avatar-text.js';
6
+ export type { EdsAvatarTextProps } from './eds-avatar-text.js';
7
+ export { EdsAvatarImage } from './eds-avatar-image.js';
8
+ export type { EdsAvatarImageProps } from './eds-avatar-image.js';
9
+ export { EdsAvatarBadge } from './eds-avatar-badge.js';
10
+ export type { EdsAvatarBadgeProps } from './eds-avatar-badge.js';
11
+ export { EdsAvatarList } from './eds-avatar-list.js';
12
+ export type { EdsAvatarListProps } from './eds-avatar-list.js';
13
+ export { EdsAvatarContent } from './eds-avatar-content.js';
14
+ export type { EdsAvatarContentProps } from './eds-avatar-content.js';
15
+ export { EdsAvatarContentLabel } from './eds-avatar-content-label.js';
16
+ export type { EdsAvatarContentLabelProps } from './eds-avatar-content-label.js';
17
+ export { EdsAvatarContentSublabel } from './eds-avatar-content-sublabel.js';
18
+ export type { EdsAvatarContentSublabelProps } from './eds-avatar-content-sublabel.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,YAAY,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { EdsAvatar } from './eds-avatar.js';
2
+ export { EdsAvatarIcon } from './eds-avatar-icon.js';
3
+ export { EdsAvatarText } from './eds-avatar-text.js';
4
+ export { EdsAvatarImage } from './eds-avatar-image.js';
5
+ export { EdsAvatarBadge } from './eds-avatar-badge.js';
6
+ export { EdsAvatarList } from './eds-avatar-list.js';
7
+ export { EdsAvatarContent } from './eds-avatar-content.js';
8
+ export { EdsAvatarContentLabel } from './eds-avatar-content-label.js';
9
+ export { EdsAvatarContentSublabel } from './eds-avatar-content-sublabel.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,174 @@
1
+ /*
2
+ * eds-badge — pure React port of eds-badge.scss.
3
+ *
4
+ * Angular emulated-encapsulation mapping (no shadow DOM here):
5
+ * :host -> .eds-badge (root class on the rendered element)
6
+ * :host([attr="v"]) -> .eds-badge[data-attr="v"]
7
+ * :host([bool]) -> .eds-badge[data-bool]
8
+ * :host-context(.X) -> .X .eds-badge
9
+ * base.eds-ellipsis() -> inlined (overflow/text-overflow/white-space)
10
+ * The --_eds-badge-* privates and --eds-* tokens are unchanged; tokens cascade in from
11
+ * the .eui-21 context (required on an ancestor), exactly like the Angular component.
12
+ */
13
+
14
+ .eds-badge {
15
+ /* Common defaults */
16
+ --_eds-badge-padding: 0 var(--eds-sp-3xs);
17
+ --_eds-badge-border-radius: var(--eds-br-full);
18
+ --_eds-badge-border-width: var(--eds-bw-xs);
19
+ --_eds-badge-font: var(--eds-f-microcopy-xs);
20
+ --_eds-badge-height: calc(var(--eds-sp-m) + var(--eds-sp-3xs));
21
+ --_eds-badge-min-width: calc(var(--eds-sp-m) + var(--eds-sp-3xs));
22
+ --_eds-badge-empty-size: var(--eds-sp-s);
23
+
24
+ /* Default color (neutral) */
25
+ --_eds-badge-surface: var(--eds-c-surface-neutral);
26
+ --_eds-badge-on-surface: var(--eds-c-on-surface-neutral);
27
+ --_eds-badge-border-color: var(--eds-c-border-neutral-subtle);
28
+
29
+ display: inline-flex;
30
+ border: var(--_eds-badge-border-width) solid var(--_eds-badge-border-color);
31
+ border-radius: var(--_eds-badge-border-radius);
32
+ background-color: var(--_eds-badge-surface);
33
+
34
+ /* a projected eds-icon follows the badge foreground (on-surface) color */
35
+ --_eds-icon-on-surface: var(--_eds-badge-on-surface);
36
+ }
37
+
38
+ .eds-badge .eds-badge__wrapper {
39
+ display: inline-flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ color: var(--_eds-badge-on-surface);
43
+ height: var(--_eds-badge-height);
44
+ min-width: var(--_eds-badge-min-width);
45
+ padding: var(--_eds-badge-padding);
46
+ font: var(--_eds-badge-font);
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+ white-space: nowrap;
50
+ }
51
+
52
+ /* COLOR — filled (default) surface / foreground / border */
53
+ .eds-badge[data-color="primary"] {
54
+ --_eds-badge-surface: var(--eds-c-surface-primary);
55
+ --_eds-badge-on-surface: var(--eds-c-on-surface-primary);
56
+ --_eds-badge-border-color: var(--eds-c-border-primary-subtle);
57
+ }
58
+ .eds-badge[data-color="neutral"] {
59
+ --_eds-badge-surface: var(--eds-c-surface-neutral);
60
+ --_eds-badge-on-surface: var(--eds-c-on-surface-neutral);
61
+ --_eds-badge-border-color: var(--eds-c-border-neutral-subtle);
62
+ }
63
+ .eds-badge[data-color="success"] {
64
+ --_eds-badge-surface: var(--eds-c-surface-success);
65
+ --_eds-badge-on-surface: var(--eds-c-on-surface-success);
66
+ --_eds-badge-border-color: var(--eds-c-border-success-subtle);
67
+ }
68
+ .eds-badge[data-color="info"] {
69
+ --_eds-badge-surface: var(--eds-c-surface-info);
70
+ --_eds-badge-on-surface: var(--eds-c-on-surface-info);
71
+ --_eds-badge-border-color: var(--eds-c-border-info-subtle);
72
+ }
73
+ .eds-badge[data-color="warning"] {
74
+ --_eds-badge-surface: var(--eds-c-surface-warning);
75
+ --_eds-badge-on-surface: var(--eds-c-on-surface-warning);
76
+ --_eds-badge-border-color: var(--eds-c-border-warning-subtle);
77
+ }
78
+ .eds-badge[data-color="critical"] {
79
+ --_eds-badge-surface: var(--eds-c-surface-critical);
80
+ --_eds-badge-on-surface: var(--eds-c-on-surface-critical);
81
+ --_eds-badge-border-color: var(--eds-c-border-critical-subtle);
82
+ }
83
+
84
+ /* VARIANT — outline: transparent surface, subtler foreground, stronger border */
85
+ .eds-badge[data-variant="outline"] {
86
+ --_eds-badge-surface: transparent;
87
+ }
88
+ .eds-badge[data-variant="outline"][data-color="primary"] {
89
+ --_eds-badge-on-surface: var(--eds-c-on-surface-primary-subtler);
90
+ --_eds-badge-border-color: var(--eds-c-border-primary);
91
+ }
92
+ .eds-badge[data-variant="outline"][data-color="neutral"] {
93
+ --_eds-badge-on-surface: var(--eds-c-on-surface-neutral-subtler);
94
+ --_eds-badge-border-color: var(--eds-c-border-neutral);
95
+ }
96
+ .eds-badge[data-variant="outline"][data-color="success"] {
97
+ --_eds-badge-on-surface: var(--eds-c-on-surface-success-subtler);
98
+ --_eds-badge-border-color: var(--eds-c-border-success);
99
+ }
100
+ .eds-badge[data-variant="outline"][data-color="info"] {
101
+ --_eds-badge-on-surface: var(--eds-c-on-surface-info-subtler);
102
+ --_eds-badge-border-color: var(--eds-c-border-info);
103
+ }
104
+ .eds-badge[data-variant="outline"][data-color="warning"] {
105
+ --_eds-badge-on-surface: var(--eds-c-on-surface-warning-subtler);
106
+ --_eds-badge-border-color: var(--eds-c-border-warning);
107
+ }
108
+ .eds-badge[data-variant="outline"][data-color="critical"] {
109
+ --_eds-badge-on-surface: var(--eds-c-on-surface-critical-subtler);
110
+ --_eds-badge-border-color: var(--eds-c-border-critical);
111
+ }
112
+
113
+ /* SIZE */
114
+ .eds-badge[data-size="s"] {
115
+ --_eds-badge-height: var(--eds-sp-m);
116
+ --_eds-badge-min-width: var(--eds-sp-m);
117
+ --_eds-badge-font: var(--eds-f-microcopy-2xs);
118
+ }
119
+
120
+ /* EMPTY — dot badge, no content in wrapper */
121
+ .eds-badge[data-empty] {
122
+ width: var(--_eds-badge-empty-size);
123
+ height: var(--_eds-badge-empty-size);
124
+ }
125
+
126
+ /* ICON-ONLY — circular indicator holding a single small icon, no wrapper padding */
127
+ .eds-badge[data-icon-only] .eds-badge__wrapper {
128
+ padding: 0;
129
+ width: var(--_eds-badge-height);
130
+ min-width: var(--_eds-badge-height);
131
+ }
132
+
133
+ /*
134
+ * CONTEXTUAL POSITIONING — badge nested inside icon / icon-button / avatar.
135
+ * :host-context(.X) -> .X .eds-badge (ancestor descendant selector).
136
+ */
137
+ .eds-icon .eds-badge {
138
+ position: absolute;
139
+ left: 60%;
140
+ top: -20%;
141
+ }
142
+ .eds-icon .eds-badge[data-empty] {
143
+ left: 60%;
144
+ top: -10%;
145
+ }
146
+ .eds-icon .eds-badge[data-size="xs"][data-empty] {
147
+ left: 70%;
148
+ top: -10%;
149
+ }
150
+
151
+ .eds-icon-button[size="2xs"] .eds-badge {
152
+ left: 50%;
153
+ top: -30%;
154
+ }
155
+ .eds-icon-button[size="xs"] .eds-badge {
156
+ left: 50%;
157
+ top: -40%;
158
+ }
159
+ .eds-icon-button[size="s"] .eds-badge {
160
+ left: 50%;
161
+ top: -50%;
162
+ }
163
+ .eds-icon-button[size="m"] .eds-badge {
164
+ left: 50%;
165
+ top: -40%;
166
+ }
167
+ .eds-icon-button[size="l"] .eds-badge {
168
+ left: 50%;
169
+ top: -25%;
170
+ }
171
+
172
+ .eds-avatar .eds-badge {
173
+ border: var(--eds-bw-s) solid var(--eds-c-border-inverted);
174
+ }
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Local narrowed unions — the badge's variant contract (ported 1:1 from the Angular
4
+ * `eds-badge`). No shared-token import.
5
+ */
6
+ export type EdsBadgeColor = 'primary' | 'neutral' | 'success' | 'info' | 'warning' | 'critical';
7
+ export type EdsBadgeVariant = 'filled' | 'outline';
8
+ export type EdsBadgeSize = 's' | 'm';
9
+ export interface EdsBadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> {
10
+ /** Semantic color of the badge. @default 'neutral' */
11
+ color?: EdsBadgeColor;
12
+ /** Visual variant. `filled` = solid surface; `outline` = transparent + stronger border. @default 'filled' */
13
+ variant?: EdsBadgeVariant;
14
+ /** Size of the badge. @default 'm' */
15
+ size?: EdsBadgeSize;
16
+ /** Whether the badge is a small dot indicator with no text content. @default false */
17
+ iconOnly?: boolean;
18
+ /**
19
+ * Maximum number of characters before truncating. When content exceeds this,
20
+ * it is replaced with `charReplacement`. `0` disables truncation. @default 0
21
+ */
22
+ maxCharCount?: number;
23
+ /** Text shown when content is truncated. Falls back to `'99+'`. @default '' */
24
+ charReplacement?: string;
25
+ /** Data attribute for e2e testing. @default 'eds-badge' */
26
+ e2eAttr?: string;
27
+ /**
28
+ * ARIA label. When `null`, the visible content serves as the accessible name.
29
+ * @default 'badge'
30
+ */
31
+ ariaLabel?: string | null;
32
+ /** Badge content (text / number / projected icon). */
33
+ children?: React.ReactNode;
34
+ }
35
+ /**
36
+ * `EdsBadge` — pure React port of the Angular `eds-badge`.
37
+ *
38
+ * A badge that displays text, numbers, or a dot indicator with semantic color, size,
39
+ * and variant styling. Supports content truncation (`maxCharCount`), an automatic empty
40
+ * state, and an icon-only (dot) mode. No Web Component / `@lit/react` dependency —
41
+ * behavior is reimplemented with React hooks, styling ported to `eds-badge.css`
42
+ * (attribute-scoped, `--eds-*` tokens). Requires `@eui/eds-styles` + the `eui-21` class
43
+ * on an ancestor, like the Angular component.
44
+ */
45
+ export declare const EdsBadge: React.ForwardRefExoticComponent<EdsBadgeProps & React.RefAttributes<HTMLSpanElement>>;
46
+ //# sourceMappingURL=eds-badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-badge.d.ts","sourceRoot":"","sources":["../../src/eds-badge/eds-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAChG,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AACnD,MAAM,MAAM,YAAY,GAAG,GAAG,GAAG,GAAG,CAAC;AAErC,MAAM,WAAW,aACb,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5D,sDAAsD;IACtD,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,6GAA6G;IAC7G,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,sCAAsC;IACtC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,uFAiEnB,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useLayoutEffect, useRef, useState } from 'react';
4
+ /**
5
+ * `EdsBadge` — pure React port of the Angular `eds-badge`.
6
+ *
7
+ * A badge that displays text, numbers, or a dot indicator with semantic color, size,
8
+ * and variant styling. Supports content truncation (`maxCharCount`), an automatic empty
9
+ * state, and an icon-only (dot) mode. No Web Component / `@lit/react` dependency —
10
+ * behavior is reimplemented with React hooks, styling ported to `eds-badge.css`
11
+ * (attribute-scoped, `--eds-*` tokens). Requires `@eui/eds-styles` + the `eui-21` class
12
+ * on an ancestor, like the Angular component.
13
+ */
14
+ export const EdsBadge = React.forwardRef(function EdsBadge({ color = 'neutral', variant = 'filled', size = 'm', iconOnly = false, maxCharCount = 0, charReplacement = '', e2eAttr = 'eds-badge', ariaLabel = 'badge', children, className, ...rest }, ref) {
15
+ const contentRef = useRef(null);
16
+ const [isEmpty, setIsEmpty] = useState(false);
17
+ const [hasContentUpdated, setHasContentUpdated] = useState(false);
18
+ const updatedContent = charReplacement || '99+';
19
+ // Mirrors the Angular effect + cdkObserveContent: measure the projected content to
20
+ // derive the empty state and truncation flag from the live DOM (outerText length).
21
+ useLayoutEffect(() => {
22
+ if (hasContentUpdated) {
23
+ return;
24
+ }
25
+ const el = contentRef.current;
26
+ if (!el) {
27
+ return;
28
+ }
29
+ const empty = el.childNodes.length === 0;
30
+ setIsEmpty(empty);
31
+ if (!empty && maxCharCount !== 0) {
32
+ const text = el.innerText;
33
+ setHasContentUpdated(!!text && text.length > maxCharCount);
34
+ }
35
+ }, [children, maxCharCount, hasContentUpdated]);
36
+ const rootClass = className ? `eds-badge ${className}` : 'eds-badge';
37
+ return (_jsx("span", { ref: ref, className: rootClass, role: "status", "data-color": color, "data-variant": variant, "data-size": size, "data-icon-only": iconOnly ? '' : undefined, "data-empty": isEmpty ? '' : undefined, "data-e2e": e2eAttr, "aria-label": ariaLabel ?? undefined, ...rest, children: hasContentUpdated ? (_jsx("span", { className: "eds-badge__wrapper", children: updatedContent })) : (_jsx("span", { className: "eds-badge__wrapper", ref: contentRef, children: children })) }));
38
+ });
39
+ //# sourceMappingURL=eds-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-badge.js","sourceRoot":"","sources":["../../src/eds-badge/eds-badge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAsC1D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAiC,SAAS,QAAQ,CACtF,EACI,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,QAAQ,EAClB,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,YAAY,GAAG,CAAC,EAChB,eAAe,GAAG,EAAE,EACpB,OAAO,GAAG,WAAW,EACrB,SAAS,GAAG,OAAO,EACnB,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACV,EACD,GAAG;IAEH,MAAM,UAAU,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElE,MAAM,cAAc,GAAG,eAAe,IAAI,KAAK,CAAC;IAEhD,mFAAmF;IACnF,mFAAmF;IACnF,eAAe,CAAC,GAAG,EAAE;QACjB,IAAI,iBAAiB,EAAE,CAAC;YACpB,OAAO;QACX,CAAC;QACD,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,EAAE,EAAE,CAAC;YACN,OAAO;QACX,CAAC;QACD,MAAM,KAAK,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;QACzC,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,EAAE,CAAC,SAAS,CAAC;YAC1B,oBAAoB,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;QAC/D,CAAC;IACL,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEhD,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,aAAa,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAErE,OAAO,CACH,eACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,IAAI,EAAC,QAAQ,gBACD,KAAK,kBACH,OAAO,eACV,IAAI,oBACC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,gBAC7B,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,cAC1B,OAAO,gBACL,SAAS,IAAI,SAAS,KAC9B,IAAI,YAEP,iBAAiB,CAAC,CAAC,CAAC,CACjB,eAAM,SAAS,EAAC,oBAAoB,YAAE,cAAc,GAAQ,CAC/D,CAAC,CAAC,CAAC,CACA,eAAM,SAAS,EAAC,oBAAoB,EAAC,GAAG,EAAE,UAAU,YAC/C,QAAQ,GACN,CACV,GACE,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { EdsBadge } from './eds-badge.js';
2
+ export type { EdsBadgeProps, EdsBadgeColor, EdsBadgeVariant, EdsBadgeSize } from './eds-badge.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { EdsBadge } from './eds-badge.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,233 @@
1
+ /*
2
+ * eds-button — pure React port of eds-button.scss.
3
+ * Class-based (pre-String-Props) source: variants are BEM classes computed in the
4
+ * component's hostClasses(), so the CSS keeps `.eds-button.eds-button--type-primary` style
5
+ * selectors verbatim (guide Part 1 rule 9) — NOT data-* attributes. `:host.eds-button` ->
6
+ * `.eds-button` (the host IS the button); the `.eui-21` wrapper is dropped (share-ready).
7
+ * Focus-ring mixins inlined from base.eds-focus-visible-ring / *-rounded.
8
+ */
9
+
10
+ /* ---------- TYPE + COLOR token mapping ---------- */
11
+
12
+ .eds-button.eds-button--type-primary {
13
+ --_border-width: var(--eds-bw-none);
14
+ --_border-color: transparent;
15
+ }
16
+ .eds-button.eds-button--type-primary.eds-button--primary {
17
+ --_surface: var(--eds-c-surface-primary);
18
+ --_on-surface: var(--eds-c-on-surface-primary);
19
+ --_surface-hover: var(--eds-c-surface-primary--hover);
20
+ --_on-surface-hover: var(--eds-c-on-surface-primary--hover);
21
+ --_surface-active: var(--eds-c-surface-primary--pressed);
22
+ --_on-surface-active: var(--eds-c-on-surface-primary--pressed);
23
+ }
24
+ .eds-button.eds-button--type-primary.eds-button--highlight {
25
+ --_surface: var(--eds-c-surface-highlight);
26
+ --_on-surface: var(--eds-c-on-surface-highlight);
27
+ --_surface-hover: var(--eds-c-surface-highlight--hover);
28
+ --_on-surface-hover: var(--eds-c-on-surface-highlight--hover);
29
+ --_surface-active: var(--eds-c-surface-highlight--pressed);
30
+ --_on-surface-active: var(--eds-c-on-surface-highlight--pressed);
31
+ }
32
+ .eds-button.eds-button--type-primary.eds-button--critical {
33
+ --_surface: var(--eds-c-surface-critical);
34
+ --_on-surface: var(--eds-c-on-surface-critical);
35
+ --_surface-hover: var(--eds-c-surface-critical--hover);
36
+ --_on-surface-hover: var(--eds-c-on-surface-critical--hover);
37
+ --_surface-active: var(--eds-c-surface-critical--pressed);
38
+ --_on-surface-active: var(--eds-c-on-surface-critical--pressed);
39
+ }
40
+ .eds-button.eds-button--type-primary:disabled,
41
+ .eds-button.eds-button--type-primary.disabled {
42
+ --_surface: var(--eds-c-surface-disabled);
43
+ --_on-surface: var(--eds-c-foreground-disabled);
44
+ --_surface-hover: var(--eds-c-surface-disabled);
45
+ --_on-surface-hover: var(--eds-c-foreground-disabled);
46
+ --_surface-active: var(--eds-c-surface-disabled);
47
+ --_on-surface-active: var(--eds-c-foreground-disabled);
48
+ }
49
+
50
+ .eds-button.eds-button--type-secondary {
51
+ --_border-width: var(--eds-bw-xs);
52
+ --_surface: transparent;
53
+ }
54
+ .eds-button.eds-button--type-secondary.eds-button--primary {
55
+ --_border-color: var(--eds-c-border-primary);
56
+ --_on-surface: var(--eds-c-foreground-primary);
57
+ --_surface-hover: var(--eds-c-surface-primary-subtle);
58
+ --_on-surface-hover: var(--eds-c-on-surface-primary-subtle);
59
+ --_surface-active: var(--eds-c-surface-primary-subtle);
60
+ --_on-surface-active: var(--eds-c-on-surface-primary-subtle);
61
+ }
62
+ .eds-button.eds-button--type-secondary.eds-button--neutral {
63
+ --_border-color: var(--eds-c-border-neutral);
64
+ --_on-surface: var(--eds-c-foreground-neutral);
65
+ --_surface-hover: var(--eds-c-surface-neutral-subtle);
66
+ --_on-surface-hover: var(--eds-c-on-surface-neutral-subtle);
67
+ --_surface-active: var(--eds-c-surface-neutral-subtle);
68
+ --_on-surface-active: var(--eds-c-on-surface-neutral-subtle);
69
+ }
70
+ .eds-button.eds-button--type-secondary.eds-button--highlight {
71
+ --_border-color: var(--eds-c-border-highlight);
72
+ --_on-surface: var(--eds-c-foreground-highlight);
73
+ --_surface-hover: var(--eds-c-surface-highlight-subtler);
74
+ --_on-surface-hover: var(--eds-c-on-surface-highlight-subtler);
75
+ --_surface-active: var(--eds-c-surface-highlight-subtler);
76
+ --_on-surface-active: var(--eds-c-on-surface-highlight-subtler);
77
+ }
78
+ .eds-button.eds-button--type-secondary.eds-button--critical {
79
+ --_border-color: var(--eds-c-border-critical);
80
+ --_on-surface: var(--eds-c-foreground-critical);
81
+ --_surface-hover: var(--eds-c-surface-critical-subtler);
82
+ --_on-surface-hover: var(--eds-c-on-surface-critical-subtler);
83
+ --_surface-active: var(--eds-c-surface-critical-subtler);
84
+ --_on-surface-active: var(--eds-c-on-surface-critical-subtler);
85
+ }
86
+ .eds-button.eds-button--type-secondary:disabled,
87
+ .eds-button.eds-button--type-secondary.disabled {
88
+ --_border-width: var(--eds-bw-xs);
89
+ --_border-color: var(--eds-c-border-disabled);
90
+ --_surface: var(--eds-c-surface-elevation);
91
+ --_on-surface: var(--eds-c-foreground-disabled);
92
+ --_surface-hover: var(--eds-c-surface-elevation);
93
+ --_on-surface-hover: var(--eds-c-foreground-disabled);
94
+ --_surface-active: var(--eds-c-surface-elevation);
95
+ --_on-surface-active: var(--eds-c-foreground-disabled);
96
+ }
97
+
98
+ .eds-button.eds-button--type-tertiary {
99
+ --_border-width: var(--eds-bw-none);
100
+ --_surface: transparent;
101
+ }
102
+ .eds-button.eds-button--type-tertiary.eds-button--primary {
103
+ --_on-surface: var(--eds-c-foreground-primary);
104
+ --_surface-hover: var(--eds-c-surface-primary-subtle);
105
+ --_on-surface-hover: var(--eds-c-on-surface-primary-subtle);
106
+ --_surface-active: var(--eds-c-surface-primary-subtle);
107
+ --_on-surface-active: var(--eds-c-on-surface-primary-subtle);
108
+ }
109
+ .eds-button.eds-button--type-tertiary.eds-button--neutral {
110
+ --_on-surface: var(--eds-c-foreground-neutral);
111
+ --_surface-hover: var(--_button-surface-hover, var(--eds-c-surface-neutral-subtle)); /* parent css vars override (see eds-chip f.e.) */
112
+ --_on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-neutral-subtle)); /* parent css vars override (see eds-chip f.e.) */
113
+ --_surface-active: var(--eds-c-surface-neutral-subtle);
114
+ --_on-surface-active: var(--eds-c-on-surface-neutral-subtle);
115
+ }
116
+ .eds-button.eds-button--type-tertiary.eds-button--highlight {
117
+ --_on-surface: var(--eds-c-foreground-highlight);
118
+ --_surface-hover: var(--eds-c-surface-highlight-subtler);
119
+ --_on-surface-hover: var(--eds-c-on-surface-highlight-subtler);
120
+ --_surface-active: var(--eds-c-surface-highlight-subtler);
121
+ --_on-surface-active: var(--eds-c-on-surface-highlight-subtler);
122
+ }
123
+ .eds-button.eds-button--type-tertiary.eds-button--critical {
124
+ --_on-surface: var(--eds-c-foreground-critical);
125
+ --_surface-hover: var(--_button-surface-hover, var(--eds-c-surface-critical-subtler)); /* parent css vars override (see eds-chip f.e.) */
126
+ --_on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-critical-subtler)); /* parent css vars override (see eds-chip f.e.) */
127
+ --_surface-active: var(--eds-c-surface-critical-subtler);
128
+ --_on-surface-active: var(--eds-c-on-surface-critical-subtler);
129
+ }
130
+ .eds-button.eds-button--type-tertiary:disabled,
131
+ .eds-button.eds-button--type-tertiary.disabled {
132
+ --_surface: var(--eds-c-surface-elevation);
133
+ --_on-surface: var(--eds-c-foreground-disabled);
134
+ --_surface-hover: var(--eds-c-surface-elevation);
135
+ --_on-surface-hover: var(--eds-c-foreground-disabled);
136
+ --_surface-active: var(--eds-c-surface-elevation);
137
+ --_on-surface-active: var(--eds-c-foreground-disabled);
138
+ }
139
+
140
+ /* ---------- SIZE token mapping ---------- */
141
+
142
+ /* 40px (default) */
143
+ .eds-button.eds-button--size-m {
144
+ --_font-size: var(--eds-f-s-m);
145
+ --_padding: 0 var(--eds-sp-xs);
146
+ --_size: var(--eds-sp-5xl);
147
+ --_icon-size: var(--eds-is-m);
148
+ }
149
+ /* 32px */
150
+ .eds-button.eds-button--size-s {
151
+ --_font-size: var(--eds-f-s-s);
152
+ --_padding: 0 var(--eds-sp-2xs);
153
+ --_size: var(--eds-sp-3xl);
154
+ --_icon-size: var(--eds-is-s);
155
+ }
156
+ /* 52px */
157
+ .eds-button.eds-button--size-l {
158
+ --_font-size: var(--eds-f-s-l);
159
+ --_padding: 0 var(--eds-sp-s);
160
+ --_size: var(--eds-sp-8xl);
161
+ --_icon-size: var(--eds-is-m);
162
+ }
163
+
164
+ /* ---------- common styles ---------- */
165
+
166
+ .eds-button {
167
+ align-items: center;
168
+ background-image: none;
169
+ border-radius: var(--eds-br-s);
170
+ box-sizing: border-box;
171
+ cursor: pointer;
172
+ display: inline-flex;
173
+ flex-shrink: 0;
174
+ justify-content: center;
175
+ outline: none;
176
+ text-transform: none;
177
+ transition: none;
178
+ vertical-align: middle;
179
+ white-space: nowrap;
180
+ border-style: solid;
181
+ }
182
+ /* inlined base.eds-focus-visible-ring() */
183
+ .eds-button:focus-visible:not([readonly]) {
184
+ outline: var(--eds-bw-s) solid var(--eds-c-border-primary) !important;
185
+ outline-offset: 1px !important;
186
+ border-radius: var(--eds-br-xs) !important;
187
+ }
188
+ .eds-button .eds-button__container {
189
+ align-items: center;
190
+ display: inline-flex;
191
+ position: relative;
192
+ gap: var(--eds-sp-2xs);
193
+ justify-content: center; /* Needed for responsive */
194
+ width: 100%; /* Needed for responsive */
195
+ }
196
+
197
+ /* ---------- internal css vars mapping ---------- */
198
+
199
+ .eds-button {
200
+ background-color: var(--_surface);
201
+ color: var(--_on-surface);
202
+ border-width: var(--_border-width);
203
+ border-color: var(--_border-color);
204
+ font-size: var(--_font-size);
205
+ min-height: var(--_size);
206
+ min-width: var(--_size);
207
+ padding: var(--_padding);
208
+
209
+ /* a projected eds-icon follows the button foreground (on-surface) color */
210
+ --_eds-icon-on-surface: var(--_on-surface);
211
+ }
212
+ .eds-button:hover {
213
+ background-color: var(--_surface-hover);
214
+ color: var(--_on-surface-hover);
215
+ --_eds-icon-on-surface: var(--_on-surface-hover);
216
+ }
217
+ .eds-button:active {
218
+ background-color: var(--_surface-active);
219
+ color: var(--_on-surface-active);
220
+ --_eds-icon-on-surface: var(--_on-surface-active);
221
+ }
222
+
223
+ /* ---------- other states ---------- */
224
+
225
+ .eds-button.eds-button--rounded {
226
+ border-radius: var(--eds-br-full);
227
+ }
228
+ /* inlined base.eds-focus-visible-ring-rounded() */
229
+ .eds-button.eds-button--rounded:focus-visible:not([readonly]) {
230
+ outline: var(--eds-bw-s) solid var(--eds-c-border-primary) !important;
231
+ outline-offset: 1px !important;
232
+ border-radius: var(--eds-br-full) !important;
233
+ }