@eui/eds-react 22.0.0-alpha.8

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 (290) hide show
  1. package/eds-alert/eds-alert-title.css +5 -0
  2. package/eds-alert/eds-alert-title.d.ts +12 -0
  3. package/eds-alert/eds-alert-title.d.ts.map +1 -0
  4. package/eds-alert/eds-alert-title.js +12 -0
  5. package/eds-alert/eds-alert-title.js.map +1 -0
  6. package/eds-alert/eds-alert.css +62 -0
  7. package/eds-alert/eds-alert.d.ts +38 -0
  8. package/eds-alert/eds-alert.d.ts.map +1 -0
  9. package/eds-alert/eds-alert.js +29 -0
  10. package/eds-alert/eds-alert.js.map +1 -0
  11. package/eds-alert/index.d.ts +5 -0
  12. package/eds-alert/index.d.ts.map +1 -0
  13. package/eds-alert/index.js +3 -0
  14. package/eds-alert/index.js.map +1 -0
  15. package/eds-avatar/eds-avatar-badge.css +34 -0
  16. package/eds-avatar/eds-avatar-badge.d.ts +20 -0
  17. package/eds-avatar/eds-avatar-badge.d.ts.map +1 -0
  18. package/eds-avatar/eds-avatar-badge.js +13 -0
  19. package/eds-avatar/eds-avatar-badge.js.map +1 -0
  20. package/eds-avatar/eds-avatar-content-label.css +5 -0
  21. package/eds-avatar/eds-avatar-content-label.d.ts +13 -0
  22. package/eds-avatar/eds-avatar-content-label.d.ts.map +1 -0
  23. package/eds-avatar/eds-avatar-content-label.js +12 -0
  24. package/eds-avatar/eds-avatar-content-label.js.map +1 -0
  25. package/eds-avatar/eds-avatar-content-sublabel.css +5 -0
  26. package/eds-avatar/eds-avatar-content-sublabel.d.ts +13 -0
  27. package/eds-avatar/eds-avatar-content-sublabel.d.ts.map +1 -0
  28. package/eds-avatar/eds-avatar-content-sublabel.js +12 -0
  29. package/eds-avatar/eds-avatar-content-sublabel.js.map +1 -0
  30. package/eds-avatar/eds-avatar-content.css +6 -0
  31. package/eds-avatar/eds-avatar-content.d.ts +17 -0
  32. package/eds-avatar/eds-avatar-content.d.ts.map +1 -0
  33. package/eds-avatar/eds-avatar-content.js +12 -0
  34. package/eds-avatar/eds-avatar-content.js.map +1 -0
  35. package/eds-avatar/eds-avatar-icon.css +13 -0
  36. package/eds-avatar/eds-avatar-icon.d.ts +14 -0
  37. package/eds-avatar/eds-avatar-icon.d.ts.map +1 -0
  38. package/eds-avatar/eds-avatar-icon.js +13 -0
  39. package/eds-avatar/eds-avatar-icon.js.map +1 -0
  40. package/eds-avatar/eds-avatar-image.css +24 -0
  41. package/eds-avatar/eds-avatar-image.d.ts +19 -0
  42. package/eds-avatar/eds-avatar-image.d.ts.map +1 -0
  43. package/eds-avatar/eds-avatar-image.js +16 -0
  44. package/eds-avatar/eds-avatar-image.js.map +1 -0
  45. package/eds-avatar/eds-avatar-list.css +21 -0
  46. package/eds-avatar/eds-avatar-list.d.ts +14 -0
  47. package/eds-avatar/eds-avatar-list.d.ts.map +1 -0
  48. package/eds-avatar/eds-avatar-list.js +13 -0
  49. package/eds-avatar/eds-avatar-list.js.map +1 -0
  50. package/eds-avatar/eds-avatar-text.css +7 -0
  51. package/eds-avatar/eds-avatar-text.d.ts +14 -0
  52. package/eds-avatar/eds-avatar-text.d.ts.map +1 -0
  53. package/eds-avatar/eds-avatar-text.js +13 -0
  54. package/eds-avatar/eds-avatar-text.js.map +1 -0
  55. package/eds-avatar/eds-avatar.css +128 -0
  56. package/eds-avatar/eds-avatar.d.ts +38 -0
  57. package/eds-avatar/eds-avatar.d.ts.map +1 -0
  58. package/eds-avatar/eds-avatar.js +48 -0
  59. package/eds-avatar/eds-avatar.js.map +1 -0
  60. package/eds-avatar/index.d.ts +19 -0
  61. package/eds-avatar/index.d.ts.map +1 -0
  62. package/eds-avatar/index.js +10 -0
  63. package/eds-avatar/index.js.map +1 -0
  64. package/eds-badge/eds-badge.css +174 -0
  65. package/eds-badge/eds-badge.d.ts +46 -0
  66. package/eds-badge/eds-badge.d.ts.map +1 -0
  67. package/eds-badge/eds-badge.js +39 -0
  68. package/eds-badge/eds-badge.js.map +1 -0
  69. package/eds-badge/index.d.ts +3 -0
  70. package/eds-badge/index.d.ts.map +1 -0
  71. package/eds-badge/index.js +2 -0
  72. package/eds-badge/index.js.map +1 -0
  73. package/eds-button/eds-button.css +233 -0
  74. package/eds-button/eds-button.d.ts +65 -0
  75. package/eds-button/eds-button.d.ts.map +1 -0
  76. package/eds-button/eds-button.js +33 -0
  77. package/eds-button/eds-button.js.map +1 -0
  78. package/eds-button/index.d.ts +3 -0
  79. package/eds-button/index.d.ts.map +1 -0
  80. package/eds-button/index.js +2 -0
  81. package/eds-button/index.js.map +1 -0
  82. package/eds-chip/eds-chip.css +171 -0
  83. package/eds-chip/eds-chip.d.ts +71 -0
  84. package/eds-chip/eds-chip.d.ts.map +1 -0
  85. package/eds-chip/eds-chip.js +90 -0
  86. package/eds-chip/eds-chip.js.map +1 -0
  87. package/eds-chip/index.d.ts +3 -0
  88. package/eds-chip/index.d.ts.map +1 -0
  89. package/eds-chip/index.js +2 -0
  90. package/eds-chip/index.js.map +1 -0
  91. package/eds-icon/eds-icon.css +80 -0
  92. package/eds-icon/eds-icon.d.ts +44 -0
  93. package/eds-icon/eds-icon.d.ts.map +1 -0
  94. package/eds-icon/eds-icon.js +26 -0
  95. package/eds-icon/eds-icon.js.map +1 -0
  96. package/eds-icon/index.d.ts +3 -0
  97. package/eds-icon/index.d.ts.map +1 -0
  98. package/eds-icon/index.js +2 -0
  99. package/eds-icon/index.js.map +1 -0
  100. package/eds-icon-button/eds-icon-button.css +83 -0
  101. package/eds-icon-button/eds-icon-button.d.ts +33 -0
  102. package/eds-icon-button/eds-icon-button.d.ts.map +1 -0
  103. package/eds-icon-button/eds-icon-button.js +15 -0
  104. package/eds-icon-button/eds-icon-button.js.map +1 -0
  105. package/eds-icon-button/index.d.ts +3 -0
  106. package/eds-icon-button/index.d.ts.map +1 -0
  107. package/eds-icon-button/index.js +2 -0
  108. package/eds-icon-button/index.js.map +1 -0
  109. package/eds-icon-state/eds-icon-state.css +5 -0
  110. package/eds-icon-state/eds-icon-state.d.ts +24 -0
  111. package/eds-icon-state/eds-icon-state.d.ts.map +1 -0
  112. package/eds-icon-state/eds-icon-state.js +21 -0
  113. package/eds-icon-state/eds-icon-state.js.map +1 -0
  114. package/eds-icon-state/index.d.ts +3 -0
  115. package/eds-icon-state/index.d.ts.map +1 -0
  116. package/eds-icon-state/index.js +2 -0
  117. package/eds-icon-state/index.js.map +1 -0
  118. package/eds-link/eds-link.css +83 -0
  119. package/eds-link/eds-link.d.ts +32 -0
  120. package/eds-link/eds-link.d.ts.map +1 -0
  121. package/eds-link/eds-link.js +15 -0
  122. package/eds-link/eds-link.js.map +1 -0
  123. package/eds-link/index.d.ts +3 -0
  124. package/eds-link/index.d.ts.map +1 -0
  125. package/eds-link/index.js +2 -0
  126. package/eds-link/index.js.map +1 -0
  127. package/eds-menu/eds-menu-item-view.d.ts +31 -0
  128. package/eds-menu/eds-menu-item-view.d.ts.map +1 -0
  129. package/eds-menu/eds-menu-item-view.js +65 -0
  130. package/eds-menu/eds-menu-item-view.js.map +1 -0
  131. package/eds-menu/eds-menu-item.css +221 -0
  132. package/eds-menu/eds-menu-item.model.d.ts +69 -0
  133. package/eds-menu/eds-menu-item.model.d.ts.map +1 -0
  134. package/eds-menu/eds-menu-item.model.js +2 -0
  135. package/eds-menu/eds-menu-item.model.js.map +1 -0
  136. package/eds-menu/eds-menu.css +83 -0
  137. package/eds-menu/eds-menu.d.ts +52 -0
  138. package/eds-menu/eds-menu.d.ts.map +1 -0
  139. package/eds-menu/eds-menu.js +145 -0
  140. package/eds-menu/eds-menu.js.map +1 -0
  141. package/eds-menu/index.d.ts +6 -0
  142. package/eds-menu/index.d.ts.map +1 -0
  143. package/eds-menu/index.js +3 -0
  144. package/eds-menu/index.js.map +1 -0
  145. package/eds-shell/eds-shell-content.css +11 -0
  146. package/eds-shell/eds-shell-content.d.ts +11 -0
  147. package/eds-shell/eds-shell-content.d.ts.map +1 -0
  148. package/eds-shell/eds-shell-content.js +10 -0
  149. package/eds-shell/eds-shell-content.js.map +1 -0
  150. package/eds-shell/eds-shell-context.d.ts +20 -0
  151. package/eds-shell/eds-shell-context.d.ts.map +1 -0
  152. package/eds-shell/eds-shell-context.js +7 -0
  153. package/eds-shell/eds-shell-context.js.map +1 -0
  154. package/eds-shell/eds-shell-footer.css +25 -0
  155. package/eds-shell/eds-shell-footer.d.ts +12 -0
  156. package/eds-shell/eds-shell-footer.d.ts.map +1 -0
  157. package/eds-shell/eds-shell-footer.js +9 -0
  158. package/eds-shell/eds-shell-footer.js.map +1 -0
  159. package/eds-shell/eds-shell-header-app.css +23 -0
  160. package/eds-shell/eds-shell-header-app.d.ts +16 -0
  161. package/eds-shell/eds-shell-header-app.d.ts.map +1 -0
  162. package/eds-shell/eds-shell-header-app.js +11 -0
  163. package/eds-shell/eds-shell-header-app.js.map +1 -0
  164. package/eds-shell/eds-shell-header-end.css +5 -0
  165. package/eds-shell/eds-shell-header-end.d.ts +11 -0
  166. package/eds-shell/eds-shell-header-end.d.ts.map +1 -0
  167. package/eds-shell/eds-shell-header-end.js +10 -0
  168. package/eds-shell/eds-shell-header-end.js.map +1 -0
  169. package/eds-shell/eds-shell-header-environment.css +21 -0
  170. package/eds-shell/eds-shell-header-environment.d.ts +11 -0
  171. package/eds-shell/eds-shell-header-environment.d.ts.map +1 -0
  172. package/eds-shell/eds-shell-header-environment.js +10 -0
  173. package/eds-shell/eds-shell-header-environment.js.map +1 -0
  174. package/eds-shell/eds-shell-header-logo.css +14 -0
  175. package/eds-shell/eds-shell-header-logo.d.ts +20 -0
  176. package/eds-shell/eds-shell-header-logo.d.ts.map +1 -0
  177. package/eds-shell/eds-shell-header-logo.js +10 -0
  178. package/eds-shell/eds-shell-header-logo.js.map +1 -0
  179. package/eds-shell/eds-shell-header-start.css +5 -0
  180. package/eds-shell/eds-shell-header-start.d.ts +11 -0
  181. package/eds-shell/eds-shell-header-start.d.ts.map +1 -0
  182. package/eds-shell/eds-shell-header-start.js +10 -0
  183. package/eds-shell/eds-shell-header-start.js.map +1 -0
  184. package/eds-shell/eds-shell-header.css +33 -0
  185. package/eds-shell/eds-shell-header.d.ts +25 -0
  186. package/eds-shell/eds-shell-header.d.ts.map +1 -0
  187. package/eds-shell/eds-shell-header.js +14 -0
  188. package/eds-shell/eds-shell-header.js.map +1 -0
  189. package/eds-shell/eds-shell-menu-toggle.css +4 -0
  190. package/eds-shell/eds-shell-menu-toggle.d.ts +16 -0
  191. package/eds-shell/eds-shell-menu-toggle.d.ts.map +1 -0
  192. package/eds-shell/eds-shell-menu-toggle.js +20 -0
  193. package/eds-shell/eds-shell-menu-toggle.js.map +1 -0
  194. package/eds-shell/eds-shell-sidebar-bottom-nav.css +8 -0
  195. package/eds-shell/eds-shell-sidebar-bottom-nav.d.ts +20 -0
  196. package/eds-shell/eds-shell-sidebar-bottom-nav.d.ts.map +1 -0
  197. package/eds-shell/eds-shell-sidebar-bottom-nav.js +11 -0
  198. package/eds-shell/eds-shell-sidebar-bottom-nav.js.map +1 -0
  199. package/eds-shell/eds-shell-sidebar-footer.css +10 -0
  200. package/eds-shell/eds-shell-sidebar-footer.d.ts +10 -0
  201. package/eds-shell/eds-shell-sidebar-footer.d.ts.map +1 -0
  202. package/eds-shell/eds-shell-sidebar-footer.js +10 -0
  203. package/eds-shell/eds-shell-sidebar-footer.js.map +1 -0
  204. package/eds-shell/eds-shell-sidebar-header.css +33 -0
  205. package/eds-shell/eds-shell-sidebar-header.d.ts +16 -0
  206. package/eds-shell/eds-shell-sidebar-header.d.ts.map +1 -0
  207. package/eds-shell/eds-shell-sidebar-header.js +10 -0
  208. package/eds-shell/eds-shell-sidebar-header.js.map +1 -0
  209. package/eds-shell/eds-shell-sidebar-nav.css +9 -0
  210. package/eds-shell/eds-shell-sidebar-nav.d.ts +20 -0
  211. package/eds-shell/eds-shell-sidebar-nav.d.ts.map +1 -0
  212. package/eds-shell/eds-shell-sidebar-nav.js +11 -0
  213. package/eds-shell/eds-shell-sidebar-nav.js.map +1 -0
  214. package/eds-shell/eds-shell-sidebar.css +5 -0
  215. package/eds-shell/eds-shell-sidebar.d.ts +25 -0
  216. package/eds-shell/eds-shell-sidebar.d.ts.map +1 -0
  217. package/eds-shell/eds-shell-sidebar.js +15 -0
  218. package/eds-shell/eds-shell-sidebar.js.map +1 -0
  219. package/eds-shell/eds-shell-toolbar-app.css +23 -0
  220. package/eds-shell/eds-shell-toolbar-app.d.ts +16 -0
  221. package/eds-shell/eds-shell-toolbar-app.d.ts.map +1 -0
  222. package/eds-shell/eds-shell-toolbar-app.js +11 -0
  223. package/eds-shell/eds-shell-toolbar-app.js.map +1 -0
  224. package/eds-shell/eds-shell-toolbar-center.css +6 -0
  225. package/eds-shell/eds-shell-toolbar-center.d.ts +11 -0
  226. package/eds-shell/eds-shell-toolbar-center.d.ts.map +1 -0
  227. package/eds-shell/eds-shell-toolbar-center.js +10 -0
  228. package/eds-shell/eds-shell-toolbar-center.js.map +1 -0
  229. package/eds-shell/eds-shell-toolbar-end.css +23 -0
  230. package/eds-shell/eds-shell-toolbar-end.d.ts +11 -0
  231. package/eds-shell/eds-shell-toolbar-end.d.ts.map +1 -0
  232. package/eds-shell/eds-shell-toolbar-end.js +10 -0
  233. package/eds-shell/eds-shell-toolbar-end.js.map +1 -0
  234. package/eds-shell/eds-shell-toolbar-environment.css +21 -0
  235. package/eds-shell/eds-shell-toolbar-environment.d.ts +11 -0
  236. package/eds-shell/eds-shell-toolbar-environment.d.ts.map +1 -0
  237. package/eds-shell/eds-shell-toolbar-environment.js +10 -0
  238. package/eds-shell/eds-shell-toolbar-environment.js.map +1 -0
  239. package/eds-shell/eds-shell-toolbar-logo.css +11 -0
  240. package/eds-shell/eds-shell-toolbar-logo.d.ts +8 -0
  241. package/eds-shell/eds-shell-toolbar-logo.d.ts.map +1 -0
  242. package/eds-shell/eds-shell-toolbar-logo.js +10 -0
  243. package/eds-shell/eds-shell-toolbar-logo.js.map +1 -0
  244. package/eds-shell/eds-shell-toolbar-start.css +5 -0
  245. package/eds-shell/eds-shell-toolbar-start.d.ts +11 -0
  246. package/eds-shell/eds-shell-toolbar-start.d.ts.map +1 -0
  247. package/eds-shell/eds-shell-toolbar-start.js +10 -0
  248. package/eds-shell/eds-shell-toolbar-start.js.map +1 -0
  249. package/eds-shell/eds-shell-toolbar.css +37 -0
  250. package/eds-shell/eds-shell-toolbar.d.ts +27 -0
  251. package/eds-shell/eds-shell-toolbar.d.ts.map +1 -0
  252. package/eds-shell/eds-shell-toolbar.js +12 -0
  253. package/eds-shell/eds-shell-toolbar.js.map +1 -0
  254. package/eds-shell/eds-shell-top-message.css +48 -0
  255. package/eds-shell/eds-shell-top-message.d.ts +22 -0
  256. package/eds-shell/eds-shell-top-message.d.ts.map +1 -0
  257. package/eds-shell/eds-shell-top-message.js +24 -0
  258. package/eds-shell/eds-shell-top-message.js.map +1 -0
  259. package/eds-shell/eds-shell.css +105 -0
  260. package/eds-shell/eds-shell.d.ts +41 -0
  261. package/eds-shell/eds-shell.d.ts.map +1 -0
  262. package/eds-shell/eds-shell.js +116 -0
  263. package/eds-shell/eds-shell.js.map +1 -0
  264. package/eds-shell/index.d.ts +50 -0
  265. package/eds-shell/index.d.ts.map +1 -0
  266. package/eds-shell/index.js +25 -0
  267. package/eds-shell/index.js.map +1 -0
  268. package/eds-tag/eds-tag.css +83 -0
  269. package/eds-tag/eds-tag.d.ts +29 -0
  270. package/eds-tag/eds-tag.d.ts.map +1 -0
  271. package/eds-tag/eds-tag.js +14 -0
  272. package/eds-tag/eds-tag.js.map +1 -0
  273. package/eds-tag/index.d.ts +3 -0
  274. package/eds-tag/index.d.ts.map +1 -0
  275. package/eds-tag/index.js +2 -0
  276. package/eds-tag/index.js.map +1 -0
  277. package/eds-tooltip/eds-tooltip.css +140 -0
  278. package/eds-tooltip/eds-tooltip.d.ts +53 -0
  279. package/eds-tooltip/eds-tooltip.d.ts.map +1 -0
  280. package/eds-tooltip/eds-tooltip.js +179 -0
  281. package/eds-tooltip/eds-tooltip.js.map +1 -0
  282. package/eds-tooltip/index.d.ts +3 -0
  283. package/eds-tooltip/index.d.ts.map +1 -0
  284. package/eds-tooltip/index.js +2 -0
  285. package/eds-tooltip/index.js.map +1 -0
  286. package/index.d.ts +42 -0
  287. package/index.d.ts.map +1 -0
  288. package/index.js +29 -0
  289. package/index.js.map +1 -0
  290. package/package.json +105 -0
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ export interface EdsAvatarTextProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ /** Text / initials rendered inside the avatar (`<ng-content/>` → `{children}`). */
4
+ children?: React.ReactNode;
5
+ }
6
+ /**
7
+ * `EdsAvatarText` — pure React port of the Angular `eds-avatar-text`.
8
+ *
9
+ * Renders initials or short text inside the avatar surface. Pure content projection carrying
10
+ * the `.eds-avatar-text` class; its color / font-size come from the avatar's `--_color` /
11
+ * `--_font-size` privates set on the `.eds-avatar` ancestor.
12
+ */
13
+ export declare const EdsAvatarText: React.ForwardRefExoticComponent<EdsAvatarTextProps & React.RefAttributes<HTMLSpanElement>>;
14
+ //# sourceMappingURL=eds-avatar-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-avatar-text.d.ts","sourceRoot":"","sources":["../../src/eds-avatar/eds-avatar-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC7E,mFAAmF;IACnF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,4FAaxB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ /**
4
+ * `EdsAvatarText` — pure React port of the Angular `eds-avatar-text`.
5
+ *
6
+ * Renders initials or short text inside the avatar surface. Pure content projection carrying
7
+ * the `.eds-avatar-text` class; its color / font-size come from the avatar's `--_color` /
8
+ * `--_font-size` privates set on the `.eds-avatar` ancestor.
9
+ */
10
+ export const EdsAvatarText = React.forwardRef(function EdsAvatarText({ children, className, ...rest }, ref) {
11
+ return (_jsx("span", { ref: ref, className: className ? `eds-avatar-text ${className}` : 'eds-avatar-text', ...rest, children: children }));
12
+ });
13
+ //# sourceMappingURL=eds-avatar-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-avatar-text.js","sourceRoot":"","sources":["../../src/eds-avatar/eds-avatar-text.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAAsC,SAAS,aAAa,CACrG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAChC,GAAG;IAEH,OAAO,CACH,eACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC,CAAC,iBAAiB,KACrE,IAAI,YAEP,QAAQ,GACN,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
@@ -0,0 +1,128 @@
1
+ /* Pure-React port of eds-avatar.scss (attribute-scoped light-DOM CSS). */
2
+
3
+ .eds-avatar {
4
+ /* surface channels consumed by projected sub-components (icon/text) */
5
+ --_surface: var(--eds-c-surface-neutral-subtler);
6
+ --_on-surface: var(--eds-c-on-surface-neutral-subtler);
7
+
8
+ /* default size = m */
9
+ --_size: var(--eds-si-4xl);
10
+ --_icon-size: var(--eds-is-m);
11
+ --_font-size: var(--eds-f-s-xl);
12
+
13
+ display: inline-flex;
14
+ position: relative;
15
+ align-items: center;
16
+ gap: var(--eds-sp-s);
17
+ border-radius: var(--eds-br-full);
18
+ }
19
+
20
+ .eds-avatar .eds-avatar-wrapper {
21
+ display: inline-flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+ border-radius: var(--eds-br-full);
25
+ background-color: var(--_surface);
26
+ color: var(--_on-surface);
27
+ height: var(--_size);
28
+ width: var(--_size);
29
+ position: relative;
30
+ }
31
+
32
+ /* SIZE VARIANTS
33
+ ------------- */
34
+
35
+ .eds-avatar[data-size="2xs"] {
36
+ --_size: var(--eds-si-m);
37
+ --_icon-size: var(--eds-is-2xs);
38
+ --_font-size: var(--eds-f-s-xs);
39
+ }
40
+ .eds-avatar[data-size="xs"] {
41
+ --_size: var(--eds-si-xl);
42
+ --_icon-size: var(--eds-is-xs);
43
+ --_font-size: var(--eds-f-s-s);
44
+ }
45
+ .eds-avatar[data-size="s"] {
46
+ --_size: var(--eds-si-3xl);
47
+ --_icon-size: var(--eds-is-s);
48
+ --_font-size: var(--eds-f-s-l);
49
+ }
50
+ .eds-avatar[data-size="m"] {
51
+ --_size: var(--eds-si-4xl);
52
+ --_icon-size: var(--eds-is-m);
53
+ --_font-size: var(--eds-f-s-xl);
54
+ }
55
+ .eds-avatar[data-size="l"] {
56
+ --_size: var(--eds-si-6xl);
57
+ --_icon-size: var(--eds-is-l);
58
+ --_font-size: var(--eds-f-s-2xl);
59
+ }
60
+ .eds-avatar[data-size="xl"] {
61
+ --_size: var(--eds-si-9xl);
62
+ --_icon-size: var(--eds-is-xl);
63
+ --_font-size: var(--eds-f-s-4xl);
64
+ }
65
+
66
+ /* COLOR PALETTE VARIANTS (expanded from base.$color-cm-map)
67
+ -------------------------------------------------------- */
68
+
69
+ .eds-avatar[data-color="cm-blue-navy"] {
70
+ --_surface: var(--eds-c-surface-cm-blue-navy-subtler);
71
+ --_on-surface: var(--eds-c-on-surface-cm-blue-navy-subtler);
72
+ }
73
+ .eds-avatar[data-color="cm-blue-electric"] {
74
+ --_surface: var(--eds-c-surface-cm-blue-electric-subtler);
75
+ --_on-surface: var(--eds-c-on-surface-cm-blue-electric-subtler);
76
+ }
77
+ .eds-avatar[data-color="cm-blue-ocean"] {
78
+ --_surface: var(--eds-c-surface-cm-blue-ocean-subtler);
79
+ --_on-surface: var(--eds-c-on-surface-cm-blue-ocean-subtler);
80
+ }
81
+ .eds-avatar[data-color="cm-green"] {
82
+ --_surface: var(--eds-c-surface-cm-green-subtler);
83
+ --_on-surface: var(--eds-c-on-surface-cm-green-subtler);
84
+ }
85
+ .eds-avatar[data-color="cm-green-dark"] {
86
+ --_surface: var(--eds-c-surface-cm-green-dark-subtler);
87
+ --_on-surface: var(--eds-c-on-surface-cm-green-dark-subtler);
88
+ }
89
+ .eds-avatar[data-color="cm-orange"] {
90
+ --_surface: var(--eds-c-surface-cm-orange-subtler);
91
+ --_on-surface: var(--eds-c-on-surface-cm-orange-subtler);
92
+ }
93
+ .eds-avatar[data-color="cm-purple"] {
94
+ --_surface: var(--eds-c-surface-cm-purple-subtler);
95
+ --_on-surface: var(--eds-c-on-surface-cm-purple-subtler);
96
+ }
97
+ .eds-avatar[data-color="cm-green-lemon"] {
98
+ --_surface: var(--eds-c-surface-cm-green-lemon-subtler);
99
+ --_on-surface: var(--eds-c-on-surface-cm-green-lemon-subtler);
100
+ }
101
+ .eds-avatar[data-color="cm-green-pine"] {
102
+ --_surface: var(--eds-c-surface-cm-green-pine-subtler);
103
+ --_on-surface: var(--eds-c-on-surface-cm-green-pine-subtler);
104
+ }
105
+ .eds-avatar[data-color="cm-red-crayola"] {
106
+ --_surface: var(--eds-c-surface-cm-red-crayola-subtler);
107
+ --_on-surface: var(--eds-c-on-surface-cm-red-crayola-subtler);
108
+ }
109
+ .eds-avatar[data-color="cm-yellow-gold"] {
110
+ --_surface: var(--eds-c-surface-cm-yellow-gold-subtler);
111
+ --_on-surface: var(--eds-c-on-surface-cm-yellow-gold-subtler);
112
+ }
113
+ .eds-avatar[data-color="cm-orange-abricot"] {
114
+ --_surface: var(--eds-c-surface-cm-orange-abricot-subtler);
115
+ --_on-surface: var(--eds-c-on-surface-cm-orange-abricot-subtler);
116
+ }
117
+ .eds-avatar[data-color="cm-purple-violet"] {
118
+ --_surface: var(--eds-c-surface-cm-purple-violet-subtler);
119
+ --_on-surface: var(--eds-c-on-surface-cm-purple-violet-subtler);
120
+ }
121
+ .eds-avatar[data-color="cm-red-tomato"] {
122
+ --_surface: var(--eds-c-surface-cm-red-tomato-subtler);
123
+ --_on-surface: var(--eds-c-on-surface-cm-red-tomato-subtler);
124
+ }
125
+ .eds-avatar[data-color="cm-warm-grey"] {
126
+ --_surface: var(--eds-c-surface-cm-warm-grey-subtler);
127
+ --_on-surface: var(--eds-c-on-surface-cm-warm-grey-subtler);
128
+ }
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ /** Local narrowed size union — the avatar's size contract (ported 1:1 from Angular `eds-avatar`). */
3
+ export type EdsAvatarSize = '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl';
4
+ export interface EdsAvatarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {
5
+ /** Data attribute for E2E testing. @default 'eds-avatar' */
6
+ e2eAttr?: string;
7
+ /** Size of the avatar. @default 'm' */
8
+ size?: EdsAvatarSize;
9
+ /**
10
+ * ARIA label for accessibility. When `null`/omitted no `aria-label` is rendered — ensure
11
+ * visible text or an explicit label is provided. @default null
12
+ */
13
+ ariaLabel?: string | null;
14
+ /**
15
+ * Extra color palette applied to the avatar surface (maps to an EDS color palette, e.g.
16
+ * `info`, `success`, or a `cm-*` palette). Empty string uses the default neutral surface.
17
+ * @default ''
18
+ */
19
+ color?: string;
20
+ /**
21
+ * Avatar content — the surface slots (`EdsAvatarIcon` / `EdsAvatarText` / `EdsAvatarImage`
22
+ * / `EdsAvatarBadge`) rendered inside the round wrapper, plus an optional `EdsAvatarContent`
23
+ * rendered beside it. Mirrors the Angular `<ng-content select="…">` split.
24
+ */
25
+ children?: React.ReactNode;
26
+ }
27
+ /**
28
+ * `EdsAvatar` — pure React port of the Angular `eds-avatar`.
29
+ *
30
+ * A round identity surface with a color palette and six sizes, holding a projected icon /
31
+ * text / image and an optional overlay badge, plus an optional label column beside it. The
32
+ * Angular template splits projection into a round `.eds-avatar-wrapper` (icon / text / image
33
+ * / badge) and a sibling content slot (`eds-avatar-content`); here `children` are split by
34
+ * element type into the same two regions. `size` / `color` reflect as `data-*`; `data-image`
35
+ * is set when an `EdsAvatarImage` is present (mirroring the Angular `contentChild` query).
36
+ */
37
+ export declare const EdsAvatar: React.ForwardRefExoticComponent<EdsAvatarProps & React.RefAttributes<HTMLDivElement>>;
38
+ //# sourceMappingURL=eds-avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-avatar.d.ts","sourceRoot":"","sources":["../../src/eds-avatar/eds-avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,qGAAqG;AACrG,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACvF,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAcD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,uFAoCpB,CAAC"}
@@ -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"}