@ebrains/components 0.3.0-alpha.0 → 0.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (550) hide show
  1. package/dist/cjs/analytics-223ea8e5.js +51 -0
  2. package/dist/cjs/color-c00146a8.js +134 -0
  3. package/dist/cjs/color-primary-palette_6.cjs.entry.js +14 -14
  4. package/dist/cjs/components.cjs.js +1 -1
  5. package/dist/cjs/correct-use-of-colors.cjs.entry.js +1 -1
  6. package/dist/cjs/eds-accordion.cjs.entry.js +11 -20
  7. package/dist/cjs/{eds-avatar_17.cjs.entry.js → eds-alert_17.cjs.entry.js} +310 -372
  8. package/dist/cjs/{eds-card-desc_3.cjs.entry.js → eds-avatar_4.cjs.entry.js} +73 -3
  9. package/dist/cjs/eds-card-generic.cjs.entry.js +4 -5
  10. package/dist/cjs/eds-card-project.cjs.entry.js +4 -3
  11. package/dist/cjs/eds-card-section.cjs.entry.js +3 -3
  12. package/dist/cjs/eds-card-tags.cjs.entry.js +1 -1
  13. package/dist/cjs/eds-card-tool.cjs.entry.js +3 -4
  14. package/dist/cjs/eds-card-wrapper.cjs.entry.js +1 -1
  15. package/dist/cjs/eds-code-block.cjs.entry.js +49 -2
  16. package/dist/cjs/eds-components-section.cjs.entry.js +7 -3
  17. package/dist/cjs/eds-docs-palettes.cjs.entry.js +1 -1
  18. package/dist/cjs/eds-docs-tokens.cjs.entry.js +1 -1
  19. package/dist/cjs/eds-dropdown_2.cjs.entry.js +158 -0
  20. package/dist/cjs/eds-form.cjs.entry.js +62 -23
  21. package/dist/cjs/eds-frame.cjs.entry.js +1 -1
  22. package/dist/cjs/eds-icon-arrow-diagonal.cjs.entry.js +1 -1
  23. package/dist/cjs/eds-icon-arrow-right.cjs.entry.js +1 -1
  24. package/dist/cjs/eds-icon-bluesky.cjs.entry.js +1 -1
  25. package/dist/cjs/eds-icon-chevron-down.cjs.entry.js +1 -1
  26. package/dist/cjs/eds-icon-chevron-left.cjs.entry.js +1 -1
  27. package/dist/cjs/eds-icon-chevron-right.cjs.entry.js +1 -1
  28. package/dist/cjs/eds-icon-chevron-up.cjs.entry.js +1 -1
  29. package/dist/cjs/eds-icon-close.cjs.entry.js +1 -1
  30. package/dist/cjs/eds-icon-copy.cjs.entry.js +1 -1
  31. package/dist/cjs/eds-icon-eu.cjs.entry.js +1 -1
  32. package/dist/cjs/eds-icon-facebook.cjs.entry.js +1 -1
  33. package/dist/cjs/eds-icon-gitlab.cjs.entry.js +1 -1
  34. package/dist/cjs/eds-icon-linkedin.cjs.entry.js +1 -1
  35. package/dist/cjs/eds-icon-loader.cjs.entry.js +1 -1
  36. package/dist/cjs/eds-icon-mastodon.cjs.entry.js +1 -1
  37. package/dist/cjs/eds-icon-menu.cjs.entry.js +1 -1
  38. package/dist/cjs/eds-icon-more.cjs.entry.js +1 -1
  39. package/dist/cjs/eds-icon-search.cjs.entry.js +1 -1
  40. package/dist/cjs/eds-icon-success.cjs.entry.js +1 -1
  41. package/dist/cjs/eds-icon-twitter.cjs.entry.js +1 -1
  42. package/dist/cjs/eds-icon-user.cjs.entry.js +1 -1
  43. package/dist/cjs/eds-icon-youtube.cjs.entry.js +1 -1
  44. package/dist/cjs/eds-input_7.cjs.entry.js +18 -10
  45. package/dist/cjs/eds-login.cjs.entry.js +60 -41
  46. package/dist/cjs/eds-logo-variations.cjs.entry.js +1 -1
  47. package/dist/cjs/eds-matomo-notice.cjs.entry.js +2 -3
  48. package/dist/cjs/eds-modal.cjs.entry.js +49 -38
  49. package/dist/cjs/eds-navigator.cjs.entry.js +1 -1
  50. package/dist/cjs/eds-pagination_2.cjs.entry.js +34 -17
  51. package/dist/cjs/eds-progress-bar.cjs.entry.js +1 -1
  52. package/dist/cjs/eds-section-core_2.cjs.entry.js +3 -3
  53. package/dist/cjs/eds-svg-repository.cjs.entry.js +1 -1
  54. package/dist/cjs/eds-tab.cjs.entry.js +1 -1
  55. package/dist/cjs/eds-tabs-content.cjs.entry.js +4 -4
  56. package/dist/cjs/eds-tabs.cjs.entry.js +3 -3
  57. package/dist/cjs/eds-timeline.cjs.entry.js +3 -2
  58. package/dist/cjs/eds-tooltip.cjs.entry.js +10 -1
  59. package/dist/cjs/eds-trl.cjs.entry.js +7 -8
  60. package/dist/cjs/eds-user.cjs.entry.js +99 -0
  61. package/dist/cjs/eds-vertical-stepper.cjs.entry.js +45 -0
  62. package/dist/cjs/incorrect-use-of-colors.cjs.entry.js +1 -1
  63. package/dist/cjs/index-f08e4f5c.js +16 -12
  64. package/dist/cjs/{keycloak-5aaa21af.js → keycloak-93fc0315.js} +225 -170
  65. package/dist/cjs/loader.cjs.js +1 -1
  66. package/dist/cjs/logo-space.cjs.entry.js +1 -1
  67. package/dist/cjs/logo-variations-horizontal_2.cjs.entry.js +2 -2
  68. package/dist/cjs/logo-wrong-usage.cjs.entry.js +1 -1
  69. package/dist/cjs/token-list_3.cjs.entry.js +3 -3
  70. package/dist/cjs/token-ratios.cjs.entry.js +1 -1
  71. package/dist/cjs/token-spacing.cjs.entry.js +1 -1
  72. package/dist/cjs/token-typography.cjs.entry.js +1 -1
  73. package/dist/collection/collection-manifest.json +5 -2
  74. package/dist/collection/components/eds-accordion/eds-accordion.js +11 -20
  75. package/dist/collection/components/eds-alert/eds-alert.js +9 -8
  76. package/dist/collection/components/eds-alert/eds-alert.stories.js +4 -4
  77. package/dist/collection/components/eds-avatar/eds-avatar.js +8 -6
  78. package/dist/collection/components/eds-avatar/eds-avatar.stories.js +24 -22
  79. package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
  80. package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +23 -28
  81. package/dist/collection/components/eds-button/eds-button.js +20 -25
  82. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +9 -1
  83. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.js +1 -1
  84. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +1 -1
  85. package/dist/collection/components/eds-cards/eds-card-composer/eds-card-wrapper/eds-card-wrapper.js +1 -1
  86. package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.js +15 -9
  87. package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.stories.js +1 -1
  88. package/dist/collection/components/eds-cards/eds-card-project/eds-card-project.js +3 -2
  89. package/dist/collection/components/eds-cards/eds-card-tool/eds-card-tool.js +2 -2
  90. package/dist/collection/components/eds-code-block/eds-code-block.js +58 -3
  91. package/dist/collection/components/eds-code-block/eds-code-block.stories.js +78 -0
  92. package/dist/collection/components/eds-dropdown/eds-dropdown.js +11 -21
  93. package/dist/collection/components/eds-form/eds-form.js +71 -45
  94. package/dist/collection/components/eds-form/eds-form.stories.js +0 -3
  95. package/dist/collection/components/eds-frame/eds-frame.js +1 -1
  96. package/dist/collection/components/eds-frame/eds-frame.stories.js +19 -18
  97. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-down/eds-icon-chevron-down.js +1 -1
  98. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-left/eds-icon-chevron-left.js +1 -1
  99. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-right/eds-icon-chevron-right.js +1 -1
  100. package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-up/eds-icon-chevron-up.js +1 -1
  101. package/dist/collection/components/eds-icons/eds-icon-arrow-diagonal/eds-icon-arrow-diagonal.js +1 -1
  102. package/dist/collection/components/eds-icons/eds-icon-arrow-right/eds-icon-arrow-right.js +1 -1
  103. package/dist/collection/components/eds-icons/eds-icon-close/eds-icon-close.js +1 -1
  104. package/dist/collection/components/eds-icons/eds-icon-copy/eds-icon-copy.js +1 -1
  105. package/dist/collection/components/eds-icons/eds-icon-eu/eds-icon-eu.js +1 -1
  106. package/dist/collection/components/eds-icons/eds-icon-gitlab/eds-icon-gitlab.js +1 -1
  107. package/dist/collection/components/eds-icons/eds-icon-loader/eds-icon-loader.js +1 -1
  108. package/dist/collection/components/eds-icons/eds-icon-menu/eds-icon-menu.js +1 -1
  109. package/dist/collection/components/eds-icons/eds-icon-more/eds-icon-more.js +1 -1
  110. package/dist/collection/components/eds-icons/eds-icon-search/eds-icon-search.js +1 -1
  111. package/dist/collection/components/eds-icons/eds-icon-success/eds-icon-success.js +1 -1
  112. package/dist/collection/components/eds-icons/eds-icon-user/eds-icon-user.js +1 -1
  113. package/dist/collection/components/eds-icons/social/eds-icon-bluesky/eds-icon-bluesky.js +1 -1
  114. package/dist/collection/components/eds-icons/social/eds-icon-facebook/eds-icon-facebook.js +1 -1
  115. package/dist/collection/components/eds-icons/social/eds-icon-linkedin/eds-icon-linkedin.js +1 -1
  116. package/dist/collection/components/eds-icons/social/eds-icon-mastodon/eds-icon-mastodon.js +1 -1
  117. package/dist/collection/components/eds-icons/social/eds-icon-twitter/eds-icon-twitter.js +1 -1
  118. package/dist/collection/components/eds-icons/social/eds-icon-youtube/eds-icon-youtube.js +1 -1
  119. package/dist/collection/components/eds-img/eds-img.js +13 -7
  120. package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +2 -2
  121. package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.js +1 -1
  122. package/dist/collection/components/eds-input-elements/eds-input-label/eds-input-label.js +1 -1
  123. package/dist/collection/components/eds-input-elements/eds-input-range/eds-input-range.js +2 -2
  124. package/dist/collection/components/eds-input-elements/eds-input-search/eds-input-search.js +1 -1
  125. package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +14 -2
  126. package/dist/collection/components/eds-input-field/eds-input-field.js +2 -2
  127. package/dist/collection/components/eds-link/eds-link.js +8 -6
  128. package/dist/collection/components/eds-logo/eds-logo.js +21 -2
  129. package/dist/collection/components/eds-modal/eds-modal.css +16 -0
  130. package/dist/collection/components/eds-modal/eds-modal.js +75 -38
  131. package/dist/collection/components/eds-modal/eds-modal.stories.js +34 -18
  132. package/dist/collection/components/eds-navigator/eds-navigator.js +1 -1
  133. package/dist/collection/components/eds-pagination/eds-pagination.js +13 -9
  134. package/dist/collection/components/eds-progress-bar/eds-progress-bar.js +1 -1
  135. package/dist/collection/components/eds-rating/eds-rating.css +48 -0
  136. package/dist/collection/components/eds-rating/eds-rating.js +14 -14
  137. package/dist/collection/components/eds-section/eds-section-core/eds-section-core.js +1 -1
  138. package/dist/collection/components/eds-section/eds-section-core/eds-section-core.stories.js +12 -11
  139. package/dist/collection/components/eds-section/eds-section-heading/eds-section-heading.js +2 -2
  140. package/dist/collection/components/eds-steps/eds-steps.css +71 -0
  141. package/dist/collection/components/eds-steps/eds-steps.js +132 -0
  142. package/dist/collection/components/eds-steps/eds-steps.stories.js +35 -0
  143. package/dist/collection/components/eds-steps/eds-vertical-stepper.css +78 -0
  144. package/dist/collection/components/eds-steps/eds-vertical-stepper.js +72 -0
  145. package/dist/collection/components/eds-switch/eds-switch.css +59 -0
  146. package/dist/collection/components/eds-switch/eds-switch.js +131 -0
  147. package/dist/collection/components/eds-switch/eds-switch.stories.js +38 -0
  148. package/dist/collection/components/eds-tab/eds-tab.js +1 -1
  149. package/dist/collection/components/eds-table/eds-table.js +21 -8
  150. package/dist/collection/components/eds-tag/eds-tag.js +22 -1
  151. package/dist/collection/components/eds-timeline/eds-timeline.js +3 -2
  152. package/dist/collection/components/eds-toast/eds-toast.js +22 -1
  153. package/dist/collection/components/eds-tooltip/eds-tooltip.js +10 -1
  154. package/dist/collection/components/eds-trl/eds-trl.js +7 -8
  155. package/dist/collection/eds-docs-ui/colors/color-palette/primary.js +1 -1
  156. package/dist/collection/eds-docs-ui/colors/color-palette/secondary.js +1 -1
  157. package/dist/collection/eds-docs-ui/colors/color-palette/support.js +1 -1
  158. package/dist/collection/eds-docs-ui/colors/gradient-palette/primary.js +1 -1
  159. package/dist/collection/eds-docs-ui/colors/gradient-palette/secondary.js +7 -7
  160. package/dist/collection/eds-docs-ui/colors/gradient-palette/support.js +3 -3
  161. package/dist/collection/eds-docs-ui/colors/use-of-colors/correct-use-of-colors.js +1 -1
  162. package/dist/collection/eds-docs-ui/colors/use-of-colors/incorrect-use-of-colors.js +1 -1
  163. package/dist/collection/eds-docs-ui/design-tokens/token-list/token-list.js +1 -1
  164. package/dist/collection/eds-docs-ui/design-tokens/token-radii/token-radii.js +1 -1
  165. package/dist/collection/eds-docs-ui/design-tokens/token-ratios/token-ratios.js +1 -1
  166. package/dist/collection/eds-docs-ui/design-tokens/token-shadows/token-shadows.js +1 -1
  167. package/dist/collection/eds-docs-ui/design-tokens/token-spacing/token-spacing.js +1 -1
  168. package/dist/collection/eds-docs-ui/design-tokens/token-typography/token-typography.js +1 -1
  169. package/dist/collection/eds-docs-ui/eds-components-section/eds-components-section.js +1 -1
  170. package/dist/collection/eds-docs-ui/eds-docs-palettes/eds-docs-palettes.js +1 -1
  171. package/dist/collection/eds-docs-ui/eds-docs-tokens/eds-docs-tokens.js +1 -1
  172. package/dist/collection/eds-docs-ui/eds-logo-variations/eds-logo-variations.js +1 -1
  173. package/dist/collection/eds-docs-ui/eds-svg-repository/eds-svg-repository.js +1 -1
  174. package/dist/collection/eds-docs-ui/functional/installation.js +1 -1
  175. package/dist/collection/eds-docs-ui/functional/react.js +1 -1
  176. package/dist/collection/eds-docs-ui/logo/logo-space/logo-space.js +1 -1
  177. package/dist/collection/eds-docs-ui/logo/logo-variations/horizontal/logo-variations-horizontal.js +1 -1
  178. package/dist/collection/eds-docs-ui/logo/logo-variations/vertical/logo-variations-vertical.js +1 -1
  179. package/dist/collection/eds-docs-ui/logo/logo-wrong-usage/logo-wrong-usage.js +1 -1
  180. package/dist/collection/shared-ui/eds-card-section/eds-card-section.js +14 -7
  181. package/dist/collection/shared-ui/eds-card-section/eds-card-section.stories.js +8 -39
  182. package/dist/collection/shared-ui/eds-footer/eds-footer.js +1 -1
  183. package/dist/collection/shared-ui/eds-header/eds-header.js +2 -75
  184. package/dist/collection/shared-ui/eds-login/eds-login.js +66 -58
  185. package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.js +1 -1
  186. package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.js +1 -1
  187. package/dist/collection/shared-ui/eds-tabs/eds-tabs.js +2 -2
  188. package/dist/collection/shared-ui/eds-tabs-content/eds-tabs-content.js +3 -3
  189. package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.js +1 -1
  190. package/dist/collection/shared-ui/eds-user/eds-user.js +27 -24
  191. package/dist/collection/shared-ui/eds-user-modal/eds-user-modal.js +1 -1
  192. package/dist/collection/utils/analytics.js +85 -0
  193. package/dist/collection/utils/color.js +129 -0
  194. package/dist/collection/utils/global.js +8 -0
  195. package/dist/collection/utils/keycloak.js +11 -5
  196. package/dist/components/analytics.js +6 -1
  197. package/dist/components/color.js +0 -164
  198. package/dist/components/components.css +63 -0
  199. package/dist/components/components.esm.js +1 -1
  200. package/dist/components/correct-use-of-colors.js +1 -1
  201. package/dist/components/eds-accordion2.js +11 -20
  202. package/dist/components/eds-alert2.js +9 -8
  203. package/dist/components/eds-avatar2.js +3 -3
  204. package/dist/components/eds-block-break2.js +1 -1
  205. package/dist/components/eds-breadcrumb.js +23 -28
  206. package/dist/components/eds-button2.js +16 -14
  207. package/dist/components/eds-card-desc2.js +1 -1
  208. package/dist/components/eds-card-generic2.js +3 -4
  209. package/dist/components/eds-card-project.js +2 -2
  210. package/dist/components/eds-card-section.js +3 -3
  211. package/dist/components/eds-card-tags.js +1 -1
  212. package/dist/components/eds-card-title2.js +1 -1
  213. package/dist/components/eds-card-tool.js +1 -2
  214. package/dist/components/eds-card-wrapper.js +1 -1
  215. package/dist/components/eds-code-block2.js +49 -2
  216. package/dist/components/eds-components-section.js +7 -3
  217. package/dist/components/eds-docs-palettes.js +1 -1
  218. package/dist/components/eds-docs-tokens.js +1 -1
  219. package/dist/components/eds-dropdown2.js +11 -21
  220. package/dist/components/eds-footer2.js +1 -1
  221. package/dist/components/eds-form.js +67 -26
  222. package/dist/components/eds-frame.js +1 -1
  223. package/dist/components/eds-header.js +10 -48
  224. package/dist/components/eds-icon-arrow-diagonal.js +1 -1
  225. package/dist/components/eds-icon-arrow-right.js +1 -1
  226. package/dist/components/eds-icon-bluesky.js +1 -1
  227. package/dist/components/eds-icon-chevron-down.js +1 -1
  228. package/dist/components/eds-icon-chevron-left.js +1 -1
  229. package/dist/components/eds-icon-chevron-right.js +1 -1
  230. package/dist/components/eds-icon-chevron-up.js +1 -1
  231. package/dist/components/eds-icon-close.js +1 -1
  232. package/dist/components/eds-icon-copy.js +1 -1
  233. package/dist/components/eds-icon-eu.js +1 -1
  234. package/dist/components/eds-icon-facebook.js +1 -1
  235. package/dist/components/eds-icon-gitlab.js +1 -1
  236. package/dist/components/eds-icon-linkedin.js +1 -1
  237. package/dist/components/eds-icon-loader.js +1 -1
  238. package/dist/components/eds-icon-mastodon.js +1 -1
  239. package/dist/components/eds-icon-menu.js +1 -1
  240. package/dist/components/eds-icon-more.js +1 -1
  241. package/dist/components/eds-icon-search.js +1 -1
  242. package/dist/components/eds-icon-success.js +1 -1
  243. package/dist/components/eds-icon-twitter.js +1 -1
  244. package/dist/components/eds-icon-user.js +1 -1
  245. package/dist/components/eds-icon-youtube.js +1 -1
  246. package/dist/components/eds-img2.js +9 -4
  247. package/dist/components/eds-input-field2.js +2 -2
  248. package/dist/components/eds-input-footer2.js +1 -1
  249. package/dist/components/eds-input-label2.js +1 -1
  250. package/dist/components/eds-input-range2.js +2 -2
  251. package/dist/components/eds-input-search2.js +1 -1
  252. package/dist/components/eds-input-select2.js +11 -2
  253. package/dist/components/eds-input2.js +2 -2
  254. package/dist/components/eds-link2.js +7 -6
  255. package/dist/components/eds-login.js +60 -41
  256. package/dist/components/eds-logo-variations.js +1 -1
  257. package/dist/components/eds-logo2.js +4 -3
  258. package/dist/components/eds-matomo-notice.js +0 -1
  259. package/dist/components/eds-modal.js +51 -39
  260. package/dist/components/eds-navigator.js +1 -1
  261. package/dist/components/eds-pagination2.js +13 -9
  262. package/dist/components/eds-progress-bar2.js +1 -1
  263. package/dist/components/eds-rating.js +25 -13
  264. package/dist/components/eds-section-core2.js +1 -1
  265. package/dist/components/eds-section-heading2.js +2 -2
  266. package/dist/components/eds-social-networks2.js +1 -1
  267. package/dist/components/eds-steps.d.ts +11 -0
  268. package/dist/components/eds-steps.js +106 -0
  269. package/dist/components/eds-svg-repository.js +1 -1
  270. package/dist/components/eds-switch.d.ts +11 -0
  271. package/dist/components/eds-switch.js +57 -0
  272. package/dist/components/eds-tab2.js +1 -1
  273. package/dist/components/eds-table2.js +21 -8
  274. package/dist/components/eds-tabs-content.js +2 -3
  275. package/dist/components/eds-tabs.js +1 -2
  276. package/dist/components/eds-tag2.js +5 -1
  277. package/dist/components/eds-timeline.js +3 -2
  278. package/dist/components/eds-toast-manager.js +1 -1
  279. package/dist/components/eds-toast2.js +22 -1
  280. package/dist/components/eds-tooltip.js +10 -1
  281. package/dist/components/eds-trl.js +7 -8
  282. package/dist/components/eds-user-modal2.js +1 -1
  283. package/dist/components/eds-user.js +157 -1
  284. package/dist/components/eds-vertical-stepper.d.ts +11 -0
  285. package/dist/components/eds-vertical-stepper.js +86 -0
  286. package/dist/components/incorrect-use-of-colors.js +1 -1
  287. package/dist/components/keycloak.js +225 -170
  288. package/dist/components/logo-space.js +1 -1
  289. package/dist/components/logo-variations-horizontal2.js +1 -1
  290. package/dist/components/logo-variations-vertical2.js +1 -1
  291. package/dist/components/logo-wrong-usage.js +1 -1
  292. package/dist/components/p-030f67c1.entry.js +1 -0
  293. package/dist/components/{p-32f282a9.entry.js → p-06299762.entry.js} +1 -1
  294. package/dist/components/p-0ab85eee.entry.js +1 -0
  295. package/dist/components/p-0bafc5ae.entry.js +1 -0
  296. package/dist/components/p-0e0e1815.entry.js +1 -0
  297. package/dist/components/p-0e7bdd2c.entry.js +1 -0
  298. package/dist/components/p-1ed3fdb7.entry.js +1 -0
  299. package/dist/components/p-209fa119.entry.js +1 -0
  300. package/dist/components/p-2831a9d5.entry.js +1 -0
  301. package/dist/components/p-2c00bd76.entry.js +1 -0
  302. package/dist/components/p-38d70586.entry.js +1 -0
  303. package/dist/components/p-3babd772.entry.js +1 -0
  304. package/dist/components/p-4a12a131.entry.js +1 -0
  305. package/dist/components/p-505ddcda.entry.js +1 -0
  306. package/dist/components/{p-52ac3456.entry.js → p-59405ecf.entry.js} +1 -1
  307. package/dist/components/p-5980a142.entry.js +1 -0
  308. package/dist/components/p-599c7b97.entry.js +1 -0
  309. package/dist/components/{p-22762818.entry.js → p-65703520.entry.js} +1 -1
  310. package/dist/components/p-6af40c33.entry.js +1 -0
  311. package/dist/components/p-6df9db15.entry.js +1 -0
  312. package/dist/components/p-72b42d77.entry.js +1 -0
  313. package/dist/components/p-75795b05.entry.js +1 -0
  314. package/dist/components/{p-435a14c1.entry.js → p-759b2640.entry.js} +1 -1
  315. package/dist/components/p-80a185ba.entry.js +1 -0
  316. package/dist/components/p-81942665.entry.js +1 -0
  317. package/dist/components/p-86fbc239.entry.js +1 -0
  318. package/dist/components/p-89227919.js +1 -0
  319. package/dist/components/{p-6fc62452.entry.js → p-89f600a3.entry.js} +1 -1
  320. package/dist/components/{p-2e8459ef.entry.js → p-8b583210.entry.js} +1 -1
  321. package/dist/components/p-8c4a0fc9.entry.js +1 -0
  322. package/dist/components/p-8d19a05b.entry.js +1 -0
  323. package/dist/components/p-8eab748d.js +1 -0
  324. package/dist/components/p-911d9b37.entry.js +1 -0
  325. package/dist/components/p-92e16cc9.entry.js +1 -0
  326. package/dist/components/p-96fe2267.entry.js +1 -0
  327. package/dist/components/p-9739def5.entry.js +1 -0
  328. package/dist/components/p-9826acae.entry.js +1 -0
  329. package/dist/components/{p-87830085.entry.js → p-9b441a1f.entry.js} +1 -1
  330. package/dist/components/p-a2621d66.entry.js +1 -0
  331. package/dist/components/p-a535838c.entry.js +1 -0
  332. package/dist/components/p-a5b7d72d.entry.js +1 -0
  333. package/dist/components/p-a5d00633.entry.js +1 -0
  334. package/dist/components/p-a63bd0c9.entry.js +1 -0
  335. package/dist/components/{p-762c8c83.entry.js → p-a846dbca.entry.js} +1 -1
  336. package/dist/components/p-a927a455.entry.js +1 -0
  337. package/dist/components/p-aec9b8e1.entry.js +1 -0
  338. package/dist/components/{p-e6bfbf51.entry.js → p-b1af5000.entry.js} +2 -2
  339. package/dist/components/{p-d571d530.entry.js → p-b1de9a6c.entry.js} +1 -1
  340. package/dist/components/{p-0910d733.entry.js → p-b3c1aef5.entry.js} +1 -1
  341. package/dist/components/p-b60ed774.entry.js +1 -0
  342. package/dist/components/p-b67aafe7.entry.js +1 -0
  343. package/dist/components/p-b79999d5.entry.js +1 -0
  344. package/dist/components/{p-02e2a62f.entry.js → p-b80457ed.entry.js} +1 -1
  345. package/dist/components/p-b860b4aa.entry.js +1 -0
  346. package/dist/components/p-c034c395.entry.js +1 -0
  347. package/dist/components/p-c5fa170d.entry.js +1 -0
  348. package/dist/components/p-d69ef196.entry.js +1 -0
  349. package/dist/components/p-de12396f.entry.js +1 -0
  350. package/dist/components/p-de2fbcfc.entry.js +1 -0
  351. package/dist/components/p-def72462.entry.js +1 -0
  352. package/dist/components/p-e2c250c5.entry.js +1 -0
  353. package/dist/components/p-eb0b93d5.js +1 -0
  354. package/dist/components/p-eeeb0d83.entry.js +1 -0
  355. package/dist/components/p-f08eac56.entry.js +1 -0
  356. package/dist/components/p-f1cd83da.entry.js +1 -0
  357. package/dist/components/{p-22e6d7d5.entry.js → p-f36f2aeb.entry.js} +1 -1
  358. package/dist/components/p-f5dafbc8.entry.js +1 -0
  359. package/dist/components/p-f7493f41.entry.js +1 -0
  360. package/dist/components/p-fce25541.entry.js +1 -0
  361. package/dist/components/primary.js +1 -1
  362. package/dist/components/primary2.js +1 -1
  363. package/dist/components/secondary.js +1 -1
  364. package/dist/components/secondary2.js +7 -7
  365. package/dist/components/support.js +1 -1
  366. package/dist/components/support2.js +3 -3
  367. package/dist/components/token-list2.js +1 -1
  368. package/dist/components/token-radii2.js +1 -1
  369. package/dist/components/token-ratios.js +1 -1
  370. package/dist/components/token-shadows2.js +1 -1
  371. package/dist/components/token-spacing.js +1 -1
  372. package/dist/components/token-typography.js +1 -1
  373. package/dist/esm/analytics-1cde8e4a.js +48 -0
  374. package/dist/esm/color-2554aad6.js +132 -0
  375. package/dist/esm/color-primary-palette_6.entry.js +14 -14
  376. package/dist/esm/components.js +1 -1
  377. package/dist/esm/correct-use-of-colors.entry.js +1 -1
  378. package/dist/esm/eds-accordion.entry.js +11 -20
  379. package/dist/esm/{eds-avatar_17.entry.js → eds-alert_17.entry.js} +304 -366
  380. package/dist/esm/{eds-card-desc_3.entry.js → eds-avatar_4.entry.js} +73 -4
  381. package/dist/esm/eds-card-generic.entry.js +3 -4
  382. package/dist/esm/eds-card-project.entry.js +3 -2
  383. package/dist/esm/eds-card-section.entry.js +3 -3
  384. package/dist/esm/eds-card-tags.entry.js +1 -1
  385. package/dist/esm/eds-card-tool.entry.js +2 -3
  386. package/dist/esm/eds-card-wrapper.entry.js +1 -1
  387. package/dist/esm/eds-code-block.entry.js +50 -3
  388. package/dist/esm/eds-components-section.entry.js +7 -3
  389. package/dist/esm/eds-docs-palettes.entry.js +1 -1
  390. package/dist/esm/eds-docs-tokens.entry.js +1 -1
  391. package/dist/esm/eds-dropdown_2.entry.js +153 -0
  392. package/dist/esm/eds-form.entry.js +62 -23
  393. package/dist/esm/eds-frame.entry.js +1 -1
  394. package/dist/esm/eds-icon-arrow-diagonal.entry.js +1 -1
  395. package/dist/esm/eds-icon-arrow-right.entry.js +1 -1
  396. package/dist/esm/eds-icon-bluesky.entry.js +1 -1
  397. package/dist/esm/eds-icon-chevron-down.entry.js +1 -1
  398. package/dist/esm/eds-icon-chevron-left.entry.js +1 -1
  399. package/dist/esm/eds-icon-chevron-right.entry.js +1 -1
  400. package/dist/esm/eds-icon-chevron-up.entry.js +1 -1
  401. package/dist/esm/eds-icon-close.entry.js +1 -1
  402. package/dist/esm/eds-icon-copy.entry.js +1 -1
  403. package/dist/esm/eds-icon-eu.entry.js +1 -1
  404. package/dist/esm/eds-icon-facebook.entry.js +1 -1
  405. package/dist/esm/eds-icon-gitlab.entry.js +1 -1
  406. package/dist/esm/eds-icon-linkedin.entry.js +1 -1
  407. package/dist/esm/eds-icon-loader.entry.js +1 -1
  408. package/dist/esm/eds-icon-mastodon.entry.js +1 -1
  409. package/dist/esm/eds-icon-menu.entry.js +1 -1
  410. package/dist/esm/eds-icon-more.entry.js +1 -1
  411. package/dist/esm/eds-icon-search.entry.js +1 -1
  412. package/dist/esm/eds-icon-success.entry.js +1 -1
  413. package/dist/esm/eds-icon-twitter.entry.js +1 -1
  414. package/dist/esm/eds-icon-user.entry.js +1 -1
  415. package/dist/esm/eds-icon-youtube.entry.js +1 -1
  416. package/dist/esm/eds-input_7.entry.js +18 -10
  417. package/dist/esm/eds-login.entry.js +60 -41
  418. package/dist/esm/eds-logo-variations.entry.js +1 -1
  419. package/dist/esm/eds-matomo-notice.entry.js +1 -2
  420. package/dist/esm/eds-modal.entry.js +49 -38
  421. package/dist/esm/eds-navigator.entry.js +1 -1
  422. package/dist/esm/eds-pagination_2.entry.js +34 -17
  423. package/dist/esm/eds-progress-bar.entry.js +1 -1
  424. package/dist/esm/eds-section-core_2.entry.js +3 -3
  425. package/dist/esm/eds-svg-repository.entry.js +1 -1
  426. package/dist/esm/eds-tab.entry.js +1 -1
  427. package/dist/esm/eds-tabs-content.entry.js +3 -3
  428. package/dist/esm/eds-tabs.entry.js +2 -2
  429. package/dist/esm/eds-timeline.entry.js +3 -2
  430. package/dist/esm/eds-tooltip.entry.js +10 -1
  431. package/dist/esm/eds-trl.entry.js +7 -8
  432. package/dist/esm/eds-user.entry.js +95 -0
  433. package/dist/esm/eds-vertical-stepper.entry.js +41 -0
  434. package/dist/esm/incorrect-use-of-colors.entry.js +1 -1
  435. package/dist/esm/index-e96badea.js +16 -12
  436. package/dist/esm/{keycloak-13893af6.js → keycloak-d502ec16.js} +225 -170
  437. package/dist/esm/loader.js +1 -1
  438. package/dist/esm/logo-space.entry.js +1 -1
  439. package/dist/esm/logo-variations-horizontal_2.entry.js +2 -2
  440. package/dist/esm/logo-wrong-usage.entry.js +1 -1
  441. package/dist/esm/token-list_3.entry.js +3 -3
  442. package/dist/esm/token-ratios.entry.js +1 -1
  443. package/dist/esm/token-spacing.entry.js +1 -1
  444. package/dist/esm/token-typography.entry.js +1 -1
  445. package/dist/hydrate/index.js +992 -763
  446. package/dist/hydrate/index.mjs +992 -763
  447. package/dist/types/components/eds-accordion/eds-accordion.d.ts +5 -12
  448. package/dist/types/components/eds-alert/eds-alert.d.ts +1 -1
  449. package/dist/types/components/eds-avatar/eds-avatar.stories.d.ts +0 -18
  450. package/dist/types/components/eds-breadcrump/eds-breadcrump.d.ts +9 -8
  451. package/dist/types/components/eds-button/eds-button.d.ts +2 -3
  452. package/dist/types/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.d.ts +8 -0
  453. package/dist/types/components/eds-cards/eds-card-generic/eds-card-generic.d.ts +6 -2
  454. package/dist/types/components/eds-code-block/eds-code-block.d.ts +43 -3
  455. package/dist/types/components/eds-code-block/eds-code-block.stories.d.ts +54 -0
  456. package/dist/types/components/eds-dropdown/eds-dropdown.d.ts +0 -7
  457. package/dist/types/components/eds-form/eds-form.d.ts +3 -7
  458. package/dist/types/components/eds-form/eds-form.stories.d.ts +0 -5
  459. package/dist/types/components/eds-frame/eds-frame.stories.d.ts +0 -2
  460. package/dist/types/components/eds-img/eds-img.d.ts +3 -1
  461. package/dist/types/components/eds-input-elements/eds-input-select/eds-input-select.d.ts +9 -0
  462. package/dist/types/components/eds-link/eds-link.d.ts +1 -1
  463. package/dist/types/components/eds-logo/eds-logo.d.ts +1 -0
  464. package/dist/types/components/eds-modal/eds-modal.d.ts +20 -10
  465. package/dist/types/components/eds-modal/eds-modal.stories.d.ts +9 -0
  466. package/dist/types/components/eds-rating/eds-rating.d.ts +4 -7
  467. package/dist/types/components/eds-section/eds-section-core/eds-section-core.stories.d.ts +0 -1
  468. package/dist/types/components/eds-steps/eds-steps.d.ts +39 -0
  469. package/dist/types/components/eds-steps/eds-steps.stories.d.ts +34 -0
  470. package/dist/types/components/eds-steps/eds-vertical-stepper.d.ts +22 -0
  471. package/dist/types/components/eds-switch/eds-switch.d.ts +25 -0
  472. package/dist/types/components/eds-switch/eds-switch.stories.d.ts +32 -0
  473. package/dist/types/components/eds-table/eds-table.d.ts +5 -5
  474. package/dist/types/components/eds-tag/eds-tag.d.ts +5 -0
  475. package/dist/types/components/eds-toast/eds-toast.d.ts +9 -0
  476. package/dist/types/components.d.ts +227 -164
  477. package/dist/types/shared-ui/eds-card-section/eds-card-section.d.ts +28 -6
  478. package/dist/types/shared-ui/eds-card-section/eds-card-section.stories.d.ts +42 -21
  479. package/dist/types/shared-ui/eds-header/eds-header.d.ts +0 -20
  480. package/dist/types/shared-ui/eds-login/eds-login.d.ts +21 -18
  481. package/dist/types/shared-ui/eds-user/eds-user.d.ts +5 -5
  482. package/dist/types/utils/global.d.ts +1 -0
  483. package/dist/types/utils/keycloak.d.ts +2 -2
  484. package/package.json +1 -1
  485. package/dist/cjs/color-3ffe3072.js +0 -342
  486. package/dist/cjs/eds-alert.cjs.entry.js +0 -96
  487. package/dist/cjs/eds-rating.cjs.entry.js +0 -58
  488. package/dist/components/eds-user2.js +0 -156
  489. package/dist/components/p-005de86f.entry.js +0 -1
  490. package/dist/components/p-0c2e844e.entry.js +0 -1
  491. package/dist/components/p-145f13ad.entry.js +0 -1
  492. package/dist/components/p-16458a81.entry.js +0 -1
  493. package/dist/components/p-2851ff44.entry.js +0 -1
  494. package/dist/components/p-29648b47.entry.js +0 -1
  495. package/dist/components/p-297b2bc3.entry.js +0 -1
  496. package/dist/components/p-32cddd94.entry.js +0 -1
  497. package/dist/components/p-3617841d.entry.js +0 -1
  498. package/dist/components/p-373673ca.js +0 -1
  499. package/dist/components/p-388b4966.entry.js +0 -1
  500. package/dist/components/p-3ff76976.entry.js +0 -1
  501. package/dist/components/p-4037ad48.entry.js +0 -1
  502. package/dist/components/p-42b4ecff.entry.js +0 -1
  503. package/dist/components/p-490ba155.entry.js +0 -1
  504. package/dist/components/p-4932aab2.entry.js +0 -1
  505. package/dist/components/p-4a24c2ce.entry.js +0 -1
  506. package/dist/components/p-54c75346.entry.js +0 -1
  507. package/dist/components/p-57c964c5.entry.js +0 -1
  508. package/dist/components/p-5a43503a.entry.js +0 -1
  509. package/dist/components/p-5aad9d3f.entry.js +0 -1
  510. package/dist/components/p-5afb626c.entry.js +0 -1
  511. package/dist/components/p-5d7af761.entry.js +0 -1
  512. package/dist/components/p-5fc68438.entry.js +0 -1
  513. package/dist/components/p-6378fb3e.entry.js +0 -1
  514. package/dist/components/p-673dce11.entry.js +0 -1
  515. package/dist/components/p-7215789a.entry.js +0 -1
  516. package/dist/components/p-73bd0c97.entry.js +0 -1
  517. package/dist/components/p-7802e966.entry.js +0 -1
  518. package/dist/components/p-79887c2c.entry.js +0 -1
  519. package/dist/components/p-846fc91c.entry.js +0 -1
  520. package/dist/components/p-84957b6d.entry.js +0 -1
  521. package/dist/components/p-8c56e39a.entry.js +0 -1
  522. package/dist/components/p-96c4deda.entry.js +0 -1
  523. package/dist/components/p-a44a1abe.entry.js +0 -1
  524. package/dist/components/p-a4e9b68b.entry.js +0 -1
  525. package/dist/components/p-ac0112d5.entry.js +0 -1
  526. package/dist/components/p-acb16e1c.entry.js +0 -1
  527. package/dist/components/p-ae5dbd41.entry.js +0 -1
  528. package/dist/components/p-bdd86a3c.entry.js +0 -1
  529. package/dist/components/p-be6c80da.entry.js +0 -1
  530. package/dist/components/p-bf0f851d.entry.js +0 -1
  531. package/dist/components/p-c2d369bc.entry.js +0 -1
  532. package/dist/components/p-c9c417de.js +0 -1
  533. package/dist/components/p-d1670eec.entry.js +0 -1
  534. package/dist/components/p-d1f6a722.entry.js +0 -1
  535. package/dist/components/p-d53b7a75.entry.js +0 -1
  536. package/dist/components/p-d6d86366.entry.js +0 -1
  537. package/dist/components/p-d7a92efb.entry.js +0 -1
  538. package/dist/components/p-d9788b54.entry.js +0 -1
  539. package/dist/components/p-e20ed2c7.entry.js +0 -1
  540. package/dist/components/p-e74834bc.entry.js +0 -1
  541. package/dist/components/p-f7a6ce69.entry.js +0 -1
  542. package/dist/components/p-fd27e56c.entry.js +0 -1
  543. package/dist/esm/color-0ba8ed56.js +0 -338
  544. package/dist/esm/eds-alert.entry.js +0 -92
  545. package/dist/esm/eds-rating.entry.js +0 -54
  546. package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/index.d.ts +0 -3
  547. package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib/keycloak.d.ts +0 -30
  548. package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib/render.d.ts +0 -8
  549. /package/dist/types/{Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib → utils}/analytics.d.ts +0 -0
  550. /package/dist/types/{Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib → utils}/color.d.ts +0 -0
@@ -47,7 +47,7 @@ export class EdsBreadcrumb {
47
47
  this.parsedItems = Array.isArray(parsed) ? parsed : [];
48
48
  }
49
49
  catch (e) {
50
- console.error('Error parsing breadcrumb items:', e);
50
+ //console.error('Error parsing breadcrumb items:', e);
51
51
  this.parsedItems = [];
52
52
  }
53
53
  }
@@ -75,9 +75,9 @@ export class EdsBreadcrumb {
75
75
  * It emits a custom event for each `eds-link` element contained within the breadcrumb.
76
76
  */
77
77
  componentDidLoad() {
78
- // Emit context for each eds-link element after the component is fully loaded
79
- const links = this.el.shadowRoot.querySelectorAll('eds-link');
80
- links.forEach((link) => {
78
+ var _a;
79
+ const links = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('eds-link');
80
+ links === null || links === void 0 ? void 0 : links.forEach((link) => {
81
81
  this.emitContext(link);
82
82
  });
83
83
  }
@@ -97,54 +97,49 @@ export class EdsBreadcrumb {
97
97
  linkElement.dispatchEvent(event);
98
98
  }
99
99
  /**
100
- * Truncates breadcrumb items based on the maxVisibleItems value.
101
- * Truncates `label` to 10 characters if `isSmallScreen` is true, except for the last label.
100
+ * Returns breadcrumb items with potential truncation if there are too many.
101
+ * It inserts an ellipsis item where necessary.
102
102
  */
103
103
  getTruncatedItems() {
104
104
  const totalItems = this.parsedItems.length;
105
+ const ellipsis = { label: '...', url: '', isHidden: true };
105
106
  if (totalItems > this.maxVisibleItems) {
106
107
  const firstItem = this.parsedItems[0];
107
108
  const lastItems = this.parsedItems.slice(-2);
108
- const ellipsis = { label: '...', url: '', isHidden: true };
109
109
  if (this.maxVisibleItems === 3) {
110
- return [
111
- this.truncateLabel(firstItem),
112
- ellipsis,
113
- ...lastItems.map((item, index) => (index === lastItems.length - 1 ? item : this.truncateLabel(item)))
114
- ];
110
+ return [firstItem, ellipsis, ...lastItems];
115
111
  }
116
112
  else if (this.maxVisibleItems === 4) {
117
113
  const middleItem = this.parsedItems[Math.floor(totalItems / 2)];
118
- return [
119
- this.truncateLabel(firstItem),
120
- this.truncateLabel(middleItem),
121
- ellipsis,
122
- ...lastItems.map((item, index) => (index === lastItems.length - 1 ? item : this.truncateLabel(item)))
123
- ];
114
+ return [firstItem, middleItem, ellipsis, ...lastItems];
124
115
  }
125
116
  }
126
- return this.parsedItems.map((item, index) => index === this.parsedItems.length - 1 ? item : this.truncateLabel(item));
117
+ return this.parsedItems;
127
118
  }
128
119
  /**
129
- * Truncates the label of a breadcrumb item to a maximum of 10 characters
130
- * if the screen is small.
120
+ * Helper to determine the display label and full label.
121
+ * If the label is longer than 15 characters and the item is not the current (last) item,
122
+ * we display a truncated version but use the full label for aria attributes.
131
123
  */
132
- truncateLabel(item) {
133
- if (item.label.length > 15) {
134
- return Object.assign(Object.assign({}, item), { label: `${item.label.slice(0, 15)}...` });
124
+ getLabels(item, isCurrent) {
125
+ if (!isCurrent && item.label.length > 15) {
126
+ return { displayLabel: `${item.label.slice(0, 15)}...`, fullLabel: item.label };
135
127
  }
136
- return item;
128
+ return { displayLabel: item.label, fullLabel: item.label };
137
129
  }
138
130
  /**
139
131
  * Render method for the breadcrumb component.
140
132
  * It creates a navigation element with an ordered list of breadcrumb links.
141
- * The last link is disabled and marked as the current page.
133
+ * The last link is marked as the current page.
142
134
  */
143
135
  render() {
144
136
  const itemsToRender = this.getTruncatedItems();
145
- return (h("nav", { key: '1491f7e548ba859e0661129de2ec320552a2bb42', "aria-label": "Breadcrumb" }, h("ol", { key: '93525aad588295e9f2a3f02d143824c7c58ea512', class: "flex items-center space-x-2" }, itemsToRender.map((item, index) => {
137
+ return (h("nav", { key: 'd177957e1b3218c21991bbdc9636a8e32befe990', "aria-label": "Breadcrumb" }, h("ol", { key: 'd10336ddee99b9fb84d17e53093c57c6a025982f', class: "flex items-center space-x-2" }, itemsToRender.map((item, index) => {
146
138
  const isLast = index === itemsToRender.length - 1;
147
- return (h("li", { class: "flex items-center" }, !item.isHidden ? (h("eds-link", { label: item.label, url: item.url, intent: this.intent, current: isLast, "aria-label": item.label, size: "small", "icon-small": "false" })) : (h("span", { class: "truncate px-2 ", "aria-hidden": "true" }, "...")), !isLast && !item.isHidden && (h("eds-icon-wrapper", { icon: "chevron-right", class: "w-20 h-20" }))));
139
+ return (h("li", { class: "flex items-center" }, !item.isHidden ? ((() => {
140
+ const { displayLabel, fullLabel } = this.getLabels(item, isLast);
141
+ return (h("eds-link", Object.assign({ label: displayLabel, url: item.url, intent: this.intent, current: isLast, "aria-label": fullLabel, size: "small", "icon-small": "false" }, (isLast ? { 'aria-current': 'page' } : {}))));
142
+ })()) : (h("span", { class: "truncate px-2", "aria-hidden": "true" }, "...")), !isLast && !item.isHidden && (h("eds-icon-wrapper", { icon: "chevron-right", class: "w-20 h-20" }))));
148
143
  }))));
149
144
  }
150
145
  static get is() { return "eds-breadcrumb"; }
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- import { sendAnalytics } from "../../../../../../../packages/utils/src/index";
2
+ import { sendAnalytics } from "../../utils/analytics";
3
3
  import { cva } from "class-variance-authority";
4
4
  /**
5
5
  * `EdsButton` is a versatile button component designed for a range of actions and interactions in applications.
@@ -166,9 +166,8 @@ export class EdsButton {
166
166
  iconOnly: false
167
167
  }
168
168
  });
169
- this.parentContext = null; // Accepts the entire event detail or null
170
169
  this.label = undefined;
171
- this.ariaLabel = undefined;
170
+ this.ariaLabel = 'Button';
172
171
  this.elementType = 'button';
173
172
  this.intent = 'secondary';
174
173
  this.loading = false;
@@ -181,15 +180,19 @@ export class EdsButton {
181
180
  this.extraClass = undefined;
182
181
  this.triggerClick = undefined;
183
182
  }
184
- handleParentContext(event) {
185
- if (event.target !== this.el) {
186
- // Ignore the event if it's not targeted at this specific instance
187
- return;
188
- }
189
- //console.log(event.detail);
190
- this.parentContext = event.detail;
191
- event.stopPropagation();
183
+ /*private parentContext: ParentContextDetail | null = null; // Accepts the entire event detail or null
184
+
185
+ @Listen('parentContext')
186
+ handleParentContext(event: CustomEvent) {
187
+ if (event.target !== this.el) {
188
+ // Ignore the event if it's not targeted at this specific instance
189
+ return;
190
+ }
191
+ //console.log(event.detail);
192
+ this.parentContext = event.detail;
193
+ event.stopPropagation();
192
194
  }
195
+ */
193
196
  handleClick(event) {
194
197
  var _a, _b;
195
198
  if (this.disabled) {
@@ -199,7 +202,7 @@ export class EdsButton {
199
202
  }
200
203
  sendAnalytics({
201
204
  category: 'ui-component',
202
- parentContext: this.parentContext,
205
+ parentContext: null,
203
206
  tag: this.el.tagName.toLowerCase(),
204
207
  name: ((_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || ((_b = this.ariaLabel) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || '',
205
208
  action: 'click'
@@ -226,7 +229,7 @@ export class EdsButton {
226
229
  show: !this.loading
227
230
  });
228
231
  const ElementType = this.elementType;
229
- return (h(ElementType, { key: '1053db0332f574db35e58453d789567eaf235d30', "aria-label": this.label || this.ariaLabel || undefined, "aria-disabled": this.elementType === 'button' ? this.disabled : undefined, disabled: this.elementType === 'button' ? this.disabled : undefined, class: `${classes || ''} ${this.extraClass || ''}`, onClick: (event) => this.handleClick(event) }, this.label && h("span", { key: 'ff95b889b008075d46b89a1d23e51ad8afa20918', class: this.loading ? 'opacity-0' : '' }, this.label), this.loading && (h("span", { key: '942f3fffcaef08defd3d0ef0dbb275b9d189c907', class: "absolute inset-0 flex items-center justify-center" }, h("span", { key: '91e53dcee9d4f2a842ea922498c9da7f15ffe109', class: "loader", style: {
232
+ return (h(ElementType, { key: '52cda715164eeca59e35b45f617a2d6d1b05a94c', "aria-label": this.label || this.ariaLabel || undefined, "aria-disabled": this.elementType === 'button' ? this.disabled : undefined, disabled: this.elementType === 'button' ? this.disabled : undefined, class: `${classes || ''} ${this.extraClass || ''}`, onClick: (event) => this.handleClick(event) }, this.label && h("span", { key: '866cd0272d9f381b3ecb892e588c860ca8b41051', class: this.loading ? 'opacity-0' : '' }, this.label), this.loading && (h("span", { key: 'fcba01e3404724869c59f4e21bd5db459643d840', class: "absolute inset-0 flex items-center justify-center" }, h("span", { key: 'e44955e5641e757e66eb4961097fb4d60e4def7c', class: "loader", style: {
230
233
  border: `3px solid ${this.intent === 'secondary' ? 'rgba(255, 255, 255, .3)' : 'rgba(0, 0, 0, .3)'}`,
231
234
  borderBottomColor: this.intent === 'secondary' ? '#fff' : '#000'
232
235
  } }))), this.icon ? h("eds-icon-wrapper", { class: iconClasses, icon: this.icon }) : null));
@@ -266,7 +269,7 @@ export class EdsButton {
266
269
  "type": "string",
267
270
  "mutable": false,
268
271
  "complexType": {
269
- "original": "string | null",
272
+ "original": "string",
270
273
  "resolved": "string",
271
274
  "references": {}
272
275
  },
@@ -274,10 +277,11 @@ export class EdsButton {
274
277
  "optional": false,
275
278
  "docs": {
276
279
  "tags": [],
277
- "text": "The accessible aria-label for the button, used when there is no visible label."
280
+ "text": "The accessible aria-label for the button, used when there is no visible label.\nDefault is \"Button\" to ensure icon-only buttons are announced properly."
278
281
  },
279
282
  "attribute": "aria-label",
280
- "reflect": false
283
+ "reflect": false,
284
+ "defaultValue": "'Button'"
281
285
  },
282
286
  "elementType": {
283
287
  "type": "string",
@@ -475,13 +479,4 @@ export class EdsButton {
475
479
  };
476
480
  }
477
481
  static get elementRef() { return "el"; }
478
- static get listeners() {
479
- return [{
480
- "name": "parentContext",
481
- "method": "handleParentContext",
482
- "target": undefined,
483
- "capture": false,
484
- "passive": false
485
- }];
486
- }
487
482
  }
@@ -1,4 +1,12 @@
1
1
  import { h } from "@stencil/core";
2
+ /**
3
+ * `eds-card-desc` is a simple component that renders a card description.
4
+ *
5
+ * It displays a block of text with optional truncation applied using a CSS line clamp.
6
+ * You can customize the description styling via the `descClass` property and control
7
+ * whether or not the text is truncated and to how many lines.
8
+ *
9
+ */
2
10
  export class EdsCardDesc {
3
11
  constructor() {
4
12
  this.description = undefined;
@@ -10,7 +18,7 @@ export class EdsCardDesc {
10
18
  return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
11
19
  }
12
20
  render() {
13
- return (h("p", { key: '017c115ebff999c74cff1eaeb5c63f97e0f6554d', class: `text-light ${this.descClass}` }, h("span", { key: 'f87b9b3d593e417ef351882f426d24c0b206ccab', class: this.getTruncateClass() }, this.description)));
21
+ return (h("p", { key: '71495cbd6ef4e7d66c4c22a37f8120624ecf57fb', class: `text-light ${this.descClass}` }, h("span", { key: '8708178f7b48cc1f31aac749f50fe92b72c39ab8', class: this.getTruncateClass() }, this.description)));
14
22
  }
15
23
  static get is() { return "eds-card-desc"; }
16
24
  static get encapsulation() { return "shadow"; }
@@ -8,7 +8,7 @@ export class EdsCardTags {
8
8
  this.tags = [];
9
9
  }
10
10
  render() {
11
- return (h("div", { key: 'b201dc6df5e809d828a055fb5f01fe798e228361', class: "flex flex-wrap gap-y-4" }, this.tags.map((tag, index) => (h("eds-tag", { key: index, intent: this.accent ? 'accent' : 'default', label: tag })))));
11
+ return (h("div", { key: '272d53abb9be9086881cb2f8e99f7fb7aae1bb59', class: "flex flex-wrap gap-y-4" }, this.tags.map((tag, index) => (h("eds-tag", { key: index, intent: this.accent ? 'accent' : 'default', label: tag })))));
12
12
  }
13
13
  static get is() { return "eds-card-tags"; }
14
14
  static get encapsulation() { return "shadow"; }
@@ -43,7 +43,7 @@ export class EdsCardTitle {
43
43
  render() {
44
44
  //const Tag = this.getTag();
45
45
  const Heading = this.headingLevel;
46
- return (h(Heading, { key: '8aee3bcb0e04508dd21a03ea0f695e040f37c767', class: this.getTitleClass() }, h("a", { key: 'c5fa27fe86037ed6b039c156aecdf1acc9c7c8bc', class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none", href: this.url, target: this.externalLink ? '_blank' : undefined, rel: this.externalLink ? 'noopener noreferrer' : undefined }, this.cardTitle)));
46
+ return (h(Heading, { key: 'bb97dc6dd53adda14ef251b2ec32952791438986', class: this.getTitleClass() }, h("a", { key: '37b6ac0668257d27fb3f03a6225a2d48e1fd1f79', class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none", href: this.url, target: this.externalLink ? '_blank' : undefined, rel: this.externalLink ? 'noopener noreferrer' : undefined }, this.cardTitle)));
47
47
  }
48
48
  static get is() { return "eds-card-title"; }
49
49
  static get encapsulation() { return "shadow"; }
@@ -21,7 +21,7 @@ export class EdsCardWrapper {
21
21
  this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '',
22
22
  'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'
23
23
  ].join(' ');
24
- return (h("article", { key: 'c52f6ad7873050c052b8c0e68b2c812d74f2ddf1', class: articleClasses }, h("slot", { key: 'dac6f9fe339c8baa191ee2fd622332ddf25ec08d' }), this.hasSlot('footer') && (h("div", { key: '301862515ba88f320d1af722bec6120bc3e7d723', class: "mt-auto" }, h("slot", { key: '85d939150663a4586934413c9965aa92a9babeef', name: "footer" })))));
24
+ return (h("article", { key: 'f21cc9703011026652765b399e2b87b1ef80d220', class: articleClasses }, h("slot", { key: '9a37adad73d2d49edcc9ca9222d5b188202c5612' }), this.hasSlot('footer') && (h("div", { key: '87addfc052ed4ae33736724fbd8fbc8aca873b4d', class: "mt-auto" }, h("slot", { key: '2e48677f42ac2aa951bc1a82afa9291fea3ddd72', name: "footer" })))));
25
25
  }
26
26
  static get is() { return "eds-card-wrapper"; }
27
27
  static get properties() {
@@ -1,4 +1,4 @@
1
- import { sendAnalytics } from "../../../../../../../../packages/utils/src/index";
1
+ import { sendAnalytics } from "../../../utils/analytics";
2
2
  import { h } from "@stencil/core";
3
3
  /**
4
4
  * `EdsCardGeneric` is a versatile card component designed to display rich content such as titles, descriptions, images, and tags.
@@ -22,7 +22,7 @@ export class EdsCardGeneric {
22
22
  this.avatar = undefined;
23
23
  this.shortAbbreviation = undefined;
24
24
  this.headingLevel = 'h3';
25
- this.tags = '';
25
+ this.tags = [];
26
26
  this.tiny = false;
27
27
  this.bg = true;
28
28
  this.withHover = true;
@@ -98,7 +98,7 @@ export class EdsCardGeneric {
98
98
  });
99
99
  }
100
100
  render() {
101
- return (h("article", { key: '17d1f00f232a4436756fa3846684bbae8c716036', class: this.articleClasses(), onClick: () => this.handleClick() }, h("eds-card-title", { key: 'd99ee1716c4e308a3ea446f0f7cedfaeac30f2ed', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.cardTitle, url: this.url, hierarchy: this.hierarchy }), this.description && (h("eds-card-desc", { key: 'c5bdc76e68a8d660609630aa8184ec3a9508ab61', class: "mt-8", "truncate-lines": "3", description: this.description })), this.parsedImage ? (h("eds-img", Object.assign({ class: "mt-8" }, this.parsedImage))) : this.avatar || this.shortAbbreviation ? (h("eds-avatar", { class: "order-first mb-12", picture: this.avatar, initials: this.shortAbbreviation })) : null, h("div", { key: 'fa993e3c60d357eb0d9a63e612bdd2bf026e7a85', class: "flex flex-wrap gap-y-4" }, this.parsedTags.map((tag, index) => (h("eds-tag", { key: index, intent: tag.style, label: tag.label })))), ' '));
101
+ return (h("article", { key: 'dcb7cea87bfb52f8886f7ee3dbc3484d615bc00c', class: this.articleClasses(), onClick: () => this.handleClick() }, h("eds-card-title", { key: '94dd6ff2679ce9ac4d25ec921cd1162b1584e4fd', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.cardTitle, url: this.url, hierarchy: this.hierarchy }), this.description && (h("eds-card-desc", { key: '433c4fe3a518153d89d48af54455286fa415a688', class: "mt-8", "truncate-lines": "3", description: this.description })), this.parsedImage ? (h("eds-img", Object.assign({ class: "mt-8" }, this.parsedImage))) : this.avatar || this.shortAbbreviation ? (h("eds-avatar", { class: "order-first mb-12", picture: this.avatar, initials: this.shortAbbreviation })) : null, h("div", { key: '97b75afb4b8de1183d4b212054ff556ba3db8fcb', class: "flex flex-wrap gap-y-4" }, this.parsedTags.map((tag, index) => (h("eds-tag", { key: index, intent: tag.style, label: tag.label })))), ' '));
102
102
  }
103
103
  static get is() { return "eds-card-generic"; }
104
104
  static get encapsulation() { return "shadow"; }
@@ -235,22 +235,28 @@ export class EdsCardGeneric {
235
235
  "defaultValue": "'h3'"
236
236
  },
237
237
  "tags": {
238
- "type": "any",
238
+ "type": "string",
239
239
  "mutable": false,
240
240
  "complexType": {
241
- "original": "any",
242
- "resolved": "any",
243
- "references": {}
241
+ "original": "string | Tag[]",
242
+ "resolved": "Tag[] | string",
243
+ "references": {
244
+ "Tag": {
245
+ "location": "local",
246
+ "path": "/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/src/components/eds-cards/eds-card-generic/eds-card-generic.tsx",
247
+ "id": "../../../packages/components/src/components/eds-cards/eds-card-generic/eds-card-generic.tsx::Tag"
248
+ }
249
+ }
244
250
  },
245
251
  "required": false,
246
252
  "optional": false,
247
253
  "docs": {
248
254
  "tags": [],
249
- "text": "A comma-separated string of tags related to the card content."
255
+ "text": "Tags related to the card content."
250
256
  },
251
257
  "attribute": "tags",
252
258
  "reflect": false,
253
- "defaultValue": "''"
259
+ "defaultValue": "[]"
254
260
  },
255
261
  "tiny": {
256
262
  "type": "boolean",
@@ -54,7 +54,7 @@ export default {
54
54
  },
55
55
  args: {
56
56
  cardTitle: 'Sample Card Title',
57
- url: 'https://example.com',
57
+ url: '#',
58
58
  description: 'This is a sample description for the card.',
59
59
  headingLevel: 'h3',
60
60
  tags: [
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
- import { sendAnalytics, gradientBGColorVariants } from "../../../../../../../../packages/utils/src/index";
2
+ import { sendAnalytics } from "../../../utils/analytics";
3
+ import { gradientBGColorVariants } from "../../../utils/color";
3
4
  /**
4
5
  * @internal
5
6
  */
@@ -55,7 +56,7 @@ export class EdsCardProject {
55
56
  this.vertical ? 'flex-col gap-y-16' : 'flex-col gap-x-16 gap-y-12 lg:flex-row'
56
57
  ].join(' ');
57
58
  const imageClasses = this.vertical ? '' : 'max-w-120 @md:max-w-192 order-first w-full lg:order-last';
58
- return (h("article", { key: '6af49754300ded8748ac3f40175e262480054969', class: cardClasses, onClick: (event) => this.handleClick(event) }, h("div", { key: '91e8501312957c44d9dc075f2ec3a9e5a5d425cb', class: `flex grow flex-col ${this.vertical ? 'min-h-156' : ''}` }, h("div", { key: '44e3cf2d67255bb5669b6c721741ed060ba599e7', class: "lg:max-w-[720px]" }, h("eds-card-title", { key: '0cf1d124b975e4d7223bab58db0d5861d348ceb2', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.titleProject, url: this.url }), this.editorialTitle && (h("span", { key: '85e1158691ae876bc0f3c6d0c5557f394ae935cb', class: `block ${this.vertical ? 'f-ui-02' : 'mt-4 f-heading-06'}` }, this.editorialTitle))), this.categoryTitle && (h("div", { key: '9ffdc9f14709600b623c3a5f878b2700864ced79', class: "mt-auto flex items-center gap-x-12 pt-12" }, ((_a = this.categoryTitle) === null || _a === void 0 ? void 0 : _a.length) && h("eds-tag", { key: 'ecc5e55430df355c13420add9969855d1d54c27f', label: this.categoryTitle })))), this.parsedImage && (h("div", { key: '97de7a06a13d9843cb18fe4eb19303f436e2ce16', class: imageClasses }, h("div", { key: '532d3c8252316a68976b4587c3d5b63167c0c598', class: "aspect-1x1 w-full" }, h("eds-img", Object.assign({ key: '37ee3dbbc99ec8c9139b0a89f9c725768eac5f6d', sizes: this.vertical ? this.parsedImage.sizes || '' : '192px' }, this.parsedImage)))))));
59
+ return (h("article", { key: '98c5dbd033ec05d08965559e00f32d9fe18698ef', class: cardClasses, onClick: (event) => this.handleClick(event) }, h("div", { key: 'e083c43e38c3c24fcd996a90267f7cd92d3651b3', class: `flex grow flex-col ${this.vertical ? 'min-h-156' : ''}` }, h("div", { key: '37de1e46023b533fd8595a3077c4e68c11fb01af', class: "lg:max-w-[720px]" }, h("eds-card-title", { key: 'ee31ae2804d2c17c82e8f4c0c3269ac8254331df', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.titleProject, url: this.url }), this.editorialTitle && (h("span", { key: 'c6f74ba9b5b522f713e25d3339f541efa68cdddd', class: `block ${this.vertical ? 'f-ui-02' : 'mt-4 f-heading-06'}` }, this.editorialTitle))), this.categoryTitle && (h("div", { key: 'ab18e55046777cf4a4f58ebd057641db9b9e0328', class: "mt-auto flex items-center gap-x-12 pt-12" }, ((_a = this.categoryTitle) === null || _a === void 0 ? void 0 : _a.length) && h("eds-tag", { key: '3714ee86a74dce7f33a8f953fd726db349ba9271', label: this.categoryTitle })))), this.parsedImage && (h("div", { key: '2818d15f7ab671b7b2dfb34ec3085b390150f38d', class: imageClasses }, h("div", { key: '5166feef3674631298f699449b956655f38f0db9', class: "aspect-1x1 w-full" }, h("eds-img", Object.assign({ key: '86555a43491da5b2aa3b287e539e603a2c2adaf3', sizes: this.vertical ? this.parsedImage.sizes || '' : '192px' }, this.parsedImage)))))));
59
60
  }
60
61
  static get is() { return "eds-card-project"; }
61
62
  static get properties() {
@@ -1,4 +1,4 @@
1
- import { sendAnalytics } from "../../../../../../../../packages/utils/src/index";
1
+ import { sendAnalytics } from "../../../utils/analytics";
2
2
  import { h } from "@stencil/core";
3
3
  /**
4
4
  * @internal
@@ -64,7 +64,7 @@ export class EdsCardTool {
64
64
  });
65
65
  }
66
66
  render() {
67
- return (h("article", { key: 'b46c0464688e45ab29f5b58b6cd2e22ed28e1034', class: `${this.el.tagName.toLowerCase()} ${this.articleClasses()}`, onClick: () => this.handleClick() }, h("eds-card-title", { key: 'a4da791280db14754b445b1a52e33cc9a25f765e', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.cardTitle, url: this.url, "external-link": this.external, hierarchy: this.hierarchy }), this.description && (h("eds-card-desc", { key: '86f7c6c80b83f244ba7d07d820d5793e1dda2933', class: "mt-8", "truncate-lines": "3", description: this.description })), this.image ? (h("eds-img", { src: this.image, alt: "Sample Image", width: 200, height: 150 })) : this.avatar || this.shortAbbreviation ? (h("eds-avatar", { class: "order-first mb-12", picture: this.avatar, initials: this.shortAbbreviation })) : null, h("div", { key: '46307b57160f908aa7066b2a636c4db38e0e7a8e', class: "flex flex-wrap gap-y-4" }, this.parsedTags.map((tag, index) => (h("eds-tag", { key: index, intent: tag.style, label: tag.label }))))));
67
+ return (h("article", { key: 'da61b384e966b148cd1f77eec59671bc4d92e259', class: `${this.el.tagName.toLowerCase()} ${this.articleClasses()}`, onClick: () => this.handleClick() }, h("eds-card-title", { key: '00702d032bc25f52b2a2c98255ceb60a1d314f4d', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.cardTitle, url: this.url, "external-link": this.external, hierarchy: this.hierarchy }), this.description && (h("eds-card-desc", { key: 'd2b135ed422fb64f142af71330dc666e2f0c2b1f', class: "mt-8", "truncate-lines": "3", description: this.description })), this.image ? (h("eds-img", { src: this.image, alt: "Sample Image", width: 200, height: 150 })) : this.avatar || this.shortAbbreviation ? (h("eds-avatar", { class: "order-first mb-12", picture: this.avatar, initials: this.shortAbbreviation })) : null, h("div", { key: '54111e90175754cb0c1f2eb339e86926914ca0e7', class: "flex flex-wrap gap-y-4" }, this.parsedTags.map((tag, index) => (h("eds-tag", { key: index, intent: tag.style, label: tag.label }))))));
68
68
  }
69
69
  static get is() { return "eds-card-tool"; }
70
70
  static get encapsulation() { return "shadow"; }
@@ -5,28 +5,82 @@ import "prismjs/components/prism-bash"; // Add support for Bash/Shell
5
5
  import "prismjs/components/prism-yaml"; // Add YAML support
6
6
  //import 'prismjs/components/prism-html';
7
7
  import "prismjs/components/prism-css";
8
+ //import { sendAnalytics } from '../../utils/analytics';
9
+ /**
10
+ * A component that displays a code block with syntax highlighting.
11
+ *
12
+ * Uses Prism.js for syntax highlighting. Supports multiple languages such as JavaScript, HTML, CSS,
13
+ * Python, Bash/Shell, and YAML.
14
+ *
15
+ * */
8
16
  export class EdsCodeBlock {
9
17
  constructor() {
10
18
  this.code = undefined;
11
19
  this.language = undefined;
12
20
  this.copied = false;
13
21
  }
22
+ /**
23
+ * Copies the current code content to the clipboard and sets a temporary copied state.
24
+ *
25
+ * @private
26
+ * @returns {void}
27
+ */
14
28
  copyToClipboard() {
15
29
  navigator.clipboard.writeText(this.code).then(() => {
16
30
  this.copied = true;
31
+ /*const analyticsName = this.createHumanFriendlyAnalyticsName(this.code, this.language);
32
+ sendAnalytics({
33
+ category: 'ui-component',
34
+ parentContext: null,
35
+ tag: this.el.tagName.toLowerCase(),
36
+ name: analyticsName || '',
37
+ action: 'copy'
38
+ });*/
17
39
  setTimeout(() => (this.copied = false), 2000);
18
40
  });
19
41
  }
42
+ /**
43
+ * Utility function that creates a human-friendly analytics name based on the code and language.
44
+ * It uses:
45
+ * - The language (in uppercase)
46
+ * - The number of non-empty lines in the code
47
+ * - The first non-empty line of code (truncated to 30 characters, if needed)
48
+ *
49
+ * returns A descriptive analytics name.
50
+ */
51
+ /*private createHumanFriendlyAnalyticsName(code: string, language: string): string {
52
+ // Count non-empty lines
53
+ const lines = code.split('\n').filter(line => line.trim() !== '').length;
54
+
55
+ // Find the first non-empty line and trim it
56
+ let firstNonEmptyLine = code.split('\n').find(line => line.trim() !== '');
57
+ firstNonEmptyLine = firstNonEmptyLine ? firstNonEmptyLine.trim() : '';
58
+
59
+ // Truncate the snippet if it’s too long
60
+ if (firstNonEmptyLine.length > 30) {
61
+ firstNonEmptyLine = firstNonEmptyLine.substring(0, 30) + '...';
62
+ }
63
+
64
+ return `CodeBlock:${language.toLowerCase()}|${lines}-line(s)|${firstNonEmptyLine.toLowerCase()}`;
65
+ }*/
66
+ /**
67
+ * Returns the syntax-highlighted HTML for the code.
68
+ * If the provided language is supported by Prism, this method returns the highlighted code.
69
+ * Otherwise, it logs a warning and returns the raw code.
70
+ *
71
+ * @private
72
+ * @returns {string} The highlighted HTML string for the code block.
73
+ */
20
74
  getHighlightedCode() {
21
75
  if (this.language && Prism.languages[this.language]) {
22
76
  return Prism.highlight(this.code, Prism.languages[this.language], this.language);
23
77
  }
24
78
  // eslint-disable-next-line
25
- console.warn(`Unsupported or missing language: ${this.language}`);
79
+ //console.warn(`Unsupported or missing language: ${this.language}`);
26
80
  return this.code; // Fallback if language is not provided or unsupported
27
81
  }
28
82
  render() {
29
- return (h("div", { key: 'a99c0c8b9546b80bb3f9e21cd53c29540e8b6e06', class: "relative bg-stronger rounded-sm" }, h("div", { key: '5856f9d30bb52f791e0d8bb03a6438bc01247f66', class: "text-inverse flex justify-between items-center p-8" }, this.language ? (h("span", { class: "f-ui-03" }, this.language.toUpperCase())) : (h("pre", { class: "bg-stronger pl-8", role: "region", "aria-label": "Code block without language" }, h("code", { innerHTML: this.getHighlightedCode() }))), h("span", { key: 'dfb0f69dbbd1032ace5afb7fe98d899816f36610', "aria-hidden": "true", class: "w-20 h-20 mt-8" }, h("eds-icon-wrapper", { key: 'b399384638265f9fcc9a824c47fe73c75bcade33', icon: this.copied ? 'success' : 'copy', onClick: () => this.copyToClipboard() })), h("span", { key: '47c2d00b2cf86b99522dbc438726e0fc57fb6a44', class: "sr-only" }, "Copy Code")), this.language && (h("pre", { key: '038321e9d3d2a38963857ab8b719653f3e8385e3', class: `language-${this.language} bg-stronger pl-8 pb-8`, role: "region", "aria-label": `Code block in ${this.language}` }, h("code", { key: '72be161dd9781d9bc2f4d9495969175f34c19249', innerHTML: this.getHighlightedCode() })))));
83
+ return (h("div", { key: 'cb379e82bcf71345945b0b88397650ecd4992770', class: "relative bg-stronger rounded-sm" }, h("div", { key: '945046d4fd747cd64a83155b421a897e380cc612', class: "text-inverse flex justify-between items-center p-8" }, this.language ? (h("span", { class: "f-ui-03" }, this.language.toUpperCase())) : (h("pre", { class: "bg-stronger pl-8", role: "region", "aria-label": "Code block without language" }, h("code", { innerHTML: this.getHighlightedCode() }))), h("span", { key: '3f6c7e996101f0bb83fb8c9e6991a205a0b268c8', "aria-hidden": "true", class: "w-20 h-20 mt-8" }, h("eds-icon-wrapper", { key: '8ad9beb61058f29e688f6777233c61f7fb3ccfe8', icon: this.copied ? 'success' : 'copy', onClick: () => this.copyToClipboard() })), h("span", { key: 'a4f9a07906e1c2d9febb7ae789a3eed76dc422e9', class: "sr-only" }, "Copy Code")), this.language && (h("pre", { key: 'e31339126dd3cc885511aaa2bdf6f06f3a113c74', class: `language-${this.language} bg-stronger pl-8 pb-8`, role: "region", "aria-label": `Code block in ${this.language}` }, h("code", { key: '7efacd276f26a00f0f61793f6b8748259e1614b5', innerHTML: this.getHighlightedCode() })))));
30
84
  }
31
85
  static get is() { return "eds-code-block"; }
32
86
  static get encapsulation() { return "shadow"; }
@@ -54,7 +108,7 @@ export class EdsCodeBlock {
54
108
  "optional": false,
55
109
  "docs": {
56
110
  "tags": [],
57
- "text": "The code content to display"
111
+ "text": "The code content to display."
58
112
  },
59
113
  "attribute": "code",
60
114
  "reflect": false
@@ -83,4 +137,5 @@ export class EdsCodeBlock {
83
137
  "copied": {}
84
138
  };
85
139
  }
140
+ static get elementRef() { return "el"; }
86
141
  }
@@ -0,0 +1,78 @@
1
+ export default {
2
+ title: 'Components/CodeBlock',
3
+ component: 'eds-code-block',
4
+ argTypes: {
5
+ code: {
6
+ control: 'text',
7
+ description: 'The code content to display in the code block.'
8
+ },
9
+ language: {
10
+ control: 'text',
11
+ description: 'The language type for syntax highlighting (e.g., "javascript", "python", "bash", "yaml").'
12
+ }
13
+ },
14
+ args: {
15
+ code: "const greeting = 'Hello, world!';\nconsole.log(greeting);",
16
+ language: 'javascript'
17
+ }
18
+ };
19
+ export const Default = {
20
+ render: (args) => `
21
+ <eds-code-block
22
+ code="${args.code}"
23
+ language="${args.language}"
24
+ ></eds-code-block>
25
+ `,
26
+ args: {
27
+ code: "const greeting = 'Hello, world!';\nconsole.log(greeting);",
28
+ language: 'javascript'
29
+ }
30
+ };
31
+ export const PythonExample = {
32
+ render: (args) => `
33
+ <eds-code-block
34
+ code="${args.code}"
35
+ language="${args.language}"
36
+ ></eds-code-block>
37
+ `,
38
+ args: {
39
+ code: "def hello_world():\n print('Hello, world!')",
40
+ language: 'python'
41
+ }
42
+ };
43
+ export const BashExample = {
44
+ render: (args) => `
45
+ <eds-code-block
46
+ code="${args.code}"
47
+ language="${args.language}"
48
+ ></eds-code-block>
49
+ `,
50
+ args: {
51
+ code: '#!/bin/bash\necho "Hello, world!"',
52
+ language: 'bash'
53
+ }
54
+ };
55
+ export const YamlExample = {
56
+ render: (args) => `
57
+ <eds-code-block
58
+ code="${args.code}"
59
+ language="${args.language}"
60
+ ></eds-code-block>
61
+ `,
62
+ args: {
63
+ code: 'greeting: "Hello, world!"',
64
+ language: 'yaml'
65
+ }
66
+ };
67
+ export const UnsupportedLanguage = {
68
+ render: (args) => `
69
+ <eds-code-block
70
+ code="${args.code}"
71
+ language="${args.language}"
72
+ ></eds-code-block>
73
+ `,
74
+ args: {
75
+ code: 'This is a code block with an unsupported language. It will render without syntax highlighting.',
76
+ language: 'unknown'
77
+ }
78
+ };
@@ -1,3 +1,4 @@
1
+ import { sendAnalytics } from "../../utils/analytics";
1
2
  import { h } from "@stencil/core";
2
3
  /**
3
4
  * `EdsDropdown` is a versatile dropdown component that provides a list of items
@@ -19,6 +20,7 @@ export class EdsDropdown {
19
20
  * Toggles the visibility of the dropdown and manages focus.
20
21
  */
21
22
  this.handleClick = () => {
23
+ var _a;
22
24
  this.isOpen = !this.isOpen;
23
25
  if (this.isOpen) {
24
26
  this.focusIndex = 0;
@@ -27,6 +29,13 @@ export class EdsDropdown {
27
29
  else {
28
30
  this.closeDropdown();
29
31
  }
32
+ sendAnalytics({
33
+ category: 'ui-component',
34
+ parentContext: null,
35
+ tag: this.host.tagName.toLowerCase(),
36
+ name: ((_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
37
+ action: this.isOpen ? 'expanded' : 'collapsed'
38
+ });
30
39
  };
31
40
  this.icon = 'chevron-down';
32
41
  this.label = undefined;
@@ -93,39 +102,20 @@ export class EdsDropdown {
93
102
  componentDidLoad() {
94
103
  var _a;
95
104
  this.focusableItems = Array.from(((_a = this.dropdownContent) === null || _a === void 0 ? void 0 : _a.querySelectorAll('a, button')) || []);
96
- const btns = this.host.shadowRoot.querySelectorAll('eds-button');
97
- btns.forEach((btn) => {
98
- this.emitContext(btn);
99
- });
100
- }
101
- /**
102
- * Emits a custom event called `parentContext` for a given button element.
103
- * Provides context information about the dropdown component.
104
- *
105
- * @param linkElement - The button element to which the event will be dispatched.
106
- */
107
- emitContext(linkElement) {
108
- const event = new CustomEvent('parentContext', {
109
- detail: {
110
- componentName: this.host.tagName.toLowerCase(),
111
- identifier: null
112
- }
113
- });
114
- linkElement.dispatchEvent(event);
115
105
  }
116
106
  /**
117
107
  * Renders the dropdown component and displays its content when open.
118
108
  * @returns {JSX.Element} The rendered dropdown component.
119
109
  */
120
110
  render() {
121
- return (h("div", { key: 'd49e23ee208cfb000baba83795899487e4d94af7', class: "z-focus relative", ref: (el) => (this.dropdownContent = el) }, h("eds-button", { key: '6647007c34b47558873e470890893ae4f8e18b5c', label: this.label, "aria-label": this.ariaLabel, icon: this.icon, intent: this.intent, onClick: this.handleClick, "aria-expanded": this.isOpen.toString(), "aria-haspopup": "menu" }), h("nav", { key: '41bbd4e2bf02345393aaa97101b2c3aca2fa4085', class: {
111
+ return (h("div", { key: '84f4cea78ea1c40c7897a356fe03ac83922fccb8', class: "z-focus relative", ref: (el) => (this.dropdownContent = el) }, h("eds-button", { key: '99dc51632dc82830054502a2d6d77d9fcefe9337', label: this.label, "aria-label": this.ariaLabel, icon: this.icon, intent: this.intent, onClick: this.handleClick, "aria-expanded": this.isOpen.toString(), "aria-haspopup": "menu" }), h("nav", { key: 'a63613a7ecf709fd1d22d77da4b2d286905fef3e', role: "menu", class: {
122
112
  'shadow-small bg-inverse border-softest z-10 z-on-top absolute top-full mt-4 flex flex-col gap-y-4 border-2 p-8': true,
123
113
  'left-4': this.dropdownPos === 'left' && this.dropdownOffset,
124
114
  'left-0': this.dropdownPos === 'left' && !this.dropdownOffset,
125
115
  'right-4': this.dropdownPos === 'right' && this.dropdownOffset,
126
116
  'right-0': this.dropdownPos === 'right' && !this.dropdownOffset,
127
117
  'rounded-lg': this.rounded
128
- }, style: { display: this.isOpen ? 'block' : 'none' }, "aria-label": "Dropdown", "aria-hidden": !this.isOpen }, h("slot", { key: '714bad9f5a8ddf6d5ea246044a83b0a5102494c4' }))));
118
+ }, style: { display: this.isOpen ? 'block' : 'none' }, "aria-label": "Dropdown", "aria-hidden": !this.isOpen }, h("slot", { key: 'dda70b865ed03dc7ad36a32934587bbcb0a16c1b' }))));
129
119
  }
130
120
  static get is() { return "eds-dropdown"; }
131
121
  static get encapsulation() { return "shadow"; }