@quartzds/core 1.0.0-beta.120 → 1.0.0-beta.122

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 (241) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/components/index.js +1 -1
  3. package/components/{p-CXP6q9Mr.js → p-BalM52S_.js} +12 -7
  4. package/components/p-BalM52S_.js.map +1 -0
  5. package/components/{p-CFVg7I9T.js → p-C0VgKX4J.js} +9 -9
  6. package/components/p-C0VgKX4J.js.map +1 -0
  7. package/components/{p-BkgfW_tl.js → p-C9R8N06B.js} +6 -32
  8. package/components/p-C9R8N06B.js.map +1 -0
  9. package/components/{p-DnZdwX0l.js → p-CKp062X8.js} +6 -6
  10. package/components/p-CKp062X8.js.map +1 -0
  11. package/components/{p-DwxIJEUj.js → p-CVuTVnQo.js} +3 -3
  12. package/components/{p-DwxIJEUj.js.map → p-CVuTVnQo.js.map} +1 -1
  13. package/components/{p-DeRqCYmp.js → p-Ck9w5WIb.js} +6 -6
  14. package/components/p-Ck9w5WIb.js.map +1 -0
  15. package/components/p-DCAlWquR.js +200 -0
  16. package/components/p-DCAlWquR.js.map +1 -0
  17. package/components/{p-BkBJDD6Y.js → p-DRcxeXWE.js} +58 -22
  18. package/components/p-DRcxeXWE.js.map +1 -0
  19. package/components/{p-Dsc0-aXK.js → p-DgYrfIr_.js} +4 -4
  20. package/components/{p-Dsc0-aXK.js.map → p-DgYrfIr_.js.map} +1 -1
  21. package/components/{p-CDRwHAIT.js → p-XP2CY_fo.js} +3 -3
  22. package/components/p-XP2CY_fo.js.map +1 -0
  23. package/components/{p-5RFBIepu.js → p-io1iVgY1.js} +47 -28
  24. package/components/p-io1iVgY1.js.map +1 -0
  25. package/components/{p-B03FWheS.js → p-oqmnh-8P.js} +4 -4
  26. package/components/{p-B03FWheS.js.map → p-oqmnh-8P.js.map} +1 -1
  27. package/components/{p-eFhV8w2l.js → p-yb0Kv4Y6.js} +24 -6
  28. package/components/p-yb0Kv4Y6.js.map +1 -0
  29. package/components/qds-action-item.js +5 -5
  30. package/components/qds-action-item.js.map +1 -1
  31. package/components/qds-avatar-media.js +1 -1
  32. package/components/qds-badge-counter.js +1 -1
  33. package/components/qds-breadcrumb-item.js +6 -6
  34. package/components/qds-breadcrumb-item.js.map +1 -1
  35. package/components/qds-button.js +5 -5
  36. package/components/qds-button.js.map +1 -1
  37. package/components/qds-checkbox.js +1 -1
  38. package/components/qds-chip.js +10 -10
  39. package/components/qds-chip.js.map +1 -1
  40. package/components/qds-dialog.js +7 -7
  41. package/components/qds-dialog.js.map +1 -1
  42. package/components/qds-divider.js +1 -1
  43. package/components/qds-dropdown.js +1 -1
  44. package/components/qds-form-message.js +4 -4
  45. package/components/qds-form-message.js.map +1 -1
  46. package/components/qds-icon-button.js +1 -1
  47. package/components/qds-icon-tab.js +9 -9
  48. package/components/qds-icon-tab.js.map +1 -1
  49. package/components/qds-icon.js +1 -1
  50. package/components/qds-inline-link.js +3 -3
  51. package/components/qds-inline-link.js.map +1 -1
  52. package/components/qds-input.js +49 -18
  53. package/components/qds-input.js.map +1 -1
  54. package/components/qds-label.js +153 -1
  55. package/components/qds-label.js.map +1 -1
  56. package/components/qds-list-item.js +25 -29
  57. package/components/qds-list-item.js.map +1 -1
  58. package/components/qds-loader.js +3 -3
  59. package/components/qds-loader.js.map +1 -1
  60. package/components/qds-menu-item.js +6 -6
  61. package/components/qds-mini-button.js +1 -1
  62. package/components/qds-progress-bar.js +1 -1
  63. package/components/qds-radio.js +1 -1
  64. package/components/qds-select.js +27 -9
  65. package/components/qds-select.js.map +1 -1
  66. package/components/qds-standalone-link.js +5 -5
  67. package/components/qds-standalone-link.js.map +1 -1
  68. package/components/qds-switch.js +5 -5
  69. package/components/qds-tab.js +20 -15
  70. package/components/qds-tab.js.map +1 -1
  71. package/components/qds-tabbar.js +95 -34
  72. package/components/qds-tabbar.js.map +1 -1
  73. package/components/qds-table-cell.js +32 -4
  74. package/components/qds-table-cell.js.map +1 -1
  75. package/components/qds-table-head-cell.js +32 -4
  76. package/components/qds-table-head-cell.js.map +1 -1
  77. package/components/qds-table-row.js +2 -2
  78. package/components/qds-table-row.js.map +1 -1
  79. package/components/qds-table.js +1 -1
  80. package/components/qds-tag.js +1 -1
  81. package/components/qds-textarea.js +4 -4
  82. package/components/qds-textarea.js.map +1 -1
  83. package/components/qds-title.js +1 -1
  84. package/components/qds-tooltip.js +1 -1
  85. package/dist/cjs/{helpers-BIL8yXqA.js → helpers-Qs3cpKiI.js} +11 -6
  86. package/dist/cjs/{helpers-BIL8yXqA.js.map → helpers-Qs3cpKiI.js.map} +1 -1
  87. package/dist/cjs/loader.cjs.js +1 -1
  88. package/dist/cjs/qds-action-item.cjs.entry.js +3 -3
  89. package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -1
  90. package/dist/cjs/qds-avatar-media.qds-checkbox.qds-radio.entry.cjs.js.map +1 -1
  91. package/dist/cjs/qds-avatar-media_3.cjs.entry.js +145 -42
  92. package/dist/cjs/qds-badge-counter.qds-badge-indicator.entry.cjs.js.map +1 -1
  93. package/dist/cjs/qds-badge-counter_2.cjs.entry.js +1 -1
  94. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +4 -4
  95. package/dist/cjs/qds-breadcrumb-item.entry.cjs.js.map +1 -1
  96. package/dist/cjs/qds-button.cjs.entry.js +2 -2
  97. package/dist/cjs/qds-button.entry.cjs.js.map +1 -1
  98. package/dist/cjs/qds-chip.cjs.entry.js +7 -7
  99. package/dist/cjs/qds-chip.entry.cjs.js.map +1 -1
  100. package/dist/cjs/qds-dialog.cjs.entry.js +3 -3
  101. package/dist/cjs/qds-dialog.entry.cjs.js.map +1 -1
  102. package/dist/cjs/qds-divider.qds-icon-button.entry.cjs.js.map +1 -1
  103. package/dist/cjs/qds-divider_2.cjs.entry.js +5 -5
  104. package/dist/cjs/qds-dropdown.cjs.entry.js +22 -4
  105. package/dist/cjs/qds-dropdown.entry.cjs.js.map +1 -1
  106. package/dist/cjs/qds-form-message.cjs.entry.js +3 -3
  107. package/dist/cjs/qds-form-message.entry.cjs.js.map +1 -1
  108. package/dist/cjs/qds-icon-tab.cjs.entry.js +5 -5
  109. package/dist/cjs/qds-icon-tab.entry.cjs.js.map +1 -1
  110. package/dist/cjs/qds-icon.cjs.entry.js +10 -30
  111. package/dist/cjs/qds-icon.entry.cjs.js.map +1 -1
  112. package/dist/cjs/qds-inline-link.cjs.entry.js +2 -2
  113. package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -1
  114. package/dist/cjs/qds-input.cjs.entry.js +46 -16
  115. package/dist/cjs/qds-input.entry.cjs.js.map +1 -1
  116. package/dist/cjs/qds-label.cjs.entry.js +3 -3
  117. package/dist/cjs/qds-list-item.cjs.entry.js +7 -5
  118. package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
  119. package/dist/cjs/qds-loader.cjs.entry.js +2 -2
  120. package/dist/cjs/qds-loader.entry.cjs.js.map +1 -1
  121. package/dist/cjs/qds-menu-item.cjs.entry.js +3 -3
  122. package/dist/cjs/qds-mini-button.cjs.entry.js +1 -1
  123. package/dist/cjs/qds-progress-bar.cjs.entry.js +1 -1
  124. package/dist/cjs/qds-select.cjs.entry.js +23 -7
  125. package/dist/cjs/qds-select.entry.cjs.js.map +1 -1
  126. package/dist/cjs/qds-standalone-link.cjs.entry.js +4 -4
  127. package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -1
  128. package/dist/cjs/qds-switch.cjs.entry.js +4 -4
  129. package/dist/cjs/qds-tab.cjs.entry.js +16 -11
  130. package/dist/cjs/qds-tab.entry.cjs.js.map +1 -1
  131. package/dist/cjs/qds-tabbar.cjs.entry.js +84 -28
  132. package/dist/cjs/qds-tabbar.entry.cjs.js.map +1 -1
  133. package/dist/cjs/qds-table-cell.cjs.entry.js +30 -3
  134. package/dist/cjs/qds-table-cell.entry.cjs.js.map +1 -1
  135. package/dist/cjs/qds-table-head-cell.cjs.entry.js +30 -3
  136. package/dist/cjs/qds-table-head-cell.entry.cjs.js.map +1 -1
  137. package/dist/cjs/qds-table-row.cjs.entry.js +2 -2
  138. package/dist/cjs/qds-table-row.entry.cjs.js.map +1 -1
  139. package/dist/cjs/qds-table.cjs.entry.js +1 -1
  140. package/dist/cjs/qds-tag.cjs.entry.js +3 -3
  141. package/dist/cjs/qds-tag.entry.cjs.js.map +1 -1
  142. package/dist/cjs/qds-textarea.cjs.entry.js +4 -4
  143. package/dist/cjs/qds-textarea.entry.cjs.js.map +1 -1
  144. package/dist/cjs/qds-title.cjs.entry.js +3 -3
  145. package/dist/cjs/qds-title.entry.cjs.js.map +1 -1
  146. package/dist/cjs/qds-tooltip.cjs.entry.js +2 -2
  147. package/dist/cjs/qds.cjs.js +1 -1
  148. package/dist/custom-elements.json +460 -33
  149. package/dist/docs.json +403 -64
  150. package/dist/esm/{helpers-BgaJNF9u.js → helpers-Fe2AA6uo.js} +12 -7
  151. package/dist/esm/{helpers-BgaJNF9u.js.map → helpers-Fe2AA6uo.js.map} +1 -1
  152. package/dist/esm/loader.js +1 -1
  153. package/dist/esm/qds-action-item.entry.js +3 -3
  154. package/dist/esm/qds-action-item.entry.js.map +1 -1
  155. package/dist/esm/qds-avatar-media.qds-checkbox.qds-radio.entry.js.map +1 -1
  156. package/dist/esm/qds-avatar-media_3.entry.js +146 -43
  157. package/dist/esm/qds-badge-counter.qds-badge-indicator.entry.js.map +1 -1
  158. package/dist/esm/qds-badge-counter_2.entry.js +1 -1
  159. package/dist/esm/qds-breadcrumb-item.entry.js +4 -4
  160. package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
  161. package/dist/esm/qds-button.entry.js +2 -2
  162. package/dist/esm/qds-button.entry.js.map +1 -1
  163. package/dist/esm/qds-chip.entry.js +7 -7
  164. package/dist/esm/qds-chip.entry.js.map +1 -1
  165. package/dist/esm/qds-dialog.entry.js +3 -3
  166. package/dist/esm/qds-dialog.entry.js.map +1 -1
  167. package/dist/esm/qds-divider.qds-icon-button.entry.js.map +1 -1
  168. package/dist/esm/qds-divider_2.entry.js +5 -5
  169. package/dist/esm/qds-dropdown.entry.js +22 -4
  170. package/dist/esm/qds-dropdown.entry.js.map +1 -1
  171. package/dist/esm/qds-form-message.entry.js +3 -3
  172. package/dist/esm/qds-form-message.entry.js.map +1 -1
  173. package/dist/esm/qds-icon-tab.entry.js +5 -5
  174. package/dist/esm/qds-icon-tab.entry.js.map +1 -1
  175. package/dist/esm/qds-icon.entry.js +11 -31
  176. package/dist/esm/qds-icon.entry.js.map +1 -1
  177. package/dist/esm/qds-inline-link.entry.js +2 -2
  178. package/dist/esm/qds-inline-link.entry.js.map +1 -1
  179. package/dist/esm/qds-input.entry.js +46 -16
  180. package/dist/esm/qds-input.entry.js.map +1 -1
  181. package/dist/esm/qds-label.entry.js +3 -3
  182. package/dist/esm/qds-list-item.entry.js +7 -5
  183. package/dist/esm/qds-list-item.entry.js.map +1 -1
  184. package/dist/esm/qds-loader.entry.js +2 -2
  185. package/dist/esm/qds-loader.entry.js.map +1 -1
  186. package/dist/esm/qds-menu-item.entry.js +3 -3
  187. package/dist/esm/qds-mini-button.entry.js +1 -1
  188. package/dist/esm/qds-progress-bar.entry.js +1 -1
  189. package/dist/esm/qds-select.entry.js +23 -7
  190. package/dist/esm/qds-select.entry.js.map +1 -1
  191. package/dist/esm/qds-standalone-link.entry.js +4 -4
  192. package/dist/esm/qds-standalone-link.entry.js.map +1 -1
  193. package/dist/esm/qds-switch.entry.js +4 -4
  194. package/dist/esm/qds-tab.entry.js +16 -11
  195. package/dist/esm/qds-tab.entry.js.map +1 -1
  196. package/dist/esm/qds-tabbar.entry.js +84 -28
  197. package/dist/esm/qds-tabbar.entry.js.map +1 -1
  198. package/dist/esm/qds-table-cell.entry.js +30 -3
  199. package/dist/esm/qds-table-cell.entry.js.map +1 -1
  200. package/dist/esm/qds-table-head-cell.entry.js +30 -3
  201. package/dist/esm/qds-table-head-cell.entry.js.map +1 -1
  202. package/dist/esm/qds-table-row.entry.js +2 -2
  203. package/dist/esm/qds-table-row.entry.js.map +1 -1
  204. package/dist/esm/qds-table.entry.js +1 -1
  205. package/dist/esm/qds-tag.entry.js +3 -3
  206. package/dist/esm/qds-tag.entry.js.map +1 -1
  207. package/dist/esm/qds-textarea.entry.js +4 -4
  208. package/dist/esm/qds-textarea.entry.js.map +1 -1
  209. package/dist/esm/qds-title.entry.js +3 -3
  210. package/dist/esm/qds-title.entry.js.map +1 -1
  211. package/dist/esm/qds-tooltip.entry.js +2 -2
  212. package/dist/esm/qds.js +1 -1
  213. package/dist/types/components/avatar-media/avatar-media.d.ts +14 -5
  214. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  215. package/dist/types/components/icon/icon.d.ts +1 -2
  216. package/dist/types/components/input/input.d.ts +10 -0
  217. package/dist/types/components/radio/radio.d.ts +4 -0
  218. package/dist/types/components/select/select.d.ts +7 -1
  219. package/dist/types/components/tab/tab.d.ts +1 -1
  220. package/dist/types/components/tabbar/tabbar.d.ts +27 -1
  221. package/dist/types/components/table-cell/table-cell.d.ts +6 -0
  222. package/dist/types/components/table-head-cell/table-head-cell.d.ts +6 -0
  223. package/dist/types/components.d.ts +94 -19
  224. package/dist/vscode.html-custom-data.json +99 -5
  225. package/hydrate/index.js +1021 -742
  226. package/hydrate/index.mjs +1021 -742
  227. package/package.json +1 -1
  228. package/styles/core.css +24 -22
  229. package/components/p-5RFBIepu.js.map +0 -1
  230. package/components/p-BkBJDD6Y.js.map +0 -1
  231. package/components/p-BkgfW_tl.js.map +0 -1
  232. package/components/p-Bnc7Puxx.js +0 -164
  233. package/components/p-Bnc7Puxx.js.map +0 -1
  234. package/components/p-CDRwHAIT.js.map +0 -1
  235. package/components/p-CFVg7I9T.js.map +0 -1
  236. package/components/p-CRVPDKfO.js +0 -163
  237. package/components/p-CRVPDKfO.js.map +0 -1
  238. package/components/p-CXP6q9Mr.js.map +0 -1
  239. package/components/p-DeRqCYmp.js.map +0 -1
  240. package/components/p-DnZdwX0l.js.map +0 -1
  241. package/components/p-eFhV8w2l.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"qds-form-message.entry.js","sources":["src/components/form-message/form-message.css?tag=qds-form-message&encapsulation=shadow","src/components/form-message/form-message.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n.qds-form-message {\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n gap: var(--qds-text-icon-gap);\n\n &.qds-inline {\n align-items: flex-start;\n }\n}\n\n.qds-icon-container,\n.qds-icon-background {\n display: flex;\n align-items: center;\n}\n\n.qds-icon-background {\n border-radius: var(--qds-control-rounded-border-radius);\n background-color: var(--qds-theme-feedback-action-destructive-contrast);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n\n[data-size='small'] {\n font: var(--qds-form-small-text);\n\n &.qds-icon-container {\n height: var(--qds-control-small-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-form-small-icon-size);\n height: var(--qds-form-small-icon-size);\n }\n\n &.qds-inline {\n min-height: var(--qds-form-input-small-height);\n padding-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-form-standard-text);\n\n &.qds-icon-container {\n height: var(--qds-control-standard-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-form-standard-icon-size);\n height: var(--qds-form-standard-icon-size);\n }\n\n &.qds-inline {\n min-height: var(--qds-form-input-standard-height);\n padding-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-form-large-text);\n\n &.qds-icon-container {\n height: var(--qds-control-large-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-form-large-icon-size);\n height: var(--qds-form-large-icon-size);\n }\n\n &.qds-inline {\n min-height: var(--qds-form-input-large-height);\n padding-block: var(--qds-control-large-padding-auto-height);\n }\n}\n\n[data-status='error'] {\n &.qds-icon {\n color: var(--qds-theme-feedback-result-failure);\n }\n\n &.qds-text {\n color: var(--qds-theme-feedback-result-failure);\n }\n}\n\n[data-status='info'].qds-icon {\n color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='success'] {\n &.qds-icon {\n color: var(--qds-theme-feedback-result-success);\n }\n\n &.qds-text {\n color: var(--qds-theme-feedback-result-success);\n }\n}\n\n[data-status='warning'].qds-icon {\n color: var(--qds-theme-feedback-result-partial-success);\n}\n\n[data-status='neutral'] {\n color: var(--qds-theme-text-subdued);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Size, Status } from '../shared'\n\nexport type FormMessageStatus = Status | 'neutral'\n\n/**\n * `<qds-form-message>` elements represent messages for a form field in a user\n * interface.\n *\n * @see https://quartz.se.com/build/components/form-message\n */\n@Component({\n tag: 'qds-form-message',\n shadow: true,\n styleUrl: 'form-message.css',\n})\nexport class FormMessage implements ComponentInterface {\n /**\n * Adds vertical margin to the form message for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The form message's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The form message's status.\n */\n @Prop() public readonly status?: FormMessageStatus = 'error'\n\n /**\n * Adds accessible text to the icon's form message that will be used by screen readers.\n *\n * @example\n * <qds-form-message status-description=\"Error\" text=\"Password is required.\"></qds-form-message>\n * // This form message will be read by screen readers as \"Error Password is required.\"\n */\n @Prop() public readonly statusDescription?: string\n\n /**\n * The form message's text.\n */\n @Prop() public readonly text?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedStatus(): FormMessageStatus {\n return this.status ?? 'error'\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-form-message': true,\n 'qds-inline': this.inline,\n }}\n data-size={this.#computedSize}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.status !== 'neutral' && (\n <div class=\"qds-icon-container\" data-size={this.#computedSize}>\n <div\n class=\"qds-icon-background\"\n data-size={this.#computedSize}\n data-status={this.status}\n >\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n data-status={this.status}\n name={`status-${this.status}-solid`}\n library=\"core\"\n />\n <span class=\"qds-sr-only\">{this.statusDescription}</span>\n </div>\n </div>\n )}\n <span class=\"qds-text\" data-status={this.#computedStatus}>\n {this.text}\n </span>\n </span>\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,cAAc,GAAG,0oEAA0oE;;ACAjqE;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,WAAW,GAAA,MAAA;AALxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAME;;;;;AAKG;AACqB,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AAE/C;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAEhD;;AAEG;AACqB,QAAA,IAAM,CAAA,MAAA,GAAuB,OAAO;AAkB5D,QAAA,gCAAA,CAAA,GAAA,CAAA,IAAA,EAAmC,EAAE,CAAA;AA2DtC;IAxCQ,iBAAiB,GAAA;AACtB,QAAA,sBAAA,CAAA,IAAI,oCAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA,GAAA,CAAA;;IAGv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C,UAAU,EAAA,aAAA,EAAc,uBAAA,IAAI,EAAA,sBAAA,EAAA,GAAA,EAAA,+BAAA,CAAgB,EACrD,EAAA,IAAI,CAAC,IAAI,CACL,CACF;;;;;AArDT,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,+BAAA,GAAA,SAAA,+BAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,MAAM,IAAI,OAAO;AAC/B,CAAC;;;;;"}
1
+ {"version":3,"file":"qds-form-message.entry.js","sources":["src/components/form-message/form-message.css?tag=qds-form-message&encapsulation=shadow","src/components/form-message/form-message.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n.qds-form-message {\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n gap: var(--qds-text-icon-gap);\n\n &.qds-inline {\n align-items: flex-start;\n }\n}\n\n.qds-icon-container,\n.qds-icon-background {\n display: flex;\n align-items: center;\n}\n\n.qds-icon-background {\n border-radius: var(--qds-control-rounded-border-radius);\n background-color: var(--qds-theme-feedback-action-destructive-contrast);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n\n[data-size='small'] {\n font: var(--qds-form-small-text);\n\n &.qds-icon-container {\n height: var(--qds-control-small-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-form-small-icon-size);\n height: var(--qds-form-small-icon-size);\n }\n\n &.qds-inline {\n min-height: var(--qds-form-input-small-height);\n padding-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-form-standard-text);\n\n &.qds-icon-container {\n height: var(--qds-control-standard-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-form-standard-icon-size);\n height: var(--qds-form-standard-icon-size);\n }\n\n &.qds-inline {\n min-height: var(--qds-form-input-standard-height);\n padding-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-form-large-text);\n\n &.qds-icon-container {\n height: var(--qds-control-large-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-form-large-icon-size);\n height: var(--qds-form-large-icon-size);\n }\n\n &.qds-inline {\n min-height: var(--qds-form-input-large-height);\n padding-block: var(--qds-control-large-padding-auto-height);\n }\n}\n\n[data-status='error'] {\n &.qds-icon {\n color: var(--qds-theme-feedback-result-failure);\n }\n\n &.qds-text {\n color: var(--qds-theme-feedback-result-failure);\n }\n}\n\n[data-status='info'].qds-icon {\n color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='success'] {\n &.qds-icon {\n color: var(--qds-theme-feedback-result-success);\n }\n\n &.qds-text {\n color: var(--qds-theme-feedback-result-success);\n }\n}\n\n[data-status='warning'].qds-icon {\n color: var(--qds-theme-feedback-result-partial-success);\n}\n\n[data-status='neutral'] {\n color: var(--qds-theme-text-subdued);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Size, Status } from '../shared'\n\nexport type FormMessageStatus = Status | 'neutral'\n\n/**\n * `<qds-form-message>` elements represent messages for a form field in a user\n * interface.\n *\n * @see https://quartz.se.com/build/components/form-message\n */\n@Component({\n tag: 'qds-form-message',\n shadow: true,\n styleUrl: 'form-message.css',\n})\nexport class FormMessage implements ComponentInterface {\n /**\n * Adds vertical margin to the form message for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The form message's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The form message's status.\n */\n @Prop() public readonly status?: FormMessageStatus = 'error'\n\n /**\n * Adds accessible text to the icon's form message that will be used by screen readers.\n *\n * @example\n * <qds-form-message status-description=\"Error\" text=\"Password is required.\"></qds-form-message>\n * // This form message will be read by screen readers as \"Error Password is required.\"\n */\n @Prop() public readonly statusDescription?: string\n\n /**\n * The form message's text.\n */\n @Prop() public readonly text?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedStatus(): FormMessageStatus {\n return this.status ?? 'error'\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-form-message': true,\n 'qds-inline': this.inline,\n }}\n data-size={this.#computedSize}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.status !== 'neutral' && (\n <div class=\"qds-icon-container\" data-size={this.#computedSize}>\n <div\n class=\"qds-icon-background\"\n data-size={this.#computedSize}\n data-status={this.status}\n >\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n data-status={this.status}\n name={`status-${this.status}-solid`}\n library=\"core\"\n />\n <span class=\"qds-sr-only\">{this.statusDescription}</span>\n </div>\n </div>\n )}\n <span class=\"qds-text\" data-status={this.#computedStatus}>\n {this.text}\n </span>\n </span>\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,cAAc,GAAG,0oEAA0oE;;ACAjqE;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,WAAW,GAAA,MAAA;AALxB,IAAA,WAAA,CAAA,OAAA,EAAA;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EAAA,6BAAA,CAAc,EAChB,aAAA,EAAA,IAAI,CAAC,MAAM,EACxB,IAAI,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,MAAM,QAAQ,EACnC,OAAO,EAAC,MAAM,EACd,CAAA,EACF,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,aAAa,EAAE,EAAA,IAAI,CAAC,iBAAiB,CAAQ,CACrD,CACF,CACP,EACD,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,UAAU,EAAA,aAAA,EAAc,uBAAA,IAAI,EAAA,sBAAA,EAAA,GAAA,EAAA,+BAAA,CAAgB,EACrD,EAAA,IAAI,CAAC,IAAI,CACL,CACF;;;;;AApDT,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,+BAAA,GAAA,SAAA,+BAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,MAAM,IAAI,OAAO;AAC/B,CAAC;;;;;"}
@@ -4,9 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-Hg1Liloy.js';
7
- import { p as pickFocusEventAttributes, r as resolveTarget } from './helpers-BgaJNF9u.js';
7
+ import { p as pickFocusEventAttributes, r as resolveTarget } from './helpers-Fe2AA6uo.js';
8
8
 
9
- const iconTabCss = ":host([hidden]){display:none!important}:host{display:inline-block;line-height:0}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}:host(:focus-visible){border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:calc(var(--qds-focus-border-width)*-1 - var(--qds-focus-border-offset))}.qds-target{-webkit-appearance:none;appearance:none;background-color:initial;border:none;cursor:pointer;padding:0;pointer-events:auto}.qds-target:disabled{pointer-events:none}.qds-target:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-icon-container{align-items:center;display:flex;justify-content:center;position:relative}.qds-icon:hover{background-color:initial}.qds-target-icon{color:var(--qds-theme-control-text-standard)}.qds-icon,.qds-target-icon{flex-shrink:0}.qds-selected:active{background-color:var(--qds-theme-interactive-background-selected-pressed)}.qds-icon-tab,.qds-target{display:flex}.qds-icon,.qds-text{color:var(--qds-theme-title)}.qds-badge-indicator{inset-block-start:0;inset-inline-end:0;position:absolute}.qds-badge-counter{inset-block-start:-2px;inset-inline-end:-2px;position:absolute}.qds-icon-tab[data-size=small]{gap:var(--qds-nav-element-small-gap-internal);min-height:var(--qds-nav-element-small-height);min-width:var(--qds-nav-element-small-height)}.qds-target-icon[data-size=small]{--qds-experimental-icon-click-target-size:var(--qds-control-small-height);height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}[data-size=small] .qds-icon-container{height:var(--qds-control-small-height);width:var(--qds-control-small-height)}[data-size=small] .qds-icon-container>.qds-icon{height:var(--qds-nav-element-small-icon-size);width:var(--qds-nav-element-small-icon-size)}.qds-icon-tab[data-size=standard]{gap:var(--qds-nav-element-standard-gap-internal);min-height:var(--qds-nav-element-standard-height);min-width:var(--qds-nav-element-standard-height)}.qds-target-icon[data-size=standard]{--qds-experimental-icon-click-target-size:var(\n --qds-control-standard-height\n );height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}[data-size=standard] .qds-icon-container{height:var(--qds-control-standard-height);width:var(--qds-control-standard-height)}[data-size=standard] .qds-icon-container>.qds-icon{height:var(--qds-nav-element-standard-icon-size);width:var(--qds-nav-element-standard-icon-size)}.qds-icon-tab[data-size=large]{gap:var(--qds-nav-element-large-gap-internal);min-height:var(--qds-nav-element-large-height);min-width:var(--qds-nav-element-large-height)}.qds-target-icon[data-size=large]{--qds-experimental-icon-click-target-size:var(--qds-control-large-height);height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}[data-size=large] .qds-icon-container{height:var(--qds-control-large-height);width:var(--qds-control-large-height)}[data-size=large] .qds-icon-container>.qds-icon{height:var(--qds-nav-element-large-icon-size);width:var(--qds-nav-element-large-icon-size)}.qds-selected[data-importance=standard]:after,.qds-selected[data-importance=subdued]:after{border-radius:var(--qds-signature-line-connection-cap-radius);content:\"\";display:block;position:absolute}.qds-selected.qds-indicator-inline-end[data-importance=standard]:after,.qds-selected.qds-indicator-inline-end[data-importance=subdued]:after,.qds-selected.qds-indicator-inline-start[data-importance=standard]:after,.qds-selected.qds-indicator-inline-start[data-importance=subdued]:after{height:100%;width:var(--qds-signature-line-connection-width)}.qds-selected.qds-indicator-inline-end[data-importance=standard]:after,.qds-selected.qds-indicator-inline-end[data-importance=subdued]:after{inset-inline-end:0}.qds-selected.qds-indicator-inline-start[data-importance=standard]:after,.qds-selected.qds-indicator-inline-start[data-importance=subdued]:after{inset-inline-start:0}.qds-selected.qds-indicator-block-end[data-importance=standard]:after,.qds-selected.qds-indicator-block-end[data-importance=subdued]:after,.qds-selected.qds-indicator-block-start[data-importance=standard]:after,.qds-selected.qds-indicator-block-start[data-importance=subdued]:after{height:var(--qds-signature-line-connection-width);width:100%}.qds-selected.qds-indicator-block-end[data-importance=standard]:after,.qds-selected.qds-indicator-block-end[data-importance=subdued]:after{bottom:0}.qds-selected.qds-indicator-block-start[data-importance=standard]:after,.qds-selected.qds-indicator-block-start[data-importance=subdued]:after{top:0}[data-importance=standard]:hover:after{background-color:var(--qds-theme-signature-color-hover)}[data-importance=standard]:active:after{background-color:var(--qds-theme-signature-color-pressed)}.qds-selected[data-importance=standard]:after{background-color:var(--qds-theme-signature-color-default)}[data-importance=standard] .qds-selected .qds-icon{color:var(--qds-theme-title)}.qds-selected[data-importance=subdued]:after,[data-importance=subdued] :active:after{background-color:var(--qds-theme-link-subdued-pressed)}[data-importance=subdued]:hover:after{background-color:var(--qds-theme-link-subdued-hover)}.qds-selected[data-importance=subdued]:after{background-color:var(\n --qds-theme-nav-element-selection-indicator-background-subdued\n )}.qds-icon-tab{align-items:center;background-color:initial;border:none;cursor:pointer;justify-content:center;position:relative;text-align:initial}.qds-icon-tab:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-icon-tab:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-icon-tab:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-icon-tab:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:calc(var(--qds-focus-border-width)*-1 - var(--qds-focus-border-offset))}.qds-hidden{display:none}";
9
+ const iconTabCss = ":host([hidden]){display:none!important}:host{display:inline-block;line-height:0}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}:host(:focus-visible){border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:calc(var(--qds-focus-border-width)*-1 - var(--qds-focus-border-offset))}.qds-icon-container{align-items:center;display:flex;justify-content:center;position:relative}.qds-icon{flex-shrink:0}.qds-icon:hover{background-color:initial}.qds-selected:active{background-color:var(--qds-theme-interactive-background-selected-pressed)}.qds-icon,.qds-text{color:var(--qds-theme-title)}.qds-badge-indicator{inset-block-start:0;inset-inline-end:0;position:absolute}.qds-badge-counter{inset-block-start:-2px;inset-inline-end:-2px;position:absolute}.qds-icon-tab[data-size=small]{gap:var(--qds-nav-element-small-gap-internal);min-height:var(--qds-nav-element-small-height);min-width:var(--qds-nav-element-small-height)}[data-size=small] .qds-icon-container{height:var(--qds-control-small-height);width:var(--qds-control-small-height)}[data-size=small] .qds-icon-container>.qds-icon{height:var(--qds-nav-element-small-icon-size);width:var(--qds-nav-element-small-icon-size)}.qds-icon-tab[data-size=standard]{gap:var(--qds-nav-element-standard-gap-internal);min-height:var(--qds-nav-element-standard-height);min-width:var(--qds-nav-element-standard-height)}[data-size=standard] .qds-icon-container{height:var(--qds-control-standard-height);width:var(--qds-control-standard-height)}[data-size=standard] .qds-icon-container>.qds-icon{height:var(--qds-nav-element-standard-icon-size);width:var(--qds-nav-element-standard-icon-size)}.qds-icon-tab[data-size=large]{gap:var(--qds-nav-element-large-gap-internal);min-height:var(--qds-nav-element-large-height);min-width:var(--qds-nav-element-large-height)}[data-size=large] .qds-icon-container{height:var(--qds-control-large-height);width:var(--qds-control-large-height)}[data-size=large] .qds-icon-container>.qds-icon{height:var(--qds-nav-element-large-icon-size);width:var(--qds-nav-element-large-icon-size)}.qds-selected[data-importance=standard]:after,.qds-selected[data-importance=subdued]:after{border-radius:var(--qds-signature-line-connection-cap-radius);content:\"\";display:block;position:absolute}.qds-selected.qds-indicator-inline-end[data-importance=standard]:after,.qds-selected.qds-indicator-inline-end[data-importance=subdued]:after,.qds-selected.qds-indicator-inline-start[data-importance=standard]:after,.qds-selected.qds-indicator-inline-start[data-importance=subdued]:after{height:100%;width:var(--qds-signature-line-connection-width)}.qds-selected.qds-indicator-inline-end[data-importance=standard]:after,.qds-selected.qds-indicator-inline-end[data-importance=subdued]:after{inset-inline-end:0}.qds-selected.qds-indicator-inline-start[data-importance=standard]:after,.qds-selected.qds-indicator-inline-start[data-importance=subdued]:after{inset-inline-start:0}.qds-selected.qds-indicator-block-end[data-importance=standard]:after,.qds-selected.qds-indicator-block-end[data-importance=subdued]:after,.qds-selected.qds-indicator-block-start[data-importance=standard]:after,.qds-selected.qds-indicator-block-start[data-importance=subdued]:after{height:var(--qds-signature-line-connection-width);width:100%}.qds-selected.qds-indicator-block-end[data-importance=standard]:after,.qds-selected.qds-indicator-block-end[data-importance=subdued]:after{bottom:0}.qds-selected.qds-indicator-block-start[data-importance=standard]:after,.qds-selected.qds-indicator-block-start[data-importance=subdued]:after{top:0}[data-importance=standard]:hover:after{background-color:var(--qds-theme-signature-color-hover)}[data-importance=standard]:active:after{background-color:var(--qds-theme-signature-color-pressed)}.qds-selected[data-importance=standard]:after{background-color:var(--qds-theme-signature-color-default)}[data-importance=standard] .qds-selected .qds-icon{color:var(--qds-theme-title)}.qds-selected[data-importance=subdued]:after,[data-importance=subdued] :active:after{background-color:var(--qds-theme-link-subdued-pressed)}[data-importance=subdued]:hover:after{background-color:var(--qds-theme-link-subdued-hover)}.qds-selected[data-importance=subdued]:after{background-color:var(\n --qds-theme-nav-element-selection-indicator-background-subdued\n )}.qds-icon-tab{align-items:center;background-color:initial;border:none;cursor:pointer;display:flex;justify-content:center;position:relative;text-align:initial}.qds-icon-tab:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-icon-tab:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-icon-tab:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-icon-tab:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:calc(var(--qds-focus-border-width)*-1 - var(--qds-focus-border-offset))}.qds-hidden{display:none}";
10
10
 
11
11
  // SPDX-FileCopyrightText: © 2026 Schneider Electric
12
12
  //
@@ -155,13 +155,13 @@ const IconTab = class {
155
155
  render() {
156
156
  const isLink = this.href === undefined ? this.indicatorPosition : 'block-start';
157
157
  const Tag = isLink ? 'a' : 'div';
158
- return (h("div", { key: 'ee55c8edcad6ea16123e32591e073638dfda985a', "aria-disabled": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedDisabled_get) ? 'true' : undefined, class: {
158
+ return (h("div", { key: '487ae8cb9a55bbe7d07a8c4dcae654a1609af5b4', "aria-disabled": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedDisabled_get) ? 'true' : undefined, class: {
159
159
  'qds-selected': this.selected,
160
- }, "data-size": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), "data-importance": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedImportance_get), ref: __classPrivateFieldGet(this, _IconTab_ref, "f") }, h(Tag, { key: '7c535857b7b2856437596c2df0099919dc99c1b6', ref: __classPrivateFieldGet(this, _IconTab_iconTabRef, "f"), "aria-disabled": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedDisabled_get) ? 'true' : undefined, ...(isLink ? undefined : { disabled: this.disabled }), onBlur: __classPrivateFieldGet(this, _IconTab_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _IconTab_onFocus, "f"), class: {
160
+ }, "data-size": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), "data-importance": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedImportance_get), ref: __classPrivateFieldGet(this, _IconTab_ref, "f") }, h(Tag, { key: '12093c90673de8fc1377992bc7892e76315b6b21', ref: __classPrivateFieldGet(this, _IconTab_iconTabRef, "f"), "aria-disabled": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedDisabled_get) ? 'true' : undefined, ...(isLink ? undefined : { disabled: this.disabled }), onBlur: __classPrivateFieldGet(this, _IconTab_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _IconTab_onFocus, "f"), class: {
161
161
  'qds-icon-tab': true,
162
162
  'qds-selected': this.selected,
163
163
  [`qds-indicator-${this.indicatorPosition}`]: true,
164
- }, role: isLink ? undefined : 'tab', "aria-current": isLink && this.selected ? 'true' : undefined, "aria-expanded": isLink ? undefined : this.selected ? 'true' : 'false', "data-importance": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedImportance_get), "data-size": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), href: isLink ? this.href : undefined }, h("div", { key: '0e5c9c975cd7839003dc6227e692974905165abe', class: "qds-icon-container" }, h("qds-icon", { key: 'e400c4a9249fcd4a6e436e196302961ff1f430d1', "aria-hidden": "true", class: "qds-icon", library: this.iconLibrary, name: this.iconName }), isIndicator(this.badge) && (h("qds-badge-indicator", { key: 'def25454ebe3e3ac6bc21b3618db347a016e2ad8', class: "qds-badge-indicator", status: this.badgeIndicatorStatus, description: this.badgeDescription, size: __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), strokeRing: true })), isCounter(this.badge) && (h("qds-badge-counter", { key: '3ee1b82b6d97c1e3aeac1347333f2487c922a6f7', class: "qds-badge-counter", description: this.badgeDescription, importance: this.badgeCounterImportance, size: __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), strokeRing: true, value: this.badge })))), h("qds-tooltip", { key: 'f292fc171e186c67537ac0159376fb3e9618d54c', placement: __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_placement_get), ref: __classPrivateFieldGet(this, _IconTab_tooltipRef, "f") }, h("qds-title", { key: 'f4e85471c2f320db20e75ae24d5c08f5a29d8a17', layer: "accessory", level: "root" }, this.text))));
164
+ }, role: isLink ? undefined : 'tab', "aria-current": isLink && this.selected ? 'true' : undefined, "aria-expanded": isLink ? undefined : this.selected ? 'true' : 'false', "data-importance": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedImportance_get), "data-size": __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), href: isLink ? this.href : undefined }, h("div", { key: '69a7818c3f16667a07cd37d0775d8c2676546693', class: "qds-icon-container" }, h("qds-icon", { key: '281df04fbea65aa853c0f3b5fe20ea0f3c491c81', "aria-hidden": "true", class: "qds-icon", library: this.iconLibrary, name: this.iconName }), isIndicator(this.badge) && (h("qds-badge-indicator", { key: '40199c0a4a79e0b98ec62c106d7f76dbac343a3f', class: "qds-badge-indicator", status: this.badgeIndicatorStatus, description: this.badgeDescription, size: __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), strokeRing: true })), isCounter(this.badge) && (h("qds-badge-counter", { key: '3c7cab837ba45ea78c741a748915ec67d2f4ae7d', class: "qds-badge-counter", description: this.badgeDescription, importance: this.badgeCounterImportance, size: __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_computedSize_get), strokeRing: true, value: this.badge })))), h("qds-tooltip", { key: 'bade89eaa9147b36bad8cc0177d1a4867373646f', placement: __classPrivateFieldGet(this, _IconTab_instances, "a", _IconTab_placement_get), ref: __classPrivateFieldGet(this, _IconTab_tooltipRef, "f") }, h("qds-title", { key: '45f7022bf7984a7bc471603d94f7f9dc8a3b7ee2', layer: "accessory", level: "root" }, this.text))));
165
165
  }
166
166
  get host() { return getElement(this); }
167
167
  static get watchers() { return {
@@ -1 +1 @@
1
- {"version":3,"file":"qds-icon-tab.entry.js","sources":["src/components/icon-tab/icon-tab.css?tag=qds-icon-tab&encapsulation=shadow","src/components/icon-tab/icon-tab.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2026 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n:host(:focus-visible) {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n outline-offset: calc(\n -1 * var(--qds-focus-border-width) - var(--qds-focus-border-offset)\n );\n}\n\n.qds-target {\n appearance: none;\n border: none;\n padding: 0;\n cursor: pointer;\n pointer-events: auto;\n background-color: transparent;\n\n &:disabled {\n pointer-events: none;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n.qds-icon-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.qds-icon:hover {\n background-color: transparent;\n}\n\n.qds-target-icon {\n color: var(--qds-theme-control-text-standard);\n}\n\n.qds-icon,\n.qds-target-icon {\n flex-shrink: 0;\n}\n\n.qds-selected {\n &:active {\n background-color: var(--qds-theme-interactive-background-selected-pressed);\n }\n}\n\n.qds-target,\n.qds-icon-tab {\n display: flex;\n}\n\n.qds-icon,\n.qds-text {\n color: var(--qds-theme-title);\n}\n\n.qds-badge-indicator {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n}\n\n.qds-badge-counter {\n position: absolute;\n inset-block-start: -2px;\n inset-inline-end: -2px;\n}\n\n[data-size='small'] {\n &.qds-icon-tab {\n min-height: var(--qds-nav-element-small-height);\n min-width: var(--qds-nav-element-small-height);\n gap: var(--qds-nav-element-small-gap-internal);\n }\n\n &.qds-target-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-small-height);\n\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n\n .qds-icon-container {\n height: var(--qds-control-small-height);\n width: var(--qds-control-small-height);\n\n & > .qds-icon {\n height: var(--qds-nav-element-small-icon-size);\n width: var(--qds-nav-element-small-icon-size);\n }\n }\n}\n\n[data-size='standard'] {\n &.qds-icon-tab {\n min-height: var(--qds-nav-element-standard-height);\n min-width: var(--qds-nav-element-standard-height);\n gap: var(--qds-nav-element-standard-gap-internal);\n }\n\n &.qds-target-icon {\n --qds-experimental-icon-click-target-size: var(\n --qds-control-standard-height\n );\n\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n\n .qds-icon-container {\n height: var(--qds-control-standard-height);\n width: var(--qds-control-standard-height);\n\n & > .qds-icon {\n height: var(--qds-nav-element-standard-icon-size);\n width: var(--qds-nav-element-standard-icon-size);\n }\n }\n}\n\n[data-size='large'] {\n &.qds-icon-tab {\n min-height: var(--qds-nav-element-large-height);\n min-width: var(--qds-nav-element-large-height);\n gap: var(--qds-nav-element-large-gap-internal);\n }\n\n &.qds-target-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-large-height);\n\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n\n .qds-icon-container {\n height: var(--qds-control-large-height);\n width: var(--qds-control-large-height);\n\n & > .qds-icon {\n height: var(--qds-nav-element-large-icon-size);\n width: var(--qds-nav-element-large-icon-size);\n }\n }\n}\n\n[data-importance='subdued'],\n[data-importance='standard'] {\n &.qds-selected {\n &::after {\n border-radius: var(--qds-signature-line-connection-cap-radius);\n content: '';\n display: block;\n position: absolute;\n }\n\n &.qds-indicator-inline-end::after,\n &.qds-indicator-inline-start::after {\n width: var(--qds-signature-line-connection-width);\n height: 100%;\n }\n\n &.qds-indicator-inline-end::after {\n inset-inline-end: 0;\n }\n\n &.qds-indicator-inline-start::after {\n inset-inline-start: 0;\n }\n\n &.qds-indicator-block-end::after,\n &.qds-indicator-block-start::after {\n width: 100%;\n height: var(--qds-signature-line-connection-width);\n }\n\n &.qds-indicator-block-end::after {\n bottom: 0;\n }\n\n &.qds-indicator-block-start::after {\n top: 0;\n }\n }\n}\n\n[data-importance='standard'] {\n &:hover {\n &::after {\n background-color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n &::after {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n\n &.qds-selected {\n &::after {\n background-color: var(--qds-theme-signature-color-default);\n }\n }\n\n .qds-selected .qds-icon {\n color: var(--qds-theme-title);\n }\n}\n\n[data-importance='subdued'] {\n &.qds-selected,\n :active {\n &::after {\n background-color: var(--qds-theme-link-subdued-pressed);\n }\n }\n\n &:hover {\n &::after {\n background-color: var(--qds-theme-link-subdued-hover);\n }\n }\n\n &.qds-selected::after {\n background-color: var(\n --qds-theme-nav-element-selection-indicator-background-subdued\n );\n }\n}\n\n.qds-icon-tab {\n position: relative;\n align-items: center;\n justify-content: center;\n border: none;\n background-color: transparent;\n cursor: pointer;\n text-align: initial;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n outline-offset: calc(\n -1 * var(--qds-focus-border-width) - var(--qds-focus-border-offset)\n );\n }\n}\n\n.qds-hidden {\n display: none;\n}\n","// SPDX-FileCopyrightText: © 2026 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { pickFocusEventAttributes, resolveTarget } from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type Placement = 'bottom' | 'left' | 'right' | 'top'\n\nexport type IndicatorPosition =\n | 'block-end'\n | 'block-start'\n | 'inline-end'\n | 'inline-start'\n\nexport type IconTabImportance = Exclude<Importance, 'emphasized'>\n\nconst isCounter = (value: unknown): value is number =>\n typeof value === 'string'\n ? !Number.isNaN(Number.parseFloat(value))\n : typeof value === 'number'\n\nconst isIndicator = (value: unknown): value is '' | true =>\n value === '' || value === true\n\nlet autoIncrementingId = 1\n\n/**\n * <qds-icon-tab> is a navigational element that is used in different horizontal or vertical navigation bars\n * (Main Navigation, secondary navigation, Tab bar, etc.)\n * as trigger points for opening a menu list or switching content in Tab bar.\n *\n * @see https://quartz.se.com/build/components/icon-tab\n */\n@Component({\n tag: 'qds-icon-tab',\n shadow: true,\n styleUrl: 'icon-tab.css',\n})\nexport class IconTab implements ComponentInterface {\n /**\n * Displays an indicator if `true` or the empty string. Otherwise, displays a\n * counter badge if a number or string representing a number is used.\n */\n @Prop() public readonly badge?: number | string | true\n\n /**\n * The tab's counter importance.\n */\n @Prop()\n public readonly badgeCounterImportance?: HTMLQdsBadgeCounterElement['importance'] =\n 'standard'\n\n /**\n * The indicator or counter badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n /**\n * The indicator's status.\n */\n @Prop()\n public readonly badgeIndicatorStatus?: HTMLQdsBadgeIndicatorElement['status'] =\n 'neutral'\n\n /**\n * Prevents the tab from being interacted with: it cannot be\n * selected or focused.\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName!: string\n\n /**\n * The tab's importance.\n */\n @Prop() public readonly importance?: IconTabImportance = 'standard'\n\n /**\n * The tab's indicator position.\n */\n @Prop() public readonly indicatorPosition?: IndicatorPosition = 'block-end'\n\n /**\n * The tab panel element associated with this tab. The `panel` specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][]\n * - A function returning a reference to an [`Element`][] or a CSS selector\n * string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n */\n @Prop() public readonly panel!: Element | string | (() => Element | string)\n\n /**\n * Whether or not the tab is selected.\n */\n @Prop() public selected = false\n\n /**\n * The tab's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Icon tab's accessible name.\n */\n @Prop() public readonly text?: string\n\n /**\n * When set, the underlying tab will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * This property has no effect if the tab has an `action`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Emitted when the tab loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the tab gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n @State() private isIndicatorOnTop = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #div?: HTMLDivElement\n\n #panel?: Element\n\n #iconTab?: HTMLElement\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedImportance(): IconTabImportance {\n return this.importance ?? 'standard'\n }\n\n get #parentLayer(): string {\n return this.host.closest('qds-tabbar')?.layer ?? 'main'\n }\n\n get #parentLevel(): string {\n return this.host.closest('qds-tabbar')?.level ?? 'root'\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #placement(): Placement {\n switch (this.indicatorPosition) {\n case 'inline-start': {\n return 'left'\n }\n case 'inline-end': {\n return 'right'\n }\n case 'block-start': {\n return 'top'\n }\n default: {\n return 'bottom'\n }\n }\n }\n\n @Watch('panel')\n protected panelChanged(): void {\n this.disconnectedCallback()\n\n const panel = resolveTarget(this.panel)\n if (!(panel instanceof globalThis.Element)) return\n this.#panel = panel\n\n const tab = this.host.shadowRoot?.querySelector('[role=\"tab\"]')\n if (tab) tab.setAttribute('aria-controls', this.#panel.id)\n\n if (this.#panel.role === null) this.#panel.role = 'tabpanel'\n if (this.#panel.getAttribute('aria-labelledby') === null)\n this.#panel.setAttribute('aria-labelledby', this.host.id)\n this.#panel.setAttribute(\n 'tabindex',\n this.#panel.getAttribute('tabindex') ?? '0',\n )\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n public componentWillLoad(): void {\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.host.id ||= `qds-icon-tab-${autoIncrementingId}`\n autoIncrementingId += 1\n\n this.#defineTab()\n }\n\n public componentWillRender(): void {\n const isPanelRoot =\n this.#parentLayer === 'panel' && this.#parentLevel === 'root'\n const isMainSubsection =\n this.#parentLayer === 'main' && this.#parentLevel === 'subsection'\n\n this.isIndicatorOnTop = isPanelRoot || isMainSubsection\n }\n\n public componentDidLoad(): void {\n this.panelChanged()\n }\n\n public disconnectedCallback(): void {\n if (!this.#panel) return\n\n const tab = this.host.shadowRoot?.querySelector('[role=\"tab\"]')\n if (tab) tab.removeAttribute('aria-controls')\n\n if (this.#panel.role === 'tabpanel')\n // eslint-disable-next-line unicorn/no-null\n this.#panel.role = null\n if (this.#panel.getAttribute('aria-labelledby') === this.host.id)\n this.#panel.removeAttribute('aria-labelledby')\n this.#panel.removeAttribute('tabindex')\n }\n\n public render() {\n const isLink =\n this.href === undefined ? this.indicatorPosition : 'block-start'\n const Tag = isLink ? 'a' : 'div'\n return (\n <div\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-selected': this.selected,\n }}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n ref={this.#ref}\n >\n <Tag\n ref={this.#iconTabRef}\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...(isLink ? undefined : { disabled: this.disabled })}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n class={{\n 'qds-icon-tab': true,\n 'qds-selected': this.selected,\n [`qds-indicator-${this.indicatorPosition}`]: true,\n }}\n role={isLink ? undefined : 'tab'}\n aria-current={isLink && this.selected ? 'true' : undefined}\n aria-expanded={isLink ? undefined : this.selected ? 'true' : 'false'}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n href={isLink ? this.href : undefined}\n >\n <div class=\"qds-icon-container\">\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n {isIndicator(this.badge) && (\n <qds-badge-indicator\n class=\"qds-badge-indicator\"\n status={this.badgeIndicatorStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )}\n {isCounter(this.badge) && (\n <qds-badge-counter\n class=\"qds-badge-counter\"\n description={this.badgeDescription}\n importance={this.badgeCounterImportance}\n size={this.#computedSize}\n strokeRing\n value={this.badge}\n />\n )}\n </div>\n </Tag>\n <qds-tooltip placement={this.#placement} ref={this.#tooltipRef}>\n <qds-title layer=\"accessory\" level=\"root\">\n {this.text}\n </qds-title>\n </qds-tooltip>\n </div>\n )\n }\n\n readonly #ref = (div?: HTMLDivElement): void => {\n this.#div = div\n }\n\n readonly #iconTabRef = (tab?: HTMLElement): void => {\n this.#iconTab = tab\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#div\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #defineTab = (): void => {\n this.internals.role = 'tab'\n this.#defineGetter('tab', () => this.#iconTab)\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,6/LAA6/L;;ACAhhM;AACA;AACA;;;;;;;;;;;;;;;;;;AA6BA,MAAM,SAAS,GAAG,CAAC,KAAc,KAC/B,OAAO,KAAK,KAAK;AACf,MAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACxC,MAAE,OAAO,KAAK,KAAK,QAAQ;AAE/B,MAAM,WAAW,GAAG,CAAC,KAAc,KACjC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI;AAEhC,IAAI,kBAAkB,GAAG,CAAC;MAcb,OAAO,GAAA,MAAA;AALpB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;;;AAYE;;AAEG;AAEa,QAAA,IAAsB,CAAA,sBAAA,GACpC,UAAU;AAQZ;;AAEG;AAEa,QAAA,IAAoB,CAAA,oBAAA,GAClC,SAAS;AAQX;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AASvD;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAAuB,UAAU;AA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E,CAAC;;;;;"}
1
+ {"version":3,"file":"qds-icon-tab.entry.js","sources":["src/components/icon-tab/icon-tab.css?tag=qds-icon-tab&encapsulation=shadow","src/components/icon-tab/icon-tab.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2026 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n:host(:focus-visible) {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n outline-offset: calc(\n -1 * var(--qds-focus-border-width) - var(--qds-focus-border-offset)\n );\n}\n\n.qds-icon-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-icon:hover {\n background-color: transparent;\n}\n\n.qds-selected {\n &:active {\n background-color: var(--qds-theme-interactive-background-selected-pressed);\n }\n}\n\n.qds-icon,\n.qds-text {\n color: var(--qds-theme-title);\n}\n\n.qds-badge-indicator {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n}\n\n.qds-badge-counter {\n position: absolute;\n inset-block-start: -2px;\n inset-inline-end: -2px;\n}\n\n[data-size='small'] {\n &.qds-icon-tab {\n min-height: var(--qds-nav-element-small-height);\n min-width: var(--qds-nav-element-small-height);\n gap: var(--qds-nav-element-small-gap-internal);\n }\n\n .qds-icon-container {\n height: var(--qds-control-small-height);\n width: var(--qds-control-small-height);\n\n & > .qds-icon {\n height: var(--qds-nav-element-small-icon-size);\n width: var(--qds-nav-element-small-icon-size);\n }\n }\n}\n\n[data-size='standard'] {\n &.qds-icon-tab {\n min-height: var(--qds-nav-element-standard-height);\n min-width: var(--qds-nav-element-standard-height);\n gap: var(--qds-nav-element-standard-gap-internal);\n }\n\n .qds-icon-container {\n height: var(--qds-control-standard-height);\n width: var(--qds-control-standard-height);\n\n & > .qds-icon {\n height: var(--qds-nav-element-standard-icon-size);\n width: var(--qds-nav-element-standard-icon-size);\n }\n }\n}\n\n[data-size='large'] {\n &.qds-icon-tab {\n min-height: var(--qds-nav-element-large-height);\n min-width: var(--qds-nav-element-large-height);\n gap: var(--qds-nav-element-large-gap-internal);\n }\n\n .qds-icon-container {\n height: var(--qds-control-large-height);\n width: var(--qds-control-large-height);\n\n & > .qds-icon {\n height: var(--qds-nav-element-large-icon-size);\n width: var(--qds-nav-element-large-icon-size);\n }\n }\n}\n\n[data-importance='subdued'],\n[data-importance='standard'] {\n &.qds-selected {\n &::after {\n border-radius: var(--qds-signature-line-connection-cap-radius);\n content: '';\n display: block;\n position: absolute;\n }\n\n &.qds-indicator-inline-end::after,\n &.qds-indicator-inline-start::after {\n width: var(--qds-signature-line-connection-width);\n height: 100%;\n }\n\n &.qds-indicator-inline-end::after {\n inset-inline-end: 0;\n }\n\n &.qds-indicator-inline-start::after {\n inset-inline-start: 0;\n }\n\n &.qds-indicator-block-end::after,\n &.qds-indicator-block-start::after {\n width: 100%;\n height: var(--qds-signature-line-connection-width);\n }\n\n &.qds-indicator-block-end::after {\n bottom: 0;\n }\n\n &.qds-indicator-block-start::after {\n top: 0;\n }\n }\n}\n\n[data-importance='standard'] {\n &:hover {\n &::after {\n background-color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n &::after {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n\n &.qds-selected {\n &::after {\n background-color: var(--qds-theme-signature-color-default);\n }\n }\n\n .qds-selected .qds-icon {\n color: var(--qds-theme-title);\n }\n}\n\n[data-importance='subdued'] {\n &.qds-selected,\n :active {\n &::after {\n background-color: var(--qds-theme-link-subdued-pressed);\n }\n }\n\n &:hover {\n &::after {\n background-color: var(--qds-theme-link-subdued-hover);\n }\n }\n\n &.qds-selected::after {\n background-color: var(\n --qds-theme-nav-element-selection-indicator-background-subdued\n );\n }\n}\n\n.qds-icon-tab {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n border: none;\n background-color: transparent;\n cursor: pointer;\n text-align: initial;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n outline-offset: calc(\n -1 * var(--qds-focus-border-width) - var(--qds-focus-border-offset)\n );\n }\n}\n\n.qds-hidden {\n display: none;\n}\n","// SPDX-FileCopyrightText: © 2026 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { pickFocusEventAttributes, resolveTarget } from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type Placement = 'bottom' | 'left' | 'right' | 'top'\n\nexport type IndicatorPosition =\n | 'block-end'\n | 'block-start'\n | 'inline-end'\n | 'inline-start'\n\nexport type IconTabImportance = Exclude<Importance, 'emphasized'>\n\nconst isCounter = (value: unknown): value is number =>\n typeof value === 'string'\n ? !Number.isNaN(Number.parseFloat(value))\n : typeof value === 'number'\n\nconst isIndicator = (value: unknown): value is '' | true =>\n value === '' || value === true\n\nlet autoIncrementingId = 1\n\n/**\n * <qds-icon-tab> is a navigational element that is used in different horizontal or vertical navigation bars\n * (Main Navigation, secondary navigation, Tab bar, etc.)\n * as trigger points for opening a menu list or switching content in Tab bar.\n *\n * @see https://quartz.se.com/build/components/icon-tab\n */\n@Component({\n tag: 'qds-icon-tab',\n shadow: true,\n styleUrl: 'icon-tab.css',\n})\nexport class IconTab implements ComponentInterface {\n /**\n * Displays an indicator if `true` or the empty string. Otherwise, displays a\n * counter badge if a number or string representing a number is used.\n */\n @Prop() public readonly badge?: number | string | true\n\n /**\n * The tab's counter importance.\n */\n @Prop()\n public readonly badgeCounterImportance?: HTMLQdsBadgeCounterElement['importance'] =\n 'standard'\n\n /**\n * The indicator or counter badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n /**\n * The indicator's status.\n */\n @Prop()\n public readonly badgeIndicatorStatus?: HTMLQdsBadgeIndicatorElement['status'] =\n 'neutral'\n\n /**\n * Prevents the tab from being interacted with: it cannot be\n * selected or focused.\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName!: string\n\n /**\n * The tab's importance.\n */\n @Prop() public readonly importance?: IconTabImportance = 'standard'\n\n /**\n * The tab's indicator position.\n */\n @Prop() public readonly indicatorPosition?: IndicatorPosition = 'block-end'\n\n /**\n * The tab panel element associated with this tab. The `panel` specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][]\n * - A function returning a reference to an [`Element`][] or a CSS selector\n * string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n */\n @Prop() public readonly panel!: Element | string | (() => Element | string)\n\n /**\n * Whether or not the tab is selected.\n */\n @Prop() public selected = false\n\n /**\n * The tab's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Icon tab's accessible name.\n */\n @Prop() public readonly text?: string\n\n /**\n * When set, the underlying tab will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * This property has no effect if the tab has an `action`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Emitted when the tab loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the tab gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n @State() private isIndicatorOnTop = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #div?: HTMLDivElement\n\n #panel?: Element\n\n #iconTab?: HTMLElement\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedImportance(): IconTabImportance {\n return this.importance ?? 'standard'\n }\n\n get #parentLayer(): string {\n return this.host.closest('qds-tabbar')?.layer ?? 'main'\n }\n\n get #parentLevel(): string {\n return this.host.closest('qds-tabbar')?.level ?? 'root'\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #placement(): Placement {\n switch (this.indicatorPosition) {\n case 'inline-start': {\n return 'left'\n }\n case 'inline-end': {\n return 'right'\n }\n case 'block-start': {\n return 'top'\n }\n default: {\n return 'bottom'\n }\n }\n }\n\n @Watch('panel')\n protected panelChanged(): void {\n this.disconnectedCallback()\n\n const panel = resolveTarget(this.panel)\n if (!(panel instanceof globalThis.Element)) return\n this.#panel = panel\n\n const tab = this.host.shadowRoot?.querySelector('[role=\"tab\"]')\n if (tab) tab.setAttribute('aria-controls', this.#panel.id)\n\n if (this.#panel.role === null) this.#panel.role = 'tabpanel'\n if (this.#panel.getAttribute('aria-labelledby') === null)\n this.#panel.setAttribute('aria-labelledby', this.host.id)\n this.#panel.setAttribute(\n 'tabindex',\n this.#panel.getAttribute('tabindex') ?? '0',\n )\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n public componentWillLoad(): void {\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.host.id ||= `qds-icon-tab-${autoIncrementingId}`\n autoIncrementingId += 1\n\n this.#defineTab()\n }\n\n public componentWillRender(): void {\n const isPanelRoot =\n this.#parentLayer === 'panel' && this.#parentLevel === 'root'\n const isMainSubsection =\n this.#parentLayer === 'main' && this.#parentLevel === 'subsection'\n\n this.isIndicatorOnTop = isPanelRoot || isMainSubsection\n }\n\n public componentDidLoad(): void {\n this.panelChanged()\n }\n\n public disconnectedCallback(): void {\n if (!this.#panel) return\n\n const tab = this.host.shadowRoot?.querySelector('[role=\"tab\"]')\n if (tab) tab.removeAttribute('aria-controls')\n\n if (this.#panel.role === 'tabpanel')\n // eslint-disable-next-line unicorn/no-null\n this.#panel.role = null\n if (this.#panel.getAttribute('aria-labelledby') === this.host.id)\n this.#panel.removeAttribute('aria-labelledby')\n this.#panel.removeAttribute('tabindex')\n }\n\n public render() {\n const isLink =\n this.href === undefined ? this.indicatorPosition : 'block-start'\n const Tag = isLink ? 'a' : 'div'\n return (\n <div\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-selected': this.selected,\n }}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n ref={this.#ref}\n >\n <Tag\n ref={this.#iconTabRef}\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...(isLink ? undefined : { disabled: this.disabled })}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n class={{\n 'qds-icon-tab': true,\n 'qds-selected': this.selected,\n [`qds-indicator-${this.indicatorPosition}`]: true,\n }}\n role={isLink ? undefined : 'tab'}\n aria-current={isLink && this.selected ? 'true' : undefined}\n aria-expanded={isLink ? undefined : this.selected ? 'true' : 'false'}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n href={isLink ? this.href : undefined}\n >\n <div class=\"qds-icon-container\">\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n {isIndicator(this.badge) && (\n <qds-badge-indicator\n class=\"qds-badge-indicator\"\n status={this.badgeIndicatorStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )}\n {isCounter(this.badge) && (\n <qds-badge-counter\n class=\"qds-badge-counter\"\n description={this.badgeDescription}\n importance={this.badgeCounterImportance}\n size={this.#computedSize}\n strokeRing\n value={this.badge}\n />\n )}\n </div>\n </Tag>\n <qds-tooltip placement={this.#placement} ref={this.#tooltipRef}>\n <qds-title layer=\"accessory\" level=\"root\">\n {this.text}\n </qds-title>\n </qds-tooltip>\n </div>\n )\n }\n\n readonly #ref = (div?: HTMLDivElement): void => {\n this.#div = div\n }\n\n readonly #iconTabRef = (tab?: HTMLElement): void => {\n this.#iconTab = tab\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#div\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #defineTab = (): void => {\n this.internals.role = 'tab'\n this.#defineGetter('tab', () => this.#iconTab)\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,+8JAA+8J;;ACAl+J;AACA;AACA;;;;;;;;;;;;;;;;;;AA6BA,MAAM,SAAS,GAAG,CAAC,KAAc,KAC/B,OAAO,KAAK,KAAK;AACf,MAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACxC,MAAE,OAAO,KAAK,KAAK,QAAQ;AAE/B,MAAM,WAAW,GAAG,CAAC,KAAc,KACjC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI;AAEhC,IAA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AY,EAAE;AACjB,YAAA,OAAO,OAAO;;QAEhB,KAAK,aAAa,EAAE;AAClB,YAAA,OAAO,KAAK;;QAEd,SAAS;AACP,YAAA,OAAO,QAAQ;;;AAGrB,CAAC,EAAA,qBAAA,GAAA,SAAA,qBAAA,CAsKa,CAAc,EAAE,GAAkB,EAAA;AAC9C,IAAA,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAChE,CAAC;;;;;"}
@@ -3,8 +3,7 @@
3
3
  *
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-Hg1Liloy.js';
7
- import { c as inheritAriaAttributes } from './helpers-BgaJNF9u.js';
6
+ import { r as registerInstance, c as createEvent, h } from './index-Hg1Liloy.js';
8
7
  import { g as getIconLibrary } from './library-CBfntPWH.js';
9
8
 
10
9
  // SPDX-FileCopyrightText: © 2024 Schneider Electric
@@ -35,40 +34,26 @@ const requestIcon = (url) => {
35
34
  return iconPromise;
36
35
  };
37
36
 
38
- const iconCss = ":host([hidden]){display:none!important}:host{display:inline-block;height:1em;width:1em}.qds-container{position:relative}.qds-icon-wrapper{display:contents}svg{display:block;fill:currentcolor;height:100%;width:100%}.qds-click-target{height:var(--qds-experimental-icon-click-target-size);left:calc((var(--qds-experimental-icon-click-target-size) - 100%)*-1/2);position:absolute;top:calc((var(--qds-experimental-icon-click-target-size) - 100%)*-1/2);width:var(--qds-experimental-icon-click-target-size)}";
37
+ const iconCss = ":host([hidden]){display:none!important}:host{display:inline-block;height:1em;width:1em}.qds-container{position:relative}.qds-icon-wrapper{display:contents}svg{display:block;fill:currentcolor;height:100%;width:100%}";
39
38
 
40
- // SPDX-FileCopyrightText: © 2024 Schneider Electric
41
- //
42
- // SPDX-License-Identifier: Apache-2.0
43
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
44
- if (kind === "a" && !f)
45
- throw new TypeError("Private accessor was defined without a getter");
46
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
47
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
48
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
49
- };
50
- var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
51
- if (kind === "m")
52
- throw new TypeError("Private method is not writable");
53
- if (kind === "a" && !f)
54
- throw new TypeError("Private accessor was defined without a setter");
55
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
56
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
57
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
58
- };
59
- var _Icon_inheritedAttributes;
60
39
  let parser;
61
40
  const Icon = class {
62
41
  constructor(hostRef) {
63
42
  registerInstance(this, hostRef);
64
43
  this.loadEmitter = createEvent(this, "qdsLoad", 6);
65
44
  this.errorEmitter = createEvent(this, "qdsError", 6);
45
+ if (hostRef.$hostElement$["s-ei"]) {
46
+ this.internals = hostRef.$hostElement$["s-ei"];
47
+ }
48
+ else {
49
+ this.internals = hostRef.$hostElement$.attachInternals();
50
+ hostRef.$hostElement$["s-ei"] = this.internals;
51
+ }
66
52
  /**
67
53
  * The name of a registered icon library.
68
54
  */
69
55
  this.library = 'default';
70
56
  this.svg = '';
71
- _Icon_inheritedAttributes.set(this, {});
72
57
  }
73
58
  async setIcon() {
74
59
  if (!this.name)
@@ -99,9 +84,6 @@ const Icon = class {
99
84
  this.errorEmitter.emit();
100
85
  }
101
86
  else {
102
- for (const [key, value] of Object.entries(__classPrivateFieldGet(this, _Icon_inheritedAttributes, "f")))
103
- if (value !== undefined)
104
- svgElement.setAttribute(key, value);
105
87
  this.svg = svgElement.outerHTML;
106
88
  this.loadEmitter.emit();
107
89
  }
@@ -111,19 +93,17 @@ const Icon = class {
111
93
  }
112
94
  }
113
95
  async componentWillLoad() {
114
- __classPrivateFieldSet(this, _Icon_inheritedAttributes, inheritAriaAttributes(this.host), "f");
96
+ this.internals.role = 'presentation';
115
97
  await this.setIcon();
116
98
  }
117
99
  render() {
118
- return (h("div", { key: 'fec63ded24fe49475d789744e32175930bfaaf45', class: "qds-container" }, h("span", { key: 'f70431d887b27792ecc3184004286ed0583689e5', class: "qds-icon-wrapper", innerHTML: this.svg }), h("div", { key: '2f6d366099a1a644da8d27e95be8ea2ff4af8e64', class: "qds-click-target" })));
100
+ return (h("div", { key: 'a572b557421a531b2247ff4bdfa3f739eddf04de', class: "qds-container", "aria-hidden": "true" }, h("span", { key: '61ffb82db95a3fc5703e5c5fa33af46281fad445', class: "qds-icon-wrapper", innerHTML: this.svg })));
119
101
  }
120
- get host() { return getElement(this); }
121
102
  static get watchers() { return {
122
103
  "name": ["setIcon"],
123
104
  "library": ["setIcon"]
124
105
  }; }
125
106
  };
126
- _Icon_inheritedAttributes = new WeakMap();
127
107
  Icon.style = iconCss;
128
108
 
129
109
  export { Icon as qds_icon };
@@ -1 +1 @@
1
- {"version":3,"file":"qds-icon.entry.js","sources":["src/components/icon/request.ts","src/components/icon/icon.css?tag=qds-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\ninterface IconResponse {\n ok: boolean\n status: number\n data: string\n}\n\nconst cachedIconRequests = new Map<\n string,\n IconResponse | Promise<IconResponse>\n>()\n\nconst requestIcon = (url: string): Promise<IconResponse> => {\n const cachedIconRequest = cachedIconRequests.get(url)\n if (cachedIconRequest) return Promise.resolve(cachedIconRequest)\n\n const iconPromise = fetch(url, { mode: 'cors' }).then(async (response) => {\n const iconResponse: IconResponse = {\n ok: response.ok,\n status: response.status,\n data: await response.text(),\n }\n if (response.ok) {\n const div = document.createElement('div')\n div.innerHTML = iconResponse.data\n const child = div.firstElementChild\n iconResponse.data =\n child?.tagName.toLowerCase() === 'svg' ? child.outerHTML : ''\n }\n\n cachedIconRequests.set(url, iconResponse)\n return iconResponse\n })\n cachedIconRequests.set(url, iconPromise)\n return iconPromise\n}\n\nexport default requestIcon\n","/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n height: 1em;\n width: 1em;\n}\n\n.qds-container {\n position: relative;\n}\n\n.qds-icon-wrapper {\n display: contents;\n}\n\nsvg {\n display: block;\n fill: currentcolor;\n height: 100%;\n width: 100%;\n}\n\n.qds-click-target {\n height: var(--qds-experimental-icon-click-target-size);\n left: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n position: absolute;\n top: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n width: var(--qds-experimental-icon-click-target-size);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport { getIconLibrary } from './library'\nimport requestIcon from './request'\n\nlet parser: DOMParser | undefined\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-icon',\n shadow: true,\n styleUrl: 'icon.css',\n})\nexport class Icon implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Emitted when the icon has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the icon fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private svg = ''\n\n #inheritedAttributes: Attributes = {}\n\n @Watch('name')\n @Watch('library')\n private async setIcon(): Promise<void> {\n if (!this.name) return\n\n const library = getIconLibrary(this.library)\n if (!library) return\n\n const url = library.resolver(this.name)\n if (!url) {\n this.svg = ''\n return\n }\n\n try {\n const request = await requestIcon(url)\n if (!request.ok) {\n this.svg = ''\n this.errorEmitter.emit()\n return\n }\n\n // Create an instance of the DOM parser. We do it here instead of at the\n // top-level to support SSR while maintaining a single parser instance\n // for optimal performance.\n parser ||= new DOMParser()\n const document = parser.parseFromString(request.data, 'text/html')\n const svgElement = document.body.querySelector('svg')\n if (svgElement === null) {\n this.svg = ''\n this.errorEmitter.emit()\n } else {\n for (const [key, value] of Object.entries(this.#inheritedAttributes))\n if (value !== undefined) svgElement.setAttribute(key, value)\n this.svg = svgElement.outerHTML\n this.loadEmitter.emit()\n }\n } catch {\n this.errorEmitter.emit()\n }\n }\n\n public async componentWillLoad(): Promise<void> {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n await this.setIcon()\n }\n\n public render() {\n return (\n <div class=\"qds-container\">\n <span class=\"qds-icon-wrapper\" innerHTML={this.svg} />\n <div class=\"qds-click-target\" />\n </div>\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AAQA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAG/B;AAEH,MAAM,WAAW,GAAG,CAAC,GAAW,KAA2B;IACzD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;AACrD,IAAA,IAAI,iBAAiB;AAAE,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC;AAEhE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,QAAQ,KAAI;AACvE,QAAA,MAAM,YAAY,GAAiB;YACjC,EAAE,EAAE,QAAQ,CAAC,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A;QACX,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,eAAe,EAAA,EACxB,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAI,CAAA,EACtD,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,kBAAkB,EAAG,CAAA,CAC5B;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"qds-icon.entry.js","sources":["src/components/icon/request.ts","src/components/icon/icon.css?tag=qds-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\ninterface IconResponse {\n ok: boolean\n status: number\n data: string\n}\n\nconst cachedIconRequests = new Map<\n string,\n IconResponse | Promise<IconResponse>\n>()\n\nconst requestIcon = (url: string): Promise<IconResponse> => {\n const cachedIconRequest = cachedIconRequests.get(url)\n if (cachedIconRequest) return Promise.resolve(cachedIconRequest)\n\n const iconPromise = fetch(url, { mode: 'cors' }).then(async (response) => {\n const iconResponse: IconResponse = {\n ok: response.ok,\n status: response.status,\n data: await response.text(),\n }\n if (response.ok) {\n const div = document.createElement('div')\n div.innerHTML = iconResponse.data\n const child = div.firstElementChild\n iconResponse.data =\n child?.tagName.toLowerCase() === 'svg' ? child.outerHTML : ''\n }\n\n cachedIconRequests.set(url, iconResponse)\n return iconResponse\n })\n cachedIconRequests.set(url, iconPromise)\n return iconPromise\n}\n\nexport default requestIcon\n","/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n height: 1em;\n width: 1em;\n}\n\n.qds-container {\n position: relative;\n}\n\n.qds-icon-wrapper {\n display: contents;\n}\n\nsvg {\n display: block;\n fill: currentcolor;\n height: 100%;\n width: 100%;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Event,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport { getIconLibrary } from './library'\nimport requestIcon from './request'\n\nlet parser: DOMParser | undefined\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-icon',\n shadow: true,\n styleUrl: 'icon.css',\n})\nexport class Icon implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Emitted when the icon has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the icon fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @State() private svg = ''\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n @Watch('name')\n @Watch('library')\n private async setIcon(): Promise<void> {\n if (!this.name) return\n\n const library = getIconLibrary(this.library)\n if (!library) return\n\n const url = library.resolver(this.name)\n if (!url) {\n this.svg = ''\n return\n }\n\n try {\n const request = await requestIcon(url)\n if (!request.ok) {\n this.svg = ''\n this.errorEmitter.emit()\n return\n }\n\n // Create an instance of the DOM parser. We do it here instead of at the\n // top-level to support SSR while maintaining a single parser instance\n // for optimal performance.\n parser ||= new DOMParser()\n const document = parser.parseFromString(request.data, 'text/html')\n const svgElement = document.body.querySelector('svg')\n if (svgElement === null) {\n this.svg = ''\n this.errorEmitter.emit()\n } else {\n this.svg = svgElement.outerHTML\n this.loadEmitter.emit()\n }\n } catch {\n this.errorEmitter.emit()\n }\n }\n\n public async componentWillLoad(): Promise<void> {\n this.internals.role = 'presentation'\n\n await this.setIcon()\n }\n\n public render() {\n return (\n <div class=\"qds-container\" aria-hidden=\"true\">\n <span class=\"qds-icon-wrapper\" innerHTML={this.svg} />\n </div>\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;AAQA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAG/B;AAEH,MAAM,WAAW,GAAG,CAAC,GAAW,KAA2B;IACzD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;AACrD,IAAA,IAAI,iBAAiB;AAAE,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC;AAEhE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,QAAQ,KAAI;AACvE,QAAA,MAAM,YAAY,GAAiB;YACjC,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,MAAM,EAAE,QAAQ,CAAC,MAAM;AACvB,YAAA,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;SAC5B;AACD,QAAA,IAAI,QAAQ,CAAC,EAAE,EAAE;YACf,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,YAAA,GAAG,CAAC,SAAS,GAAG,YAAY,CAAC,IAAI;AACjC,YAAA,MAAM,KAAK,GAAG,GAAG,CAAC,iBAAiB;AACnC,YAAA,YAAY,CAAC,IAAI;AACf,gBAAA,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE,KAAK,KAAK,GAAG,KAAK,CAAC,SAAS,GAAG,EAAE;;AAGjE,QAAA,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC;AACzC,QAAA,OAAO,YAAY;AACrB,KAAC,CAAC;AACF,IAAA,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC;AACxC,IAAA,OAAO,WAAW;AACpB,CAAC;;ACtCD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C,IAAI,EAAE;;;AAEzB,QAAA,MAAM;AACN,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;;;AAIrB,IAAA,MAAM,iBAAiB,GAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,cAAc;AAEpC,QAAA,MAAM,IAAI,CAAC,OAAO,EAAE;;IAGf,MAAM,GAAA;AACX,QAAA,QACE,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,eAAe,iBAAa,MAAM,EAAA,EAC3C,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,kBAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAA,CAAI,CAClD;;;;;;;;;;;"}
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-Hg1Liloy.js';
7
- import { p as pickFocusEventAttributes, i as invariant, d as determineLinkIcon } from './helpers-BgaJNF9u.js';
7
+ import { p as pickFocusEventAttributes, i as invariant, d as determineLinkIcon } from './helpers-Fe2AA6uo.js';
8
8
 
9
9
  const inlineLinkCss = ":host([hidden]){display:none!important}:host{display:inline-block}:host(:focus-visible){border-radius:var(--qds-control-border-radius);box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0}.qds-icon{height:var(--qds-control-hero-icon-size);width:var(--qds-control-hero-icon-size)}.qds-inline-link{align-items:center;display:flex;gap:var(--qds-text-icon-gap)}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}[data-importance=subdued]{color:var(--qds-theme-link-subdued-default)}[data-importance=subdued]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=subdued]:hover{color:var(--qds-theme-link-subdued-hover)}[data-importance=subdued]:active{color:var(--qds-theme-link-subdued-pressed)}[data-importance=subdued]:visited:hover{color:var(--qds-theme-link-visited-hover)}[data-importance=subdued]:visited:active{color:var(--qds-theme-link-visited-pressed)}[data-importance=standard]{color:var(--qds-theme-link-standard-default)}[data-importance=standard]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=standard]:hover{color:var(--qds-theme-link-standard-hover)}[data-importance=standard]:active{color:var(--qds-theme-link-standard-pressed)}[data-importance=standard]:visited:hover{color:var(--qds-theme-link-visited-hover)}[data-importance=standard]:visited:active{color:var(--qds-theme-link-visited-pressed)}[data-importance=emphasized]{color:var(--qds-theme-link-emphasized-default)}[data-importance=emphasized]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=emphasized]:hover{color:var(--qds-theme-link-emphasized-hover)}[data-importance=emphasized]:active{color:var(--qds-theme-link-emphasized-pressed)}[data-importance=emphasized]:visited:hover{color:var(--qds-theme-link-visited-hover)}[data-importance=emphasized]:visited:active{color:var(--qds-theme-link-visited-pressed)}";
10
10
 
@@ -118,7 +118,7 @@ const InlineLink = class {
118
118
  return (h("a", { key: '0a4e02f5a4ccd184c3b2fdc72d39b437cb951799', "aria-hidden": "true", class: {
119
119
  'qds-inline-link': true,
120
120
  'qds-disabled': this.disabled,
121
- }, "data-importance": __classPrivateFieldGet(this, _InlineLink_instances, "a", _InlineLink_computedImportance_get), download: this.download, href: this.href?.toString(), hrefLang: this.hreflang, onBlur: __classPrivateFieldGet(this, _InlineLink_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _InlineLink_onFocus, "f"), referrerPolicy: this.referrerPolicy, rel: this.rel, tabIndex: -1, target: this.target, ref: __classPrivateFieldGet(this, _InlineLink_linkRef, "f") }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '832fca80e8ce0a64ea284ed4a04b0212300c82ff', class: "qds-icon", "aria-hidden": "true", library: this.iconLibrary, name: this.iconName })), h("slot", { key: 'b2686e6f0991f97113d86db97e85048ccbf06efa', onSlotchange: __classPrivateFieldGet(this, _InlineLink_onSlotchange, "f") }), this.linkIcon && (h("qds-icon", { key: '0fbe27eaff58285c8e18953404aab1eb751b2ced', "aria-hidden": "true", class: "qds-icon", library: "core", name: this.linkIcon }))));
121
+ }, "data-importance": __classPrivateFieldGet(this, _InlineLink_instances, "a", _InlineLink_computedImportance_get), download: this.download, href: this.href?.toString(), hrefLang: this.hreflang, onBlur: __classPrivateFieldGet(this, _InlineLink_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _InlineLink_onFocus, "f"), referrerPolicy: this.referrerPolicy, rel: this.rel, tabIndex: -1, target: this.target, ref: __classPrivateFieldGet(this, _InlineLink_linkRef, "f") }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '66400e2071d58f4ae5b2afd32e435fd688ff9f7b', class: "qds-icon", library: this.iconLibrary, name: this.iconName })), h("slot", { key: '7650baedea48e920ad0aaf445b11654a91954119', onSlotchange: __classPrivateFieldGet(this, _InlineLink_onSlotchange, "f") }), this.linkIcon && (h("qds-icon", { key: 'ec44b064cbca50416722bde16fad8f9401e62e8a', class: "qds-icon", library: "core", name: this.linkIcon }))));
122
122
  }
123
123
  get host() { return getElement(this); }
124
124
  static get watchers() { return {
@@ -1 +1 @@
1
- {"version":3,"file":"qds-inline-link.entry.js","sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n:host(:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n border-radius: var(--qds-control-border-radius);\n}\n\n.qds-icon {\n height: var(--qds-control-hero-icon-size);\n width: var(--qds-control-hero-icon-size);\n}\n\n.qds-inline-link {\n display: flex;\n gap: var(--qds-text-icon-gap);\n align-items: center;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n determineLinkIcon,\n invariant,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, LinkIcon, Target } from '../shared'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: true,\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the inline link points to. Inline links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: URL | string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the inline link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<Target, string>\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private linkIcon?: LinkIcon\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n #link?: HTMLAnchorElement\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #openInNewTab(): boolean {\n return this.target === '_blank'\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) event.stopImmediatePropagation()\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n invariant(this.#link)\n if (this.disabled) return\n if (event.key === 'Enter') this.#link.click()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n if (this.disabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n // FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests\n // to fail, but it's not clear why this is the case since it works for\n // other components.\n this.#savedTabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n if (this.disabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('rel')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.target, this.rel)\n this.#updateAriaLabelElements()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'link'\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#updateAriaLabelElements()\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-inline-link': true,\n 'qds-disabled': this.disabled,\n }}\n data-importance={this.#computedImportance}\n download={this.download}\n href={this.href?.toString()}\n hrefLang={this.hreflang}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n tabIndex={-1}\n target={this.target}\n ref={this.#linkRef}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n aria-hidden=\"true\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <slot onSlotchange={this.#onSlotchange} />\n {this.linkIcon && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library=\"core\"\n name={this.linkIcon}\n />\n )}\n </a>\n )\n }\n\n readonly #linkRef = (link?: HTMLAnchorElement): void => {\n this.#link = link\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #updateAriaLabelElements = (): void => {\n this.internals.ariaLabel = `${this.host.textContent} ${\n this.#openInNewTab ? 'Opens in a new tab' : ''\n }`.trim()\n }\n\n readonly #onSlotchange = (): void => {\n this.#updateAriaLabelElements()\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,aAAa,GAAG,68DAA68D;;ACAn+D;AACA;AACA;;;;;;;;;;;;;;;;;;MAyCa,UAAU,GAAA,MAAA;AALvB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;;;AAME;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAAgB,UAAU;AAoM5D,QAAA,yBAAA,CAAA,GAAA,CAAA,IAAA,EAAiB,CAA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,EAAI,CAAA,EACzC,IAAI,CAAC,QAAQ,KACZ,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,aAAA,EACc,MAAM,EAClB,KAAK,EAAC,UAAU,EAChB,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,CAAA,CACH,CACC;;;;;;;;;;;AApGN,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,SAAS;QACd,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,4BAAA,GAAA,SAAA,4BAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;AACjC,CAAC;;;;;"}
1
+ {"version":3,"file":"qds-inline-link.entry.js","sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n:host(:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n border-radius: var(--qds-control-border-radius);\n}\n\n.qds-icon {\n height: var(--qds-control-hero-icon-size);\n width: var(--qds-control-hero-icon-size);\n}\n\n.qds-inline-link {\n display: flex;\n gap: var(--qds-text-icon-gap);\n align-items: center;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n determineLinkIcon,\n invariant,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, LinkIcon, Target } from '../shared'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: true,\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the inline link points to. Inline links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: URL | string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the inline link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<Target, string>\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private linkIcon?: LinkIcon\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n #link?: HTMLAnchorElement\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #openInNewTab(): boolean {\n return this.target === '_blank'\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) event.stopImmediatePropagation()\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n invariant(this.#link)\n if (this.disabled) return\n if (event.key === 'Enter') this.#link.click()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n if (this.disabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n // FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests\n // to fail, but it's not clear why this is the case since it works for\n // other components.\n this.#savedTabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n if (this.disabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('rel')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.target, this.rel)\n this.#updateAriaLabelElements()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'link'\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#updateAriaLabelElements()\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-inline-link': true,\n 'qds-disabled': this.disabled,\n }}\n data-importance={this.#computedImportance}\n download={this.download}\n href={this.href?.toString()}\n hrefLang={this.hreflang}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n tabIndex={-1}\n target={this.target}\n ref={this.#linkRef}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <slot onSlotchange={this.#onSlotchange} />\n {this.linkIcon && (\n <qds-icon class=\"qds-icon\" library=\"core\" name={this.linkIcon} />\n )}\n </a>\n )\n }\n\n readonly #linkRef = (link?: HTMLAnchorElement): void => {\n this.#link = link\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #updateAriaLabelElements = (): void => {\n this.internals.ariaLabel = `${this.host.textContent} ${\n this.#openInNewTab ? 'Opens in a new tab' : ''\n }`.trim()\n }\n\n readonly #onSlotchange = (): void => {\n this.#updateAriaLabelElements()\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,aAAa,GAAG,68DAA68D;;ACAn+D;AACA;AACA;;;;;;;;;;;;;;;;;;MAyCa,UAAU,GAAA,MAAA;AALvB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;;;AAME;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAAgB,UAAU;AAoM5D,QAAA,yBAAA,CAAA,GAAA,CAAA,IAAA,EAAiB,CAAC,CAAA;QAElB,gBAAyB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAqGhB,mBAAW,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,IAAwB,KAAU;YACrD,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAS,IAAI,EAAA,GAAA,CAAA;AACnB,SAAC,CAAA;QAEQ,kBAAU,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,KAAiB,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