@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,163 +0,0 @@
1
- /*!
2
- * SPDX-FileCopyrightText: © 2026 Schneider Electric
3
- *
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { p as proxyCustomElement, H, d as readTask, h } from './p-D2489VzR.js';
7
- import { a as isEllipsisActive } from './p-CXP6q9Mr.js';
8
- import { d as defineCustomElement$1 } from './p-B03FWheS.js';
9
-
10
- const labelCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-label{align-items:center;box-sizing:border-box;color:var(--qds-theme-control-text-standard);display:inline-flex;gap:var(--qds-text-icon-gap);width:100%}.qds-label:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-focus-border-width) solid var(--qds-theme-focus-border);outline-offset:var(--qds-focus-border-offset)}.qds-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-required{color:var(--qds-theme-feedback-field-required);-webkit-user-select:none;user-select:none}[data-size=small][data-importance=standard]{font:var(--qds-form-small-text)}[data-size=small][data-importance=emphasized] .qds-text{font:var(--qds-form-small-text-emphasized)}.qds-inline[data-size=small]{min-height:var(--qds-control-small-height)}.qds-icon[data-size=small]{height:var(--qds-form-small-icon-size);min-width:var(--qds-form-small-icon-size);width:var(--qds-form-small-icon-size)}[data-size=standard][data-importance=standard]{font:var(--qds-form-standard-text)}[data-size=standard][data-importance=emphasized] .qds-text{font:var(--qds-form-standard-text-emphasized)}.qds-inline[data-size=standard]{min-height:var(--qds-control-standard-height)}.qds-icon[data-size=standard]{height:var(--qds-form-standard-icon-size);min-width:var(--qds-form-standard-icon-size);width:var(--qds-form-standard-icon-size)}[data-size=large][data-importance=standard]{font:var(--qds-form-large-text)}[data-size=large][data-importance=emphasized] .qds-text{font:var(--qds-form-large-text-emphasized)}.qds-inline[data-size=large]{min-height:var(--qds-control-large-height)}.qds-icon[data-size=large]{height:var(--qds-form-large-icon-size);min-width:var(--qds-form-large-icon-size);width:var(--qds-form-large-icon-size)}";
11
-
12
- // SPDX-FileCopyrightText: © 2024 Schneider Electric
13
- //
14
- // SPDX-License-Identifier: Apache-2.0
15
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
16
- if (kind === "a" && !f)
17
- throw new TypeError("Private accessor was defined without a getter");
18
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
19
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
20
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
21
- };
22
- var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
23
- if (kind === "m")
24
- throw new TypeError("Private method is not writable");
25
- if (kind === "a" && !f)
26
- throw new TypeError("Private accessor was defined without a setter");
27
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
28
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
30
- };
31
- var _Label_instances, _Label_label, _Label_ro, _Label_span, _Label_computedSize_get, _Label_computedImportance_get, _Label_labelRef, _Label_spanRef, _Label_tooltipRef;
32
- const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
33
- constructor(registerHost) {
34
- super();
35
- if (registerHost !== false) {
36
- this.__registerHost();
37
- }
38
- this.__attachShadow();
39
- _Label_instances.add(this);
40
- /**
41
- * Adds vertical margin to the label for alignment.
42
- *
43
- * This is useful when creating inline layouts so that the first lines have
44
- * the correct vertical centering.
45
- */
46
- this.inline = false;
47
- /**
48
- * Specify the labelled item as required by appending a red asterisk (*).
49
- */
50
- this.required = false;
51
- /**
52
- * The label's size.
53
- */
54
- this.size = 'standard';
55
- /**
56
- * The label's importance.
57
- */
58
- this.importance = 'standard';
59
- this.tooltip = false;
60
- _Label_label.set(this, void 0);
61
- _Label_ro.set(this, void 0);
62
- _Label_span.set(this, void 0);
63
- _Label_labelRef.set(this, (label) => {
64
- __classPrivateFieldSet(this, _Label_label, label, "f");
65
- });
66
- _Label_spanRef.set(this, (span) => {
67
- __classPrivateFieldSet(this, _Label_span, span, "f");
68
- });
69
- _Label_tooltipRef.set(this, (tooltip) => {
70
- if (tooltip)
71
- // eslint-disable-next-line no-param-reassign
72
- tooltip.target = this.tooltipTarget ?? __classPrivateFieldGet(this, _Label_label, "f");
73
- });
74
- }
75
- textChanged() {
76
- if (__classPrivateFieldGet(this, _Label_ro, "f"))
77
- __classPrivateFieldGet(this, _Label_ro, "f").disconnect();
78
- if (!__classPrivateFieldGet(this, _Label_span, "f"))
79
- return;
80
- const span = __classPrivateFieldGet(this, _Label_span, "f");
81
- readTask(() => {
82
- this.tooltip = isEllipsisActive(span);
83
- });
84
- __classPrivateFieldSet(this, _Label_ro, new ResizeObserver(([spanEntry]) => {
85
- this.tooltip = isEllipsisActive(spanEntry.target);
86
- }), "f");
87
- __classPrivateFieldGet(this, _Label_ro, "f").observe(__classPrivateFieldGet(this, _Label_span, "f"));
88
- }
89
- componentDidLoad() {
90
- this.textChanged();
91
- }
92
- disconnectedCallback() {
93
- if (__classPrivateFieldGet(this, _Label_ro, "f"))
94
- __classPrivateFieldGet(this, _Label_ro, "f").disconnect();
95
- }
96
- render() {
97
- return (h("span", { key: '0915703faa9ab405d9906f6620bfa19d78fbfca2', class: {
98
- 'qds-inline': this.inline,
99
- 'qds-label': true,
100
- }, "data-size": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedSize_get), "data-importance": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedImportance_get), ref: __classPrivateFieldGet(this, _Label_labelRef, "f"),
101
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
102
- tabIndex: this.tooltip ? 0 : undefined }, this.required && h("span", { key: 'd0a36929ba2e813923e5e28c5d13f9f62203637b', class: "qds-required" }, "*"), h("span", { key: '0dd2a08b4c5458408aaa30fe241fc807920dd50c', class: "qds-text", ref: __classPrivateFieldGet(this, _Label_spanRef, "f") }, this.text), this.tooltip && (h("qds-tooltip", { key: '68050637f772a80cae98db77c10fb7d42a507dca', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _Label_tooltipRef, "f") }, this.text))));
103
- }
104
- static get watchers() { return {
105
- "text": ["textChanged"]
106
- }; }
107
- static get style() { return labelCss; }
108
- }, [257, "qds-label", {
109
- "inline": [4],
110
- "required": [4],
111
- "size": [1],
112
- "importance": [1],
113
- "text": [1],
114
- "tooltipTarget": [1, "tooltip-target"],
115
- "tooltip": [32]
116
- }, undefined, {
117
- "text": ["textChanged"]
118
- }]);
119
- _Label_label = new WeakMap(), _Label_ro = new WeakMap(), _Label_span = new WeakMap(), _Label_labelRef = new WeakMap(), _Label_spanRef = new WeakMap(), _Label_tooltipRef = new WeakMap(), _Label_instances = new WeakSet(), _Label_computedSize_get = function _Label_computedSize_get() {
120
- switch (this.size) {
121
- case 'standard':
122
- case 'small':
123
- case 'large': {
124
- return this.size;
125
- }
126
- default: {
127
- return 'standard';
128
- }
129
- }
130
- }, _Label_computedImportance_get = function _Label_computedImportance_get() {
131
- switch (this.importance) {
132
- case 'emphasized':
133
- case 'standard': {
134
- return this.importance;
135
- }
136
- default: {
137
- return 'standard';
138
- }
139
- }
140
- };
141
- function defineCustomElement() {
142
- if (typeof customElements === "undefined") {
143
- return;
144
- }
145
- const components = ["qds-label", "qds-tooltip"];
146
- components.forEach(tagName => { switch (tagName) {
147
- case "qds-label":
148
- if (!customElements.get(tagName)) {
149
- customElements.define(tagName, Label);
150
- }
151
- break;
152
- case "qds-tooltip":
153
- if (!customElements.get(tagName)) {
154
- defineCustomElement$1();
155
- }
156
- break;
157
- } });
158
- }
159
-
160
- export { Label as L, defineCustomElement as d };
161
- //# sourceMappingURL=p-CRVPDKfO.js.map
162
-
163
- //# sourceMappingURL=p-CRVPDKfO.js.map
@@ -1 +0,0 @@
1
- {"file":"p-CRVPDKfO.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,mwDAAmwD;;ACApxD;AACA;AACA;;;;;;;;;;;;;;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ErC,IAAI,CAAC,QAAQ,IAAI,6DAAM,KAAK,EAAC,cAAc,EAAS,EAAA,GAAA,CAAA,EACrD,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,UAAU,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAS,cAAA,EAAA,GAAA,CAAA,EAAA,EACtC,IAAI,CAAC,IAAI,CACL,EACN,IAAI,CAAC,OAAO,KACX,mFAAyB,MAAM,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAY,iBAAA,EAAA,GAAA,CAAA,EAAA,EAClD,IAAI,CAAC,IAAI,CACE,CACf,CACI;;;;;;;;;;;;;;;;;;AAtET,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,6BAAA,GAAA,SAAA,6BAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,YAAY;QACjB,KAAK,UAAU,EAAE;YACf,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/label/label.css?tag=qds-label&encapsulation=shadow","src/components/label/label.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.qds-label {\n box-sizing: border-box;\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n align-items: center;\n gap: var(--qds-text-icon-gap);\n width: 100%;\n\n &:focus-visible {\n outline: var(--qds-focus-border-width) solid var(--qds-theme-focus-border);\n outline-offset: var(--qds-focus-border-offset);\n border-radius: var(--qds-focus-border-radius);\n }\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-required {\n color: var(--qds-theme-feedback-field-required);\n user-select: none;\n}\n\n[data-size='small'] {\n &[data-importance='standard'] {\n font: var(--qds-form-small-text);\n }\n\n &[data-importance='emphasized'] .qds-text {\n font: var(--qds-form-small-text-emphasized);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-small-height);\n }\n\n &.qds-icon {\n height: var(--qds-form-small-icon-size);\n width: var(--qds-form-small-icon-size);\n min-width: var(--qds-form-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &[data-importance='standard'] {\n font: var(--qds-form-standard-text);\n }\n\n &[data-importance='emphasized'] .qds-text {\n font: var(--qds-form-standard-text-emphasized);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-standard-height);\n }\n\n &.qds-icon {\n height: var(--qds-form-standard-icon-size);\n width: var(--qds-form-standard-icon-size);\n min-width: var(--qds-form-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &[data-importance='standard'] {\n font: var(--qds-form-large-text);\n }\n\n &[data-importance='emphasized'] .qds-text {\n font: var(--qds-form-large-text-emphasized);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-large-height);\n }\n\n &.qds-icon {\n height: var(--qds-form-large-icon-size);\n width: var(--qds-form-large-icon-size);\n min-width: var(--qds-form-large-icon-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, h, Prop, readTask, State, Watch } from '@stencil/core'\n\nimport { isEllipsisActive } from '../../helpers'\nimport type { Importance, Size } from '../shared'\nimport type { Tooltip } from '../tooltip/tooltip'\n\nexport type LabelImportance = Exclude<Importance, 'subdued'>\n\n/**\n * `<qds-label>` elements represent a caption for an item in a user interface.\n *\n * @see https://quartz.se.com/build/components/label\n */\n@Component({\n tag: 'qds-label',\n shadow: true,\n styleUrl: 'label.css',\n})\nexport class Label implements ComponentInterface {\n /**\n * Adds vertical margin to the label 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 * Specify the labelled item as required by appending a red asterisk (*).\n */\n @Prop() public readonly required: boolean = false\n\n /**\n * The label's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The label's importance.\n */\n @Prop() public readonly importance?: LabelImportance = 'standard'\n\n /**\n * The label's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * The element to which the tooltip is anchored.\n * By default, the tooltip is anchored to the label itself when this prop is not set.\n */\n @Prop() public readonly tooltipTarget?: Tooltip['target']\n\n @State() private tooltip = false\n\n #label?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #span?: HTMLSpanElement\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(): LabelImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'standard': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Watch('text')\n protected textChanged(): void {\n if (this.#ro) this.#ro.disconnect()\n\n if (!this.#span) return\n\n const span = this.#span\n readTask(() => {\n this.tooltip = isEllipsisActive(span)\n })\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isEllipsisActive(spanEntry.target as HTMLSpanElement)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n ref={this.#labelRef}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={this.tooltip ? 0 : undefined}\n >\n {this.required && <span class=\"qds-required\">*</span>}\n <span class=\"qds-text\" ref={this.#spanRef}>\n {this.text}\n </span>\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </span>\n )\n }\n\n readonly #labelRef = (label?: HTMLSpanElement): void => {\n this.#label = label\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.tooltipTarget ?? this.#label\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-CXP6q9Mr.js","mappings":";;;;;AAAA;AACA;AACA;AAaA,MAAM,iBAAiB,GAAG,CACxB,OAAgB,EAChB,UAAuB,GAAA,EAAE,KACX;IACd,MAAM,eAAe,GAAe,EAAE;AAEtC,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;AAC7C,QAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAClB,YAAA,eAAe,CAAC,SAAS,CAAC,GAAG,KAAK;AAClC,YAAA,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC;;;AAItC,IAAA,OAAO,eAAe;AACxB,CAAC;AAmBD,MAAM,cAAc,GAAoB;IACtC,uBAAuB;IACvB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,6BAA6B;IAC7B,WAAW;IACX,cAAc;IACd,eAAe;IACf,eAAe;IACf,mBAAmB;IACnB,cAAc;IACd,eAAe;IACf,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,eAAe;IACf,aAAa;IACb,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,WAAW;IACX,gBAAgB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","names":[],"sources":["src/helpers.ts"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n MiddlewareState,\n OffsetOptions as LibraryOffsetOptions,\n ReferenceElement,\n} from '@floating-ui/dom'\nimport type { Except, Replace } from 'type-fest'\n\nimport type { LinkIcon } from './components/shared'\n\nexport type Attributes = Record<string, string | undefined>\n\nconst inheritAttributes = (\n element: Element,\n attributes: string[] = [],\n): Attributes => {\n const attributeObject: Attributes = {}\n\n for (const attribute of attributes) {\n const value = element.getAttribute(attribute)\n if (value !== null) {\n attributeObject[attribute] = value\n element.removeAttribute(attribute)\n }\n }\n\n return attributeObject\n}\n\ntype ARIAAttribute =\n | Replace<Lowercase<keyof ARIAMixin>, 'aria', 'aria-'>\n | 'aria-activedescendant'\n | 'aria-braillelabel'\n | 'aria-brailleroledescription'\n | 'aria-colindextext'\n | 'aria-controls'\n | 'aria-describedby'\n | 'aria-description'\n | 'aria-details'\n | 'aria-errormessage'\n | 'aria-flowto'\n | 'aria-labelledby'\n | 'aria-owns'\n | 'aria-relevant'\n | 'aria-rowindextext'\n\nconst ariaAttributes: ARIAAttribute[] = [\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'role',\n]\n\n/**\n * Returns an array of aria attributes that should be copied from\n * the shadow host element to a target within the light DOM.\n *\n * @param element The element that the attributes should be copied from.\n */\nexport const inheritAriaAttributes = (\n element: Element,\n): ReturnType<typeof inheritAttributes> =>\n inheritAttributes(element, ariaAttributes)\n\nconst isProduction = process.env.NODE_ENV === 'production'\nconst prefix = 'Invariant failed'\n\n/**\n * Throws an error if the value is falsy.\n *\n * @param value Value to test.\n * @param message Optional message to display in development builds.\n */\nexport function invariant(value: unknown, message?: string): asserts value {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n if (value) return\n if (isProduction) throw new Error(prefix)\n\n const error = message === undefined ? prefix : `${prefix}: ${message}`\n throw new Error(error)\n}\n\n/**\n * From an object pick a set of keys.\n *\n * @param object Object to pick from.\n * @param keys They keys to pick.\n * @returns New object with only the picked keys.\n */\nexport const pick = <T, K extends keyof T>(\n object: T,\n ...keys: K[]\n): Pick<T, K> => {\n const returnValue: Partial<Pick<T, K>> = {}\n for (const key of keys) returnValue[key] = object[key]\n return returnValue as Pick<T, K>\n}\n\nexport type QdsFocusEventDetail = Pick<FocusEvent, 'relatedTarget'>\nexport type QdsInputEventDetail = Pick<\n InputEvent,\n 'data' | 'inputType' | 'isComposing'\n>\nexport const pickFocusEventAttributes = (\n event: FocusEvent,\n): QdsFocusEventDetail => pick(event, 'relatedTarget')\nexport const pickInputEventAttributes = (\n event: InputEvent,\n): QdsInputEventDetail => pick(event, 'data', 'inputType', 'isComposing')\n\nconst getConversionFactor = (\n element: Element,\n unit: string,\n): number | undefined => {\n switch (unit) {\n case 'cm': {\n return 96 / 2.54\n }\n case 'em': {\n return Number.parseFloat(\n globalThis.getComputedStyle(\n element.parentElement ?? document.documentElement,\n ).fontSize,\n )\n }\n case 'in': {\n return 96\n }\n case 'mm': {\n return 96 / 25.4\n }\n case 'pc': {\n return 16\n }\n case 'pt': {\n return 96 / 72\n }\n case 'px': {\n return 1\n }\n case 'rem': {\n return Number.parseFloat(\n globalThis.getComputedStyle(document.documentElement).fontSize,\n )\n }\n default: {\n return undefined\n }\n }\n}\n\nexport const propertyToPx = (\n element: Element,\n property: string,\n): number | undefined => {\n const value = globalThis.getComputedStyle(element).getPropertyValue(property)\n const number = Number.parseFloat(value)\n if (Number.isNaN(number)) return undefined\n const unit = /\\s*[\\d+.-]*\\s*(.*)/.exec(value)?.[1] ?? ''\n\n const conversionFactor = getConversionFactor(element, unit) ?? 1\n return number * conversionFactor\n}\n\nexport const ignorePromise = <T>(promise: Promise<T>): void => {\n promise.catch(() => {\n invariant(false)\n })\n}\n\nexport const isTouchDevice = (): boolean =>\n 'ontouchstart' in globalThis ||\n ('maxTouchPoints' in globalThis && globalThis.navigator.maxTouchPoints > 0)\n\n/**\n * Checks if an element's ellipsis is active.\n *\n * @param element The element to check.\n * @returns `true` if ellipsis is active, `false` otherwise.\n */\nexport const isEllipsisActive = (element: Element): boolean => {\n const range = document.createRange()\n range.selectNodeContents(element)\n\n const rangeRect = range.getBoundingClientRect()\n const elementWidth = element.getBoundingClientRect().width\n\n if (rangeRect.width > elementWidth) return true\n\n const { webkitLineClamp, lineHeight } = globalThis.getComputedStyle(element)\n\n const parsedLineClamp = Number.parseInt(webkitLineClamp, 10)\n if (Number.isNaN(parsedLineClamp)) return false\n const parsedLineHeight = Number.parseInt(lineHeight, 10)\n if (Number.isNaN(parsedLineHeight)) return false\n\n return rangeRect.height >= (parsedLineClamp + 1) * parsedLineHeight\n}\n\nexport const determineLinkIcon = (\n target?: string,\n // eslint-disable-next-line unicorn/prevent-abbreviations\n rel?: string,\n): LinkIcon | undefined => {\n if (!(rel?.split(' ') ?? []).includes('external')) return undefined\n return target === '_blank' ? 'external-new-tab-link' : 'external-link'\n}\n\nexport const resolveTarget = (\n target?: ReferenceElement | string | (() => ReferenceElement | string),\n): ReferenceElement | undefined => {\n const resolvedTarget = typeof target === 'function' ? target() : target\n if (typeof resolvedTarget !== 'string') return resolvedTarget\n\n const element = document.querySelector(resolvedTarget)\n if (element === null) throw new Error('String must resolve to an Element.')\n return element\n}\n\n/**\n * Patched version of requestAnimationFrame that avoids ngzone\n * Use only when you know ngzone should not run\n */\nconst raf = (h: FrameRequestCallback): number => {\n const win = window as Window & {\n ['__zone_symbol__requestAnimationFrame']?: (\n callback: FrameRequestCallback,\n ) => number\n }\n // eslint-disable-next-line no-underscore-dangle\n if (typeof win.__zone_symbol__requestAnimationFrame === 'function') {\n // eslint-disable-next-line no-underscore-dangle\n return win.__zone_symbol__requestAnimationFrame(h)\n }\n if (typeof requestAnimationFrame === 'function') {\n return requestAnimationFrame(h)\n }\n return setTimeout(h)\n}\n\n/**\n * Waits for a component to be ready for\n * both custom element and non-custom element builds.\n * If non-custom element build, el.componentOnReady\n * will be used.\n * For custom element builds, we wait a frame\n * so that the inner contents of the component\n * have a chance to render.\n *\n * Use this utility rather than calling\n * el.componentOnReady yourself.\n *\n * Reference: https://stenciljs.com/docs/api#componentonready\n */\nexport const componentOnReady = <\n T extends { componentOnReady?: () => Promise<T> },\n>(\n element: T,\n callback: (element_: T) => void,\n): void => {\n if (element.componentOnReady === undefined) {\n raf(() => {\n callback(element)\n })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n element.componentOnReady().then((resolvedElement) => {\n callback(resolvedElement)\n })\n }\n}\n\nconst resolvePanelFromValue = (value: unknown): HTMLElement | undefined => {\n if (value instanceof HTMLElement) {\n return value\n }\n\n if (typeof value === 'string') {\n const element = document.querySelector(value)\n return element instanceof HTMLElement ? element : undefined\n }\n\n return undefined\n}\n\nexport const resolvePanelElement = (\n tab: HTMLQdsTabElement,\n): HTMLElement | undefined => {\n const panelValue = typeof tab.panel === 'function' ? tab.panel() : tab.panel\n return resolvePanelFromValue(panelValue)\n}\n\ntype OffsetValue = Except<\n Exclude<\n LibraryOffsetOptions,\n // eslint-disable-next-line @typescript-eslint/ban-types\n Function | number\n >,\n 'mainAxis'\n>\ntype OffsetFunction = (state: MiddlewareState) => OffsetValue\nexport type OffsetOptions = OffsetFunction | OffsetValue\n\nexport const HORIZONTAL_MOVE_KEYS: ReadonlySet<string> = new Set([\n 'ArrowLeft',\n 'ArrowRight',\n 'Home',\n 'End',\n])\n\nexport const VERTICAL_MOVE_KEYS: ReadonlySet<string> = new Set([\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n])\n\nexport const closestElement = (\n selector: string,\n base: Element,\n): Element | undefined => {\n function closestFrom(\n element: Document | Element | typeof globalThis,\n ): Element | undefined {\n if (element === document || element === globalThis) return undefined\n const { assignedSlot } = element as Slottable\n // eslint-disable-next-line no-param-reassign\n if (assignedSlot) element = assignedSlot\n const found = (element as Element).closest(selector)\n return (\n found ??\n closestFrom(((element as Element).getRootNode() as ShadowRoot).host)\n )\n }\n return closestFrom(base)\n}\n\nexport const isCurrentPage = (url: string): boolean => {\n const currentUrl = new URL(window.location.href)\n const targetUrl = new URL(url)\n return (\n currentUrl.origin === targetUrl.origin &&\n currentUrl.pathname === targetUrl.pathname\n )\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-DeRqCYmp.js","mappings":";;;;;;;;AAAA,MAAM,QAAQ,GAAG,02SAA02S;;ACA33S;AACA;AACA;;;;;;;;;MAyBa,KAAK,iBAAAA,kBAAA,CAAA,MAAA,KAAA,SAAAC,CAAA,CAAA;AALlB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAME;;AAEG;AACqB,QAAA,IAAS,CAAA,SAAA,GAAe,OAAO;AASvD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAO/B,QAAA,IAAK,CAAA,KAAA,GAAW,MAAM;AAEtB,QAAA,IAAK,CAAA,KAAA,GAAW,SAAS;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I,CAAG,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,YAAY,EAAE,EAAA,IAAI,CAAC,MAAM,CAAK,EAC1D,sBAAA,CAAA,IAAI,EAAa,gBAAA,EAAA,GAAA,EAAA,sBAAA,CAAA,IAAI,CAAG,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,cAAc,EAAE,EAAA,IAAI,CAAC,QAAQ,CAAK,EAChE,OAAO,KACN,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,aAAA,EACc,MAAM,EAClB,KAAK,EAAC,UAAU,EAChB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,CAAA,CACH,CACM;;;;;;;;;;;;;;;IA5CX,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE;AAC5D,CAAC,EAAA,oBAAA,GAAA,SAAA,oBAAA,GAAA;IAGC,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE;AACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/title/title.css?tag=qds-title&encapsulation=shadow","src/components/title/title.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: block;\n}\n\n.qds-titles {\n display: grid;\n grid-template-areas: 'title';\n\n &.qds-has-kicker {\n grid-template-areas:\n 'kicker'\n 'title';\n }\n\n &.qds-has-subtitle {\n grid-template-areas:\n 'title'\n 'subtitle';\n }\n\n &.qds-has-kicker.qds-has-subtitle {\n grid-template-areas:\n 'kicker'\n 'title'\n 'subtitle';\n }\n}\n\n.qds-has-icon {\n grid-template-columns: auto 1fr;\n grid-template-areas: 'icon title';\n\n &.qds-has-kicker {\n grid-template-areas:\n '. kicker'\n 'icon title';\n }\n\n &.qds-has-subtitle {\n grid-template-areas:\n 'icon title'\n '. subtitle';\n }\n\n &.qds-has-kicker.qds-has-subtitle {\n grid-template-areas:\n '. kicker'\n 'icon title'\n '. subtitle';\n }\n}\n\n.qds-titles,\n.qds-title {\n hyphens: inherit;\n}\n\n.qds-subtitle,\n.qds-kicker {\n hyphens: initial;\n}\n\n.qds-title,\n.qds-subtitle,\n.qds-kicker {\n margin-block: 0;\n}\n\n.qds-title {\n grid-area: title;\n color: var(--qds-theme-title);\n}\n\n.qds-subtitle {\n grid-area: subtitle;\n color: var(--qds-theme-subtitle);\n}\n\n.qds-kicker {\n grid-area: kicker;\n color: var(--qds-theme-kicker);\n}\n\n.qds-icon {\n grid-area: icon;\n align-content: center;\n color: var(--qds-theme-text-standard);\n}\n\n.qds-main {\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-main-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-section-titles-gap)\n var(--qds-main-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-section-titles-icon-size);\n height: var(--qds-main-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-main-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-subsection-titles-gap)\n var(--qds-main-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-subsection-titles-icon-size);\n height: var(--qds-main-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-panel {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-panel-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-titles-gap) var(--qds-panel-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-titles-icon-size);\n height: var(--qds-panel-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-panel-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-section-titles-gap)\n var(--qds-panel-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-section-titles-icon-size);\n height: var(--qds-panel-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-panel-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-subsection-titles-gap)\n var(--qds-panel-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-subsection-titles-icon-size);\n height: var(--qds-panel-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-navigation {\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-navigation-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-section-titles-gap)\n var(--qds-navigation-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-navigation-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-section-titles-icon-size);\n height: var(--qds-navigation-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-navigation-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-subsection-titles-gap)\n var(--qds-navigation-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-navigation-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-subsection-titles-icon-size);\n height: var(--qds-navigation-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-popup {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-popup-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-titles-gap) var(--qds-popup-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-titles-icon-size);\n height: var(--qds-popup-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-popup-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-section-titles-gap)\n var(--qds-popup-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-section-titles-icon-size);\n height: var(--qds-popup-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-popup-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-subsection-titles-gap)\n var(--qds-popup-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-subsection-titles-icon-size);\n height: var(--qds-popup-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-accessory {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-accessory-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-accessory-titles-gap) var(--qds-accessory-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-accessory-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-accessory-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-accessory-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-accessory-titles-icon-size);\n height: var(--qds-accessory-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-accessory-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-accessory-section-titles-gap)\n var(--qds-accessory-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-accessory-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-accessory-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-accessory-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-accessory-section-titles-icon-size);\n height: var(--qds-accessory-section-titles-icon-crop-height);\n }\n }\n}\n\n[data-variant='web-main-section-promo'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-promo-titles-gap);\n margin: auto;\n }\n\n & .qds-title {\n font: var(--qds-main-section-promo-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-section-promo-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-section-promo-kicker);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-section-promo-titles-gap)\n var(--qds-main-section-promo-titles-icon-gap);\n }\n\n & .qds-icon {\n width: var(--qds-main-section-promo-titles-icon-size);\n height: var(--qds-main-section-promo-titles-icon-crop-height);\n }\n }\n}\n\n[data-alignment='start'] {\n text-align: start;\n}\n\n[data-alignment='center'] {\n text-align: center;\n}\n\n[data-alignment='end'] {\n text-align: end;\n}\n\n[data-variant='web-main-section-display'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-display-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-display-title);\n }\n }\n}\n\n[data-variant='web-main-subsection-card'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-subsection-card-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-subsection-card-standard-title);\n }\n }\n}\n\n[data-variant='web-main-section-hero'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-hero-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-hero-title);\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { AttachInternals, Component, h, Prop } from '@stencil/core'\n\nexport type Layer = 'accessory' | 'main' | 'navigation' | 'panel' | 'popup'\nexport type Level = 'root' | 'section' | 'subsection'\nexport type Tag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\nexport type TitleVariant =\n | 'web-main-section-display'\n | 'web-main-section-hero'\n | 'web-main-section-promo'\n | 'web-main-subsection-card'\n\nexport type Alignment = 'center' | 'end' | 'start'\n\n/**\n * @slot Content to display for the title.\n * @see https://quartz.se.com/build/components/title\n */\n@Component({\n tag: 'qds-title',\n shadow: true,\n styleUrl: 'title.css',\n})\nexport class Title implements ComponentInterface {\n /**\n * The alignment of the title.\n */\n @Prop() public readonly alignment?: Alignment = 'start'\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 * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n @Prop() public readonly layer?: Layer = 'main'\n\n @Prop() public readonly level?: Level = 'section'\n\n /**\n * Text to display for the subtitle.\n */\n @Prop() public readonly subtitle?: string\n\n /**\n * HTML tag to use to render the title.\n */\n @Prop() public readonly tag?: Tag = 'h2'\n\n /**\n * The title's variant.\n */\n @Prop() public readonly variant?: TitleVariant\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n get #hasSubtitle(): boolean {\n return this.subtitle !== undefined && this.subtitle !== ''\n }\n\n get #hasKicker(): boolean {\n return this.kicker !== undefined && this.kicker !== ''\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'group'\n }\n\n public render() {\n const layer = `qds-${this.layer ?? 'main'}`\n const level = `qds-${this.level ?? 'section'}`\n const Tag = this.tag ?? 'h2'\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n\n return (\n <hgroup\n data-alignment={this.alignment ?? 'start'}\n data-variant={this.variant}\n class={{\n [layer]: true,\n [level]: true,\n 'qds-titles': true,\n 'qds-has-icon': hasIcon,\n 'qds-has-kicker': this.#hasKicker,\n 'qds-has-subtitle': this.#hasSubtitle,\n }}\n role=\"none\"\n >\n <Tag class=\"qds-title\" data-variant={this.variant}>\n <slot />\n </Tag>\n {this.#hasKicker && <p class=\"qds-kicker\">{this.kicker}</p>}\n {this.#hasSubtitle && <p class=\"qds-subtitle\">{this.subtitle}</p>}\n {hasIcon && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )}\n </hgroup>\n )\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-DnZdwX0l.js","mappings":";;;;;;;;;;AAAA,MAAM,MA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E;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,uBAAA,GAAA,SAAA,uBAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,MAAM;AACjB,QAAA,KAAK,OAAO;AACZ,QAAA,KAAK,MAAM;AACX,QAAA,KAAK,SAAS;QACd,KAAK,SAAS,EAAE;YACd,OAAO,IAAI,CAAC,MAAM;;QAEpB,SAAS;AACP,YAAA,OAAO,SAAS;;;AAGtB,CAAC,EAAA,iBAAA,GAAA,SAAA,iBAAA,GAAA;AAGC,IAAA,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,UAAU,KAAK,YAAY;AAClE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/tag/tag.css?tag=qds-tag&encapsulation=shadow","src/components/tag/tag.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.qds-tag {\n align-items: center;\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n max-width: inherit;\n min-width: inherit;\n width: inherit;\n}\n\n.qds-text {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n[data-status='error'] {\n color: var(--qds-theme-feedback-message-critical);\n}\n\n[data-status='success'] {\n color: var(--qds-theme-feedback-message-success);\n}\n\n[data-status='warning'] {\n color: var(--qds-theme-feedback-message-important);\n}\n\n[data-status='info'] {\n color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='neutral'] {\n color: var(--qds-theme-feedback-message-neutral);\n}\n\n[data-importance='subdued'] .qds-text {\n color: var(--qds-theme-text-standard);\n}\n\n[data-importance='standard'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical-dimmed);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success-dimmed);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important-dimmed);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational-dimmed);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral-dimmed);\n }\n}\n\n[data-importance='emphasized'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical);\n color: var(--qds-theme-feedback-message-critical-contrast);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success);\n color: var(--qds-theme-feedback-message-success-contrast);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important);\n color: var(--qds-theme-feedback-message-important-contrast);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-size='small'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-small-text);\n gap: var(--qds-feedback-tag-small-gap-internal);\n min-height: var(--qds-feedback-tag-small-height);\n border-radius: var(--qds-feedback-tag-small-border-radius);\n }\n\n &.qds-padding {\n padding: var(--qds-feedback-tag-small-padding-vertical)\n var(--qds-feedback-tag-small-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-small-icon-size);\n height: var(--qds-feedback-tag-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-standard-text);\n gap: var(--qds-feedback-tag-standard-gap-internal);\n min-height: var(--qds-feedback-tag-standard-height);\n border-radius: var(--qds-feedback-tag-standard-border-radius);\n }\n\n &.qds-padding {\n padding: var(--qds-feedback-tag-large-padding-vertical)\n var(--qds-feedback-tag-standard-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-standard-icon-size);\n height: var(--qds-feedback-tag-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-large-text);\n gap: var(--qds-feedback-tag-large-gap-internal);\n min-height: var(--qds-feedback-tag-large-height);\n border-radius: var(--qds-feedback-tag-large-border-radius);\n }\n\n &.qds-padding {\n padding: var(--qds-feedback-tag-large-padding-vertical)\n var(--qds-feedback-tag-large-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-large-icon-size);\n height: var(--qds-feedback-tag-large-icon-size);\n }\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, Fragment, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Importance, Size, Status } from '../shared'\n\nexport type TagStatus = Status | 'neutral'\n\n/**\n * The `<qds-tag>` element is a static descriptor used for items that need to\n * be labeled, categorized, or organized using keywords that describe them.\n *\n * @see https://quartz.se.com/build/components/tag\n */\n@Component({\n tag: 'qds-tag',\n shadow: true,\n styleUrl: 'tag.css',\n})\nexport class Tag 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 iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The tag's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The tag's status.\n */\n @Prop() public readonly status?: TagStatus = 'neutral'\n\n /**\n * The tag's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The tag's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Provides a text description of the icon for screen readers.\n */\n @Prop() public readonly iconDescription?: string\n\n /**\n * Displays an indicator if `true`.\n */\n @Prop() public readonly badge?: boolean = false\n\n /**\n * The indicator badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\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 #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(): TagStatus {\n switch (this.status) {\n case 'error':\n case 'info':\n case 'success':\n case 'warning': {\n return this.status\n }\n default: {\n return 'neutral'\n }\n }\n }\n\n get #hasBadge(): boolean {\n return (this.badge ?? false) && this.importance !== 'emphasized'\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-tag': true,\n 'qds-padding': this.importance !== 'subdued',\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-status={this.#computedStatus}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' ? (\n <>\n {this.iconDescription !== undefined &&\n this.iconDescription !== '' && (\n <span class=\"qds-sr-only\">{this.iconDescription}</span>\n )}\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </>\n ) : (\n this.#hasBadge && (\n <qds-badge-indicator\n status={this.#computedStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )\n )}\n <span class=\"qds-text\">{this.text}</span>\n </span>\n )\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":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C,CAAC;AACJ,CAAC,EAAA,oCAAA,GAAA,SAAA,oCAAA,GAAA;AAGC,IAAA,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC;AAE5C,IAAA,IAAI,EAAE,sBAAA,CAAA,IAAI,kCAAkB,YAAY,UAAU,CAAC,OAAO,CAAC;QAAE;IAE7D,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CACxC,UAAU,EACV,sBAAA,CAAA,IAAI,EAAiB,yBAAA,EAAA,GAAA,CAAA,CACtB;IACD,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CAAC,SAAS,EAAE,sBAAA,CAAA,IAAI,EAAgB,wBAAA,EAAA,GAAA,CAAA,CAAC;AAC3E,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACvD,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACzD,CAAC;;;;;;;;;;;;;;;;;","names":["HTMLElement","__stencil_proxyCustomElement"],"sources":["src/components/dropdown/dropdown.css?tag=qds-dropdown&encapsulation=shadow","src/components/dropdown/dropdown.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 background-color: var(--qds-theme-popup-background);\n border-radius: var(--qds-popup-border-radius);\n border: none;\n box-shadow: var(--qds-popup-elevation);\n box-sizing: border-box;\n display: inline-block;\n inset: unset;\n margin: 0;\n overflow: initial;\n padding: 0;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n AutoUpdateOptions,\n DetectOverflowOptions,\n FlipOptions,\n Middleware,\n Placement,\n ReferenceElement,\n ShiftOptions,\n Strategy,\n} from '@floating-ui/dom'\nimport {\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Host,\n Listen,\n Method,\n Prop,\n Watch,\n} from '@stencil/core'\n\nimport type { OffsetOptions } from '../../helpers'\nimport {\n closestElement,\n ignorePromise,\n propertyToPx,\n resolveTarget,\n VERTICAL_MOVE_KEYS,\n} from '../../helpers'\n\nlet autoIncrementingId = 1\n\nconst isQdsButton = (\n element: globalThis.Element,\n): element is HTMLQdsButtonElement =>\n element.tagName.toLowerCase() === 'qds-button'\n\nconst ALLOWED_TAGS: ReadonlySet<string> = new Set([\n 'qds-action-item',\n 'qds-menu-item',\n 'qds-list-item',\n])\n\nconst isEnabledItem = (element: unknown): element is HTMLElement =>\n element instanceof HTMLElement &&\n ALLOWED_TAGS.has(element.tagName.toLowerCase()) &&\n !element.hasAttribute('disabled') &&\n !element.inert\n\n/**\n * @slot Content to display in the dropdown.\n * @see https://quartz.se.com/build/components/dropdown\n */\n@Component({\n tag: 'qds-dropdown',\n shadow: { delegatesFocus: true },\n styleUrl: 'dropdown.css',\n})\nexport class Dropdown implements ComponentInterface {\n /**\n * Options to pass to Floating UI's\n * [`autoUpdate()` function](https://floating-ui.com/docs/autoUpdate).\n *\n * @see https://floating-ui.com/docs/autoupdate#options\n */\n @Prop() public readonly autoUpdateOptions?: AutoUpdateOptions\n\n /**\n * Prevents the dropdown from being shown by user interaction. The dropdown\n * can still be displayed by calling the `show()` method.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n *\n * The [`crossAxis` option](https://floating-ui.com/docs/flip#crossaxis) is\n * set to the value of the `noShift` property by default for interoperability\n * with the [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/flip#options\n */\n @Prop() public readonly flipOptions?: Partial<\n DetectOverflowOptions & FlipOptions\n >\n\n /**\n * Disable Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n */\n @Prop() public readonly noFlip: boolean = false\n\n /**\n * Disable Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n */\n @Prop() public readonly noShift: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`offset` middleware](https://floating-ui.com/docs/offset).\n *\n * The [`mainAxis` option](https://floating-ui.com/docs/offset#mainaxis) is\n * not supported.\n *\n * @see https://floating-ui.com/docs/offset#options\n */\n @Prop() public readonly offsetOptions?: OffsetOptions\n\n /**\n * Where to place the dropdown relative to the `target`.\n *\n * @see https://floating-ui.com/docs/tutorial#placements\n */\n @Prop() public readonly placement: Placement = 'bottom-start'\n\n /**\n * Options to pass to Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/shift#options\n */\n @Prop() public readonly shiftOptions?: Partial<\n DetectOverflowOptions & ShiftOptions\n >\n\n /**\n * The CSS position strategy to use.\n *\n * @see https://floating-ui.com/docs/computeposition#strategy\n */\n @Prop() public readonly strategy?: Strategy\n\n /**\n * The trigger element that will trigger the dropdown. The target specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][] or [Virtual Element][]\n * - A function returning a reference to an [`Element`][],\n * [Virtual Element][], or a CSS selector string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n * [Virtual Element]: https://floating-ui.com/docs/virtual-elements\n */\n @Prop() public readonly target!:\n | ReferenceElement\n | string\n | (() => ReferenceElement | string)\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @Prop() public readonly keepOpenOnSelect: boolean = false\n\n /**\n * Emitted when the user instructs the browser that they wish to dismiss the\n * current open dropdown by pressing the `Esc` key.\n *\n * When a dropdown is dismissed with the `Esc` key, both the `qdsCancel` and\n * `qdsClose` events are emitted.\n */\n @Event({ eventName: 'qdsCancel', bubbles: false })\n private readonly cancelEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event({ eventName: 'qdsClose', bubbles: false, cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #cleanup?: () => void\n\n #Items: HTMLElement[] = []\n\n #gap = 0\n\n #middleware?: (Middleware | false)[]\n\n #referenceElement?: ReferenceElement\n\n #open = false\n\n /**\n * Whether the dropdown has been opened at least once.\n * This is used to determine whether the dropdown should update its position, gap\n * and middleware when it is opened.\n */\n #opened = false\n\n /**\n * Updates the gap between the dropdown and its target element.\n */\n @Method()\n public async updateGap(): Promise<void> {\n this.#gap = propertyToPx(this.host, '--qds-accessory-gap-floating') ?? 0\n\n await this.updateMiddleware()\n }\n\n /**\n * Shows the dropdown.\n */\n @Method()\n public async show(): Promise<void> {\n if (this.#open) return\n\n const reference = this.#referenceElement\n const { host } = this\n\n if (reference instanceof globalThis.Element) {\n reference.setAttribute('aria-expanded', 'true')\n reference.setAttribute('aria-controls', host.id)\n host.setAttribute('aria-labelledby', reference.id)\n if (!reference.hasAttribute('aria-haspopup'))\n reference.setAttribute('aria-haspopup', 'true')\n\n if (isQdsButton(reference) && reference.action === 'dropdown')\n reference.action = 'dropdown-close'\n }\n\n if (!this.#opened) {\n await this.updateGap()\n this.#opened = true\n }\n this.startAutoUpdate()\n this.#open = true\n host.hidden = false\n host.showPopover()\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n public async close(): Promise<void> {\n if (!this.#open) return\n\n if (this.#referenceElement instanceof globalThis.Element) {\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.removeAttribute('aria-controls')\n\n if (\n isQdsButton(this.#referenceElement) &&\n this.#referenceElement.action === 'dropdown-close'\n )\n this.#referenceElement.action = 'dropdown'\n }\n\n if (this.#cleanup) this.#cleanup()\n this.#open = false\n this.host.hidden = true\n this.host.hidePopover()\n\n this.closeEmitter.emit()\n }\n\n @Listen('click', { target: 'document' })\n protected async handleMouseDown(event: MouseEvent): Promise<void> {\n if (!this.#open) return\n\n const composedPath = event.composedPath()\n const withinBounds =\n composedPath.includes(this.host) ||\n (this.#referenceElement instanceof globalThis.Element &&\n composedPath.includes(this.#referenceElement))\n if (!withinBounds) await this.close()\n }\n\n @Listen('click')\n protected async onItemClick(event: MouseEvent): Promise<void> {\n if (!this.keepOpenOnSelect && isEnabledItem(event.target)) {\n await this.close()\n }\n }\n\n @Watch('target')\n private async updateReferenceElement(): Promise<void> {\n this.#disconnectReferenceElement()\n\n this.#referenceElement = resolveTarget(this.target)\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.addEventListener(\n 'click',\n this.#boundOnReferenceClick,\n )\n this.#referenceElement.addEventListener('focusout', this.#boundOnFocusout)\n this.#referenceElement.addEventListener('keydown', this.#boundOnKeydown)\n\n if (this.host.role === 'menu') {\n this.#referenceElement.id ||= `qds-dropdown-trigger-${autoIncrementingId}`\n this.host.setAttribute('aria-labelledby', this.#referenceElement.id)\n }\n }\n\n @Watch('flipOptions')\n @Watch('noFlip')\n @Watch('noShift')\n @Watch('offsetOptions')\n @Watch('shiftOptions')\n private async updateMiddleware(): Promise<void> {\n this.#middleware = [\n offset({\n ...this.offsetOptions,\n mainAxis: this.#gap,\n }),\n !this.noFlip &&\n flip({\n crossAxis: this.noShift,\n ...this.flipOptions,\n }),\n !this.noShift &&\n shift({\n limiter: limitShift(),\n ...this.shiftOptions,\n }),\n ]\n }\n\n @Watch('middleware')\n @Watch('placement')\n @Watch('strategy')\n private async updatePosition(): Promise<void> {\n if (!this.#referenceElement) return\n\n const { x, y, strategy } = await computePosition(\n this.#referenceElement,\n this.host,\n {\n middleware: this.#middleware,\n placement: this.placement,\n strategy: this.strategy,\n },\n )\n Object.assign(this.host.style, {\n position: strategy,\n left: `${x}px`,\n top: `${y}px`,\n })\n }\n\n @Watch('autoUpdateOptions')\n private startAutoUpdate(): void {\n if (!this.#referenceElement) return\n\n if (this.#cleanup) this.#cleanup()\n this.#cleanup = autoUpdate(\n this.#referenceElement,\n this.host,\n () => {\n ignorePromise(this.updatePosition())\n },\n this.autoUpdateOptions,\n )\n }\n\n public async componentWillLoad(): Promise<void> {\n this.host.hidden = true\n this.host.popover = 'manual'\n this.internals.role = 'menu'\n this.host.id ||= `qds-dropdown-${autoIncrementingId}`\n await this.updateReferenceElement()\n autoIncrementingId += 1\n }\n\n public disconnectedCallback(): void {\n this.#disconnectReferenceElement()\n }\n\n public render() {\n return (\n <Host onKeyDown={this.#onKeydown} onFocusout={this.#onFocusout}>\n <slot onSlotchange={this.#onSlotchange} />\n </Host>\n )\n }\n\n readonly #onFocusout = async (event: Event): Promise<void> => {\n if (!(event instanceof FocusEvent)) return\n const { relatedTarget } = event\n\n const dropdownItem = this.#Items.find((item) => item === relatedTarget)\n if (\n relatedTarget instanceof globalThis.Element &&\n !this.host.contains(relatedTarget) &&\n this.#referenceElement !== relatedTarget &&\n !dropdownItem\n )\n await this.close()\n }\n\n #focusOnTrigger(): void {\n if (\n this.#referenceElement instanceof globalThis.HTMLElement ||\n this.#referenceElement instanceof globalThis.SVGElement\n ) {\n this.#referenceElement.focus()\n }\n }\n\n readonly #onKeydown = async (event: Event): Promise<void> => {\n if (!(event instanceof KeyboardEvent)) return\n\n const { key, target } = event\n\n if (key === 'Enter' && !this.keepOpenOnSelect && isEnabledItem(target)) {\n await this.close()\n this.#focusOnTrigger()\n return\n }\n\n if (\n key === 'Escape' &&\n (target === this.#referenceElement ||\n (target instanceof globalThis.Element &&\n closestElement('qds-dropdown', target) === this.host))\n ) {\n const cancelEvent = this.cancelEmitter.emit()\n if (cancelEvent.defaultPrevented) return\n\n await this.close()\n this.#focusOnTrigger()\n\n return\n }\n\n if (\n target === this.#referenceElement &&\n (key === 'ArrowDown' || key === 'ArrowUp')\n ) {\n if (!this.#open) await this.show()\n this.#focusFirstItem()\n event.preventDefault()\n return\n }\n\n if (!VERTICAL_MOVE_KEYS.has(key)) return\n\n const Items = this.#Items.filter(\n (item: HTMLElement) =>\n isEnabledItem(item) &&\n closestElement('qds-dropdown', item) === this.host,\n )\n\n if (Items.length === 0) return\n\n event.preventDefault()\n event.stopPropagation()\n\n const currentIndex = Items.findIndex(\n (item: HTMLElement) => item.getAttribute('tabindex') === '0',\n )\n\n let nextIndex = currentIndex\n\n switch (key) {\n case 'ArrowUp': {\n nextIndex = currentIndex > 0 ? currentIndex - 1 : Items.length - 1\n break\n }\n case 'ArrowDown': {\n nextIndex = currentIndex < Items.length - 1 ? currentIndex + 1 : 0\n break\n }\n case 'Home': {\n nextIndex = 0\n break\n }\n case 'End': {\n nextIndex = Items.length - 1\n break\n }\n default: {\n return\n }\n }\n const nextItem = Items[nextIndex]\n for (const [index, item] of Items.entries()) {\n ;(item as HTMLElement).setAttribute(\n 'tabindex',\n index === nextIndex ? '0' : '-1',\n )\n }\n\n nextItem.focus()\n event.preventDefault()\n }\n\n readonly #onReferenceClick = async (): Promise<void> => {\n if (this.disabled) return\n\n if (this.#open) {\n await this.close()\n return\n }\n\n await this.show()\n this.#focusFirstItem()\n }\n\n #focusFirstItem(): void {\n requestAnimationFrame(() => {\n const firstItem = this.#Items.find(\n (item) =>\n item instanceof HTMLElement &&\n isEnabledItem(item) &&\n closestElement('qds-dropdown', item) === this.host,\n )\n if (!firstItem) return\n for (const item of this.#Items) item.setAttribute('tabindex', '-1')\n firstItem.setAttribute('tabindex', '0')\n firstItem.focus()\n })\n }\n\n #disconnectReferenceElement(): void {\n this.host.removeAttribute('aria-labelledby')\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.removeEventListener(\n 'focusout',\n this.#boundOnFocusout,\n )\n this.#referenceElement.removeEventListener('keydown', this.#boundOnKeydown)\n this.#referenceElement.removeAttribute('aria-expanded')\n this.#referenceElement.removeAttribute('aria-controls')\n }\n\n readonly #boundOnFocusout = (event: Event): void => {\n ignorePromise(this.#onFocusout(event))\n }\n\n readonly #boundOnKeydown = (event: Event): void => {\n ignorePromise(this.#onKeydown(event))\n }\n\n readonly #boundOnReferenceClick = (): void => {\n ignorePromise(this.#onReferenceClick())\n }\n\n readonly #onSlotchange = (event: Event): void => {\n const slot = event.target as HTMLSlotElement\n const assignedElements = slot.assignedElements({ flatten: true })\n\n this.#Items = assignedElements.filter((element): element is HTMLElement =>\n isEnabledItem(element),\n )\n }\n}\n"],"version":3}