@infineon/infineon-design-system-stencil 37.12.1--canary.1988.42a4a34b0a478afeea7ca5b47d1e4a4ed329327b.0 → 37.12.1--canary.1987.b27982aa9c28fcf0181cb6d7ef6b4b7a07d87aeb.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 (257) hide show
  1. package/dist/cjs/ifx-alert_2.cjs.entry.js +1 -1
  2. package/dist/cjs/ifx-card.cjs.entry.js +11 -21
  3. package/dist/cjs/ifx-card.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ifx-chip_3.cjs.entry.js +1 -1
  5. package/dist/cjs/ifx-chip_3.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ifx-faq.cjs.entry.js +1 -1
  7. package/dist/cjs/ifx-link.cjs.entry.js +1 -1
  8. package/dist/cjs/ifx-link.cjs.entry.js.map +1 -1
  9. package/dist/cjs/ifx-progress-bar.cjs.entry.js +1 -1
  10. package/dist/cjs/ifx-progress-bar.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ifx-select.cjs.entry.js +43 -27
  12. package/dist/cjs/ifx-select.cjs.entry.js.map +1 -1
  13. package/dist/cjs/ifx-sidebar-item.cjs.entry.js +1 -1
  14. package/dist/cjs/ifx-sidebar-item.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ifx-slider.cjs.entry.js +3 -3
  16. package/dist/cjs/ifx-slider.cjs.entry.js.map +1 -1
  17. package/dist/cjs/ifx-spinner_2.cjs.entry.js +7 -7
  18. package/dist/cjs/ifx-spinner_2.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ifx-status.cjs.entry.js +1 -1
  20. package/dist/cjs/ifx-status.cjs.entry.js.map +1 -1
  21. package/dist/cjs/ifx-step.cjs.entry.js +1 -1
  22. package/dist/cjs/ifx-step.cjs.entry.js.map +1 -1
  23. package/dist/cjs/ifx-stepper.cjs.entry.js +2 -2
  24. package/dist/cjs/ifx-stepper.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ifx-switch.cjs.entry.js +1 -1
  26. package/dist/cjs/ifx-switch.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ifx-tag.cjs.entry.js +2 -2
  28. package/dist/cjs/ifx-tag.cjs.entry.js.map +1 -1
  29. package/dist/cjs/ifx-templates-ui.cjs.entry.js +1 -1
  30. package/dist/cjs/ifx-textarea.cjs.entry.js +3 -3
  31. package/dist/cjs/ifx-textarea.cjs.entry.js.map +1 -1
  32. package/dist/cjs/ifx-tooltip.cjs.entry.js +4 -4
  33. package/dist/cjs/ifx-tooltip.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ifx-tree-view-item.cjs.entry.js +2 -2
  35. package/dist/cjs/ifx-tree-view.cjs.entry.js +1 -1
  36. package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/collection/components/card/card.css +2 -2
  39. package/dist/collection/components/card/card.js +10 -20
  40. package/dist/collection/components/card/card.js.map +1 -1
  41. package/dist/collection/components/link/link.js +1 -1
  42. package/dist/collection/components/link/link.js.map +1 -1
  43. package/dist/collection/components/navigation/sidebar/sidebar-item.css +6 -2
  44. package/dist/collection/components/pagination/pagination.js +1 -1
  45. package/dist/collection/components/pagination/pagination.js.map +1 -1
  46. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  47. package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
  48. package/dist/collection/components/select/single-select/select.css +6 -0
  49. package/dist/collection/components/select/single-select/select.js +42 -26
  50. package/dist/collection/components/select/single-select/select.js.map +1 -1
  51. package/dist/collection/components/slider/slider.css +8 -0
  52. package/dist/collection/components/slider/slider.js +2 -2
  53. package/dist/collection/components/slider/slider.js.map +1 -1
  54. package/dist/collection/components/spinner/spinner.js +2 -2
  55. package/dist/collection/components/spinner/spinner.js.map +1 -1
  56. package/dist/collection/components/status/status.js +1 -1
  57. package/dist/collection/components/status/status.js.map +1 -1
  58. package/dist/collection/components/stepper/step/step.css +4 -0
  59. package/dist/collection/components/stepper/stepper.js +40 -2
  60. package/dist/collection/components/stepper/stepper.js.map +1 -1
  61. package/dist/collection/components/stepper/stepper.stories.js +30 -0
  62. package/dist/collection/components/stepper/stepper.stories.js.map +1 -1
  63. package/dist/collection/components/switch/switch.js +1 -1
  64. package/dist/collection/components/switch/switch.js.map +1 -1
  65. package/dist/collection/components/tag/tag.css +2 -5
  66. package/dist/collection/components/tag/tag.js +39 -1
  67. package/dist/collection/components/tag/tag.js.map +1 -1
  68. package/dist/collection/components/tag/tag.stories.js +29 -1
  69. package/dist/collection/components/tag/tag.stories.js.map +1 -1
  70. package/dist/collection/components/templates/template/template.js +1 -1
  71. package/dist/collection/components/templates/templates-ui/templates-ui.js +1 -1
  72. package/dist/collection/components/text-field/text-field.css +11 -2
  73. package/dist/collection/components/text-field/text-field.js +23 -4
  74. package/dist/collection/components/text-field/text-field.js.map +1 -1
  75. package/dist/collection/components/text-field/text-field.stories.js +17 -2
  76. package/dist/collection/components/text-field/text-field.stories.js.map +1 -1
  77. package/dist/collection/components/textarea/textarea.css +2 -2
  78. package/dist/collection/components/textarea/textarea.js +2 -2
  79. package/dist/collection/components/tooltip/tooltip.js +23 -4
  80. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  81. package/dist/collection/components/tooltip/tooltip.stories.js +16 -1
  82. package/dist/collection/components/tooltip/tooltip.stories.js.map +1 -1
  83. package/dist/collection/components/tree-view/tree-view-item.js +2 -2
  84. package/dist/collection/components/tree-view/tree-view.js +1 -1
  85. package/dist/collection/stories/setup-and-installation/faq/faq.js +1 -1
  86. package/dist/components/ifx-card.js +11 -21
  87. package/dist/components/ifx-card.js.map +1 -1
  88. package/dist/components/ifx-download.js +1 -1
  89. package/dist/components/ifx-faq.js +1 -1
  90. package/dist/components/ifx-file-upload.js +1 -1
  91. package/dist/components/ifx-icons-preview.js +2 -2
  92. package/dist/components/ifx-link.js +1 -1
  93. package/dist/components/ifx-list.js +1 -1
  94. package/dist/components/ifx-notification.js +1 -1
  95. package/dist/components/ifx-overview-table.js +1 -1
  96. package/dist/components/ifx-pagination.js +1 -1
  97. package/dist/components/ifx-progress-bar.js +1 -1
  98. package/dist/components/ifx-select.js +1 -1
  99. package/dist/components/ifx-set-filter.js +2 -2
  100. package/dist/components/ifx-sidebar-item.js +1 -1
  101. package/dist/components/ifx-sidebar-item.js.map +1 -1
  102. package/dist/components/ifx-slider.js +3 -3
  103. package/dist/components/ifx-slider.js.map +1 -1
  104. package/dist/components/ifx-spinner.js +1 -1
  105. package/dist/components/ifx-status.js +1 -1
  106. package/dist/components/ifx-status.js.map +1 -1
  107. package/dist/components/ifx-step.js +1 -1
  108. package/dist/components/ifx-step.js.map +1 -1
  109. package/dist/components/ifx-stepper.js +4 -2
  110. package/dist/components/ifx-stepper.js.map +1 -1
  111. package/dist/components/ifx-switch.js +1 -1
  112. package/dist/components/ifx-switch.js.map +1 -1
  113. package/dist/components/ifx-table.js +2 -2
  114. package/dist/components/ifx-tag.js +5 -3
  115. package/dist/components/ifx-tag.js.map +1 -1
  116. package/dist/components/ifx-template.js +1 -1
  117. package/dist/components/ifx-templates-ui.js +5 -5
  118. package/dist/components/ifx-text-field.js +1 -1
  119. package/dist/components/ifx-textarea.js +3 -3
  120. package/dist/components/ifx-textarea.js.map +1 -1
  121. package/dist/components/ifx-tooltip.js +5 -4
  122. package/dist/components/ifx-tooltip.js.map +1 -1
  123. package/dist/components/ifx-tree-view-item.js +2 -2
  124. package/dist/components/ifx-tree-view.js +1 -1
  125. package/dist/components/{p-1bd23a52.js → p-01ec76f0.js} +3 -3
  126. package/dist/components/p-01ec76f0.js.map +1 -0
  127. package/dist/components/{p-2d712043.js → p-031c3ed3.js} +2 -2
  128. package/dist/components/p-031c3ed3.js.map +1 -0
  129. package/dist/components/{p-5dd50ee8.js → p-4d955838.js} +44 -28
  130. package/dist/components/p-4d955838.js.map +1 -0
  131. package/dist/components/{p-4cea50e1.js → p-5f78da32.js} +2 -2
  132. package/dist/components/{p-4cea50e1.js.map → p-5f78da32.js.map} +1 -1
  133. package/dist/components/{p-f58ef41c.js → p-63a6c65a.js} +5 -5
  134. package/dist/components/{p-f58ef41c.js.map → p-63a6c65a.js.map} +1 -1
  135. package/dist/components/{p-f27f2aad.js → p-67efc4cd.js} +2 -2
  136. package/dist/components/p-67efc4cd.js.map +1 -0
  137. package/dist/components/p-ab2957b9.js +125 -0
  138. package/dist/components/p-ab2957b9.js.map +1 -0
  139. package/dist/components/{p-b58ed8a4.js → p-d0da3d4f.js} +3 -3
  140. package/dist/components/p-d0da3d4f.js.map +1 -0
  141. package/dist/esm/ifx-alert_2.entry.js +1 -1
  142. package/dist/esm/ifx-card.entry.js +11 -21
  143. package/dist/esm/ifx-card.entry.js.map +1 -1
  144. package/dist/esm/ifx-chip_3.entry.js +1 -1
  145. package/dist/esm/ifx-chip_3.entry.js.map +1 -1
  146. package/dist/esm/ifx-faq.entry.js +1 -1
  147. package/dist/esm/ifx-link.entry.js +1 -1
  148. package/dist/esm/ifx-link.entry.js.map +1 -1
  149. package/dist/esm/ifx-progress-bar.entry.js +1 -1
  150. package/dist/esm/ifx-progress-bar.entry.js.map +1 -1
  151. package/dist/esm/ifx-select.entry.js +43 -27
  152. package/dist/esm/ifx-select.entry.js.map +1 -1
  153. package/dist/esm/ifx-sidebar-item.entry.js +1 -1
  154. package/dist/esm/ifx-sidebar-item.entry.js.map +1 -1
  155. package/dist/esm/ifx-slider.entry.js +3 -3
  156. package/dist/esm/ifx-slider.entry.js.map +1 -1
  157. package/dist/esm/ifx-spinner_2.entry.js +7 -7
  158. package/dist/esm/ifx-spinner_2.entry.js.map +1 -1
  159. package/dist/esm/ifx-status.entry.js +1 -1
  160. package/dist/esm/ifx-status.entry.js.map +1 -1
  161. package/dist/esm/ifx-step.entry.js +1 -1
  162. package/dist/esm/ifx-step.entry.js.map +1 -1
  163. package/dist/esm/ifx-stepper.entry.js +2 -2
  164. package/dist/esm/ifx-stepper.entry.js.map +1 -1
  165. package/dist/esm/ifx-switch.entry.js +1 -1
  166. package/dist/esm/ifx-switch.entry.js.map +1 -1
  167. package/dist/esm/ifx-tag.entry.js +2 -2
  168. package/dist/esm/ifx-tag.entry.js.map +1 -1
  169. package/dist/esm/ifx-templates-ui.entry.js +1 -1
  170. package/dist/esm/ifx-textarea.entry.js +3 -3
  171. package/dist/esm/ifx-textarea.entry.js.map +1 -1
  172. package/dist/esm/ifx-tooltip.entry.js +4 -4
  173. package/dist/esm/ifx-tooltip.entry.js.map +1 -1
  174. package/dist/esm/ifx-tree-view-item.entry.js +2 -2
  175. package/dist/esm/ifx-tree-view.entry.js +1 -1
  176. package/dist/esm/infineon-design-system-stencil.js +1 -1
  177. package/dist/esm/loader.js +1 -1
  178. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
  179. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
  180. package/dist/infineon-design-system-stencil/p-0bddd006.entry.js +2 -0
  181. package/dist/infineon-design-system-stencil/p-0bddd006.entry.js.map +1 -0
  182. package/dist/infineon-design-system-stencil/p-171f6c74.entry.js +2 -0
  183. package/dist/infineon-design-system-stencil/p-171f6c74.entry.js.map +1 -0
  184. package/dist/infineon-design-system-stencil/p-251fefee.entry.js +2 -0
  185. package/dist/infineon-design-system-stencil/p-251fefee.entry.js.map +1 -0
  186. package/dist/infineon-design-system-stencil/{p-daca9ec0.entry.js → p-28e7dc9d.entry.js} +2 -2
  187. package/dist/infineon-design-system-stencil/p-28e7dc9d.entry.js.map +1 -0
  188. package/dist/infineon-design-system-stencil/{p-eb8b78e4.entry.js → p-28f2ea42.entry.js} +2 -2
  189. package/dist/infineon-design-system-stencil/{p-eb8b78e4.entry.js.map → p-28f2ea42.entry.js.map} +1 -1
  190. package/dist/infineon-design-system-stencil/{p-03690ea5.entry.js → p-2cefc6c3.entry.js} +2 -2
  191. package/dist/infineon-design-system-stencil/p-2cefc6c3.entry.js.map +1 -0
  192. package/dist/infineon-design-system-stencil/p-45d59da5.entry.js +2 -0
  193. package/dist/infineon-design-system-stencil/{p-fbc808e2.entry.js.map → p-45d59da5.entry.js.map} +1 -1
  194. package/dist/infineon-design-system-stencil/{p-24d7ff6e.entry.js → p-56586b39.entry.js} +2 -2
  195. package/dist/infineon-design-system-stencil/p-56586b39.entry.js.map +1 -0
  196. package/dist/infineon-design-system-stencil/{p-e6632fdc.entry.js → p-6b43ea01.entry.js} +2 -2
  197. package/dist/infineon-design-system-stencil/p-6b43ea01.entry.js.map +1 -0
  198. package/dist/infineon-design-system-stencil/{p-fdb22b89.entry.js → p-6ec8258a.entry.js} +2 -2
  199. package/dist/infineon-design-system-stencil/p-71058002.entry.js +2 -0
  200. package/dist/infineon-design-system-stencil/p-71058002.entry.js.map +1 -0
  201. package/dist/infineon-design-system-stencil/p-73b3be0e.entry.js +2 -0
  202. package/dist/infineon-design-system-stencil/p-73b3be0e.entry.js.map +1 -0
  203. package/dist/infineon-design-system-stencil/{p-0701035c.entry.js → p-7958bc33.entry.js} +2 -2
  204. package/dist/infineon-design-system-stencil/p-7cd2e63c.entry.js +2 -0
  205. package/dist/infineon-design-system-stencil/p-7cd2e63c.entry.js.map +1 -0
  206. package/dist/infineon-design-system-stencil/{p-bcf3f499.entry.js → p-a4541ce1.entry.js} +2 -2
  207. package/dist/infineon-design-system-stencil/{p-bcf3f499.entry.js.map → p-a4541ce1.entry.js.map} +1 -1
  208. package/dist/infineon-design-system-stencil/p-b1d233fd.entry.js +2 -0
  209. package/dist/infineon-design-system-stencil/p-b1d233fd.entry.js.map +1 -0
  210. package/dist/infineon-design-system-stencil/{p-33b46161.entry.js → p-cce095cb.entry.js} +2 -2
  211. package/dist/infineon-design-system-stencil/{p-e3f6431c.entry.js → p-ed30fb98.entry.js} +2 -2
  212. package/dist/infineon-design-system-stencil/{p-7078cbee.entry.js → p-ed76f48a.entry.js} +2 -2
  213. package/dist/infineon-design-system-stencil/{p-fbaf1c8a.entry.js → p-fc13a4d6.entry.js} +2 -2
  214. package/dist/infineon-design-system-stencil/p-fc13a4d6.entry.js.map +1 -0
  215. package/dist/types/components/card/card.d.ts +0 -1
  216. package/dist/types/components/stepper/stepper.d.ts +2 -0
  217. package/dist/types/components/stepper/stepper.stories.d.ts +28 -0
  218. package/dist/types/components/tag/tag.d.ts +2 -0
  219. package/dist/types/components/tag/tag.stories.d.ts +28 -0
  220. package/dist/types/components/text-field/text-field.d.ts +1 -0
  221. package/dist/types/components/text-field/text-field.stories.d.ts +14 -0
  222. package/dist/types/components/tooltip/tooltip.d.ts +1 -0
  223. package/dist/types/components/tooltip/tooltip.stories.d.ts +14 -0
  224. package/dist/types/components.d.ts +12 -0
  225. package/package.json +1 -1
  226. package/dist/components/p-1bd23a52.js.map +0 -1
  227. package/dist/components/p-2d712043.js.map +0 -1
  228. package/dist/components/p-5dd50ee8.js.map +0 -1
  229. package/dist/components/p-607359ae.js +0 -124
  230. package/dist/components/p-607359ae.js.map +0 -1
  231. package/dist/components/p-b58ed8a4.js.map +0 -1
  232. package/dist/components/p-f27f2aad.js.map +0 -1
  233. package/dist/infineon-design-system-stencil/p-03690ea5.entry.js.map +0 -1
  234. package/dist/infineon-design-system-stencil/p-24d7ff6e.entry.js.map +0 -1
  235. package/dist/infineon-design-system-stencil/p-3bce1f22.entry.js +0 -2
  236. package/dist/infineon-design-system-stencil/p-3bce1f22.entry.js.map +0 -1
  237. package/dist/infineon-design-system-stencil/p-65a5cdd0.entry.js +0 -2
  238. package/dist/infineon-design-system-stencil/p-65a5cdd0.entry.js.map +0 -1
  239. package/dist/infineon-design-system-stencil/p-6f43f8cb.entry.js +0 -2
  240. package/dist/infineon-design-system-stencil/p-6f43f8cb.entry.js.map +0 -1
  241. package/dist/infineon-design-system-stencil/p-7b2c1280.entry.js +0 -2
  242. package/dist/infineon-design-system-stencil/p-7b2c1280.entry.js.map +0 -1
  243. package/dist/infineon-design-system-stencil/p-81b6afb3.entry.js +0 -2
  244. package/dist/infineon-design-system-stencil/p-81b6afb3.entry.js.map +0 -1
  245. package/dist/infineon-design-system-stencil/p-b6b68e30.entry.js +0 -2
  246. package/dist/infineon-design-system-stencil/p-b6b68e30.entry.js.map +0 -1
  247. package/dist/infineon-design-system-stencil/p-daca9ec0.entry.js.map +0 -1
  248. package/dist/infineon-design-system-stencil/p-e5e7a3d5.entry.js +0 -2
  249. package/dist/infineon-design-system-stencil/p-e5e7a3d5.entry.js.map +0 -1
  250. package/dist/infineon-design-system-stencil/p-e6632fdc.entry.js.map +0 -1
  251. package/dist/infineon-design-system-stencil/p-fbaf1c8a.entry.js.map +0 -1
  252. package/dist/infineon-design-system-stencil/p-fbc808e2.entry.js +0 -2
  253. /package/dist/infineon-design-system-stencil/{p-fdb22b89.entry.js.map → p-6ec8258a.entry.js.map} +0 -0
  254. /package/dist/infineon-design-system-stencil/{p-0701035c.entry.js.map → p-7958bc33.entry.js.map} +0 -0
  255. /package/dist/infineon-design-system-stencil/{p-33b46161.entry.js.map → p-cce095cb.entry.js.map} +0 -0
  256. /package/dist/infineon-design-system-stencil/{p-e3f6431c.entry.js.map → p-ed30fb98.entry.js.map} +0 -0
  257. /package/dist/infineon-design-system-stencil/{p-7078cbee.entry.js.map → p-ed76f48a.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../src/components/text-field/text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAgB,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AASzE,MAAM,OAAO,SAAS;IAPtB;QAUU,gBAAW,GAAW,aAAa,CAAA;QAClB,UAAK,GAAW,EAAE,CAA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Q,kBAAkB,IAC7E,IAAI,CAAC,OAAO,CACT;gBACP,IAAI,CAAC,KAAK;oBACT,4DAAK,KAAK,EAAC,yCAAyC,IACjD,IAAI,CAAC,OAAO,CACT,CACJ,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Event, Element, Prop, EventEmitter, Watch, Method, AttachInternals, State } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking'; \nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\n\n@Component({\n tag: 'ifx-text-field',\n styleUrl: 'text-field.scss',\n shadow: true,\n formAssociated: true\n})\n\nexport class TextField {\n private inputElement: HTMLInputElement;\n @Element() el;\n @Prop() placeholder: string = \"Placeholder\"\n @Prop({ mutable: true }) value: string = '';\n @Prop() error: boolean = false;\n @Prop() label: string = \"\";\n @Prop() icon: string = \"\";\n @Prop() caption: string = \"\";\n @Prop() size: string = 'm';\n @Prop() required: boolean = false;\n @Prop() optional: boolean = false;\n @Prop() success: boolean = false;\n @Prop() disabled: boolean = false;\n @Prop() maxlength?: number;\n @Prop() showDeleteIcon: boolean = false;\n @Prop() autocomplete: string = 'on'\n @Prop() type: 'text' | 'password' = 'text';\n @Prop() internalId: string = \"text-field\"\n @State() internalType: string;\n @Event() ifxInput: EventEmitter<String>;\n // @Prop({ reflect: true })\n // resetOnSubmit: boolean = false;\n\n @AttachInternals() internals: ElementInternals;\n\n\n @Watch('value')\n valueWatcher(newValue: string) {\n if (newValue !== this.inputElement.value) {\n this.inputElement.value = newValue;\n }\n }\n\n @Method()\n async reset() {\n this.value = '';\n this.inputElement.value = '';\n }\n\n handleDeleteContent() {\n this.reset();\n this.ifxInput.emit(this.value);\n }\n\n handleInput() {\n const query = this.inputElement.value;\n this.value = query; // update the value property when input changes\n this.internals.setFormValue(query) // update form value\n this.ifxInput.emit(this.value);\n }\n\n handleTypeProp() { \n this.internalType = this.type === 'text' || this.type === 'password' ? this.type : 'text'\n }\n\n formResetCallback() {\n this.internals.setValidity({});\n this.internals.setFormValue(\"\");\n }\n\n componentWillLoad() { \n this.handleTypeProp()\n }\n\n async componentDidLoad() { \n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-text-field', await framework)\n }\n }\n\n render() {\n return (\n <div aria-label=\"a text field for user input\" aria-value={this.value} aria-disabled={this.disabled} class={`textInput__container ${this.disabled ? 'disabled' : \"\"}`}>\n <div class=\"textInput__top-wrapper\">\n <label htmlFor={this.internalId}>\n <slot></slot>\n {this.optional && this.required ? (\n <span class=\"optional-required\">(optional) *</span>\n ) : this.optional ? (\n <span class=\"optional\">(optional)</span>\n ) : this.required ? (\n <span class={`required ${this.error ? 'error' : \"\"}`}>*</span>\n ) : null}\n </label>\n </div>\n\n <div class=\"textInput__bottom-wrapper\">\n <div class=\"input-container\">\n {this.icon && (\n <ifx-icon class='input-icon' icon={this.icon} />\n )}\n <input\n ref={(el) => (this.inputElement = el)}\n disabled={this.disabled}\n autocomplete={this.autocomplete}\n type={this.internalType}\n id={this.internalId}\n value={this.value}\n onInput={() => this.handleInput()}\n placeholder={this.placeholder}\n maxlength={this.maxlength}\n class={\n `${this.icon ? 'icon' : \"\"}\n ${this.error ? 'error' : \"\"} \n ${this.size === \"s\" ? \"input-s\" : \"\"}\n ${this.success ? \"success\" : \"\"}`} />\n\n { (this.showDeleteIcon && this.value) && (\n <ifx-icon class=\"delete-icon\" icon=\"cRemove16\" onClick={() => this.handleDeleteContent()}></ifx-icon> \n )}\n </div>\n {this.caption && !this.error &&\n <div class={`textInput__bottom-wrapper-caption ${this.disabled} ? disabled : \"\"`}>\n {this.caption}\n </div>}\n {this.error &&\n <div class=\"textInput__bottom-wrapper-caption error\">\n {this.caption}\n </div>}\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../src/components/text-field/text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAgB,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AASzE,MAAM,OAAO,SAAS;IAPtB;QAUU,gBAAW,GAAW,aAAa,CAAA;QAClB,UAAK,GAAW,EAAE,CAAC;QACpC,UAAK,GAAY,KAAK,CAAC;QACvB,UAAK,GAAW,EAAE,CAAC;QACnB,SAAI,GAAW,EAAE,CAAC;QAClB,YAAO,GAAW,EAAE,CAAC;QACrB,SAAI,GAAW,GAAG,CAAC;QACnB,aAAQ,GAAY,KAAK,CAAC;QAC1B,aAAQ,GAAY,KAAK,CAAC;QAC1B,YAAO,GAAY,KAAK,CAAC;QACzB,aAAQ,GAAY,KAAK,CAAC;QAE1B,mBAAc,GAAY,KAAK,CAAC;QAChC,iBAAY,GAAW,IAAI,CAAA;QAC3B,SAAI,GAAwB,MAAM,CAAC;QACnC,eAAU,GAAW,YAAY,CAAA;KAiH1C;I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AAO,CACT,CACJ,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Event, Element, Prop, EventEmitter, Watch, Method, AttachInternals, State } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking'; \nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\n\n@Component({\n tag: 'ifx-text-field',\n styleUrl: 'text-field.scss',\n shadow: true,\n formAssociated: true\n})\n\nexport class TextField {\n private inputElement: HTMLInputElement;\n @Element() el;\n @Prop() placeholder: string = \"Placeholder\"\n @Prop({ mutable: true }) value: string = '';\n @Prop() error: boolean = false;\n @Prop() label: string = \"\";\n @Prop() icon: string = \"\";\n @Prop() caption: string = \"\";\n @Prop() size: string = 'm';\n @Prop() required: boolean = false;\n @Prop() optional: boolean = false;\n @Prop() success: boolean = false;\n @Prop() disabled: boolean = false;\n @Prop() maxlength?: number;\n @Prop() showDeleteIcon: boolean = false;\n @Prop() autocomplete: string = 'on'\n @Prop() type: 'text' | 'password' = 'text';\n @Prop() internalId: string = \"text-field\"\n @Prop() ariaLabel: string | null;\n @State() internalType: string;\n @Event() ifxInput: EventEmitter<String>;\n // @Prop({ reflect: true })\n // resetOnSubmit: boolean = false;\n\n @AttachInternals() internals: ElementInternals;\n\n\n @Watch('value')\n valueWatcher(newValue: string) {\n if (newValue !== this.inputElement.value) {\n this.inputElement.value = newValue;\n }\n }\n\n @Method()\n async reset() {\n this.value = '';\n this.inputElement.value = '';\n }\n\n handleDeleteContent() {\n this.reset();\n this.ifxInput.emit(this.value);\n }\n\n handleInput() {\n const query = this.inputElement.value;\n this.value = query; // update the value property when input changes\n this.internals.setFormValue(query) // update form value\n this.ifxInput.emit(this.value);\n }\n\n handleTypeProp() { \n this.internalType = this.type === 'text' || this.type === 'password' ? this.type : 'text'\n }\n\n formResetCallback() {\n this.internals.setValidity({});\n this.internals.setFormValue(\"\");\n }\n\n componentWillLoad() { \n this.handleTypeProp()\n }\n\n async componentDidLoad() { \n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-text-field', await framework)\n }\n }\n\n render() {\n return (\n <div aria-label={this.ariaLabel} aria-value={this.value} aria-disabled={this.disabled} class={`textInput__container ${this.disabled ? 'disabled' : \"\"}`}>\n <div class=\"textInput__top-wrapper\">\n <label htmlFor={this.internalId}>\n <slot></slot>\n {this.optional && this.required ? (\n <span class=\"optional-required\">(optional) *</span>\n ) : this.optional ? (\n <span class=\"optional\">(optional)</span>\n ) : this.required ? (\n <span class={`required ${this.error ? 'error' : \"\"}`}>*</span>\n ) : null}\n </label>\n </div>\n\n <div class=\"textInput__bottom-wrapper\">\n <div class=\"input-container\">\n {this.icon && (\n <ifx-icon class='input-icon' icon={this.icon} />\n )}\n <input\n tabindex={this.disabled ? '-1' : '0'}\n ref={(el) => (this.inputElement = el)}\n disabled={this.disabled}\n autocomplete={this.autocomplete}\n type={this.internalType}\n id={this.internalId}\n value={this.value}\n onInput={() => this.handleInput()}\n placeholder={this.placeholder}\n maxlength={this.maxlength}\n class={\n `${this.icon ? 'icon' : \"\"}\n ${this.error ? 'error' : \"\"} \n ${this.size === \"s\" ? \"input-s\" : \"\"}\n ${this.success ? \"success\" : \"\"}`} />\n\n { (this.showDeleteIcon && this.value) && (\n <ifx-icon tabindex={this.disabled ? '-1' : '0'} \n class=\"delete-icon\" \n icon=\"cRemove16\" \n onKeyDown={(event) => event.key === 'Enter' && this.handleDeleteContent()} \n onClick={() => this.handleDeleteContent()}></ifx-icon> \n )}\n </div>\n {this.caption && !this.error &&\n <div class={`textInput__bottom-wrapper-caption ${this.disabled} ? disabled : \"\"`}>\n {this.caption}\n </div>}\n {this.error &&\n <div class=\"textInput__bottom-wrapper-caption error\">\n {this.caption}\n </div>}\n </div>\n </div>\n );\n }\n}\n"]}
@@ -20,7 +20,8 @@ export default {
20
20
  value: '',
21
21
  autocomplete: 'on',
22
22
  type: 'text',
23
- internalId: 'text-field'
23
+ internalId: 'text-field',
24
+ ariaLabel: 'text field for user input'
24
25
  },
25
26
  argTypes: {
26
27
  label: {
@@ -178,6 +179,19 @@ export default {
178
179
  }
179
180
  }
180
181
  },
182
+ ariaLabel: {
183
+ description: 'Aria label of the Tag.',
184
+ control: 'text',
185
+ table: {
186
+ category: 'ARIA Labels',
187
+ defaultValue: {
188
+ summary: '',
189
+ },
190
+ type: {
191
+ summary: 'string',
192
+ },
193
+ },
194
+ },
181
195
  ifxInput: {
182
196
  action: 'ifxInput',
183
197
  description: 'Custom event emitted on input change.',
@@ -191,7 +205,7 @@ export default {
191
205
  },
192
206
  },
193
207
  };
194
- const DefaultTemplate = ({ error, disabled, success, size, placeholder, label, caption, icon, required, optional, name, maxlength, showDeleteIcon, value, autocomplete, type, internalId }) => {
208
+ const DefaultTemplate = ({ error, disabled, success, size, placeholder, label, caption, icon, required, optional, name, maxlength, showDeleteIcon, value, autocomplete, type, internalId, ariaLabel }) => {
195
209
  const element = document.createElement('ifx-text-field');
196
210
  element.setAttribute('error', error);
197
211
  element.setAttribute('disabled', disabled);
@@ -208,6 +222,7 @@ const DefaultTemplate = ({ error, disabled, success, size, placeholder, label, c
208
222
  element.setAttribute('autocomplete', autocomplete);
209
223
  element.setAttribute('type', type);
210
224
  element.setAttribute('internal-id', internalId);
225
+ element.setAttribute('aria-label', ariaLabel);
211
226
  if (maxlength)
212
227
  element.setAttribute('maxlength', maxlength);
213
228
  element.addEventListener('ifxInput', action('ifxInput'));
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.stories.js","sourceRoot":"","sources":["../../../src/components/text-field/text-field.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,sBAAsB;IAEtB,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,EAAE;QACR,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,IAAI;QAClB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,YAAY;KACzB;IAED,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,wDAAwD;YACrE,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;aAC3B;SACF;QACD,KAAK,EAAE;YACL,WAAW,EAAE,8CAA8C;YAC3D,KAAK,EAAE;gBACL,QAAQ,EAAE,sBAAsB;gBAChC,YAAY,EAAE;oBACZ,OAAO,EAAE,KAAK;iBACf;aACF;SACF;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,0BAA0B;YACvC,KAAK,EAAE;gBACL,QAAQ,EAAE,sBAAsB;gBAChC,YAAY,EAAE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CAAC;IACnD,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC,OAAO,CAAC,YAAY,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAChD,IAAI,SAAS;QAAE,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAE5D,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAGzD,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Text Field',\n // tags: ['autodocs'],\n\n args: {\n label: 'Label',\n error: false,\n disabled: false,\n size: 'm',\n icon: '',\n success: false,\n placeholder: 'Placeholder',\n caption: 'Caption',\n required: true,\n optional: false,\n name: 'text-field',\n showDeleteIcon: false,\n maxlength: '',\n value: '',\n autocomplete: 'on',\n type: 'text',\n internalId: 'text-field'\n },\n\n argTypes: {\n label: {\n name: 'Label of Text Field',\n description: 'The text label displayed above the *<ifx-text-field>*.',\n table: {\n category: 'story controls',\n }\n },\n error: {\n description: 'Indicates an error state for the text field.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n disabled: {\n description: 'Disables the text field.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n size: {\n description: 'Size options: s (36px) and m (40px) - default: m',\n options: ['s', 'm'],\n control: 'radio',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: 'm'\n }\n }\n },\n icon: {\n description: 'Specifies an icon to display within the text field.',\n options: Object.keys(icons),\n control: 'select',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: ''\n }\n }\n },\n success: {\n description: 'Indicates a successful state for the text field.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n placeholder: {\n description: 'Displays a placeholder text inside the text field when it is empty.',\n table: {\n category: 'ifx-text-field props',\n }\n },\n caption: {\n description: 'Text displayed below the text field to provide additional information.',\n table: {\n category: 'ifx-text-field props',\n }\n },\n required: {\n description: 'Marks the text field as required for form submission. Displays an asterisk next to the label when set to **true**.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: true\n }\n }\n },\n optional: {\n description: 'Indicates that the field is optional.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n name: {\n description: 'Name of the element, that is used as reference when a form is submitted.',\n table: {\n category: 'ifx-text-field props',\n }\n },\n showDeleteIcon: {\n description: 'Displays a delete icon inside the text field when set to **true**, allowing user to clear the input content.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n maxlength: {\n description: 'Specifies the maximum number of characters that can be entered into the text field.',\n control: 'number',\n table: {\n category: 'ifx-text-field props',\n }\n },\n value: {\n description: 'The value of the text field. It is used for the form submission.',\n control: 'text',\n table: {\n category: 'ifx-text-field props',\n type: {\n summary: 'string'\n }\n }\n },\n internalId: {\n description: 'Sets the ID of the internal input and the value of htmlFor for the label element',\n control: 'text',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: 'text-field'\n },\n type: {\n summary: 'string'\n }\n }\n },\n autocomplete: {\n description: 'Sets the autocomplete attribute. \"on\" by default.',\n control: 'text',\n table: {\n category: 'ifx-text-field props',\n type: {\n summary: 'string'\n }\n }\n },\n type: {\n description: 'Sets the type attribute. \"Text\" by default.',\n options: ['text', 'password'],\n control: 'radio',\n table: {\n category: 'ifx-text-field props',\n type: {\n summary: 'string'\n },\n defaultValue: {\n summary: 'text'\n }\n }\n },\n ifxInput: {\n action: 'ifxInput',\n description: 'Custom event emitted on input change.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxInput={handleInput}\\nVue:@ifxInput=\"handleInput\"\\nAngular:(ifxInput)=\"handleInput()\"\\nVanillaJs:.addEventListener(\"ifxInput\", (event) => {//handle input});',\n },\n },\n },\n },\n};\n\nconst DefaultTemplate = ({ error, disabled, success, size, placeholder, label, caption, icon, required, optional, name, maxlength, showDeleteIcon, value, autocomplete, type, internalId }) => {\n const element = document.createElement('ifx-text-field');\n element.setAttribute('error', error);\n element.setAttribute('disabled', disabled);\n element.setAttribute('size', size);\n element.setAttribute('icon', icon);\n element.setAttribute('success', success);\n element.setAttribute('placeholder', placeholder);\n element.setAttribute('caption', caption);\n element.setAttribute('required', required);\n element.setAttribute('optional', optional);\n element.setAttribute('name', name);\n element.setAttribute('show-delete-icon', showDeleteIcon);\n element.setAttribute('value', value);\n element.setAttribute('autocomplete', autocomplete);\n element.setAttribute('type', type);\n element.setAttribute('internal-id', internalId);\n if (maxlength) element.setAttribute('maxlength', maxlength);\n\n element.addEventListener('ifxInput', action('ifxInput'));\n\n\n const slotContent = document.createTextNode(label);\n element.appendChild(slotContent);\n\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});\n"]}
1
+ {"version":3,"file":"text-field.stories.js","sourceRoot":"","sources":["../../../src/components/text-field/text-field.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,sBAAsB;IAEtB,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,EAAE;QACR,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,aAAa;QAC1B,O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,CAAC,CAAC;IAGzD,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Text Field',\n // tags: ['autodocs'],\n\n args: {\n label: 'Label',\n error: false,\n disabled: false,\n size: 'm',\n icon: '',\n success: false,\n placeholder: 'Placeholder',\n caption: 'Caption',\n required: true,\n optional: false,\n name: 'text-field',\n showDeleteIcon: false,\n maxlength: '',\n value: '',\n autocomplete: 'on',\n type: 'text',\n internalId: 'text-field',\n ariaLabel: 'text field for user input'\n },\n\n argTypes: {\n label: {\n name: 'Label of Text Field',\n description: 'The text label displayed above the *<ifx-text-field>*.',\n table: {\n category: 'story controls',\n }\n },\n error: {\n description: 'Indicates an error state for the text field.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n disabled: {\n description: 'Disables the text field.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n size: {\n description: 'Size options: s (36px) and m (40px) - default: m',\n options: ['s', 'm'],\n control: 'radio',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: 'm'\n }\n }\n },\n icon: {\n description: 'Specifies an icon to display within the text field.',\n options: Object.keys(icons),\n control: 'select',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: ''\n }\n }\n },\n success: {\n description: 'Indicates a successful state for the text field.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n placeholder: {\n description: 'Displays a placeholder text inside the text field when it is empty.',\n table: {\n category: 'ifx-text-field props',\n }\n },\n caption: {\n description: 'Text displayed below the text field to provide additional information.',\n table: {\n category: 'ifx-text-field props',\n }\n },\n required: {\n description: 'Marks the text field as required for form submission. Displays an asterisk next to the label when set to **true**.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: true\n }\n }\n },\n optional: {\n description: 'Indicates that the field is optional.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n name: {\n description: 'Name of the element, that is used as reference when a form is submitted.',\n table: {\n category: 'ifx-text-field props',\n }\n },\n showDeleteIcon: {\n description: 'Displays a delete icon inside the text field when set to **true**, allowing user to clear the input content.',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: false\n }\n }\n },\n maxlength: {\n description: 'Specifies the maximum number of characters that can be entered into the text field.',\n control: 'number',\n table: {\n category: 'ifx-text-field props',\n }\n },\n value: {\n description: 'The value of the text field. It is used for the form submission.',\n control: 'text',\n table: {\n category: 'ifx-text-field props',\n type: {\n summary: 'string'\n }\n }\n },\n internalId: {\n description: 'Sets the ID of the internal input and the value of htmlFor for the label element',\n control: 'text',\n table: {\n category: 'ifx-text-field props',\n defaultValue: {\n summary: 'text-field'\n },\n type: {\n summary: 'string'\n }\n }\n },\n autocomplete: {\n description: 'Sets the autocomplete attribute. \"on\" by default.',\n control: 'text',\n table: {\n category: 'ifx-text-field props',\n type: {\n summary: 'string'\n }\n }\n },\n type: {\n description: 'Sets the type attribute. \"Text\" by default.',\n options: ['text', 'password'],\n control: 'radio',\n table: {\n category: 'ifx-text-field props',\n type: {\n summary: 'string'\n },\n defaultValue: {\n summary: 'text'\n }\n }\n },\n ariaLabel: {\n description: 'Aria label of the Tag.',\n control: 'text',\n table: {\n category: 'ARIA Labels',\n defaultValue: {\n summary: '',\n },\n type: {\n summary: 'string',\n },\n },\n },\n ifxInput: {\n action: 'ifxInput',\n description: 'Custom event emitted on input change.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxInput={handleInput}\\nVue:@ifxInput=\"handleInput\"\\nAngular:(ifxInput)=\"handleInput()\"\\nVanillaJs:.addEventListener(\"ifxInput\", (event) => {//handle input});',\n },\n },\n },\n },\n};\n\nconst DefaultTemplate = ({ error, disabled, success, size, placeholder, label, caption, icon, required, optional, name, maxlength, showDeleteIcon, value, autocomplete, type, internalId, ariaLabel }) => {\n const element = document.createElement('ifx-text-field');\n element.setAttribute('error', error);\n element.setAttribute('disabled', disabled);\n element.setAttribute('size', size);\n element.setAttribute('icon', icon);\n element.setAttribute('success', success);\n element.setAttribute('placeholder', placeholder);\n element.setAttribute('caption', caption);\n element.setAttribute('required', required);\n element.setAttribute('optional', optional);\n element.setAttribute('name', name);\n element.setAttribute('show-delete-icon', showDeleteIcon);\n element.setAttribute('value', value);\n element.setAttribute('autocomplete', autocomplete);\n element.setAttribute('type', type);\n element.setAttribute('internal-id', internalId);\n element.setAttribute('aria-label', ariaLabel);\n if (maxlength) element.setAttribute('maxlength', maxlength);\n\n element.addEventListener('ifxInput', action('ifxInput'));\n\n\n const slotContent = document.createTextNode(label);\n element.appendChild(slotContent);\n\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});\n"]}
@@ -48,8 +48,8 @@
48
48
  border: 1px solid #575352;
49
49
  }
50
50
  .wrapper__textarea textarea:focus-within {
51
- outline: none;
52
- border: 1px solid #0A8276;
51
+ outline: 2px solid #0A8276;
52
+ outline-offset: 0;
53
53
  }
54
54
 
55
55
  :host(.wrapper--error) .wrapper__textarea textarea {
@@ -54,8 +54,8 @@ export class TextArea {
54
54
  }
55
55
  render() {
56
56
  var _a, _b;
57
- return (h(Host, { key: '951419c82b71f92bc83f91fa69d6aab474ec9b71', class: `wrapper--${this.error ? 'error' : ''} wrapper--${this.disabled ? 'disabled' : ''}` }, h("label", { key: '0ea6af9a349ee0b01494ea6650b1d9c563e9fc7a', class: 'wrapper__label', htmlFor: this.inputId }, (_a = this.label) === null || _a === void 0 ? void 0 :
58
- _a.trim(), this.required && (h("span", { key: '0c4a1f59774489ec9310aacbc253f9ddab50b446', class: `required ${this.error ? 'error' : ""}` }, "*"))), h("div", { key: 'f7f0816826bb60c9c32fb0734f86c7801a2bea0e', class: 'wrapper__textarea' }, h("textarea", { key: '41819e87ff5bd6979512f8fadd2bd7065026cdad', "aria-label": 'a textarea', "aria-value": this.value, "aria-disabled": this.disabled, id: this.inputId, style: { resize: this.resize }, name: this.name ? this.name : this.inputId, cols: this.cols, rows: this.rows, maxlength: this.maxlength, wrap: this.wrap, disabled: this.disabled, readonly: this.readOnly, placeholder: this.placeholder, value: this.value, onInput: (e) => this.handleOnInput(e) })), ((_b = this.caption) === null || _b === void 0 ? void 0 : _b.trim()) && (h("div", { key: 'f1649ab138f761a360d8519e96976b76a642d5e7', class: 'wrapper__caption' }, this.caption.trim()))));
57
+ return (h(Host, { key: '12bde489e47781aec33e8d4926c4df84f59b2fbb', class: `wrapper--${this.error ? 'error' : ''} wrapper--${this.disabled ? 'disabled' : ''}` }, h("label", { key: '5e71a8259e4bad4c128964b1f1ce88e7ab6e79a4', class: 'wrapper__label', htmlFor: this.inputId }, (_a = this.label) === null || _a === void 0 ? void 0 :
58
+ _a.trim(), this.required && (h("span", { key: '50e89654dd63aea0d30960538b7deed3e8ae5bb1', class: `required ${this.error ? 'error' : ""}` }, "*"))), h("div", { key: 'd385ecd414a6b71a06ca64a8db477229b070f333', class: 'wrapper__textarea' }, h("textarea", { key: '4047c48ea3444963990899301eca7d744a7cb7fc', "aria-label": 'a textarea', "aria-value": this.value, "aria-disabled": this.disabled, id: this.inputId, style: { resize: this.resize }, name: this.name ? this.name : this.inputId, cols: this.cols, rows: this.rows, maxlength: this.maxlength, wrap: this.wrap, disabled: this.disabled, readonly: this.readOnly, placeholder: this.placeholder, value: this.value, onInput: (e) => this.handleOnInput(e) })), ((_b = this.caption) === null || _b === void 0 ? void 0 : _b.trim()) && (h("div", { key: '7f5dcfefb8274224155d0b0dcbc556a5443e21bd', class: 'wrapper__caption' }, this.caption.trim()))));
59
59
  }
60
60
  static get is() { return "ifx-textarea"; }
61
61
  static get encapsulation() { return "shadow"; }
@@ -155,10 +155,10 @@ export class Tooltip {
155
155
  'tooltip-extended': true,
156
156
  'visible': this.tooltipVisible,
157
157
  };
158
- return (h("div", { key: '079e144b7d8cf6312e5e165ec776f52e15417307', "aria-label": "a tooltip showing important information", "aria-value": this.header, class: "tooltip__container" }, h("slot", { key: 'f5e242eabb2fa73b80c0bc182735b17bb7fa8ceb' }), this.variant.toLowerCase() === 'dismissible' && h("div", { key: '288354bac7953b5a0e6c3d464c96cd3ee7994386', class: tooltipDismissible }, h("button", { key: 'dc13ab57c1fdbcd11ac7f8754902e5f864c3004d', "aria-label": "Close Tooltip", class: "close-button", onClick: this.onDismissClick }, h("ifx-icon", { key: '783cfe7a879c05e69e3473661b36d17e2c565935', icon: "cross16" })), h("div", { key: '1642b238ba748d58ab44d63d71d757fab656bd8b', class: "tooltip-dismissible-content" }, this.header && h("div", { key: 'b4c26f058431a5955cbd386c3426fe34f3de0a7f', class: "tooltip-dismissible-header" }, this.header), h("div", { key: '79c24e30da4957adc55a2a7ac32989e9425d35ce', class: "tooltip-dismissible-body" }, this.text)), h("svg", { key: '9ae17ee987acc122ed58d49106bf98b26945c30d', class: "tooltip-arrow-svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '4afd9b10d830241784a1d5f83c776dda35fe705b', id: "Indicator", d: "M6 0L12 8L0 8L6 0Z", fill: "#1D1D1D" }))), this.variant.toLowerCase() === 'compact' &&
159
- h("div", { key: '051255636a8ae3afefbec6ebfd55fb678fe13309', class: tooltipCompact }, this.text, h("svg", { key: '03c160fd88050c1d020e421277dbeb2a695e2e67', class: "tooltip-arrow-svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '08116653175441e46944a40b2ac4e5fcac2eaab4', id: "Indicator", d: "M6 0L12 8L0 8L6 0Z", fill: "#1D1D1D" }))), this.variant.toLowerCase() === 'extended' &&
160
- h("div", { key: 'f90f9969f922c74ce1ee47ed514a69c9174a771e', class: tooltipExtended }, h("slot", { key: '54f4f4e0891b8bdb69ec92c824faa0f9b72adcb1', name: "icon" }, this.icon ? h("div", { class: "extended_icon" }, h("ifx-icon", { icon: this.icon })) :
161
- h("svg", { class: "extended_icon", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24" }, h("path", { stroke: "#fff", "stroke-linecap": "round", "stroke-linejoin": "round", d: "M20.5 2.5h-16a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-16a2 2 0 0 0-2-2Z" }), h("path", { stroke: "#fff", d: "M19 17H6l2.5-4 2.097 2.516.405.486.379-.506 4.118-5.49.003-.002L19 17Z" }), h("path", { fill: "#fff", d: "M10 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" }))), h("div", { key: '68dae1e20d9b332b9172834d661d2c284bcf7e19', class: "tooltip-extended-content" }, this.header && h("div", { key: '1d3d19a91d848673cad09e6ed69b6a020a7d7971', class: "tooltip-extended-header" }, this.header), h("div", { key: '1b2ddfc31755b92a7222e24db4d1ba09922f0799', class: "tooltip-extended-body" }, this.text)), h("svg", { key: 'c03ab4f480dc50c2b53b99796e6eb570348f0eb8', class: "tooltip-arrow-svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '1f54bbdd47b72111f8f563ca394f20330ea29544', id: "Indicator", d: "M6 0L12 8L0 8L6 0Z", fill: "#1D1D1D" })))));
158
+ return (h("div", { key: '392a0dea33ce094c1c9edfa66bac570041c6faa8', "aria-label": this.ariaLabel, "aria-value": this.header, class: "tooltip__container" }, h("slot", { key: '060d3d893192da2f5c9e7da059a72ad24c3e96fb' }), this.variant.toLowerCase() === 'dismissible' && h("div", { key: 'f692d7b1592c89f011d5ecedf33bddf9eb76fea7', class: tooltipDismissible }, h("button", { key: 'ebb9ec532d359f6f3d7e27bce88d39a5bef0a02a', "aria-label": "Close Tooltip", class: "close-button", onClick: this.onDismissClick }, h("ifx-icon", { key: '5d6135b54703c7a9543913868033d20400c621d3', icon: "cross16" })), h("div", { key: '70a28bfc24bed55c221b2f63aabe22fe937cb9cb', class: "tooltip-dismissible-content" }, this.header && h("div", { key: 'a84b24eaf5770c80953a2a3b9bc58d4a47971d23', class: "tooltip-dismissible-header" }, this.header), h("div", { key: '5784c784d17950c0c656fd3b20b55d2c5439dfb4', class: "tooltip-dismissible-body" }, this.text)), h("svg", { key: '4873d99641fc0d149f7a8670d60b137da4850ec6', class: "tooltip-arrow-svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'fe2be9c1c3e054513a06279a93079ad27157c09f', id: "Indicator", d: "M6 0L12 8L0 8L6 0Z", fill: "#1D1D1D" }))), this.variant.toLowerCase() === 'compact' &&
159
+ h("div", { key: '8e01e6bce39dfe478415debfb61b2e9220b4d28e', class: tooltipCompact }, this.text, h("svg", { key: 'dab75581ded89658750d748b631a540c3f4f7646', class: "tooltip-arrow-svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'a25a3ec98ba2a6c59183ae0220a004d2c903757e', id: "Indicator", d: "M6 0L12 8L0 8L6 0Z", fill: "#1D1D1D" }))), this.variant.toLowerCase() === 'extended' &&
160
+ h("div", { key: '09283c102e17de29a463565681bca1eb5a1a0cb3', class: tooltipExtended }, h("slot", { key: '599a57702fbf73b7540eb59d3a7d2c1e82a63b06', name: "icon" }, this.icon ? h("div", { class: "extended_icon" }, h("ifx-icon", { icon: this.icon })) :
161
+ h("svg", { class: "extended_icon", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24" }, h("path", { stroke: "#fff", "stroke-linecap": "round", "stroke-linejoin": "round", d: "M20.5 2.5h-16a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-16a2 2 0 0 0-2-2Z" }), h("path", { stroke: "#fff", d: "M19 17H6l2.5-4 2.097 2.516.405.486.379-.506 4.118-5.49.003-.002L19 17Z" }), h("path", { fill: "#fff", d: "M10 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" }))), h("div", { key: 'b0e22b8bab61afc6150a3d2aa7d79d9744a0abf8', class: "tooltip-extended-content" }, this.header && h("div", { key: 'e7b46d17bf65831f2875af89326d0a5774910192', class: "tooltip-extended-header" }, this.header), h("div", { key: 'e5123a74a9234baf5fb6b5f25026217ea066d6b2', class: "tooltip-extended-body" }, this.text)), h("svg", { key: '321c1f9fca215417f9f68998fc0de65dc23c4a80', class: "tooltip-arrow-svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '99062b9d90e6c7c109612eb3b59170694c150f62', id: "Indicator", d: "M6 0L12 8L0 8L6 0Z", fill: "#1D1D1D" })))));
162
162
  }
163
163
  static get is() { return "ifx-tooltip"; }
164
164
  static get encapsulation() { return "shadow"; }
@@ -234,6 +234,25 @@ export class Tooltip {
234
234
  "reflect": false,
235
235
  "defaultValue": "'auto'"
236
236
  },
237
+ "ariaLabel": {
238
+ "type": "string",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "string | null",
242
+ "resolved": "string",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": ""
250
+ },
251
+ "getter": false,
252
+ "setter": false,
253
+ "attribute": "aria-label",
254
+ "reflect": false
255
+ },
237
256
  "variant": {
238
257
  "type": "string",
239
258
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE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,EAAC,MAAM,EAAC,CAAC,EAAC,8CAA8C,GAAG,CACjE,CAEH;oBACP,4DAAK,KAAK,EAAC,0BAA0B;wBAClC,IAAI,CAAC,MAAM,IAAI,4DAAK,KAAK,EAAC,yBAAyB,IAAE,IAAI,CAAC,MAAM,CAAO;wBACxE,4DAAK,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,IAAI,CAAO,CAChD;oBACN,4DAAK,KAAK,EAAC,mBAAmB,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,GAAG,EAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;wBACpH,6DAAM,EAAE,EAAC,WAAW,EAAC,CAAC,EAAC,oBAAoB,EAAC,IAAI,EAAC,SAAS,GAAG,CACzD,CACD,CAEL,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import { Component, Prop, h, Element, State, Watch } from '@stencil/core';\nimport { createPopper } from '@popperjs/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\n\n@Component({\n tag: 'ifx-tooltip',\n styleUrl: 'tooltip.scss',\n shadow: true\n})\nexport class Tooltip {\n\n @Element() el: HTMLElement;\n @State() tooltipVisible: boolean = false;\n @Prop() header: string = '';\n @Prop() text: string = '';\n @Prop() position: 'bottom-start' | 'top-start' | 'left' | 'bottom-end' | 'top-end' | 'right' | 'bottom' | 'top' | 'auto' = 'auto';\n @State() internalPosition: 'bottom-start' | 'top-start' | 'left' | 'bottom-end' | 'top-end' | 'right' | 'bottom' | 'top' | 'auto' = 'auto';\n\n @Prop() variant: 'compact' | 'dismissible' | 'extended' = 'compact';\n @Prop() icon: string;\n\n tooltipEl: HTMLElement;\n referenceEl: HTMLElement;\n popperInstance: any = null;\n\n\n componentWillLoad() { \n if(this.variant.toLowerCase().trim() === \"\") { \n this.variant = 'compact'\n }\n }\n \n async componentDidLoad() {\n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-tooltip', await framework)\n }\n const slotElement = this.el.shadowRoot.querySelector('.tooltip__container').firstChild;\n \n if(this.variant.toLowerCase() === 'compact' || this.variant.toLowerCase() === 'extended') {\n slotElement.addEventListener('mouseenter', this.onMouseEnter)\n slotElement.addEventListener('mouseleave', this.onMouseLeave)\n }else{\n slotElement.addEventListener('click', this.onClick);\n }\n\n }\n\n initializePopper() {\n if (this.popperInstance) return;\n\n this.referenceEl = this.el;\n this.tooltipEl;\n if (this.variant.toLowerCase() === 'compact') {\n this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip-compact');\n }\n else if (this.variant.toLowerCase() === 'dismissible') {\n this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip-dismissible');\n }\n else {\n this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip-extended');\n\n }\n\n const effectivePosition = this.position === 'auto' ? this.determineBestPosition() : this.position;\n\n // Set the internalPosition\n this.internalPosition = effectivePosition;\n\n if (this.tooltipEl && this.referenceEl) {\n\n this.popperInstance = createPopper(this.referenceEl, this.tooltipEl, {\n placement: this.internalPosition,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8] // this offset should be adjusted to ensure the tooltip doesn't overlap its reference element\n }\n },\n {\n name: 'arrow',\n options: {\n element: '.tooltip-arrow-svg'\n }\n }\n ]\n });\n\n }\n\n // Add this line to set the 'data-placement' attribute on the tooltip\n this.tooltipEl.setAttribute('data-placement', effectivePosition);\n\n\n }\n\n determineBestPosition() {\n // This is a simplified version, you can enhance this based on available viewport space.\n const rect = this.referenceEl.getBoundingClientRect();\n const yOffset = window.scrollY; // Get current scroll position\n const xOffset = window.scrollX; // Get current horizontal scroll position\n\n const verticalHalfwayPoint = rect.top + yOffset + rect.height / 2;\n const horizontalHalfwayPoint = rect.left + xOffset + rect.width / 2;\n\n if (this.position === 'auto') {\n if (verticalHalfwayPoint > window.innerHeight / 2) {\n if (horizontalHalfwayPoint > window.innerWidth / 2) {\n return 'top-end';\n } else {\n return 'top-start';\n }\n } else {\n if (horizontalHalfwayPoint > window.innerWidth / 2) {\n return 'bottom-end';\n } else {\n return 'bottom-start';\n }\n }\n } else {\n return this.position;\n }\n }\n\n @Watch('position')\n positionChanged(newVal: any) {\n this.internalPosition = newVal;\n this.popperInstance?.destroy();\n this.popperInstance = null; // Force re-initialization on next mouse enter\n }\n\n\n\n onMouseEnter = () => {\n // Enable the event listeners immediately\n this.popperInstance?.setOptions((options) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // Initialize the popper instance\n this.initializePopper();\n\n // Make the tooltip visible\n this.tooltipVisible = true;\n this.tooltipEl.style.display = 'block';\n\n // Update the popper instance immediately after initialization\n this.popperInstance?.update();\n }\n\n\n onMouseLeave = () => {\n this.tooltipVisible = false;\n this.tooltipEl.style.display = 'none';\n\n }\n\n disconnectedCallback() {\n this.popperInstance?.destroy();\n }\n\n onClick = () => {\n if (this.variant.toLowerCase() === 'dismissible') {\n this.initializePopper();\n this.tooltipVisible = !this.tooltipVisible;\n this.tooltipEl.style.display = this.tooltipVisible ? 'block' : 'none';\n this.popperInstance?.update();\n }\n }\n\n onDismissClick = () => {\n this.tooltipVisible = false;\n this.tooltipEl.style.display = 'none';\n }\n\n render() {\n const tooltipDismissible = {\n 'tooltip-dismissible': true,\n 'visible': this.tooltipVisible,\n };\n\n const tooltipCompact = {\n 'tooltip-compact': true,\n 'visible': this.tooltipVisible,\n };\n\n const tooltipExtended = {\n 'tooltip-extended': true,\n 'visible': this.tooltipVisible,\n };\n\n return (\n <div aria-label=\"a tooltip showing important information\" aria-value={this.header} class=\"tooltip__container\" >\n <slot></slot>\n\n {this.variant.toLowerCase() === 'dismissible' && <div class={tooltipDismissible}>\n <button aria-label=\"Close Tooltip\" class=\"close-button\" onClick={this.onDismissClick}>\n <ifx-icon icon=\"cross16\"></ifx-icon>\n </button>\n <div class=\"tooltip-dismissible-content\">\n {this.header && <div class=\"tooltip-dismissible-header\">{this.header}</div>}\n <div class=\"tooltip-dismissible-body\">{this.text}</div>\n </div>\n <svg class=\"tooltip-arrow-svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"Indicator\" d=\"M6 0L12 8L0 8L6 0Z\" fill=\"#1D1D1D\" />\n </svg>\n </div>\n }\n {this.variant.toLowerCase() === 'compact' &&\n <div class={tooltipCompact}>\n {this.text}\n <svg class=\"tooltip-arrow-svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"Indicator\" d=\"M6 0L12 8L0 8L6 0Z\" fill=\"#1D1D1D\" />\n </svg>\n </div>\n }\n {this.variant.toLowerCase() === 'extended' &&\n <div class={tooltipExtended}>\n <slot name=\"icon\">\n {this.icon ? <div class=\"extended_icon\"><ifx-icon icon={this.icon}></ifx-icon></div> :\n <svg class=\"extended_icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\">\n <path stroke=\"#fff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M20.5 2.5h-16a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-16a2 2 0 0 0-2-2Z\" />\n <path stroke=\"#fff\" d=\"M19 17H6l2.5-4 2.097 2.516.405.486.379-.506 4.118-5.49.003-.002L19 17Z\" />\n <path fill=\"#fff\" d=\"M10 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\" />\n </svg>\n }\n </slot>\n <div class=\"tooltip-extended-content\">\n {this.header && <div class=\"tooltip-extended-header\">{this.header}</div>}\n <div class=\"tooltip-extended-body\">{this.text}</div>\n </div>\n <svg class=\"tooltip-arrow-svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"Indicator\" d=\"M6 0L12 8L0 8L6 0Z\" fill=\"#1D1D1D\" />\n </svg>\n </div >\n }\n </div>\n );\n }\n\n\n}"]}
1
+ {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAOzE,MAAM,OAAO,OAAO;IALpB;QAQW,mBAAc,GAAY,KAAK,CAAC;QACjC,WAAM,GAAW,EAAE,CAAC;QACpB,SAAI,GAAW,EAAE,CAAC;QAClB,aAAQ,GAA2G,MAAM,CAAC;QACzH,qBAAgB,GAA2G,MAAM,CAAC;QAEnI,YAAO,GAA2C,SAAS,CAAC;QAKpE,mBAAc,GAAQ,IAAI,CAAC;QA+G3B,iBAAY,GAAG,GAAG,EAAE;;YAClB,yCAAyC;YACzC,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,iCACxC,OAAO,KACV,SAAS,EAAE;oBACT,GAAG,OAAO,CAAC,SAAS;oBACpB,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE;iBAC1C,IACD,CAAC,CAAC;YAEJ,iCAAiC;YACjC,IA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AK,KAAK,EAAC,eAAe;wBAAC,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,GAAa,CAAM,CAAC,CAAC;wBACpF,WAAK,KAAK,EAAC,eAAe,EAAC,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW;4BAClH,YAAM,MAAM,EAAC,MAAM,oBAAgB,OAAO,qBAAiB,OAAO,EAAC,CAAC,EAAC,kFAAkF,GAAG;4BAC1J,YAAM,MAAM,EAAC,MAAM,EAAC,CAAC,EAAC,wEAAwE,GAAG;4BACjG,YAAM,IAAI,EAAC,MAAM,EAAC,CAAC,EAAC,8CAA8C,GAAG,CACjE,CAEH;oBACP,4DAAK,KAAK,EAAC,0BAA0B;wBAClC,IAAI,CAAC,MAAM,IAAI,4DAAK,KAAK,EAAC,yBAAyB,IAAE,IAAI,CAAC,MAAM,CAAO;wBACxE,4DAAK,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,IAAI,CAAO,CAChD;oBACN,4DAAK,KAAK,EAAC,mBAAmB,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,GAAG,EAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;wBACpH,6DAAM,EAAE,EAAC,WAAW,EAAC,CAAC,EAAC,oBAAoB,EAAC,IAAI,EAAC,SAAS,GAAG,CACzD,CACD,CAEL,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import { Component, Prop, h, Element, State, Watch } from '@stencil/core';\nimport { createPopper } from '@popperjs/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\n\n@Component({\n tag: 'ifx-tooltip',\n styleUrl: 'tooltip.scss',\n shadow: true\n})\nexport class Tooltip {\n\n @Element() el: HTMLElement;\n @State() tooltipVisible: boolean = false;\n @Prop() header: string = '';\n @Prop() text: string = '';\n @Prop() position: 'bottom-start' | 'top-start' | 'left' | 'bottom-end' | 'top-end' | 'right' | 'bottom' | 'top' | 'auto' = 'auto';\n @State() internalPosition: 'bottom-start' | 'top-start' | 'left' | 'bottom-end' | 'top-end' | 'right' | 'bottom' | 'top' | 'auto' = 'auto';\n @Prop() ariaLabel: string | null;\n @Prop() variant: 'compact' | 'dismissible' | 'extended' = 'compact';\n @Prop() icon: string;\n\n tooltipEl: HTMLElement;\n referenceEl: HTMLElement;\n popperInstance: any = null;\n\n\n componentWillLoad() { \n if(this.variant.toLowerCase().trim() === \"\") { \n this.variant = 'compact'\n }\n }\n \n async componentDidLoad() {\n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-tooltip', await framework)\n }\n const slotElement = this.el.shadowRoot.querySelector('.tooltip__container').firstChild;\n \n if(this.variant.toLowerCase() === 'compact' || this.variant.toLowerCase() === 'extended') {\n slotElement.addEventListener('mouseenter', this.onMouseEnter)\n slotElement.addEventListener('mouseleave', this.onMouseLeave)\n }else{\n slotElement.addEventListener('click', this.onClick);\n }\n\n }\n\n initializePopper() {\n if (this.popperInstance) return;\n\n this.referenceEl = this.el;\n this.tooltipEl;\n if (this.variant.toLowerCase() === 'compact') {\n this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip-compact');\n }\n else if (this.variant.toLowerCase() === 'dismissible') {\n this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip-dismissible');\n }\n else {\n this.tooltipEl = this.el.shadowRoot.querySelector('.tooltip-extended');\n\n }\n\n const effectivePosition = this.position === 'auto' ? this.determineBestPosition() : this.position;\n\n // Set the internalPosition\n this.internalPosition = effectivePosition;\n\n if (this.tooltipEl && this.referenceEl) {\n\n this.popperInstance = createPopper(this.referenceEl, this.tooltipEl, {\n placement: this.internalPosition,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8] // this offset should be adjusted to ensure the tooltip doesn't overlap its reference element\n }\n },\n {\n name: 'arrow',\n options: {\n element: '.tooltip-arrow-svg'\n }\n }\n ]\n });\n\n }\n\n // Add this line to set the 'data-placement' attribute on the tooltip\n this.tooltipEl.setAttribute('data-placement', effectivePosition);\n\n\n }\n\n determineBestPosition() {\n // This is a simplified version, you can enhance this based on available viewport space.\n const rect = this.referenceEl.getBoundingClientRect();\n const yOffset = window.scrollY; // Get current scroll position\n const xOffset = window.scrollX; // Get current horizontal scroll position\n\n const verticalHalfwayPoint = rect.top + yOffset + rect.height / 2;\n const horizontalHalfwayPoint = rect.left + xOffset + rect.width / 2;\n\n if (this.position === 'auto') {\n if (verticalHalfwayPoint > window.innerHeight / 2) {\n if (horizontalHalfwayPoint > window.innerWidth / 2) {\n return 'top-end';\n } else {\n return 'top-start';\n }\n } else {\n if (horizontalHalfwayPoint > window.innerWidth / 2) {\n return 'bottom-end';\n } else {\n return 'bottom-start';\n }\n }\n } else {\n return this.position;\n }\n }\n\n @Watch('position')\n positionChanged(newVal: any) {\n this.internalPosition = newVal;\n this.popperInstance?.destroy();\n this.popperInstance = null; // Force re-initialization on next mouse enter\n }\n\n\n\n onMouseEnter = () => {\n // Enable the event listeners immediately\n this.popperInstance?.setOptions((options) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // Initialize the popper instance\n this.initializePopper();\n\n // Make the tooltip visible\n this.tooltipVisible = true;\n this.tooltipEl.style.display = 'block';\n\n // Update the popper instance immediately after initialization\n this.popperInstance?.update();\n }\n\n\n onMouseLeave = () => {\n this.tooltipVisible = false;\n this.tooltipEl.style.display = 'none';\n\n }\n\n disconnectedCallback() {\n this.popperInstance?.destroy();\n }\n\n onClick = () => {\n if (this.variant.toLowerCase() === 'dismissible') {\n this.initializePopper();\n this.tooltipVisible = !this.tooltipVisible;\n this.tooltipEl.style.display = this.tooltipVisible ? 'block' : 'none';\n this.popperInstance?.update();\n }\n }\n\n onDismissClick = () => {\n this.tooltipVisible = false;\n this.tooltipEl.style.display = 'none';\n }\n\n render() {\n const tooltipDismissible = {\n 'tooltip-dismissible': true,\n 'visible': this.tooltipVisible,\n };\n\n const tooltipCompact = {\n 'tooltip-compact': true,\n 'visible': this.tooltipVisible,\n };\n\n const tooltipExtended = {\n 'tooltip-extended': true,\n 'visible': this.tooltipVisible,\n };\n\n return (\n <div aria-label={this.ariaLabel} aria-value={this.header} class=\"tooltip__container\" >\n <slot></slot>\n\n {this.variant.toLowerCase() === 'dismissible' && <div class={tooltipDismissible}>\n <button aria-label=\"Close Tooltip\" class=\"close-button\" onClick={this.onDismissClick}>\n <ifx-icon icon=\"cross16\"></ifx-icon>\n </button>\n <div class=\"tooltip-dismissible-content\">\n {this.header && <div class=\"tooltip-dismissible-header\">{this.header}</div>}\n <div class=\"tooltip-dismissible-body\">{this.text}</div>\n </div>\n <svg class=\"tooltip-arrow-svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"Indicator\" d=\"M6 0L12 8L0 8L6 0Z\" fill=\"#1D1D1D\" />\n </svg>\n </div>\n }\n {this.variant.toLowerCase() === 'compact' &&\n <div class={tooltipCompact}>\n {this.text}\n <svg class=\"tooltip-arrow-svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"Indicator\" d=\"M6 0L12 8L0 8L6 0Z\" fill=\"#1D1D1D\" />\n </svg>\n </div>\n }\n {this.variant.toLowerCase() === 'extended' &&\n <div class={tooltipExtended}>\n <slot name=\"icon\">\n {this.icon ? <div class=\"extended_icon\"><ifx-icon icon={this.icon}></ifx-icon></div> :\n <svg class=\"extended_icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\">\n <path stroke=\"#fff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M20.5 2.5h-16a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-16a2 2 0 0 0-2-2Z\" />\n <path stroke=\"#fff\" d=\"M19 17H6l2.5-4 2.097 2.516.405.486.379-.506 4.118-5.49.003-.002L19 17Z\" />\n <path fill=\"#fff\" d=\"M10 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\" />\n </svg>\n }\n </slot>\n <div class=\"tooltip-extended-content\">\n {this.header && <div class=\"tooltip-extended-header\">{this.header}</div>}\n <div class=\"tooltip-extended-body\">{this.text}</div>\n </div>\n <svg class=\"tooltip-arrow-svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"Indicator\" d=\"M6 0L12 8L0 8L6 0Z\" fill=\"#1D1D1D\" />\n </svg>\n </div >\n }\n </div>\n );\n }\n\n\n}"]}
@@ -8,6 +8,7 @@ export default {
8
8
  position: 'auto',
9
9
  variant: 'compact',
10
10
  icon: 'c-info-16',
11
+ ariaLabel: 'Tooltip with important information'
11
12
  },
12
13
  argTypes: {
13
14
  text: {
@@ -67,9 +68,22 @@ export default {
67
68
  }
68
69
  }
69
70
  },
71
+ ariaLabel: {
72
+ description: 'Defines the aria-label for the tooltip, providing a text alternative for screen readers.',
73
+ control: 'text',
74
+ table: {
75
+ category: 'ifx-tooltip props',
76
+ type: {
77
+ summary: 'string | null'
78
+ },
79
+ defaultValue: {
80
+ summary: 'null'
81
+ }
82
+ }
83
+ }
70
84
  },
71
85
  };
72
- const DefaultTemplate = ({ header, text, variant, position, icon }) => {
86
+ const DefaultTemplate = ({ header, text, variant, position, icon, ariaLabel }) => {
73
87
  const element = document.createElement('ifx-tooltip');
74
88
  if (variant === 'dismissible' || variant === 'extended') {
75
89
  element.setAttribute('header', header);
@@ -78,6 +92,7 @@ const DefaultTemplate = ({ header, text, variant, position, icon }) => {
78
92
  element.setAttribute('variant', variant === 'extended' ? 'extended' : variant);
79
93
  element.setAttribute('position', position);
80
94
  element.setAttribute('icon', icon);
95
+ element.setAttribute('aria-label', ariaLabel);
81
96
  element.textContent = `I'm the tooltip reference element - Please ${variant === 'dismissible' ? 'click' : 'hover'} me`; // Set content for the reference element
82
97
  return element;
83
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.stories.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,MAAM,EAAE,kBAAkB;QAC1B,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,WAAW;KAClB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,WAAW,EAAE,0CAA0C;YACvD,OAAO,EAAE,MAAM;YACf,KAAK,EAAE;gBACL,QAAQ,EAAE,mBAAmB;gBAC7B,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;aACF;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,sGAAsG;YACnH,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3B,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE;gBACL,QAAQ,EAAE,mBAAmB;gBAC7B,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;oBACjB,YAAY,EAAE;wBACZ,OAAO,EAAE,WAAW;qBACrB;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,2E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AAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC/E,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEnC,OAAO,CAAC,WAAW,GAAG,8CAA8C,OAAO,KAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,wCAAwC;IAE9J,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Tooltip',\n tags: ['autodocs'],\n args: {\n header: 'Tooltip headline',\n text: \"Hi, I'm a tooltip\",\n position: 'auto',\n variant: 'compact',\n icon: 'c-info-16',\n },\n argTypes: {\n text: {\n description: 'Defines the main content of the tooltip.',\n control: 'text',\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string'\n }\n }\n },\n icon: {\n description: 'The icon to be displayed. This control is only applicable when the variant is set to ***extended***.',\n options: Object.keys(icons),\n control: 'select',\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string',\n defaultValue: {\n summary: 'c-info-16'\n }\n }\n }\n },\n position: {\n description: 'Determines the position of the tooltip relative to the reference element.',\n options: ['auto', 'bottom-start', 'top-start', 'left', 'bottom-end', 'top-end', 'right', 'bottom', 'top'],\n control: 'radio',\n table: {\n category: 'ifx-tooltip props',\n defaultValue: {\n summary: 'auto'\n }\n }\n },\n variant: {\n description: 'Sets the style variant of the tooltip.',\n control: 'radio',\n options: ['compact', 'dismissible', 'extended'],\n table: {\n category: 'ifx-tooltip props',\n defaultValue: {\n summary: 'compact'\n }\n }\n },\n header: {\n description: 'Specifies the header or title of the tooltip. This field is only applicable when the variant is set to ***dismissible*** or ***extended***.',\n control: 'text', \n if: { arg: 'variant', neq: 'compact' },\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string'\n }\n }\n },\n },\n};\n\nconst DefaultTemplate = ({ header, text, variant, position, icon }) => {\n const element = document.createElement('ifx-tooltip');\n if (variant === 'dismissible' || variant === 'extended') {\n element.setAttribute('header', header);\n }\n element.setAttribute('text', text);\n element.setAttribute('variant', variant === 'extended' ? 'extended' : variant);\n element.setAttribute('position', position);\n element.setAttribute('icon', icon);\n\n element.textContent = `I'm the tooltip reference element - Please ${variant==='dismissible' ? 'click' : 'hover'} me`; // Set content for the reference element\n\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});\n"]}
1
+ {"version":3,"file":"tooltip.stories.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,MAAM,EAAE,kBAAkB;QAC1B,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,oCAAoC;KAChD;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,WAAW,EAAE,0CAA0C;YACvD,OAAO,EAAE,MAAM;YACf,KAAK,EAAE;gBACL,QAAQ,EAAE,mBAAmB;gBAC7B,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;aACF;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,sGAAsG;YACnH,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3B,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE;gBACL,QAAQ,EAAE,mBAAmB;gBAC7B,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;oBACjB,YAAY,EAAE;wBACZ,OAAO,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,CAAC,aAAa,CAAC,CAAC;IACtD,IAAI,OAAO,KAAK,aAAa,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QACxD,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC/E,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAE9C,OAAO,CAAC,WAAW,GAAG,8CAA8C,OAAO,KAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,wCAAwC;IAE9J,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Tooltip',\n tags: ['autodocs'],\n args: {\n header: 'Tooltip headline',\n text: \"Hi, I'm a tooltip\",\n position: 'auto',\n variant: 'compact',\n icon: 'c-info-16',\n ariaLabel: 'Tooltip with important information'\n },\n argTypes: {\n text: {\n description: 'Defines the main content of the tooltip.',\n control: 'text',\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string'\n }\n }\n },\n icon: {\n description: 'The icon to be displayed. This control is only applicable when the variant is set to ***extended***.',\n options: Object.keys(icons),\n control: 'select',\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string',\n defaultValue: {\n summary: 'c-info-16'\n }\n }\n }\n },\n position: {\n description: 'Determines the position of the tooltip relative to the reference element.',\n options: ['auto', 'bottom-start', 'top-start', 'left', 'bottom-end', 'top-end', 'right', 'bottom', 'top'],\n control: 'radio',\n table: {\n category: 'ifx-tooltip props',\n defaultValue: {\n summary: 'auto'\n }\n }\n },\n variant: {\n description: 'Sets the style variant of the tooltip.',\n control: 'radio',\n options: ['compact', 'dismissible', 'extended'],\n table: {\n category: 'ifx-tooltip props',\n defaultValue: {\n summary: 'compact'\n }\n }\n },\n header: {\n description: 'Specifies the header or title of the tooltip. This field is only applicable when the variant is set to ***dismissible*** or ***extended***.',\n control: 'text', \n if: { arg: 'variant', neq: 'compact' },\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string'\n }\n }\n },\n ariaLabel: {\n description: 'Defines the aria-label for the tooltip, providing a text alternative for screen readers.',\n control: 'text',\n table: {\n category: 'ifx-tooltip props',\n type: {\n summary: 'string | null'\n },\n defaultValue: {\n summary: 'null'\n }\n }\n }\n },\n};\n\nconst DefaultTemplate = ({ header, text, variant, position, icon, ariaLabel }) => {\n const element = document.createElement('ifx-tooltip');\n if (variant === 'dismissible' || variant === 'extended') {\n element.setAttribute('header', header);\n }\n element.setAttribute('text', text);\n element.setAttribute('variant', variant === 'extended' ? 'extended' : variant);\n element.setAttribute('position', position);\n element.setAttribute('icon', icon);\n element.setAttribute('aria-label', ariaLabel);\n\n element.textContent = `I'm the tooltip reference element - Please ${variant==='dismissible' ? 'click' : 'hover'} me`; // Set content for the reference element\n\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});\n"]}
@@ -356,12 +356,12 @@ export class TreeViewItem {
356
356
  };
357
357
  }
358
358
  render() {
359
- return (h("div", { key: '9d2a45503ddf4f0039c08fdfc03a2cc8f8cf6ea5', class: {
359
+ return (h("div", { key: '162ae23e62d1e72d51db7be555af269a404a8a8b', class: {
360
360
  'tree-item': true,
361
361
  'tree-item--expanded': this.isExpanded,
362
362
  'tree-item--has-children': this.hasChildren,
363
363
  'tree-item--disabled': this.disabled,
364
- }, role: "treeitem", "aria-expanded": this.isExpanded ? 'true' : 'false', "data-level": this.level, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel }, h("div", { key: '98d93c5ec96f9d24ae9a200825a8d25993ffea14', class: "tree-item__content" }, h("div", { key: '9413dbf670d5c38bc62a410ddf75339dba3cd73c', class: "tree-item__checkbox-container", onClick: e => e.stopPropagation() }, h("ifx-checkbox", { key: '3fefd8e77f8cf5073f5c020007549452e5501215', size: 's', checked: this.partialChecked ? false : this.isChecked, indeterminate: this.partialChecked, onIfxChange: this.handleCheckboxChange, disabled: this.disabled })), h("div", { key: '6e272b043e8514e002f40789125f50b3a01f2a1c', class: "tree-item__header", style: { paddingLeft: `${this.level * 24 + 10}px` }, onClick: this.handleHeaderClick, tabIndex: -1, "aria-disabled": this.disabled ? 'true' : undefined }, this.hasChildren && (h("div", { key: '1fca7a1ef266fcc053d58db5b04847875a0d0b1c', class: "tree-item__chevron-container", onClick: this.toggleExpand }, h("ifx-icon", { key: 'b46989513a66a0b7705a88b8d84183456b1ae100', class: `tree-item__chevron ${this.isExpanded ? 'chevron-down' : 'chevron-right'}`, icon: "chevron-right-16" }), h("div", { key: '0c9b345b9cec677f19947edffee434fd85ab6d1d', class: "tree-item__line" }))), h("div", { key: 'a35dd0b7870afb253e4f4b425b1626a0f3f70ba6', class: "tree-item__label-icon-container", tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown }, h("div", { key: '9460601181841d66a949e853819c31f2722ca3b7', class: "tree-item__icon-container" }, this.hasChildren ? (h(Fragment, null, h("ifx-icon", { class: { 'icon--hidden': this.isExpanded }, icon: "folder-16" }), h("ifx-icon", { class: { 'icon--hidden': !this.isExpanded }, icon: "folder-open-16" }))) : (h("ifx-icon", { icon: "file-16" }))), h("span", { key: '417bd3a16ed0a142d24737912c743f0074dc5137', class: "tree-item__label" }, h("slot", { key: 'f60932832ebac5471f3f5a820f07bc45cd8586aa' }))))), this.isExpanded && h("div", { key: '8c3bc5b44350f232d74b1636dd893826ee32dacd', class: "tree-item__children" }, h("slot", { key: 'a392c5a65c2ffad4a5b89e2588792976f1cdf478', name: "children" }))));
364
+ }, role: "treeitem", "aria-expanded": this.isExpanded ? 'true' : 'false', "data-level": this.level, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel }, h("div", { key: 'befe8adcc6e30761593f89dcbc0b0afe3699e002', class: "tree-item__content" }, h("div", { key: '5ad3f49e004fed83f1541ecef8bd94fd78ddc59f', class: "tree-item__checkbox-container", onClick: e => e.stopPropagation() }, h("ifx-checkbox", { key: 'c038eb439265d26b74e6598a488f2d41a6d5dd96', size: 's', checked: this.partialChecked ? false : this.isChecked, indeterminate: this.partialChecked, onIfxChange: this.handleCheckboxChange, disabled: this.disabled })), h("div", { key: '316f703d55730d34724c8ef8568d55fc69e6815b', class: "tree-item__header", style: { paddingLeft: `${this.level * 24 + 10}px` }, onClick: this.handleHeaderClick, tabIndex: -1, "aria-disabled": this.disabled ? 'true' : undefined }, this.hasChildren && (h("div", { key: 'd2a8e5a1a403e6a239056a353d3bc38d209e0907', class: "tree-item__chevron-container", onClick: this.toggleExpand }, h("ifx-icon", { key: 'ea9ea3c3e9dc083b53faf27a89b73df19d2e68ca', class: `tree-item__chevron ${this.isExpanded ? 'chevron-down' : 'chevron-right'}`, icon: "chevron-right-16" }), h("div", { key: '14be28eda1a6d823f3416b6fdef0cd17cbc5a39f', class: "tree-item__line" }))), h("div", { key: '488409621c1355737f0e5d7f5b90d6b94465cdaa', class: "tree-item__label-icon-container", tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown }, h("div", { key: '163c36cdda49d36c94f7c7f18539f8e71bf04ed2', class: "tree-item__icon-container" }, this.hasChildren ? (h(Fragment, null, h("ifx-icon", { class: { 'icon--hidden': this.isExpanded }, icon: "folder-16" }), h("ifx-icon", { class: { 'icon--hidden': !this.isExpanded }, icon: "folder-open-16" }))) : (h("ifx-icon", { icon: "file-16" }))), h("span", { key: '42f0d9e90ae841e206318811c73e54bcf44c3cee', class: "tree-item__label" }, h("slot", { key: 'a06b08003dbaf058dee39508b193e4a5b94f65a7' }))))), this.isExpanded && h("div", { key: 'fc197474a8d0ba6d16cceede2ebef4c5db296501', class: "tree-item__children" }, h("slot", { key: 'cda8a8d46c3a59af25371545611bd6c9229be625', name: "children" }))));
365
365
  }
366
366
  static get is() { return "ifx-tree-view-item"; }
367
367
  static get encapsulation() { return "shadow"; }
@@ -36,7 +36,7 @@ export class TreeView {
36
36
  }
37
37
  }
38
38
  render() {
39
- return (h("div", { key: '9de7b6668d3a669f8edf68007faa931adcf6cb99', class: `tree-view ${this.disableAllItems ? ' tree-view--disabled' : ''}`, role: "tree", "aria-label": this.ariaLabel }, this.label && this.label.trim() !== '' && h("div", { key: 'a22176e6154132f7af0de7ddd63d7bf42d3378e3', class: "tree-view__label" }, this.label), h("slot", { key: '85a409e32ac9425449fdcd5c0a5b993391dd09ef', ref: this.handleSlotRef })));
39
+ return (h("div", { key: '2416bba6c7a463c881349da1040cf63634ee75d5', class: `tree-view ${this.disableAllItems ? ' tree-view--disabled' : ''}`, role: "tree", "aria-label": this.ariaLabel }, this.label && this.label.trim() !== '' && h("div", { key: '84f4d5a8610fd7c92059b3e04c99b92271bcf5df', class: "tree-view__label" }, this.label), h("slot", { key: '2adfecbdcf546603e8da93a30db53f3d5ca7f5e1', ref: this.handleSlotRef })));
40
40
  }
41
41
  static get is() { return "ifx-tree-view"; }
42
42
  static get encapsulation() { return "shadow"; }
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  export class Faq {
3
3
  render() {
4
- return (h("div", { key: '225fe6a1692f8b6475e3cda101eb192cf3f51de6', class: 'container' }, h("ifx-accordion", { key: '1df94194f6d4e1a897650005b7e9f71f4a6148a4' }, h("ifx-accordion-item", { key: 'ec8ff8d9e0004611ef5c21c93394f93078797e3f', caption: "What is the Infineon DDS?" }, "The Infineon Digital Design System consists of code components, design principles, tools and guidelines as well as a dedicated interdisciplinary team. Its purpose is to support internal and external colleagues create digital user interfaces with a high level of usability as well as a consistent expression of the Infineon brand. The DDS does not focus on the content of a web application but it describes how the design of the application\u2019s structure should be."), h("ifx-accordion-item", { key: '376d2e11e1d93d8ef048317e98a7e927964febd5', caption: "How do I get access to the DDS?" }, "You can use the provided Figma file as a foundation for mockups and prototypes, use Storybook to view what UI components and variants are available and use code components provided via Storybook or Github."), h("ifx-accordion-item", { key: '55ef07d5c96ebb72fc3c5d28b460940f7fc71296', caption: "Can I integrate the Infineon DDS into my project?" }, "Yes, you can. We are happy to discuss with you which point in time and which scope of integration is bestsuited for updating your interface to the Infineon DDS. (To avoid that users get confused by a mixture of UI components, we recommend choosing larger updates or technology changes as opportunity to integrate the Infineon DDS.)"), h("ifx-accordion-item", { key: '87a51df79c2fa1b846ddfeb338cc33cc9a4a0a3f', caption: "Are Infineon DDS components accessable?" }, "We have taken WCAG 2.0 Level AA as baseline level for all design decisions inside the Infineon Digital Design System. To make an online experience truly accessible you have to implement the specific code, content, and visual design according to the accessibility standard. Find an introduction to this topic here."), h("ifx-accordion-item", { key: '3d445ccf2d8b3b148e969ee2f12b416844754aec', caption: "How to request a new component?" }, "Please contact us like described in the contribution section! We are planning to expand the number of components continually. If your component is also usable for multiple other projects, there is a good chance we might work together with you."))));
4
+ return (h("div", { key: 'd65665af11d77f22eba694be830c0d2cbd1c2aed', class: 'container' }, h("ifx-accordion", { key: '21a6945e8e2989152d4ae3b525d0b03100289a53' }, h("ifx-accordion-item", { key: '6a17004a92a541a569d0a0fcfc99ab3b036e0321', caption: "What is the Infineon DDS?" }, "The Infineon Digital Design System consists of code components, design principles, tools and guidelines as well as a dedicated interdisciplinary team. Its purpose is to support internal and external colleagues create digital user interfaces with a high level of usability as well as a consistent expression of the Infineon brand. The DDS does not focus on the content of a web application but it describes how the design of the application\u2019s structure should be."), h("ifx-accordion-item", { key: '173ea57ea7fb62173945b1c8c804e2472f174f34', caption: "How do I get access to the DDS?" }, "You can use the provided Figma file as a foundation for mockups and prototypes, use Storybook to view what UI components and variants are available and use code components provided via Storybook or Github."), h("ifx-accordion-item", { key: '7344d949d820868fee6ab85b8197fdde1b4574c7', caption: "Can I integrate the Infineon DDS into my project?" }, "Yes, you can. We are happy to discuss with you which point in time and which scope of integration is bestsuited for updating your interface to the Infineon DDS. (To avoid that users get confused by a mixture of UI components, we recommend choosing larger updates or technology changes as opportunity to integrate the Infineon DDS.)"), h("ifx-accordion-item", { key: '6f242e7e3a4116bdf122905becd07fc8f8f4cd22', caption: "Are Infineon DDS components accessable?" }, "We have taken WCAG 2.0 Level AA as baseline level for all design decisions inside the Infineon Digital Design System. To make an online experience truly accessible you have to implement the specific code, content, and visual design according to the accessibility standard. Find an introduction to this topic here."), h("ifx-accordion-item", { key: '1dd2fe2389021540de4d1ded1f66003592644a1d', caption: "How to request a new component?" }, "Please contact us like described in the contribution section! We are planning to expand the number of components continually. If your component is also usable for multiple other projects, there is a good chance we might work together with you."))));
5
5
  }
6
6
  static get is() { return "ifx-faq"; }
7
7
  static get encapsulation() { return "shadow"; }
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h, d as Host } from './p-f8e6a4ef.js';
2
2
  import { d as detectFramework, t as trackComponent } from './p-08c92877.js';
3
3
  import { i as isNestedInIfxComponent } from './p-1ecafb97.js';
4
4
 
5
- const cardCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:inline-flex}.card{position:relative;display:inline-flex;flex-direction:column;word-wrap:break-word;background-color:#FFFFFF;background-clip:border-box;border:1px solid #EEEDED;border-radius:1px;width:350px;height:auto;font-family:var(--ifx-font-family)}.card:has(.card-href:focus),.card:has(.card-href:hover){outline:none;border-color:#0A8276}.card:has(.card-href:focus) ::slotted(ifx-card-headline),.card:has(.card-href:hover) ::slotted(ifx-card-headline){color:#0A8276}.card.noBtns .vertical .lower__body-wrapper{padding-bottom:24px}.card.noBtns .horizontal .lower__body-wrapper{padding-bottom:24px}.card .horizontal{display:flex;flex-direction:row;min-height:218px}.card .horizontal .card-img{flex:1;text-decoration:none}.card .horizontal .card-img.noImage{display:none}.card .horizontal .card-img ::slotted([slot=img]){width:100%;vertical-align:bottom}.card .horizontal .lower__body-wrapper{flex:1;display:grid;grid-template-rows:1fr auto}.card .horizontal .lower__body-wrapper .upper-body{display:flex;flex-direction:column;text-decoration:none;color:#1D1D1D;padding:24px 24px 0px 24px}.card .vertical .upper__body-wrapper{text-decoration:none;color:#1D1D1D}.card .vertical .upper__body-wrapper .card-img{height:190px}.card .vertical .upper__body-wrapper .card-img.noImage{display:none}.card .vertical .upper__body-wrapper .upper-body{padding:24px 24px 0px 24px}.card .vertical .lower__body-wrapper:hover{border-color:#EEEDED}.card.horizontal{flex-direction:row;width:538px}.card.horizontal .card-img{flex:1;order:2}.card.horizontal .card-img ::slotted([slot=img]){width:100%;height:100%;vertical-align:bottom;object-fit:cover}.card.horizontal.left .horizontal .card-img{order:1}.card.horizontal.left .horizontal .lower__body-wrapper{order:2}.card .card-href:focus{outline:none}";
5
+ const cardCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:inline-flex}.card{position:relative;display:inline-flex;flex-direction:column;word-wrap:break-word;background-color:#FFFFFF;background-clip:border-box;border:2px solid #EEEDED;border-radius:2px;width:350px;height:auto;font-family:var(--ifx-font-family)}.card:has(.card-href:focus),.card:has(.card-href:hover){outline:none;border-color:#0A8276}.card:has(.card-href:focus) ::slotted(ifx-card-headline),.card:has(.card-href:hover) ::slotted(ifx-card-headline){color:#0A8276}.card.noBtns .vertical .lower__body-wrapper{padding-bottom:24px}.card.noBtns .horizontal .lower__body-wrapper{padding-bottom:24px}.card .horizontal{display:flex;flex-direction:row;min-height:218px}.card .horizontal .card-img{flex:1;text-decoration:none}.card .horizontal .card-img.noImage{display:none}.card .horizontal .card-img ::slotted([slot=img]){width:100%;vertical-align:bottom}.card .horizontal .lower__body-wrapper{flex:1;display:grid;grid-template-rows:1fr auto}.card .horizontal .lower__body-wrapper .upper-body{display:flex;flex-direction:column;text-decoration:none;color:#1D1D1D;padding:24px 24px 0px 24px}.card .vertical .upper__body-wrapper{text-decoration:none;color:#1D1D1D}.card .vertical .upper__body-wrapper .card-img{height:190px}.card .vertical .upper__body-wrapper .card-img.noImage{display:none}.card .vertical .upper__body-wrapper .upper-body{padding:24px 24px 0px 24px}.card .vertical .lower__body-wrapper:hover{border-color:#EEEDED}.card.horizontal{flex-direction:row;width:538px}.card.horizontal .card-img{flex:1;order:2}.card.horizontal .card-img ::slotted([slot=img]){width:100%;height:100%;vertical-align:bottom;object-fit:cover}.card.horizontal.left .horizontal .card-img{order:1}.card.horizontal.left .horizontal .lower__body-wrapper{order:2}.card .card-href:focus{outline:none}";
6
6
  const IfxCardStyle0 = cardCss;
7
7
 
8
8
  const Card = /*@__PURE__*/ proxyCustomElement(class Card extends H {
@@ -21,24 +21,14 @@ const Card = /*@__PURE__*/ proxyCustomElement(class Card extends H {
21
21
  handleComponentAdjustment() {
22
22
  const image = this.el.querySelector('ifx-card-image');
23
23
  const links = this.el.querySelector('ifx-card-links');
24
- if (!image) {
25
- this.noImg = true;
26
- }
27
- else
28
- this.noImg = false;
29
- if (!links) {
30
- this.noBtns = true;
31
- }
32
- else
33
- this.noBtns = false;
24
+ this.noImg = !image;
25
+ this.noBtns = !links;
34
26
  if (this.href.trim() === "") {
35
27
  this.internalHref = undefined;
36
28
  }
37
- else
29
+ else {
38
30
  this.internalHref = this.href;
39
- }
40
- handleClassList(el, type, className) {
41
- el.classList[type](className);
31
+ }
42
32
  }
43
33
  componentWillLoad() {
44
34
  this.handleComponentAdjustment();
@@ -53,12 +43,12 @@ const Card = /*@__PURE__*/ proxyCustomElement(class Card extends H {
53
43
  this.handleComponentAdjustment();
54
44
  }
55
45
  render() {
56
- return (h(Host, { key: 'afffff9fb6210582066a232a45aa86cdfe4c9e45' }, h("div", { key: 'c8ecba3c783b66c863b83c971d851885fca49df2', "aria-label": this.ariaLabel, class: `card
57
- ${this.noBtns ? 'noBtns' : ""}
58
- ${this.direction}
59
- ${this.alignment}`, role: "region" }, this.direction === 'horizontal' &&
60
- h("div", { key: '62aa54f2518997b7975ed5e59f1872aa400470fe', class: "horizontal" }, h("a", { key: 'eecd736fb9795970eadf2476f5dd01438d102db9', class: `card-img ${this.noImg ? 'noImage' : ""} ${this.internalHref ? 'card-href' : ''}`, href: this.internalHref }, h("slot", { key: '4659406caf4b719900c2ebcaa7032db98bbc4011', name: "img" })), h("div", { key: '8cf920e71ea472d34a229b15211e9d02924f84dd', class: 'lower__body-wrapper' }, h("a", { key: 'e67c7b4e02373124d4721ff515b8d91eae168f28', class: `upper-body ${this.internalHref ? 'card-href' : ''}`, href: this.internalHref }, h("slot", { key: '54b05da8a4fe7b6b60fd385d475b5912f04556b3' })), h("div", { key: '313b4b02878726a551dc091daea631c07bd32937' }, h("slot", { key: '419466be1928cfd0977a98fdd6b4b3b60368f65a', name: 'buttons' })))), this.direction === 'vertical' &&
61
- h("div", { key: '9dca0fc22c42393e4807fe11dff20b42426925a3', class: "vertical" }, h("a", { key: '0100232ea7cbf3934568c8b6fb15c8dc6ebd4c9d', class: `upper__body-wrapper ${this.internalHref ? 'card-href' : ''}`, href: this.internalHref, target: this.target }, h("div", { key: '4aea5fce5d0eaf74f09683dfe61cabae379accf1', class: `card-img ${this.noImg ? 'noImage' : ""}` }, h("slot", { key: '139492f5025301f7fd9b5488bc9301fb5a04fd1c', name: "img" })), h("div", { key: '584546d61bf1012a0ee172ff36303c3f033d1718', class: 'upper-body' }, h("slot", { key: '5fd4a0ea1d0677ed6929060a5b53934b8445ce30' }))), h("div", { key: 'e819efa1ce1aa389737d888fc3aa9b65636719af', class: 'lower__body-wrapper' }, h("slot", { key: '478fcfa0149412ae3333b21f277bc086e8f8d73d', name: 'buttons' }))))));
46
+ return (h(Host, { key: '7a0780953a6893b1e7178cf52bbb4a0c90808bbf' }, h("div", { key: 'c4e49dbe8a1bc2a8cef3952cf70a88d47bb2e7c9', "aria-label": this.ariaLabel, class: `card
47
+ ${this.noBtns ? 'noBtns' : ""}
48
+ ${this.direction}
49
+ ${this.alignment}`, role: "group" }, this.direction === 'horizontal' &&
50
+ h("div", { key: '086a7287530747bda7154ea6ed5c80984bf2b3f3', class: "horizontal" }, h("a", { key: 'a1bd2d0ab3f203f712d3222fe71199da1e5c24e9', class: `card-img ${this.noImg ? 'noImage' : ""} ${this.internalHref ? 'card-href' : ''}`, href: this.internalHref }, h("slot", { key: 'be5e480eaebc91de9f71c6953e90362879e7319a', name: "img" })), h("div", { key: '7bd12a56a66a2219059fdc9cd8ef1a77a68ae75b', class: 'lower__body-wrapper' }, h("a", { key: '9fdb1755fd1d2932008b2618c7fd89ff3f74453e', class: `upper-body ${this.internalHref ? 'card-href' : ''}`, href: this.internalHref, id: "upper-body-content" }, h("slot", { key: '508c537f02b9f8d8a360b104d534ce35f03b8b90' })), h("div", { key: 'd1866385d1aa28b74b56d0a64cd9d9e3fd4b7c5e' }, h("slot", { key: 'b6dcc04698bf10714ad473b19087eaa52fcad056', name: 'buttons' })))), this.direction === 'vertical' &&
51
+ h("div", { key: 'ab2bf4432da21fcb6ea4fbd383a883aa5bb09cc1', class: "vertical" }, h("a", { key: '8ca38de22e688384623f91e43968000cd0332e2c', class: `upper__body-wrapper ${this.internalHref ? 'card-href' : ''}`, href: this.internalHref, target: this.target }, h("div", { key: 'd5ece9e569b659ae75bd734ecee28acb0ed8a524', class: `card-img ${this.noImg ? 'noImage' : ""}` }, h("slot", { key: '20f8143a1581d32bd95a44cf355668868ae33503', name: "img" })), h("div", { key: 'b233b26f896472f79f02997292cfe80d8656fa6a', class: 'upper-body', id: "upper-body-content" }, h("slot", { key: '255dcd8f6bca0ed8506e00c1ee2cbcf5a02d1023' }))), h("div", { key: '5f30be5b734b4f2467180119c366c6bb87718ca5', class: 'lower__body-wrapper', role: "group", "aria-labelledby": "upper-body-content" }, h("slot", { key: '252604784de1be77af048feba37610a5be244d50', name: 'buttons' }))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EAAC,KAAK,GAAG,CACf,EAEN,4DAAK,KAAK,EAAC,YAAY,IACrB,8DAAQ,CACJ,CACJ,EAEJ,4DAAK,KAAK,EAAC,qBAAqB,IAC9B,6DAAM,IAAI,EAAC,SAAS,GAAG,CACnB,CACF,CACJ,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/card/card.scss?tag=ifx-card&encapsulation=shadow","src/components/card/card.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: inline-flex;\n}\n\n.card {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n word-wrap: break-word;\n background-color: tokens.$ifxColorBaseWhite;\n background-clip: border-box;\n border: 1px solid tokens.$ifxColorEngineering200;\n border-radius: 1px;\n //width: 22rem;\n width: 350px;\n height: auto;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n // when the link is focused or hovered, the border color changes\n &:has(.card-href:focus), &:has(.card-href:hover) {\n outline: none;\n border-color: tokens.$ifxColorOcean500;\n\n ::slotted(ifx-card-headline) {\n color: tokens.$ifxColorOcean500;\n }\n }\n\n &.noBtns {\n & .vertical {\n & .lower__body-wrapper {\n padding-bottom: 24px;\n }\n }\n\n & .horizontal {\n & .lower__body-wrapper {\n padding-bottom: 24px;\n }\n }\n }\n\n & .horizontal {\n display: flex;\n flex-direction: row;\n min-height: 218px;\n\n & .card-img {\n flex: 1;\n text-decoration: none;\n\n &.noImage {\n display: none;\n }\n\n & ::slotted([slot=img]) {\n width: 100%;\n vertical-align: bottom;\n }\n }\n\n & .lower__body-wrapper {\n flex: 1;\n display: grid;\n grid-template-rows: 1fr auto;\n\n & .upper-body {\n display: flex;\n flex-direction: column;\n text-decoration: none;\n color: tokens.$ifxColorBaseBlack;\n padding: 24px 24px 0px 24px;\n }\n }\n }\n\n & .vertical {\n & .upper__body-wrapper {\n text-decoration: none;\n color: tokens.$ifxColorBaseBlack;\n\n & .card-img {\n height: 190px;\n\n &.noImage {\n display: none;\n }\n }\n\n & .upper-body {\n padding: 24px 24px 0px 24px;\n }\n }\n\n & .lower__body-wrapper {\n &:hover {\n border-color: tokens.$ifxColorEngineering200;\n }\n }\n }\n\n &.horizontal {\n flex-direction: row;\n width: 538px;\n\n & .card-img {\n flex: 1;\n order: 2;\n\n & ::slotted([slot=img]) {\n width: 100%;\n height: 100%;\n vertical-align: bottom;\n object-fit: cover;\n }\n }\n\n &.left {\n & .horizontal {\n & .card-img {\n order: 1;\n }\n\n & .lower__body-wrapper {\n order: 2;\n }\n }\n }\n }\n\n & .card-href:focus {\n outline: none;\n }\n}","import { Component, h, Host, Element, Prop, State, Listen } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\n\n@Component({\n tag: 'ifx-card',\n styleUrl: 'card.scss',\n shadow: true,\n})\n\nexport class Card {\n @Element() el;\n @State() noBtns: boolean;\n @Prop() direction: 'horizontal' | 'vertical' = 'vertical';\n @State() alignment: string;\n @State() noImg: boolean;\n @Prop() href: string = \"\";\n @State() internalHref: string = \"\"\n @Prop() target: string = \"_self\";\n @Prop() ariaLabel: string | null;\n\n @Listen('imgPosition')\n setImgPosition(event) {\n this.alignment = event.detail\n }\n\n handleComponentAdjustment() {\n const image = this.el.querySelector('ifx-card-image')\n const links = this.el.querySelector('ifx-card-links')\n\n if (!image) {\n this.noImg = true;\n } else this.noImg = false;\n\n if (!links) {\n this.noBtns = true;\n } else this.noBtns = false;\n\n if (this.href.trim() === \"\") {\n this.internalHref = undefined;\n } else this.internalHref = this.href;\n }\n\n handleClassList(el, type, className) {\n el.classList[type](className)\n }\n\n\n componentWillLoad() {\n this.handleComponentAdjustment()\n }\n\n async componentDidLoad() { \n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-card', await framework)\n }\n }\n\n componentWillUpdate() {\n this.handleComponentAdjustment()\n }\n\nrender() {\n return (\n <Host>\n <div aria-label={this.ariaLabel} class={\n `card \n ${this.noBtns ? 'noBtns' : \"\"}\n ${this.direction} \n ${this.alignment}`\n }\n role=\"region\">\n\n {this.direction === 'horizontal' &&\n <div class=\"horizontal\">\n <a class={`card-img ${this.noImg ? 'noImage' : \"\"} ${this.internalHref ? 'card-href' : ''}`} href={this.internalHref}>\n <slot name=\"img\" />\n </a>\n\n <div class='lower__body-wrapper'>\n <a class={`upper-body ${this.internalHref ? 'card-href' : ''}`} href={this.internalHref}>\n <slot />\n </a>\n <div>\n <slot name='buttons' />\n </div>\n </div>\n </div>}\n\n {this.direction === 'vertical' &&\n <div class=\"vertical\">\n <a class={`upper__body-wrapper ${this.internalHref ? 'card-href' : ''}`} href={this.internalHref} target={this.target}>\n <div class={`card-img ${this.noImg ? 'noImage' : \"\"}`}>\n <slot name=\"img\" />\n </div>\n\n <div class='upper-body'>\n <slot />\n </div>\n </a>\n\n <div class='lower__body-wrapper'>\n <slot name='buttons' />\n </div>\n </div>}\n </div>\n </Host>\n );\n }\n}"],"version":3}
1
+ {"file":"ifx-card.js","mappings":";;;;AAAA,MAAM,OAAO,GAAG,w0DAAw0D,CAAC;AACz1D,sBAAe,OAAO;;MCUT,IAAI;IANjB;;;;QASU,cAAS,GAA8B,UAAU,CAAC;QAGlD,SAAI,GAAW,EAAE,CAAC;QACjB,iBAAY,GAAW,EAAE,CAAC;QAC3B,WAAM,GAAW,OAAO,CAAC;KAkGlC;IA9FC,cAAc,CAAC,KAAK;QAClB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;KAC/B;IAED,yBAAyB;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAEtD,IAAI,CAAC,KAAK,GAA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DAAQ,CACN,EACJ,8DACE,6DAAM,IAAI,EAAC,SAAS,GAAG,CACnB,CACF,CACF,EAEP,IAAI,CAAC,SAAS,KAAK,UAAU;YAC5B,4DAAK,KAAK,EAAC,UAAU,IACnB,0DACE,KAAK,EAAE,uBAAuB,IAAI,CAAC,YAAY,GAAG,WAAW,GAAG,EAAE,EAAE,EACpE,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,IAEnB,4DAAK,KAAK,EAAE,YAAY,IAAI,CAAC,KAAK,GAAG,SAAS,GAAG,EAAE,EAAE,IACnD,6DAAM,IAAI,EAAC,KAAK,GAAG,CACf,EAEN,4DAAK,KAAK,EAAC,YAAY,EAAC,EAAE,EAAC,oBAAoB,IAC7C,8DAAQ,CACJ,CACJ,EAEJ,4DAAK,KAAK,EAAC,qBAAqB,EAAC,IAAI,EAAC,OAAO,qBAAiB,oBAAoB,IAChF,6DAAM,IAAI,EAAC,SAAS,GAAG,CACnB,CACF,CACJ,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/card/card.scss?tag=ifx-card&encapsulation=shadow","src/components/card/card.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: inline-flex;\n}\n\n.card {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n word-wrap: break-word;\n background-color: tokens.$ifxColorBaseWhite;\n background-clip: border-box;\n border: 2px solid tokens.$ifxColorEngineering200;\n border-radius: 2px;\n //width: 22rem;\n width: 350px;\n height: auto;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n // when the link is focused or hovered, the border color changes\n &:has(.card-href:focus), &:has(.card-href:hover) {\n outline: none;\n border-color: tokens.$ifxColorOcean500;\n\n ::slotted(ifx-card-headline) {\n color: tokens.$ifxColorOcean500;\n }\n }\n\n &.noBtns {\n & .vertical {\n & .lower__body-wrapper {\n padding-bottom: 24px;\n }\n }\n\n & .horizontal {\n & .lower__body-wrapper {\n padding-bottom: 24px;\n }\n }\n }\n\n & .horizontal {\n display: flex;\n flex-direction: row;\n min-height: 218px;\n\n & .card-img {\n flex: 1;\n text-decoration: none;\n\n &.noImage {\n display: none;\n }\n\n & ::slotted([slot=img]) {\n width: 100%;\n vertical-align: bottom;\n }\n }\n\n & .lower__body-wrapper {\n flex: 1;\n display: grid;\n grid-template-rows: 1fr auto;\n\n & .upper-body {\n display: flex;\n flex-direction: column;\n text-decoration: none;\n color: tokens.$ifxColorBaseBlack;\n padding: 24px 24px 0px 24px;\n }\n }\n }\n\n & .vertical {\n & .upper__body-wrapper {\n text-decoration: none;\n color: tokens.$ifxColorBaseBlack;\n\n & .card-img {\n height: 190px;\n\n &.noImage {\n display: none;\n }\n }\n\n & .upper-body {\n padding: 24px 24px 0px 24px;\n }\n }\n\n & .lower__body-wrapper {\n &:hover {\n border-color: tokens.$ifxColorEngineering200;\n }\n }\n }\n\n &.horizontal {\n flex-direction: row;\n width: 538px;\n\n & .card-img {\n flex: 1;\n order: 2;\n\n & ::slotted([slot=img]) {\n width: 100%;\n height: 100%;\n vertical-align: bottom;\n object-fit: cover;\n }\n }\n\n &.left {\n & .horizontal {\n & .card-img {\n order: 1;\n }\n\n & .lower__body-wrapper {\n order: 2;\n }\n }\n }\n }\n\n & .card-href:focus {\n outline: none;\n }\n}","import { Component, h, Host, Element, Prop, State, Listen } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\n\n@Component({\n tag: 'ifx-card',\n styleUrl: 'card.scss',\n shadow: true,\n})\n\nexport class Card {\n @Element() el;\n @State() noBtns: boolean;\n @Prop() direction: 'horizontal' | 'vertical' = 'vertical';\n @State() alignment: string;\n @State() noImg: boolean;\n @Prop() href: string = \"\";\n @State() internalHref: string = \"\";\n @Prop() target: string = \"_self\";\n @Prop() ariaLabel: string | null;\n\n @Listen('imgPosition')\n setImgPosition(event) {\n this.alignment = event.detail;\n }\n\n handleComponentAdjustment() {\n const image = this.el.querySelector('ifx-card-image');\n const links = this.el.querySelector('ifx-card-links');\n\n this.noImg = !image;\n this.noBtns = !links;\n\n if (this.href.trim() === \"\") {\n this.internalHref = undefined;\n } else {\n this.internalHref = this.href;\n }\n }\n\n componentWillLoad() {\n this.handleComponentAdjustment();\n }\n\n async componentDidLoad() { \n if(!isNestedInIfxComponent(this.el)) { \n const framework = detectFramework();\n trackComponent('ifx-card', await framework);\n }\n }\n\n componentWillUpdate() {\n this.handleComponentAdjustment();\n }\n\n render() {\n return (\n <Host>\n <div \n aria-label={this.ariaLabel} \n class={\n `card \n ${this.noBtns ? 'noBtns' : \"\"}\n ${this.direction} \n ${this.alignment}`\n }\n role=\"group\"\n >\n\n {this.direction === 'horizontal' &&\n <div class=\"horizontal\">\n <a \n class={`card-img ${this.noImg ? 'noImage' : \"\"} ${this.internalHref ? 'card-href' : ''}`} \n href={this.internalHref}\n >\n <slot name=\"img\" />\n </a>\n\n <div class='lower__body-wrapper'>\n <a \n class={`upper-body ${this.internalHref ? 'card-href' : ''}`} \n href={this.internalHref}\n id=\"upper-body-content\"\n >\n <slot />\n </a>\n <div>\n <slot name='buttons' />\n </div>\n </div>\n </div>}\n\n {this.direction === 'vertical' &&\n <div class=\"vertical\">\n <a \n class={`upper__body-wrapper ${this.internalHref ? 'card-href' : ''}`} \n href={this.internalHref} \n target={this.target}\n >\n <div class={`card-img ${this.noImg ? 'noImage' : \"\"}`}>\n <slot name=\"img\" />\n </div>\n\n <div class='upper-body' id=\"upper-body-content\">\n <slot />\n </div>\n </a>\n\n <div class='lower__body-wrapper' role=\"group\" aria-labelledby=\"upper-body-content\">\n <slot name='buttons' />\n </div>\n </div>}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-f8e6a4ef.js';
2
- import { d as defineCustomElement$2 } from './p-2d712043.js';
2
+ import { d as defineCustomElement$2 } from './p-031c3ed3.js';
3
3
 
4
4
  const downloadCss = "";
5
5
  const IfxDownloadStyle0 = downloadCss;