@quartzds/core 1.0.0-beta.9 → 1.0.0-beta.90

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 (387) hide show
  1. package/README.md +5 -5
  2. package/components/index.d.ts +48 -0
  3. package/components/index.js +60 -28
  4. package/components/index.js.map +1 -1
  5. package/components/p-2806fee1.js +1887 -0
  6. package/components/p-2806fee1.js.map +1 -0
  7. package/components/p-3c48ff53.js +103 -0
  8. package/components/p-3c48ff53.js.map +1 -0
  9. package/components/p-688c90f6.js +267 -0
  10. package/components/p-688c90f6.js.map +1 -0
  11. package/components/p-8abba29b.js +204 -0
  12. package/components/p-8abba29b.js.map +1 -0
  13. package/components/p-a020ece3.js +142 -0
  14. package/components/p-a020ece3.js.map +1 -0
  15. package/components/p-a6310886.js +144 -0
  16. package/components/p-a6310886.js.map +1 -0
  17. package/components/p-adefd438.js +404 -0
  18. package/components/p-adefd438.js.map +1 -0
  19. package/components/p-b4c302d4.js +91 -0
  20. package/components/p-b4c302d4.js.map +1 -0
  21. package/components/p-ba880369.js +256 -0
  22. package/components/p-ba880369.js.map +1 -0
  23. package/components/p-c80f112a.js +408 -0
  24. package/components/p-c80f112a.js.map +1 -0
  25. package/components/p-d107c90c.js +27 -0
  26. package/components/p-d107c90c.js.map +1 -0
  27. package/components/p-fac26e20.js +111 -0
  28. package/components/p-fac26e20.js.map +1 -0
  29. package/components/{floating-ui.dom.esm.js → p-fdd0abae.js} +468 -416
  30. package/components/p-fdd0abae.js.map +1 -0
  31. package/components/p-fed0d11f.js +94 -0
  32. package/components/p-fed0d11f.js.map +1 -0
  33. package/components/qds-badge-counter.d.ts +11 -0
  34. package/components/qds-badge-counter.js +13 -0
  35. package/components/qds-badge-counter.js.map +1 -0
  36. package/components/qds-badge-indicator.d.ts +11 -0
  37. package/components/qds-badge-indicator.js +13 -0
  38. package/components/qds-badge-indicator.js.map +1 -0
  39. package/components/qds-breadcrumb-item.d.ts +11 -0
  40. package/components/qds-breadcrumb-item.js +126 -0
  41. package/components/qds-breadcrumb-item.js.map +1 -0
  42. package/components/qds-button.d.ts +2 -2
  43. package/components/qds-button.js +3 -138
  44. package/components/qds-button.js.map +1 -1
  45. package/components/qds-checkbox.d.ts +2 -2
  46. package/components/qds-checkbox.js +3 -146
  47. package/components/qds-checkbox.js.map +1 -1
  48. package/components/qds-chip.d.ts +11 -0
  49. package/components/qds-chip.js +296 -0
  50. package/components/qds-chip.js.map +1 -0
  51. package/components/qds-dialog.d.ts +11 -0
  52. package/components/qds-dialog.js +126 -0
  53. package/components/qds-dialog.js.map +1 -0
  54. package/components/qds-divider.d.ts +2 -2
  55. package/components/qds-divider.js +3 -39
  56. package/components/qds-divider.js.map +1 -1
  57. package/components/qds-dropdown.d.ts +2 -2
  58. package/components/qds-dropdown.js +273 -239
  59. package/components/qds-dropdown.js.map +1 -1
  60. package/components/qds-form-message.d.ts +11 -0
  61. package/components/qds-form-message.js +112 -0
  62. package/components/qds-form-message.js.map +1 -0
  63. package/components/qds-icon.d.ts +2 -2
  64. package/components/qds-icon.js +3 -3
  65. package/components/qds-inline-link.d.ts +2 -2
  66. package/components/qds-inline-link.js +136 -73
  67. package/components/qds-inline-link.js.map +1 -1
  68. package/components/qds-input.d.ts +2 -2
  69. package/components/qds-input.js +489 -230
  70. package/components/qds-input.js.map +1 -1
  71. package/components/qds-label.d.ts +2 -2
  72. package/components/qds-label.js +3 -3
  73. package/components/qds-list-item.d.ts +11 -0
  74. package/components/qds-list-item.js +212 -0
  75. package/components/qds-list-item.js.map +1 -0
  76. package/components/qds-loader.d.ts +11 -0
  77. package/components/qds-loader.js +113 -0
  78. package/components/qds-loader.js.map +1 -0
  79. package/components/qds-nav-list-item.d.ts +11 -0
  80. package/components/qds-nav-list-item.js +162 -0
  81. package/components/qds-nav-list-item.js.map +1 -0
  82. package/components/qds-progress-bar.d.ts +11 -0
  83. package/components/qds-progress-bar.js +153 -0
  84. package/components/qds-progress-bar.js.map +1 -0
  85. package/components/qds-radio.d.ts +2 -2
  86. package/components/qds-radio.js +147 -93
  87. package/components/qds-radio.js.map +1 -1
  88. package/components/qds-select.d.ts +11 -0
  89. package/components/qds-select.js +361 -0
  90. package/components/qds-select.js.map +1 -0
  91. package/components/qds-standalone-link.d.ts +11 -0
  92. package/components/qds-standalone-link.js +174 -0
  93. package/components/qds-standalone-link.js.map +1 -0
  94. package/components/qds-switch.d.ts +2 -2
  95. package/components/qds-switch.js +221 -105
  96. package/components/qds-switch.js.map +1 -1
  97. package/components/qds-tab.d.ts +11 -0
  98. package/components/qds-tab.js +379 -0
  99. package/components/qds-tab.js.map +1 -0
  100. package/components/qds-tabbar.d.ts +11 -0
  101. package/components/qds-tabbar.js +407 -0
  102. package/components/qds-tabbar.js.map +1 -0
  103. package/components/qds-table-body.d.ts +11 -0
  104. package/components/qds-table-body.js +68 -0
  105. package/components/qds-table-body.js.map +1 -0
  106. package/components/qds-table-cell.d.ts +11 -0
  107. package/components/qds-table-cell.js +71 -0
  108. package/components/qds-table-cell.js.map +1 -0
  109. package/components/qds-table-head-cell.d.ts +11 -0
  110. package/components/qds-table-head-cell.js +73 -0
  111. package/components/qds-table-head-cell.js.map +1 -0
  112. package/components/qds-table-head.d.ts +11 -0
  113. package/components/qds-table-head.js +68 -0
  114. package/components/qds-table-head.js.map +1 -0
  115. package/components/qds-table-row.d.ts +11 -0
  116. package/components/qds-table-row.js +68 -0
  117. package/components/qds-table-row.js.map +1 -0
  118. package/components/qds-table.d.ts +11 -0
  119. package/components/qds-table.js +68 -0
  120. package/components/qds-table.js.map +1 -0
  121. package/components/qds-tag.d.ts +11 -0
  122. package/components/qds-tag.js +13 -0
  123. package/components/qds-tag.js.map +1 -0
  124. package/components/qds-textarea.d.ts +2 -2
  125. package/components/qds-textarea.js +331 -193
  126. package/components/qds-textarea.js.map +1 -1
  127. package/components/qds-title.d.ts +2 -2
  128. package/components/qds-title.js +3 -84
  129. package/components/qds-title.js.map +1 -1
  130. package/components/qds-tooltip.d.ts +2 -2
  131. package/components/qds-tooltip.js +3 -315
  132. package/components/qds-tooltip.js.map +1 -1
  133. package/dist/cjs/app-globals-c4cf08df.js +12 -0
  134. package/dist/cjs/app-globals-c4cf08df.js.map +1 -0
  135. package/dist/cjs/controls-ee3d2ec8.js +31 -0
  136. package/dist/cjs/controls-ee3d2ec8.js.map +1 -0
  137. package/dist/cjs/{floating-ui.dom.esm-71fa96af.js → floating-ui.dom.esm-19b2b933.js} +468 -416
  138. package/dist/cjs/floating-ui.dom.esm-19b2b933.js.map +1 -0
  139. package/dist/cjs/helpers-10154521.js +217 -0
  140. package/dist/cjs/helpers-10154521.js.map +1 -0
  141. package/dist/cjs/index-523dd2e0.js +2149 -0
  142. package/dist/cjs/index-523dd2e0.js.map +1 -0
  143. package/dist/cjs/index.cjs.js +39 -27
  144. package/dist/cjs/index.cjs.js.map +1 -1
  145. package/dist/cjs/library-41b19b9e.js +117 -0
  146. package/dist/cjs/library-41b19b9e.js.map +1 -0
  147. package/dist/cjs/loader.cjs.js +8 -6
  148. package/dist/cjs/loader.cjs.js.map +1 -1
  149. package/dist/cjs/qds-badge-counter_2.cjs.entry.js +151 -0
  150. package/dist/cjs/qds-badge-counter_2.cjs.entry.js.map +1 -0
  151. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +96 -0
  152. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -0
  153. package/dist/cjs/qds-button.cjs.entry.js +321 -90
  154. package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
  155. package/dist/cjs/qds-checkbox.cjs.entry.js +207 -99
  156. package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
  157. package/dist/cjs/qds-chip.cjs.entry.js +256 -0
  158. package/dist/cjs/qds-chip.cjs.entry.js.map +1 -0
  159. package/dist/cjs/qds-dialog.cjs.entry.js +108 -0
  160. package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -0
  161. package/dist/cjs/qds-divider.cjs.entry.js +60 -18
  162. package/dist/cjs/qds-divider.cjs.entry.js.map +1 -1
  163. package/dist/cjs/qds-dropdown.cjs.entry.js +232 -206
  164. package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
  165. package/dist/cjs/qds-form-message.cjs.entry.js +86 -0
  166. package/dist/cjs/qds-form-message.cjs.entry.js.map +1 -0
  167. package/dist/cjs/qds-icon.cjs.entry.js +113 -90
  168. package/dist/cjs/qds-icon.cjs.entry.js.map +1 -1
  169. package/dist/cjs/qds-inline-link.cjs.entry.js +99 -46
  170. package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
  171. package/dist/cjs/qds-input.cjs.entry.js +404 -185
  172. package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
  173. package/dist/cjs/qds-label.cjs.entry.js +102 -24
  174. package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
  175. package/dist/cjs/qds-list-item.cjs.entry.js +157 -0
  176. package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -0
  177. package/dist/cjs/qds-loader.cjs.entry.js +94 -0
  178. package/dist/cjs/qds-loader.cjs.entry.js.map +1 -0
  179. package/dist/cjs/qds-nav-list-item.cjs.entry.js +124 -0
  180. package/dist/cjs/qds-nav-list-item.cjs.entry.js.map +1 -0
  181. package/dist/cjs/qds-progress-bar.cjs.entry.js +135 -0
  182. package/dist/cjs/qds-progress-bar.cjs.entry.js.map +1 -0
  183. package/dist/cjs/qds-radio.cjs.entry.js +102 -57
  184. package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
  185. package/dist/cjs/qds-select.cjs.entry.js +323 -0
  186. package/dist/cjs/qds-select.cjs.entry.js.map +1 -0
  187. package/dist/cjs/qds-standalone-link.cjs.entry.js +134 -0
  188. package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -0
  189. package/dist/cjs/qds-switch.cjs.entry.js +193 -64
  190. package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
  191. package/dist/cjs/qds-tab.cjs.entry.js +299 -0
  192. package/dist/cjs/qds-tab.cjs.entry.js.map +1 -0
  193. package/dist/cjs/qds-tabbar.cjs.entry.js +349 -0
  194. package/dist/cjs/qds-tabbar.cjs.entry.js.map +1 -0
  195. package/dist/cjs/qds-table-body.cjs.entry.js +54 -0
  196. package/dist/cjs/qds-table-body.cjs.entry.js.map +1 -0
  197. package/dist/cjs/qds-table-cell.cjs.entry.js +54 -0
  198. package/dist/cjs/qds-table-cell.cjs.entry.js.map +1 -0
  199. package/dist/cjs/qds-table-head-cell.cjs.entry.js +54 -0
  200. package/dist/cjs/qds-table-head-cell.cjs.entry.js.map +1 -0
  201. package/dist/cjs/qds-table-head.cjs.entry.js +54 -0
  202. package/dist/cjs/qds-table-head.cjs.entry.js.map +1 -0
  203. package/dist/cjs/qds-table-row.cjs.entry.js +54 -0
  204. package/dist/cjs/qds-table-row.cjs.entry.js.map +1 -0
  205. package/dist/cjs/qds-table.cjs.entry.js +54 -0
  206. package/dist/cjs/qds-table.cjs.entry.js.map +1 -0
  207. package/dist/cjs/qds-tag_2.cjs.entry.js +181 -0
  208. package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -0
  209. package/dist/cjs/qds-textarea.cjs.entry.js +288 -153
  210. package/dist/cjs/qds-textarea.cjs.entry.js.map +1 -1
  211. package/dist/cjs/qds-tooltip.cjs.entry.js +332 -260
  212. package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -1
  213. package/dist/cjs/qds.cjs.js +15 -13
  214. package/dist/cjs/qds.cjs.js.map +1 -1
  215. package/dist/custom-elements.json +8707 -2149
  216. package/dist/docs.d.ts +344 -240
  217. package/dist/docs.json +9494 -3054
  218. package/dist/esm/app-globals-8ced3a41.js +10 -0
  219. package/dist/esm/app-globals-8ced3a41.js.map +1 -0
  220. package/dist/esm/controls-a4768aaf.js +27 -0
  221. package/dist/esm/controls-a4768aaf.js.map +1 -0
  222. package/dist/esm/{floating-ui.dom.esm-f96ac766.js → floating-ui.dom.esm-61986f35.js} +468 -416
  223. package/dist/esm/floating-ui.dom.esm-61986f35.js.map +1 -0
  224. package/dist/esm/helpers-2e4ca34d.js +204 -0
  225. package/dist/esm/helpers-2e4ca34d.js.map +1 -0
  226. package/dist/esm/index-b1d6acd2.js +2118 -0
  227. package/dist/esm/index-b1d6acd2.js.map +1 -0
  228. package/dist/esm/index.js +39 -28
  229. package/dist/esm/index.js.map +1 -1
  230. package/dist/esm/library-2e5458af.js +113 -0
  231. package/dist/esm/library-2e5458af.js.map +1 -0
  232. package/dist/esm/loader.js +9 -7
  233. package/dist/esm/loader.js.map +1 -1
  234. package/dist/esm/qds-badge-counter_2.entry.js +146 -0
  235. package/dist/esm/qds-badge-counter_2.entry.js.map +1 -0
  236. package/dist/esm/qds-breadcrumb-item.entry.js +92 -0
  237. package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -0
  238. package/dist/esm/qds-button.entry.js +321 -90
  239. package/dist/esm/qds-button.entry.js.map +1 -1
  240. package/dist/esm/qds-checkbox.entry.js +207 -99
  241. package/dist/esm/qds-checkbox.entry.js.map +1 -1
  242. package/dist/esm/qds-chip.entry.js +252 -0
  243. package/dist/esm/qds-chip.entry.js.map +1 -0
  244. package/dist/esm/qds-dialog.entry.js +104 -0
  245. package/dist/esm/qds-dialog.entry.js.map +1 -0
  246. package/dist/esm/qds-divider.entry.js +60 -18
  247. package/dist/esm/qds-divider.entry.js.map +1 -1
  248. package/dist/esm/qds-dropdown.entry.js +232 -206
  249. package/dist/esm/qds-dropdown.entry.js.map +1 -1
  250. package/dist/esm/qds-form-message.entry.js +82 -0
  251. package/dist/esm/qds-form-message.entry.js.map +1 -0
  252. package/dist/esm/qds-icon.entry.js +113 -90
  253. package/dist/esm/qds-icon.entry.js.map +1 -1
  254. package/dist/esm/qds-inline-link.entry.js +99 -46
  255. package/dist/esm/qds-inline-link.entry.js.map +1 -1
  256. package/dist/esm/qds-input.entry.js +404 -185
  257. package/dist/esm/qds-input.entry.js.map +1 -1
  258. package/dist/esm/qds-label.entry.js +102 -24
  259. package/dist/esm/qds-label.entry.js.map +1 -1
  260. package/dist/esm/qds-list-item.entry.js +153 -0
  261. package/dist/esm/qds-list-item.entry.js.map +1 -0
  262. package/dist/esm/qds-loader.entry.js +90 -0
  263. package/dist/esm/qds-loader.entry.js.map +1 -0
  264. package/dist/esm/qds-nav-list-item.entry.js +120 -0
  265. package/dist/esm/qds-nav-list-item.entry.js.map +1 -0
  266. package/dist/esm/qds-progress-bar.entry.js +131 -0
  267. package/dist/esm/qds-progress-bar.entry.js.map +1 -0
  268. package/dist/esm/qds-radio.entry.js +102 -57
  269. package/dist/esm/qds-radio.entry.js.map +1 -1
  270. package/dist/esm/qds-select.entry.js +319 -0
  271. package/dist/esm/qds-select.entry.js.map +1 -0
  272. package/dist/esm/qds-standalone-link.entry.js +130 -0
  273. package/dist/esm/qds-standalone-link.entry.js.map +1 -0
  274. package/dist/esm/qds-switch.entry.js +193 -64
  275. package/dist/esm/qds-switch.entry.js.map +1 -1
  276. package/dist/esm/qds-tab.entry.js +295 -0
  277. package/dist/esm/qds-tab.entry.js.map +1 -0
  278. package/dist/esm/qds-tabbar.entry.js +345 -0
  279. package/dist/esm/qds-tabbar.entry.js.map +1 -0
  280. package/dist/esm/qds-table-body.entry.js +50 -0
  281. package/dist/esm/qds-table-body.entry.js.map +1 -0
  282. package/dist/esm/qds-table-cell.entry.js +50 -0
  283. package/dist/esm/qds-table-cell.entry.js.map +1 -0
  284. package/dist/esm/qds-table-head-cell.entry.js +50 -0
  285. package/dist/esm/qds-table-head-cell.entry.js.map +1 -0
  286. package/dist/esm/qds-table-head.entry.js +50 -0
  287. package/dist/esm/qds-table-head.entry.js.map +1 -0
  288. package/dist/esm/qds-table-row.entry.js +50 -0
  289. package/dist/esm/qds-table-row.entry.js.map +1 -0
  290. package/dist/esm/qds-table.entry.js +50 -0
  291. package/dist/esm/qds-table.entry.js.map +1 -0
  292. package/dist/esm/qds-tag_2.entry.js +176 -0
  293. package/dist/esm/qds-tag_2.entry.js.map +1 -0
  294. package/dist/esm/qds-textarea.entry.js +288 -153
  295. package/dist/esm/qds-textarea.entry.js.map +1 -1
  296. package/dist/esm/qds-tooltip.entry.js +332 -260
  297. package/dist/esm/qds-tooltip.entry.js.map +1 -1
  298. package/dist/esm/qds.js +16 -14
  299. package/dist/esm/qds.js.map +1 -1
  300. package/dist/types/components/badge-counter/badge-counter.d.ts +40 -0
  301. package/dist/types/components/badge-indicator/badge-indicator.d.ts +36 -0
  302. package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +160 -0
  303. package/dist/types/components/button/button.d.ts +272 -194
  304. package/dist/types/components/checkbox/checkbox.d.ts +130 -124
  305. package/dist/types/components/chip/chip.d.ts +109 -0
  306. package/dist/types/components/controls.d.ts +4 -1
  307. package/dist/types/components/dialog/dialog.d.ts +35 -0
  308. package/dist/types/components/divider/divider.d.ts +13 -9
  309. package/dist/types/components/dropdown/dropdown.d.ts +107 -125
  310. package/dist/types/components/form-message/form-message.d.ts +42 -0
  311. package/dist/types/components/icon/icon.d.ts +24 -24
  312. package/dist/types/components/icon/library.d.ts +3 -3
  313. package/dist/types/components/icon/request.d.ts +5 -9
  314. package/dist/types/components/inline-link/inline-link.d.ts +208 -191
  315. package/dist/types/components/input/input.d.ts +415 -368
  316. package/dist/types/components/label/label.d.ts +26 -24
  317. package/dist/types/components/list-item/list-item.d.ts +100 -0
  318. package/dist/types/components/loader/loader.d.ts +27 -0
  319. package/dist/types/components/nav-list-item/nav-list-item.d.ts +67 -0
  320. package/dist/types/components/progress-bar/progress-bar.d.ts +60 -0
  321. package/dist/types/components/radio/radio.d.ts +90 -95
  322. package/dist/types/components/select/select.d.ts +203 -0
  323. package/dist/types/components/shared.d.ts +6 -0
  324. package/dist/types/components/standalone-link/standalone-link.d.ts +233 -0
  325. package/dist/types/components/switch/switch.d.ts +114 -107
  326. package/dist/types/components/tab/tab.d.ts +160 -0
  327. package/dist/types/components/tabbar/tabbar.d.ts +47 -0
  328. package/dist/types/components/table/table.d.ts +15 -0
  329. package/dist/types/components/table-body/table-body.d.ts +15 -0
  330. package/dist/types/components/table-cell/table-cell.d.ts +32 -0
  331. package/dist/types/components/table-head/table-head.d.ts +15 -0
  332. package/dist/types/components/table-head-cell/table-head-cell.d.ts +56 -0
  333. package/dist/types/components/table-row/table-row.d.ts +15 -0
  334. package/dist/types/components/tag/tag.d.ts +55 -0
  335. package/dist/types/components/textarea/textarea.d.ts +285 -300
  336. package/dist/types/components/title/title.d.ts +39 -32
  337. package/dist/types/components/tooltip/tooltip.d.ts +123 -137
  338. package/dist/types/components.d.ts +3928 -820
  339. package/dist/types/helpers.d.ts +15 -16
  340. package/dist/types/index.d.ts +2 -1
  341. package/dist/types/interface-overrides.d.ts +211 -0
  342. package/dist/types/qds-test.d.ts +22 -11
  343. package/dist/types/stencil-public-runtime.d.ts +55 -15
  344. package/dist/types/utils.d.ts +11 -4
  345. package/dist/vscode.html-custom-data.json +1523 -209
  346. package/hydrate/index.d.ts +59 -18
  347. package/hydrate/index.js +25682 -8977
  348. package/hydrate/index.mjs +26622 -0
  349. package/hydrate/package.json +7 -1
  350. package/loader/cdn.js +3 -4
  351. package/loader/index.cjs.js +3 -4
  352. package/loader/index.d.ts +4 -1
  353. package/loader/index.es2017.js +3 -4
  354. package/loader/index.js +3 -4
  355. package/package.json +53 -89
  356. package/styles/core.css +137 -14
  357. package/components/floating-ui.dom.esm.js.map +0 -1
  358. package/components/helpers.js +0 -175
  359. package/components/helpers.js.map +0 -1
  360. package/components/icon.js +0 -175
  361. package/components/icon.js.map +0 -1
  362. package/components/label.js +0 -55
  363. package/components/label.js.map +0 -1
  364. package/dist/cjs/floating-ui.dom.esm-71fa96af.js.map +0 -1
  365. package/dist/cjs/helpers-452256e8.js +0 -185
  366. package/dist/cjs/helpers-452256e8.js.map +0 -1
  367. package/dist/cjs/index-d181f952.js +0 -2039
  368. package/dist/cjs/index-d181f952.js.map +0 -1
  369. package/dist/cjs/library-0a619eeb.js +0 -62
  370. package/dist/cjs/library-0a619eeb.js.map +0 -1
  371. package/dist/cjs/qds-title.cjs.entry.js +0 -66
  372. package/dist/cjs/qds-title.cjs.entry.js.map +0 -1
  373. package/dist/esm/floating-ui.dom.esm-f96ac766.js.map +0 -1
  374. package/dist/esm/helpers-76b84f45.js +0 -175
  375. package/dist/esm/helpers-76b84f45.js.map +0 -1
  376. package/dist/esm/index-d7183092.js +0 -2009
  377. package/dist/esm/index-d7183092.js.map +0 -1
  378. package/dist/esm/library-021aca11.js +0 -58
  379. package/dist/esm/library-021aca11.js.map +0 -1
  380. package/dist/esm/polyfills/core-js.js +0 -11
  381. package/dist/esm/polyfills/dom.js +0 -79
  382. package/dist/esm/polyfills/es5-html-element.js +0 -1
  383. package/dist/esm/polyfills/index.js +0 -34
  384. package/dist/esm/polyfills/system.js +0 -6
  385. package/dist/esm/qds-title.entry.js +0 -62
  386. package/dist/esm/qds-title.entry.js.map +0 -1
  387. package/dist/types/components/create-story.d.ts +0 -5
@@ -0,0 +1 @@
1
+ {"file":"qds-standalone-link.entry.js","mappings":";;;;;;;;AAAA,MAAM,iBAAiB,GAAG,uuHAAuuH,CAAC;AAClwH,gCAAe,iBAAiB;;ACDhC;AACA;AACA;;;;;;;;;MAwCa,cAAc;IAL3B;;;;;;;;;QAU0B,aAAQ,GAAY,KAAK,CAAA;;;;QAYzB,gBAAW,GAAW,SAAS,CAAA;;;;QAK/B,eAAU,GAAgB,UAAU,CAAA;;;;QAKpC,SAAI,GAAU,UAAU,CAAA;;;;QAKxB,cAAS,GAAY,KAAK,CAAA;;QAqMzC,oCAA+B,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA;QA0HzD,iCAAU,CAAC,KAAiB;YACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,EAAA;QAEQ,kCAAW,CAAC,KAAiB;YACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,EAAA;QAE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,IAAI,CAAC,UAAU;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;","names":[],"sources":["src/components/standalone-link/standalone-link.css?tag=qds-standalone-link&encapsulation=shadow","src/components/standalone-link/standalone-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.qds-icon-crop {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.qds-icon {\n flex-shrink: 0;\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-standalone-link {\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n print-color-adjust: exact;\n text-decoration: none;\n width: 100%;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:hover,\n &:active {\n text-decoration: underline;\n }\n}\n\n.qds-text {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited.qds-visitable {\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.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\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.qds-visitable {\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.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\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.qds-visitable {\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.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-standalone-link {\n font: var(--qds-control-small-link);\n gap: var(--qds-control-small-gap-internal);\n padding-block: var(--qds-control-small-padding-auto-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-small-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-small-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-standalone-link {\n font: var(--qds-control-standard-link);\n gap: var(--qds-control-standard-gap-internal);\n padding-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-standard-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-standard-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-standalone-link {\n font: var(--qds-control-large-link);\n gap: var(--qds-control-large-gap-internal);\n padding-block: var(--qds-control-large-padding-auto-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-large-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-large-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\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 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 attachInternals,\n determineLinkIcon,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, LinkIcon, Size, Target } from '../shared'\n\n/**\n * `<qds-standalone-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-standalone-link>` *should* indicate the standalone link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-standalone-link>` element will activate it.\n *\n * @slot Content to display for the standalone link.\n * @see https://quartz.se.com/build/components/standalone-link\n */\n@Component({\n tag: 'qds-standalone-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'standalone-link.css',\n})\nexport class StandaloneLink implements ComponentInterface {\n /**\n * Prevents the standalone 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 standalone link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The standalone link's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Defines if the standalone link will display the visited state.\n */\n @Prop() public readonly visitable: boolean = false\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 standalone link points to. Standalone 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 standalone 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 standalone link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the standalone 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 @State() private tabIndex?: number\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n readonly #internals: ElementInternals = attachInternals.call(this)\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 | undefined {\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 @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.#internals.ariaDisabled = this.disabled.toString()\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.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Watch('href')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.href, this.target)\n }\n\n public componentWillLoad(): void {\n this.#internals.role = 'link'\n\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#internals.ariaLabel = this.host.textContent\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-standalone-link': true,\n 'qds-disabled': this.disabled,\n 'qds-visitable': this.visitable,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\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={this.disabled ? -1 : this.tabIndex}\n target={this.target}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </span>\n )}\n <span class=\"qds-text\">\n <slot onSlotchange={this.#onSlotchange} />\n </span>\n {this.linkIcon && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n class=\"qds-icon\"\n library=\"core\"\n data-size={this.#computedSize}\n name={this.linkIcon}\n />\n </span>\n )}\n {this.importance === 'emphasized' && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library=\"core\"\n name=\"next\"\n />\n </span>\n )}\n </a>\n )\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 #onSlotchange = (): void => {\n this.#internals.ariaLabel = this.host.textContent\n }\n}\n"],"version":3}
@@ -1,74 +1,203 @@
1
1
  /*!
2
- * SPDX-FileCopyrightText: © 2023 Schneider Electric
2
+ * SPDX-FileCopyrightText: © 2025 Schneider Electric
3
3
  *
4
- * SPDX-License-Identifier: LGPL-2.1-only
4
+ * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, a as getElement } from './index-d7183092.js';
7
- import { p as pickFocusEventAttributes, i as inheritAriaAttributes, b as inheritAttributes } from './helpers-76b84f45.js';
6
+ import { r as registerInstance, c as createEvent, h, a as getElement } from './index-b1d6acd2.js';
7
+ import { p as pickFocusEventAttributes, b as inheritAriaAttributes } from './helpers-2e4ca34d.js';
8
+ import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './controls-a4768aaf.js';
8
9
 
9
- const switchCss = ".sc-qds-switch-h{box-sizing:border-box}[hidden].sc-qds-switch-h{display:none !important}.sc-qds-switch-h *.sc-qds-switch,.sc-qds-switch-h *.sc-qds-switch::before,.sc-qds-switch-h *.sc-qds-switch::after{box-sizing:inherit}.sc-qds-switch-h{display:inline-block}.track.sc-qds-switch,.knob.sc-qds-switch{-webkit-print-color-adjust:exact;print-color-adjust:exact}.unchecked-text.sc-qds-switch{text-align:end}.icon.sc-qds-switch{color:var(--qds-theme-control-text-standard);flex-shrink:0}.track.sc-qds-switch{align-items:center;border-radius:var(--qds-control-rounded-border-radius);display:flex;flex-shrink:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;background-color:var(--qds-theme-control-slider-track-inactive)}.knob.sc-qds-switch{background-color:var(--qds-theme-accessory-background);border-radius:var(--qds-control-rounded-border-radius);border:var(--qds-control-border-width) solid var(--qds-theme-control-border);box-shadow:var(--qds-theme-accessory-elevation);box-sizing:content-box}.label.sc-qds-switch{cursor:pointer;display:flex}.switch.sc-qds-switch{-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:0;position:absolute;white-space:nowrap;width:1px}.switch.sc-qds-switch:hover~.track.sc-qds-switch>.knob.sc-qds-switch{background-color:var(--qds-theme-interactive-background-hover)}.switch.sc-qds-switch:active~.track.sc-qds-switch>.knob.sc-qds-switch{background-color:var(--qds-theme-interactive-background-pressed)}.switch.sc-qds-switch:checked~.track.sc-qds-switch{justify-content:flex-end;background-color:var(--qds-theme-signature-color-default)}.switch.sc-qds-switch:checked~.track.sc-qds-switch>.knob.sc-qds-switch{border-color:transparent;box-sizing:border-box;-webkit-margin-end:var(--qds-control-border-width);margin-inline-end:var(--qds-control-border-width)}.switch.sc-qds-switch:checked:hover~.track.sc-qds-switch>.knob.sc-qds-switch{background-color:var(--qds-theme-interactive-background-hover)}.switch.sc-qds-switch:checked:active~.track.sc-qds-switch>.knob.sc-qds-switch{background-color:var(--qds-theme-interactive-background-pressed)}.switch.sc-qds-switch:focus-visible~.track.sc-qds-switch{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}[aria-disabled='true'].sc-qds-switch{opacity:var(--qds-theme-disabled);pointer-events:none}.icon[data-size='small'].sc-qds-switch{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}.inline[data-size='small'].sc-qds-switch{margin-block:var(--qds-control-small-padding-auto-height)}.label[data-size='small'].sc-qds-switch{gap:var(--qds-control-small-gap-siblings-related)}.track[data-size='small'].sc-qds-switch{width:calc(var(--qds-control-slider-knob-small-size) * 2);height:var(--qds-control-toggle-box-small-size)}.knob[data-size='small'].sc-qds-switch{height:var(--qds-control-slider-knob-small-size);width:var(--qds-control-slider-knob-small-size)}.icon[data-size='standard'].sc-qds-switch{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.inline[data-size='standard'].sc-qds-switch{margin-block:var(--qds-control-standard-padding-auto-height)}.label[data-size='standard'].sc-qds-switch{gap:var(--qds-control-standard-gap-siblings-related)}.track[data-size='standard'].sc-qds-switch{width:calc(var(--qds-control-slider-knob-standard-size) * 2);height:var(--qds-control-toggle-box-standard-size)}.knob[data-size='standard'].sc-qds-switch{height:var(--qds-control-slider-knob-standard-size);width:var(--qds-control-slider-knob-standard-size)}.icon[data-size='large'].sc-qds-switch{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}.inline[data-size='large'].sc-qds-switch{margin-block:var(--qds-control-large-padding-auto-height)}.label[data-size='large'].sc-qds-switch{gap:var(--qds-control-large-gap-siblings-related)}.track[data-size='large'].sc-qds-switch{width:calc(var(--qds-control-slider-knob-large-size) * 2);height:var(--qds-control-toggle-box-large-size)}.knob[data-size='large'].sc-qds-switch{height:var(--qds-control-slider-knob-large-size);width:var(--qds-control-slider-knob-large-size)}";
10
+ const switchCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-knob,.qds-track{-webkit-print-color-adjust:exact;print-color-adjust:exact}.qds-track{align-items:center;background-color:var(--qds-theme-control-toggle-track-default);border-radius:var(--qds-control-toggle-track-border-radius);box-sizing:border-box;display:flex;flex-shrink:0;padding:var(--qds-control-toggle-track-padding)}.qds-track:hover{background-color:var(--qds-theme-control-toggle-track-hover)}.qds-track:active{background-color:var(--qds-theme-control-toggle-track-pressed)}.qds-knob{background-color:var(--qds-theme-control-input-background);border-radius:var(--qds-control-knob-border-radius);box-shadow:var(--qds-theme-accessory-elevation);box-sizing:border-box;margin:0}.qds-container{box-sizing:border-box;cursor:pointer;display:flex}.qds-switch{clip-path:inset(50%);height:1px;margin:0;position:absolute;white-space:nowrap;width:1px}.qds-switch:focus-visible~.qds-track{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-switch:checked~.qds-track{background-color:var(--qds-theme-signature-color-default);justify-content:flex-end}.qds-switch:checked~.qds-track:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-switch:checked~.qds-track:active{background-color:var(--qds-theme-signature-color-pressed)}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height)}.qds-track[data-size=small]{height:var(--qds-control-toggle-track-small-size);width:var(--qds-control-toggle-track-small-width)}.qds-knob[data-size=small]{height:var(--qds-control-knob-small-size);width:var(--qds-control-knob-small-size)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height)}.qds-track[data-size=standard]{height:var(--qds-control-toggle-track-standard-height);width:var(--qds-control-toggle-track-standard-width)}.qds-knob[data-size=standard]{height:var(--qds-control-knob-standard-size);width:var(--qds-control-knob-standard-size)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height)}.qds-track[data-size=large]{height:var(--qds-control-toggle-track-large-height);width:calc(var(--qds-control-toggle-track-large-height)*2)}.qds-knob[data-size=large]{height:var(--qds-control-knob-large-size);width:var(--qds-control-knob-large-size)}";
11
+ const QdsSwitchStyle0 = switchCss;
10
12
 
11
- let autoIncrementingId = 1;
13
+ // SPDX-FileCopyrightText: © 2024 Schneider Electric
14
+ //
15
+ // SPDX-License-Identifier: Apache-2.0
16
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
+ if (kind === "a" && !f)
18
+ throw new TypeError("Private accessor was defined without a getter");
19
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
20
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
21
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
22
+ };
23
+ var _Switch_instances, _Switch_computedChecked_get, _Switch_computedDisabled_get, _Switch_computedSize_get, _Switch_computedValue_get, _Switch_onBlur, _Switch_onFocus, _Switch_defineGetter, _Switch_updateFormValue;
12
24
  const Switch = class {
13
- constructor(hostRef) {
14
- registerInstance(this, hostRef);
15
- this.blurEmitter = createEvent(this, "qdsBlur", 2);
16
- this.changeEmitter = createEvent(this, "qdsChange", 6);
17
- this.focusEmitter = createEvent(this, "qdsFocus", 2);
18
- this.inheritedAttributes = {};
19
- this.onBlur = (event) => {
20
- this.blurEmitter.emit(pickFocusEventAttributes(event));
21
- };
22
- this.onFocus = (event) => {
23
- this.focusEmitter.emit(pickFocusEventAttributes(event));
24
- };
25
- this.inline = false;
26
- this.iconCheckedName = undefined;
27
- this.iconCheckedLibrary = 'default';
28
- this.iconUncheckedName = undefined;
29
- this.iconUncheckedLibrary = 'default';
30
- this.size = 'standard';
31
- this.textChecked = undefined;
32
- this.textUnchecked = undefined;
33
- this.autoFocus = undefined;
34
- this.checked = undefined;
35
- this.disabled = undefined;
36
- this.form = undefined;
37
- this.name = `qds-switch-${autoIncrementingId}`;
38
- this.value = undefined;
39
- }
40
- get computedDisabled() {
41
- return this.disabled ?? false;
42
- }
43
- onClick(event) {
44
- if (this.computedDisabled)
45
- return;
46
- event.preventDefault();
47
- this.checked = !(this.checked ?? false);
48
- this.changeEmitter.emit();
49
- }
50
- componentWillLoad() {
51
- autoIncrementingId += 1;
52
- this.inheritedAttributes = {
53
- ...inheritAriaAttributes(this.element),
54
- ...inheritAttributes(this.element, ['tabindex']),
55
- };
56
- }
57
- render() {
58
- return (
59
- // eslint-disable-next-line jsx-a11y/label-has-associated-control
60
- h("label", { "aria-disabled": this.computedDisabled ? 'true' : 'false', class: {
61
- inline: this.inline,
62
- label: true,
63
- }, "data-size": this.size }, this.textUnchecked !== undefined && this.textUnchecked !== '' && (h("qds-label", { class: "unchecked-text", size: this.size, text: this.textUnchecked })), this.iconUncheckedName !== undefined &&
64
- this.iconUncheckedName !== '' && (h("qds-icon", { class: "icon", "data-size": this.size, library: this.iconUncheckedLibrary, name: this.iconUncheckedName })), h("input", {
65
- // eslint-disable-next-line jsx-a11y/no-autofocus
66
- autoFocus: this.autoFocus, checked: this.checked, class: "switch", disabled: this.disabled, form: this.form, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, type: "checkbox", value: this.value ?? undefined, ...this.inheritedAttributes
67
- }), h("div", { class: "track", "data-size": this.size }, h("div", { class: "knob", "data-size": this.size })), this.iconCheckedName !== undefined && this.iconCheckedName !== '' && (h("qds-icon", { class: "icon", "data-size": this.size, library: this.iconCheckedLibrary, name: this.iconCheckedName })), this.textChecked !== undefined && this.textChecked !== '' && (h("qds-label", { size: this.size, text: this.textChecked }))));
68
- }
69
- get element() { return getElement(this); }
25
+ constructor(hostRef) {
26
+ registerInstance(this, hostRef);
27
+ this.blurEmitter = createEvent(this, "qdsBlur", 2);
28
+ this.changeEmitter = createEvent(this, "qdsChange", 6);
29
+ this.focusEmitter = createEvent(this, "qdsFocus", 2);
30
+ if (hostRef.$hostElement$["s-ei"]) {
31
+ this.internals = hostRef.$hostElement$["s-ei"];
32
+ }
33
+ else {
34
+ this.internals = hostRef.$hostElement$.attachInternals();
35
+ hostRef.$hostElement$["s-ei"] = this.internals;
36
+ }
37
+ _Switch_instances.add(this);
38
+ /**
39
+ * Adds vertical margin to the switch for alignment.
40
+ *
41
+ * This is useful when creating inline layouts so that the first lines have
42
+ * the correct vertical centering.
43
+ */
44
+ this.inline = false;
45
+ /**
46
+ * The switches's size.
47
+ */
48
+ this.size = 'standard';
49
+ /**
50
+ * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)
51
+ * element to associate the switch with (its form owner).
52
+ *
53
+ * The value of this property must be the id of a `<form>` in the same
54
+ * document. If this property is not set, the `<qds-switch>` is associated
55
+ * with its ancestor `<form>` element, if any.
56
+ *
57
+ * This property lets you associate `<qds-switch>` elements to `<form>`s
58
+ * anywhere in the document, not just inside a `<form>`. It can also override
59
+ *an ancestor `<form>` element.
60
+ *
61
+ * @webnative
62
+ */
63
+ // eslint-disable-next-line unicorn/no-null
64
+ this.form = null;
65
+ /**
66
+ * Returns a list of the [`<label>`][] elements associated with the
67
+ * `qds-switch` element.
68
+ *
69
+ * [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label
70
+ *
71
+ * @readonly
72
+ * @webnative
73
+ */
74
+ // eslint-disable-next-line unicorn/no-null
75
+ this.labels = null;
76
+ /**
77
+ * The error message that would be shown to the user if the `<qds-switch>`
78
+ * was to be checked for validity.
79
+ *
80
+ * @readonly
81
+ * @webnative
82
+ */
83
+ this.validationMessage = '';
84
+ /**
85
+ * The [`ValidityState`][] object for this `<qds-switch>`.
86
+ *
87
+ * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState
88
+ *
89
+ * @readonly
90
+ * @webnative
91
+ */
92
+ this.validity = VALID_STATE;
93
+ /**
94
+ * True if `<qds-switch>` will be validated when the form is submitted;
95
+ * false otherwise.
96
+ *
97
+ * @readonly
98
+ * @webnative
99
+ */
100
+ this.willValidate = false;
101
+ this.inheritedAttributes = {};
102
+ this.checkValidity = () => this.internals.checkValidity();
103
+ this.reportValidity = () => this.internals.reportValidity();
104
+ this.setCustomValidity = (error) => {
105
+ if (error)
106
+ this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host);
107
+ else
108
+ this.internals.setValidity(NO_ERROR_FLAGS);
109
+ };
110
+ _Switch_onBlur.set(this, (event) => {
111
+ this.blurEmitter.emit(pickFocusEventAttributes(event));
112
+ });
113
+ _Switch_onFocus.set(this, (event) => {
114
+ this.focusEmitter.emit(pickFocusEventAttributes(event));
115
+ });
116
+ }
117
+ onClick(event) {
118
+ if (__classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedDisabled_get)) {
119
+ event.stopImmediatePropagation();
120
+ return;
121
+ }
122
+ event.preventDefault();
123
+ this.checked = !__classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedChecked_get);
124
+ this.changeEmitter.emit();
125
+ }
126
+ checkedChanged() {
127
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_updateFormValue).call(this);
128
+ this.internals.ariaChecked = __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedChecked_get).toString();
129
+ }
130
+ disabledChanged() {
131
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_updateFormValue).call(this);
132
+ this.internals.ariaDisabled = __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedDisabled_get).toString();
133
+ }
134
+ tabindexChanged(newValue) {
135
+ const parsedValue = Number.parseInt(newValue, 10);
136
+ this.tabIndex =
137
+ parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue;
138
+ }
139
+ valueChanged() {
140
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_updateFormValue).call(this);
141
+ }
142
+ componentWillLoad() {
143
+ this.internals.role = 'switch';
144
+ this.checkedChanged();
145
+ this.disabledChanged();
146
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_defineGetter).call(this, 'form', () => this.internals.form);
147
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_defineGetter).call(this, 'labels', () => this.internals.labels);
148
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_defineGetter).call(this, 'validationMessage', () => this.internals.validationMessage);
149
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_defineGetter).call(this, 'validity', () => this.internals.validity);
150
+ __classPrivateFieldGet(this, _Switch_instances, "m", _Switch_defineGetter).call(this, 'willValidate', () => this.internals.willValidate);
151
+ this.inheritedAttributes = inheritAriaAttributes(this.host);
152
+ this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0');
153
+ }
154
+ render() {
155
+ return (h("div", { key: '342bf6f92bda0c26d06847b697962507f44ba66f', class: {
156
+ 'qds-container': true,
157
+ 'qds-disabled': __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedDisabled_get),
158
+ 'qds-inline': this.inline,
159
+ }, "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }, h("input", { key: '101c463e6970cd79c3776cf7d8e9328e3c4d8fee', "aria-hidden": "true",
160
+ // eslint-disable-next-line jsx-a11y/no-autofocus
161
+ autoFocus: this.host.autofocus, checked: this.checked, class: "qds-switch", disabled: this.disabled, onBlur: __classPrivateFieldGet(this, _Switch_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Switch_onFocus, "f"), tabIndex: __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedDisabled_get) ? undefined : this.tabIndex, type: "checkbox", value: this.value ?? undefined, ...this.inheritedAttributes }), h("div", { key: '58a9e90c1b9df6aec5c7dec6b95544003bc82def', class: "qds-track", "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }, h("div", { key: '14745582855113a1015c7d076cb8e157298af6b9', class: "qds-knob", "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }))));
162
+ }
163
+ static get delegatesFocus() { return true; }
164
+ static get formAssociated() { return true; }
165
+ get host() { return getElement(this); }
166
+ static get watchers() { return {
167
+ "checked": ["checkedChanged"],
168
+ "disabled": ["disabledChanged"],
169
+ "tabindex": ["tabindexChanged"],
170
+ "value": ["valueChanged"]
171
+ }; }
172
+ };
173
+ _Switch_onBlur = new WeakMap(), _Switch_onFocus = new WeakMap(), _Switch_instances = new WeakSet(), _Switch_computedChecked_get = function _Switch_computedChecked_get() {
174
+ return this.checked ?? false;
175
+ }, _Switch_computedDisabled_get = function _Switch_computedDisabled_get() {
176
+ return ((this.host.matches(':disabled') || (this.disabled ?? false)) &&
177
+ this.host.getAttribute('disabled') !== 'false');
178
+ }, _Switch_computedSize_get = function _Switch_computedSize_get() {
179
+ switch (this.size) {
180
+ case 'standard':
181
+ case 'small':
182
+ case 'large': {
183
+ return this.size;
184
+ }
185
+ default: {
186
+ return 'standard';
187
+ }
188
+ }
189
+ }, _Switch_computedValue_get = function _Switch_computedValue_get() {
190
+ // eslint-disable-next-line unicorn/no-null
191
+ return this.value == null ? null : this.value.toString();
192
+ }, _Switch_defineGetter = function _Switch_defineGetter(p, get) {
193
+ Object.defineProperty(this.host, p, { enumerable: true, get });
194
+ }, _Switch_updateFormValue = function _Switch_updateFormValue() {
195
+ this.internals.setFormValue(__classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedChecked_get) && !__classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedDisabled_get)
196
+ ? __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedValue_get)
197
+ : // eslint-disable-next-line unicorn/no-null
198
+ null);
70
199
  };
71
- Switch.style = switchCss;
200
+ Switch.style = QdsSwitchStyle0;
72
201
 
73
202
  export { Switch as qds_switch };
74
203
 
@@ -1 +1 @@
1
- {"file":"qds-switch.entry.js","mappings":";;;;;;;;AAAA,MAAM,SAAS,GAAG,ulIAAulI;;ACiBzmI,IAAI,kBAAkB,GAAG,CAAC,CAAA;MAUb,MAAM;;;;;;IA2HT,wBAAmB,GAAe,EAAE,CAAA;IAoF3B,WAAM,GAAG,CAAC,KAAiB;MAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;KACvD,CAAA;IAEgB,YAAO,GAAG,CAAC,KAAiB;MAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;KACxD,CAAA;kBA9MyC,KAAK;;8BAa7C,SAAS;;gCAaT,SAAS;gBAKiD,UAAU;;;;;;;gBAwDvC,cAAc,kBAAkB,EAAE;;;EA+BjE,IAAY,gBAAgB;IAC1B,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAA;GAC9B;EAGS,OAAO,CAAC,KAAiB;IACjC,IAAI,IAAI,CAAC,gBAAgB;MAAE,OAAM;IAEjC,KAAK,CAAC,cAAc,EAAE,CAAA;IAEtB,IAAI,CAAC,OAAO,GAAG,EAAE,IAAI,CAAC,OAA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K,IAAI,SAAS,KAE1B,IAAI,CAAC,mBAAmB;MAC5B,EACF,WAAK,KAAK,EAAC,OAAO,eAAY,IAAI,CAAC,IAAI,IACrC,WAAK,KAAK,EAAC,MAAM,eAAY,IAAI,CAAC,IAAI,GAAI,CACtC,EACL,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,KAAK,EAAE,KAChE,gBACE,KAAK,EAAC,MAAM,eACD,IAAI,CAAC,IAAI,EACpB,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAChC,IAAI,EAAE,IAAI,CAAC,eAAe,GAC1B,CACH,EACA,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,EAAE,KACxD,iBAAW,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,GAAI,CACvD,CACK,EACT;GACF;;;;;;;","names":[],"sources":["src/components/switch/switch.css?tag=qds-switch&encapsulation=scoped","src/components/switch/switch.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2023 Schneider Electric\n *\n * SPDX-License-Identifier: LGPL-2.1-only\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.track,\n.knob {\n print-color-adjust: exact;\n}\n\n.unchecked-text {\n text-align: end;\n}\n\n.icon {\n color: var(--qds-theme-control-text-standard);\n flex-shrink: 0;\n}\n\n.track {\n align-items: center;\n border-radius: var(--qds-control-rounded-border-radius);\n display: flex;\n flex-shrink: 0;\n print-color-adjust: exact;\n background-color: var(--qds-theme-control-slider-track-inactive);\n}\n\n.knob {\n background-color: var(--qds-theme-accessory-background);\n border-radius: var(--qds-control-rounded-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n box-shadow: var(--qds-theme-accessory-elevation);\n box-sizing: content-box;\n}\n\n.label {\n cursor: pointer;\n display: flex;\n}\n\n.switch {\n clip-path: inset(50%);\n height: 1px;\n margin: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n\n &:hover ~ .track > .knob {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active ~ .track > .knob {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n\n &:checked {\n & ~ .track {\n justify-content: flex-end;\n background-color: var(--qds-theme-signature-color-default);\n\n & > .knob {\n border-color: transparent;\n box-sizing: border-box;\n margin-inline-end: var(--qds-control-border-width);\n }\n }\n\n &:hover ~ .track > .knob {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active ~ .track > .knob {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n\n &:focus-visible ~ .track {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n\n &.inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.label {\n gap: var(--qds-control-small-gap-siblings-related);\n }\n\n &.track {\n width: calc(var(--qds-control-slider-knob-small-size) * 2);\n height: var(--qds-control-toggle-box-small-size);\n }\n\n &.knob {\n height: var(--qds-control-slider-knob-small-size);\n width: var(--qds-control-slider-knob-small-size);\n }\n}\n\n[data-size='standard'] {\n &.icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n\n &.inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.label {\n gap: var(--qds-control-standard-gap-siblings-related);\n }\n\n &.track {\n width: calc(var(--qds-control-slider-knob-standard-size) * 2);\n height: var(--qds-control-toggle-box-standard-size);\n }\n\n &.knob {\n height: var(--qds-control-slider-knob-standard-size);\n width: var(--qds-control-slider-knob-standard-size);\n }\n}\n\n[data-size='large'] {\n &.icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n\n &.inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.label {\n gap: var(--qds-control-large-gap-siblings-related);\n }\n\n &.track {\n width: calc(var(--qds-control-slider-knob-large-size) * 2);\n height: var(--qds-control-toggle-box-large-size);\n }\n\n &.knob {\n height: var(--qds-control-slider-knob-large-size);\n width: var(--qds-control-slider-knob-large-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2023 Schneider Electric\n//\n// SPDX-License-Identifier: LGPL-2.1-only\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Value } from '../controls'\n\nexport type SwitchSize = 'large' | 'small' | 'standard'\n\nlet autoIncrementingId = 1\n\n/**\n * @see https://quartz.se.com/build/components/switch\n */\n@Component({\n tag: 'qds-switch',\n scoped: true,\n styleUrl: 'switch.css',\n})\nexport class Switch implements ComponentInterface {\n /**\n * Adds vertical margin to the switch 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 name of the checked icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop({ reflect: true }) public readonly iconCheckedName?: string\n\n /**\n * The name of a registered checked icon library.\n */\n @Prop({ reflect: true }) public readonly iconCheckedLibrary: string =\n 'default'\n\n /**\n * The name of the unchecked icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop({ reflect: true }) public readonly iconUncheckedName?: string\n\n /**\n * The name of a registered unchecked icon library.\n */\n @Prop({ reflect: true }) public readonly iconUncheckedLibrary: string =\n 'default'\n\n /**\n * The switches's size.\n */\n @Prop({ reflect: true }) public readonly size: SwitchSize = 'standard'\n\n /**\n * The switch's checked text.\n */\n @Prop({ mutable: true, reflect: true }) public readonly textChecked?: string\n\n /**\n * The switch's unchecked text.\n */\n @Prop({ mutable: true, reflect: true }) public readonly textUnchecked?: string\n\n /**\n * Specify whether the switch should have focus when the page loads.\n *\n * @webnative\n */\n @Prop({ attribute: 'autofocus' }) public readonly autoFocus?: boolean\n\n /**\n *Sets the switch's state.\n *\n * @webnative\n */\n @Prop({ mutable: true, reflect: true }) public checked?: boolean\n\n /**\n * Prevents the switch from being interacted with: it cannot be pressed or\n *focused.\n *\n * @webnative\n */\n @Prop({ mutable: true, reflect: true }) public disabled?: boolean\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the switch with (its form owner).\n *\n * The value of this property must be the id of a `<form>` in the same\n * document. If this property is not set, the `<qds-switch>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This property lets you associate `<qds-switch>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n *an ancestor `<form>` element.\n *\n * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * The name of the switch, which is submitted with the form data. An\n *incrementing ID is used by default.\n *\n * @webnative\n */\n @Prop() public readonly name = `qds-switch-${autoIncrementingId}`\n\n /**\n * The value of the switch, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: Value\n\n /**\n * Emitted when the switch loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the switch's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the switch gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsSwitchElement\n\n private inheritedAttributes: Attributes = {}\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.computedDisabled) return\n\n event.preventDefault()\n\n this.checked = !(this.checked ?? false)\n this.changeEmitter.emit()\n }\n\n public componentWillLoad(): void {\n autoIncrementingId += 1\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.computedDisabled ? 'true' : 'false'}\n class={{\n inline: this.inline,\n label: true,\n }}\n data-size={this.size}\n >\n {this.textUnchecked !== undefined && this.textUnchecked !== '' && (\n <qds-label\n class=\"unchecked-text\"\n size={this.size}\n text={this.textUnchecked}\n />\n )}\n {this.iconUncheckedName !== undefined &&\n this.iconUncheckedName !== '' && (\n <qds-icon\n class=\"icon\"\n data-size={this.size}\n library={this.iconUncheckedLibrary}\n name={this.iconUncheckedName}\n />\n )}\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.autoFocus}\n checked={this.checked}\n class=\"switch\"\n disabled={this.disabled}\n form={this.form}\n name={this.name}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n type=\"checkbox\"\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n />\n <div class=\"track\" data-size={this.size}>\n <div class=\"knob\" data-size={this.size} />\n </div>\n {this.iconCheckedName !== undefined && this.iconCheckedName !== '' && (\n <qds-icon\n class=\"icon\"\n data-size={this.size}\n library={this.iconCheckedLibrary}\n name={this.iconCheckedName}\n />\n )}\n {this.textChecked !== undefined && this.textChecked !== '' && (\n <qds-label size={this.size} text={this.textChecked} />\n )}\n </label>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
1
+ {"file":"qds-switch.entry.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,65EAA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C,KAAK,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,OAAO,EAC/C;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;IAIC,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;AAC1D,CAAC,uDA4Ga,CAAc,EAAE,GAAkB;IAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;AAChE,CAAC;IAGC,IAAI,CAAC,SAAS,CAAC,YAAY,CACzB,uBAAA,IAAI,sDAAiB,IAAI,CAAC,uBAAA,IAAI,uDAAkB;UAC5C,uBAAA,IAAI,oDAAe;;YAEnB,IAAI,CACT,CAAA;AACH,CAAC;;;;;","names":[],"sources":["src/components/switch/switch.css?tag=qds-switch&encapsulation=shadow","src/components/switch/switch.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-track,\n.qds-knob {\n print-color-adjust: exact;\n}\n\n.qds-track {\n align-items: center;\n border-radius: var(--qds-control-toggle-track-border-radius);\n display: flex;\n box-sizing: border-box;\n flex-shrink: 0;\n padding: var(--qds-control-toggle-track-padding);\n print-color-adjust: exact;\n background-color: var(--qds-theme-control-toggle-track-default);\n\n &:hover {\n background-color: var(--qds-theme-control-toggle-track-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-control-toggle-track-pressed);\n }\n}\n\n.qds-knob {\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-knob-border-radius);\n box-shadow: var(--qds-theme-accessory-elevation);\n box-sizing: border-box;\n margin: 0;\n}\n\n.qds-container {\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n}\n\n.qds-switch {\n clip-path: inset(50%);\n height: 1px;\n margin: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n\n &:focus-visible ~ .qds-track {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:checked ~ .qds-track {\n justify-content: flex-end;\n background-color: var(--qds-theme-signature-color-default);\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.qds-track {\n width: var(--qds-control-toggle-track-small-width);\n height: var(--qds-control-toggle-track-small-size);\n }\n\n &.qds-knob {\n height: var(--qds-control-knob-small-size);\n width: var(--qds-control-knob-small-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.qds-track {\n width: var(--qds-control-toggle-track-standard-width);\n height: var(--qds-control-toggle-track-standard-height);\n }\n\n &.qds-knob {\n height: var(--qds-control-knob-standard-size);\n width: var(--qds-control-knob-standard-size);\n }\n}\n\n[data-size='large'] {\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.qds-track {\n width: calc(var(--qds-control-toggle-track-large-height) * 2);\n height: var(--qds-control-toggle-track-large-height);\n }\n\n &.qds-knob {\n height: var(--qds-control-knob-large-size);\n width: var(--qds-control-knob-large-size);\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'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport type { Value } from '../controls'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\n/**\n * @see https://quartz.se.com/build/components/switch\n */\n@Component({\n tag: 'qds-switch',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'switch.css',\n})\nexport class Switch implements ComponentInterface {\n /**\n * Adds vertical margin to the switch 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 switches's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n *Sets the switch's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the switch from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the switch with (its form owner).\n *\n * The value of this property must be the id of a `<form>` in the same\n * document. If this property is not set, the `<qds-switch>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This property lets you associate `<qds-switch>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n *an ancestor `<form>` element.\n *\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Returns a list of the [`<label>`][] elements associated with the\n * `qds-switch` element.\n *\n * [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly labels: HTMLInputElement['labels'] = null\n\n /**\n * The name of the switch, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * The value of the switch, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: Value\n\n /**\n * The error message that would be shown to the user if the `<qds-switch>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-switch>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * True if `<qds-switch>` will be validated when the form is submitted;\n * false otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the switch loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the switch's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the switch 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 inheritedAttributes: Attributes = {}\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedDisabled(): boolean {\n return (\n (this.host.matches(':disabled') || (this.disabled ?? false)) &&\n this.host.getAttribute('disabled') !== 'false'\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 #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n this.checked = !this.#computedChecked\n this.changeEmitter.emit()\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.#updateFormValue()\n this.internals.ariaChecked = this.#computedChecked.toString()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.#updateFormValue()\n this.internals.ariaDisabled = this.#computedDisabled.toString()\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 @Watch('value')\n protected valueChanged(): void {\n this.#updateFormValue()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'switch'\n this.checkedChanged()\n this.disabledChanged()\n\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('labels', () => this.internals.labels)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n\n this.inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-container': true,\n 'qds-disabled': this.#computedDisabled,\n 'qds-inline': this.inline,\n }}\n data-size={this.#computedSize}\n >\n <input\n aria-hidden=\"true\"\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.checked}\n class=\"qds-switch\"\n disabled={this.disabled}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n />\n <div class=\"qds-track\" data-size={this.#computedSize}>\n <div class=\"qds-knob\" data-size={this.#computedSize} />\n </div>\n </div>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLInputElement['setCustomValidity'] = (error) => {\n if (error) this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host)\n else this.internals.setValidity(NO_ERROR_FLAGS)\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 #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n\n #updateFormValue(): void {\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n}\n"],"version":3}