@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
@@ -1 +1 @@
1
- {"file":"qds-button.entry.js","mappings":";;;;;;;;AAAA,MAAM,SAAS,GAAG,qjHAAqjH;;MC+B1jH,MAAM;;;;;IA4MT,wBAAmB,GAAe,EAAE,CAAA;IA0E3B,YAAO,GAAG,CAAC,KAAiB;MAC3C,IAAI,IAAI,CAAC,gBAAgB,EAAE;QACzB,KAAK,CAAC,cAAc,EAAE,CAAA;QACtB,KAAK,CAAC,eAAe,EAAE,CAAA;QACvB,OAAM;OACP;MAED,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAM;MAC7D,KAAK,CAAC,cAAc,EAAE,CAAA;MAEtB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;MACnD,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAA;MACjC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;MACxD,IAAI,IAAI,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AAK,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,SAAS,EACzC,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,IAAI,EACzC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,qBAAqB,GAAG,SAAS,EACpD,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,QAAQ,GAAG,SAAS,EACxC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,EAC5D,MAAM,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,EAC7C,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,UAAU,EAC/C,KAAK,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,KAAK,KAEvC,IAAI,CAAC,mBAAmB,IAE3B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,KAClD,gBACE,KAAK,EAAC,MAAM,eACD,IAAI,CAAC,IAAI,EACpB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACH,EACA,IAAI,CAAC,IAAI,CACN,EACP;GACF;;;;;;;;","names":[],"sources":["src/components/button/button.css?tag=qds-button&encapsulation=shadow","src/components/button/button.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.button {\n appearance: none;\n background-color: initial;\n border: none;\n padding-block: 0;\n align-items: center;\n border-radius: var(--qds-control-border-radius);\n cursor: pointer;\n display: inline-flex;\n gap: var(--qds-control-button-gap-internal);\n justify-content: center;\n padding-inline: var(--qds-control-button-padding-horizontal);\n print-color-adjust: exact;\n user-select: none;\n white-space: nowrap;\n width: 100%;\n\n &.icon-only {\n padding-inline: 0;\n }\n\n &:any-link {\n text-decoration: none;\n }\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\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n height: var(--qds-control-small-height);\n\n &.icon-only {\n width: var(--qds-control-small-height);\n }\n\n &.icon {\n font-size: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n height: var(--qds-control-standard-height);\n\n &.icon-only {\n width: var(--qds-control-standard-height);\n }\n\n &.icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n height: var(--qds-control-large-height);\n\n &.icon-only {\n width: var(--qds-control-large-height);\n }\n\n &.icon {\n font-size: var(--qds-control-large-icon-size);\n }\n}\n\n[data-importance='subdued'] {\n border: var(--qds-control-border-width) solid transparent;\n color: var(--qds-theme-link-default);\n\n &.icon-only {\n color: var(--qds-theme-control-text-standard);\n }\n\n &:hover {\n border: var(--qds-control-border-width) solid var(--qds-theme-link-default);\n\n &.icon-only {\n background-color: var(--qds-theme-interactive-background-hover);\n border: none;\n color: var(--qds-theme-control-text-standard);\n }\n }\n\n &:active {\n border: var(--qds-control-border-width) solid var(--qds-theme-link-pressed);\n color: var(--qds-theme-link-pressed);\n\n &.icon-only {\n background-color: var(--qds-theme-interactive-background-pressed);\n border: none;\n color: var(--qds-theme-control-text-standard);\n }\n }\n}\n\n[data-importance='standard'] {\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n color: var(--qds-theme-control-text-standard);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n background-color: var(--qds-theme-signature-color-default);\n color: var(--qds-theme-signature-color-contrast);\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[data-importance='destructive'] {\n background-color: var(--qds-theme-feedback-action-destructive-default);\n color: var(--qds-theme-feedback-action-destructive-contrast);\n\n &:hover {\n background-color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-feedback-action-destructive-pressed);\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, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\n\nexport type ButtonType = 'button' | 'reset' | 'submit'\nexport type Importance = 'destructive' | 'emphasized' | 'standard' | 'subdued'\nexport type ButtonSize = 'large' | 'small' | 'standard'\nexport type FormMethod = 'get' | 'post'\nexport type ButtonTarget = '_blank' | '_parent' | '_self' | '_top'\n\n/**\n * The `<qds-button>` element is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it then performs a programmable action, such as submitting a\n * [form](https://developer.mozilla.org/docs/Learn/Forms)\n * or opening a dialog.\n *\n * @see https://quartz.se.com/build/components/button\n */\n@Component({\n tag: 'qds-button',\n shadow: { delegatesFocus: true },\n styleUrl: 'button.css',\n})\nexport class Button 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({ reflect: true }) public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop({ reflect: true }) public readonly iconLibrary: string = 'default'\n\n /**\n * The button's importance.\n */\n @Prop({ reflect: true }) public readonly importance: Importance = 'standard'\n\n /**\n * The button's size.\n */\n @Prop({ reflect: true }) public readonly size: ButtonSize = 'standard'\n\n /**\n * The button's text.\n */\n @Prop({ mutable: true, reflect: true }) public readonly text?: string\n\n /**\n * Prevents the button 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 * Tells the browser to download the linked file as this filename. Only used\n * when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly download?: string\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the button with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<button>` is associated with\n * its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<button>` 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 URL that processes the information submitted by the button. Overrides\n * the [`action`](https://developer.mozilla.org/docs/Web/HTML/Element/button#attr-formaction)\n * attribute of the button's form owner. Does nothing if there is no form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formaction' }) public readonly formAction?: string\n\n /**\n * If the button is a submit button (it's inside/associated with a `<form>`\n * and doesn't have `type=\"button\"`), this attribute specifies the\n * [HTTP method](https://developer.mozilla.org/docs/Web/HTTP/Methods) used to\n * submit the form. Possible values:\n *\n * - `get`: The form data are appended to the form's action URL, with a ? as\n * a separator, and the resulting URL is sent to the server. Use this method\n * when the form has no side effects, like search forms.\n * - `post`: The data from the form are included in the body of the HTTP\n * request when sent to the server. Use when the form contains information\n * that shouldn't be public, like login credentials.\n *\n * If specified, this attribute overrides the method attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formmethod' }) public readonly formMethod?: FormMethod\n\n /**\n * If the button is a submit button, this attribute specifies that the form\n * is not to be\n * [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)\n * when it is submitted. If this attribute is specified, it overrides the\n * [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)\n * attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formnovalidate' })\n public readonly formNoValidate: boolean = false\n\n /**\n * If the button is a submit button, this attribute is an author-defined name\n * or standardized, underscore-prefixed keyword indicating where to display\n * the response from submitting the form. This is the `name` of, or keyword\n * for, a browsing context (a tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).\n * If this attribute is specified, it overrides the\n * [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)\n * attribute of the button's form owner. The following keywords have special\n * meanings:\n *\n * - `_blank`: Load the response into a new unnamed browsing context — usually\n * a new tab or window, depending on the user's browser settings.\n * - `_parent`: Load the response into the parent browsing context of the\n * current one. If there is no parent, this option behaves the same way as\n * `_self`.\n * - `_self`: Load the response into the same browsing context as the current\n * one.\n * - `_top`: Load the response into the top-level browsing context (that is,\n * the browsing context that is an ancestor of the current one, and has no\n * parent). If there is no parent, this option behaves the same way as\n * `_self`.\n *\n * @webnative\n */\n @Prop({ attribute: 'formtarget' })\n public readonly formTarget: LiteralUnion<ButtonTarget, string> = '_self'\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * The name of the button, submitted as a pair with the button's `value` as\n * part of the form data, when that button is used to submit the form.\n * Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly name?: 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<ButtonTarget, string> = '_self'\n\n /**\n * The type of button.\n *\n * `button`: The button has no default behavior, and does nothing when\n * pressed by default. It can have client-side scripts listen to the\n * element's events, which are triggered when the events occur.\n *\n * `submit`: The button submits the form data to the server. This is the\n * default if the attribute is not specified for buttons associated with a\n * `<form>`, or if the attribute is an empty or invalid value.\n *\n * `reset`: The button resets all the controls to their initial values.\n *\n * @webnative\n */\n @Prop() public readonly type?: ButtonType\n\n /**\n * Defines the value associated with the button's `name` when it's submitted\n * with the form data. This value is passed to the server in params when the\n * form is submitted using this button. Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly value?: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsButtonElement\n\n private inheritedAttributes: Attributes = {}\n\n private get formElement(): HTMLElement | null {\n return this.form !== undefined && this.form !== ''\n ? document.querySelector(`#${this.form}`)\n : this.element.closest('form')\n }\n\n private get buttonType(): ButtonType {\n if (this.type === undefined) return this.formElement ? 'submit' : 'button'\n return this.type\n }\n\n private get iconOnly(): boolean {\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n const hasNoLabel = this.text === undefined || this.text === ''\n\n return hasIcon && hasNoLabel\n }\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(this.inheritedAttributes.tabindex, 10)\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n\n return (\n <Tag\n aria-disabled={this.computedDisabled ? 'true' : 'false'}\n class={{\n button: true,\n 'icon-only': this.iconOnly,\n }}\n data-importance={this.importance}\n data-size={this.size}\n disabled={Tag === 'a' ? undefined : this.disabled}\n download={Tag === 'a' ? this.download : undefined}\n href={Tag === 'a' ? this.href : undefined}\n name={Tag === 'a' ? undefined : this.name}\n onBlur={this.onBlur}\n onClick={this.onClick}\n onFocus={this.onFocus}\n rel={Tag === 'a' ? 'noreferrer noopener' : undefined}\n role={Tag === 'a' ? 'button' : undefined}\n tabIndex={this.computedDisabled ? -1 : this.computedTabIndex}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.buttonType}\n value={Tag === 'a' ? undefined : this.value}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"icon\"\n data-size={this.size}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n {this.text}\n </Tag>\n )\n }\n\n private readonly onClick = (event: MouseEvent): void => {\n if (this.computedDisabled) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n\n if (this.buttonType === 'button' || !this.formElement) return\n event.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.buttonType\n if (this.name !== undefined) fakeButton.name = this.name\n if (this.value !== undefined) fakeButton.value = this.value\n if (this.formAction !== undefined) fakeButton.formAction = this.formAction\n if (this.formMethod !== undefined) fakeButton.formMethod = this.formMethod\n fakeButton.formNoValidate = this.formNoValidate\n fakeButton.formTarget = this.formTarget\n fakeButton.style.display = 'none'\n\n this.formElement.append(fakeButton)\n fakeButton.click()\n fakeButton.remove()\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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cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;AAChE,CAAC;;;;;","names":[],"sources":["src/components/button/button.css?tag=qds-button&encapsulation=shadow","src/components/button/button.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-button:disabled,\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-overflow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &[data-size='hero'] {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: normal;\n }\n}\n\n.qds-action {\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-container {\n display: grid;\n grid-template-areas: 'button';\n}\n\n.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n )\n );\n grid-area: button;\n isolation: isolate;\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n pointer-events: none;\n visibility: hidden;\n width: calc(\n 100% + var(--qds-control-border-width) -\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n );\n height: calc(\n 100% + var(--qds-control-border-width) -\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n );\n}\n\n.qds-button {\n position: relative;\n align-items: center;\n appearance: none;\n\n /* Avoid automatic minimum size on flex element: https://www.w3.org/TR/css-flexbox-1/#min-size-auto */\n min-width: 0;\n background-color: initial;\n border: none;\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n var(--qds-control-border-radius-top-right, var(--qds-control-border-radius))\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n );\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n grid-area: button;\n justify-content: center;\n outline: none;\n padding-block: 0;\n print-color-adjust: exact;\n text-align: center;\n user-select: none;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:focus-visible ~ .qds-focus-ring {\n visibility: visible;\n }\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-indicator {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-button {\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n padding-inline: var(--qds-control-button-small-padding-horizontal);\n\n &.qds-icon-only {\n width: var(--qds-control-small-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-button {\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n padding-inline: var(--qds-control-button-standard-padding-horizontal);\n\n &.qds-icon-only {\n width: var(--qds-control-standard-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-button {\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n padding-inline: var(--qds-control-button-large-padding-horizontal);\n\n &.qds-icon-only {\n width: var(--qds-control-large-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n}\n\n[data-size='small'],\n[data-size='standard'],\n[data-size='large'] {\n line-height: normal;\n\n &.qds-button.qds-icon-only {\n padding-inline: 0;\n }\n}\n\n[data-size='hero'] {\n font: var(--qds-control-hero-text);\n\n &.qds-button {\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-hero-border-radius)\n );\n gap: var(--qds-control-hero-gap-internal);\n padding-block: var(--qds-control-hero-padding-auto-height);\n padding-inline: var(--qds-control-button-hero-padding-horizontal);\n\n &.qds-icon-only {\n height: var(--qds-control-hero-height);\n padding-inline: 0;\n width: var(--qds-control-hero-height);\n }\n }\n\n &.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-hero-border-radius)\n )\n );\n }\n\n &.qds-icon {\n font-size: var(--qds-control-hero-icon-size);\n }\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-standard-default);\n\n &.qds-button {\n border-block-end: var(--qds-control-border-width) solid transparent;\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:not(.qds-icon-only) {\n border-radius: 0;\n }\n\n &.qds-icon-only {\n border: none;\n color: var(--qds-theme-control-text-standard);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-control-text-standard);\n\n &.qds-button {\n border-color: var(--qds-theme-control-border);\n border-style: solid;\n border-width: var(--qds-control-border-width)\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n var(--qds-control-border-width);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-button {\n background-color: var(--qds-theme-signature-color-default);\n color: var(--qds-theme-signature-color-contrast);\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[data-importance='destructive'] {\n &.qds-button {\n background-color: var(--qds-theme-feedback-action-destructive-default);\n color: var(--qds-theme-feedback-action-destructive-contrast);\n\n &:hover {\n background-color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n}\n\n[data-importance='subdued-destructive'] {\n color: var(--qds-theme-feedback-action-destructive-default);\n\n &.qds-button {\n border-block-end: var(--qds-control-border-width) solid transparent;\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-feedback-action-destructive-hover);\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-feedback-action-destructive-pressed);\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n\n &:not(.qds-icon-only) {\n border-radius: 0;\n }\n\n &.qds-icon-only {\n border: none;\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n }\n }\n}\n\n:is([data-action='dropdown'], [data-action='dropdown-close']) {\n .qds-action {\n margin-inline-start: auto;\n transition-duration: 0.3s;\n transition-property: transform;\n }\n\n &[data-importance='standard'] {\n background-color: var(--qds-theme-control-input-background);\n }\n\n &:not([data-importance='subdued'], [data-importance='subdued-destructive']) {\n padding-inline: var(--qds-control-input-padding-horizontal);\n }\n}\n\n[data-action='dropdown-close'] .qds-action {\n transform: rotate(-180deg);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { isOverflowing, pickFocusEventAttributes } from '../../helpers'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Importance, Size } from '../shared'\n\nexport type Action = 'dropdown-close' | 'dropdown' | 'next'\nexport type ButtonImportance =\n | Importance\n | 'destructive'\n | 'subdued-destructive'\nexport type ButtonSize = Size | 'hero'\nexport type ButtonTarget = '_blank' | '_parent' | '_self' | '_top'\nexport type ButtonType = 'button' | 'reset' | 'submit'\nexport type FormMethod = 'dialog' | 'get' | 'post'\n\nconst isCounter = (value: unknown): value is number =>\n typeof value === 'string'\n ? !Number.isNaN(Number.parseFloat(value))\n : typeof value === 'number'\n\nconst isIndicator = (value: unknown): value is '' | true =>\n value === '' || value === true\n\n/**\n * The `<qds-button>` element is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it then performs a programmable action, such as submitting a\n * [form](https://developer.mozilla.org/docs/Learn/Forms)\n * or opening a dialog.\n *\n * @see https://quartz.se.com/build/components/button\n */\n@Component({\n tag: 'qds-button',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'button.css',\n})\nexport class Button implements ComponentInterface {\n /**\n * The name of the action icon to render.\n */\n @Prop() public readonly action?: Action\n\n /**\n * Displays an indicator if `true` or the empty string. Otherwise, displays a\n * counter badge if a number or string representing a number is used.\n *\n * @webnative\n */\n @Prop() public readonly badge?: number | string | true\n\n /**\n * The indicator or counter badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n /**\n * The indicator's status.\n */\n @Prop()\n public readonly badgeIndicatorStatus?: HTMLQdsBadgeIndicatorElement['status'] =\n 'neutral'\n\n /**\n * 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 button's importance.\n */\n @Prop() public readonly importance?: ButtonImportance = 'standard'\n\n /**\n * The button's size.\n */\n @Prop() public readonly size?: Size | 'hero' = 'standard'\n\n /**\n * The button's text.\n */\n @Prop() public readonly text!: string\n\n /**\n * Sets if button is icon only.\n */\n @Prop() public readonly iconOnly: boolean = false\n\n /**\n * Prevents the button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\n\n /**\n * Tells the browser to download the linked file as this filename. Only used\n * when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly download?: string\n\n /**\n * The [`<form>`][] element to associate the button with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-button>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-button>` 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 * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * The URL that processes the information submitted by the button. Overrides\n * the [`action`](https://developer.mozilla.org/docs/Web/HTML/Element/button#attr-formaction)\n * attribute of the button's form owner. Does nothing if there is no form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formaction' }) public readonly formAction?: string\n\n /**\n * If the button is a submit button (it's inside/associated with a `<form>`\n * and doesn't have `type=\"button\"`), this attribute specifies the\n * [HTTP method][] used to submit the form, or `dialog` which won't submit\n * the form. Possible values:\n *\n * - `get`: The form data are appended to the form's action URL, with a ? as\n * a separator, and the resulting URL is sent to the server. Use this method\n * when the form has no side effects, like search forms.\n * - `post`: The data from the form are included in the body of the HTTP\n * request when sent to the server. Use when the form contains information\n * that shouldn't be public, like login credentials.\n * - `dialog`: Close the dialog box in which the button finds itself, if any,\n * and do not submit the button's form owner.\n *\n * If specified, this attribute overrides the `method` attribute of the\n * button's form owner.\n *\n * [HTTP method]: https://developer.mozilla.org/docs/Web/HTTP/Methods\n *\n * @webnative\n */\n @Prop({ attribute: 'formmethod' }) public readonly formMethod?: FormMethod\n\n /**\n * If the button is a submit button, this attribute specifies that the form\n * is not to be\n * [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)\n * when it is submitted. If this attribute is specified, it overrides the\n * [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)\n * attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formnovalidate' })\n public readonly formNoValidate: boolean = false\n\n /**\n * If the button is a submit button, this attribute is an author-defined name\n * or standardized, underscore-prefixed keyword indicating where to display\n * the response from submitting the form. This is the `name` of, or keyword\n * for, a browsing context (a tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).\n * If this attribute is specified, it overrides the\n * [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)\n * attribute of the button's form owner. The following keywords have special\n * meanings:\n *\n * - `_blank`: Load the response into a new unnamed browsing context — usually\n * a new tab or window, depending on the user's browser settings.\n * - `_parent`: Load the response into the parent browsing context of the\n * current one. If there is no parent, this option behaves the same way as\n * `_self`.\n * - `_self`: Load the response into the same browsing context as the current\n * one.\n * - `_top`: Load the response into the top-level browsing context (that is,\n * the browsing context that is an ancestor of the current one, and has no\n * parent). If there is no parent, this option behaves the same way as\n * `_self`.\n *\n * @webnative\n */\n @Prop({ attribute: 'formtarget' })\n public readonly formTarget: LiteralUnion<ButtonTarget, string> = '_self'\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Returns a list of the [`<label>`][] elements associated with the\n * `qds-button` element.\n *\n * [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly labels: ElementInternals['labels'] =\n {} as ElementInternals['labels']\n\n /**\n * When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string = 'noopener'\n\n /**\n * The name of the button, submitted as a pair with the button's `value` as\n * part of the form data, when that button is used to submit the form.\n * Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly name?: 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<ButtonTarget, string>\n\n /**\n * The type of button.\n *\n * `button`: The button has no default behavior, and does nothing when\n * pressed by default. It can have client-side scripts listen to the\n * element's events, which are triggered when the events occur.\n *\n * `submit`: The button submits the form data to the server. This is the\n * default if the attribute is not specified for buttons associated with a\n * `<form>`, or if the attribute is an empty or invalid value.\n *\n * `reset`: The button resets all the controls to their initial values.\n *\n * @webnative\n */\n @Prop() public readonly type?: ButtonType\n\n /**\n * The error message that would be shown to the user if the `<qds-button>`\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-button>`.\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 * Defines the value associated with the button's `name` when it's submitted\n * with the form data. This value is passed to the server in params when the\n * form is submitted using this button. Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly value?: string\n\n /**\n * True if `<qds-button>` will be validated when the form is submitted; false\n * otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLQdsButtonElement\n\n @State() private tabIndex?: number\n\n @State() private tooltip = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #button?: HTMLAnchorElement | HTMLButtonElement\n\n #span?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n get #buttonType(): ButtonType {\n if (this.type === undefined)\n return this.internals.form ? 'submit' : 'button'\n return this.type\n }\n\n get #iconOnly(): boolean {\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n\n return hasIcon && this.iconOnly\n }\n\n get #computedAction(): Action | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'dropdown-close':\n case 'next': {\n return this.action\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedActionIcon(): Exclude<Action, 'dropdown-close'> | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'next': {\n return this.action\n }\n case 'dropdown-close': {\n return 'dropdown'\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #computedImportance(): ButtonImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive':\n case 'subdued-destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): ButtonSize {\n switch (this.size) {\n case 'small':\n case 'large':\n case 'hero': {\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.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.#buttonType === 'button' || !this.internals.form) return\n if (this.#buttonType === 'reset') {\n this.internals.form.reset()\n } else {\n this.internals.form.requestSubmit()\n }\n event.preventDefault()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\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('text')\n protected textChanged(): void {\n this.internals.ariaLabel = this.text\n\n if (this.#ro) this.#ro.disconnect()\n if (!this.#span) return\n\n this.tooltip = isOverflowing(this.#span)\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isOverflowing(spanEntry.target)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'button'\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n this.#defineGetter('labels', () => this.internals.labels)\n\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\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 const Tag = this.href === undefined ? 'button' : 'a'\n const disabledTabIndex = Tag === 'a' ? -1 : undefined\n const hasBadgeProperties =\n this.badgeDescription !== undefined && this.badge !== undefined\n const ariaLabel = hasBadgeProperties\n ? `${this.text} ${this.badge} ${this.badgeDescription}`\n : this.text\n\n return (\n <div class=\"qds-container\">\n <Tag\n aria-hidden=\"true\"\n class={{\n 'qds-button': true,\n 'qds-disabled': Tag === 'a' ? this.#computedDisabled : false,\n 'qds-icon-only': this.#iconOnly,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-action={this.#computedAction}\n disabled={Tag === 'a' ? undefined : this.disabled}\n download={Tag === 'a' ? this.download : undefined}\n formAction={this.formAction}\n formMethod={this.formMethod}\n formNoValidate={this.formNoValidate}\n formTarget={this.formTarget}\n href={Tag === 'a' ? this.href : undefined}\n name={Tag === 'a' ? undefined : this.name}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n ref={this.#buttonRef}\n rel={Tag === 'a' ? this.rel : undefined}\n tabIndex={this.#computedDisabled ? disabledTabIndex : this.tabIndex}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.#buttonType}\n value={Tag === 'a' ? undefined : this.value}\n aria-label={this.#iconOnly ? ariaLabel : undefined}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\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 {!this.#iconOnly && (\n <span\n class=\"qds-overflow\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n )}\n {isIndicator(this.badge) && (\n <qds-badge-indicator\n class=\"qds-indicator\"\n status={this.badgeIndicatorStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )}\n {isCounter(this.badge) && (\n <qds-badge-counter\n class={{\n 'qds-indicator': this.#iconOnly,\n }}\n description={this.badgeDescription}\n importance={this.#computedImportance}\n size={this.#computedSize}\n strokeRing\n value={this.badge}\n />\n )}\n {this.#computedActionIcon !== undefined && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon qds-action\"\n data-size={this.#computedSize}\n library=\"core\"\n name={this.#computedActionIcon}\n />\n )}\n </Tag>\n <div\n class={{\n 'qds-focus-ring': true,\n 'qds-icon-only': this.#iconOnly,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n />\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\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: HTMLButtonElement['setCustomValidity'] = (\n error,\n ) => {\n if (error)\n this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.#button)\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 readonly #buttonRef = (\n button?: HTMLAnchorElement | HTMLButtonElement,\n ): void => {\n this.#button = button\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.#button\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
@@ -1,111 +1,219 @@
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, a as invariant, 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 checkboxCss = ".sc-qds-checkbox-h{box-sizing:border-box}[hidden].sc-qds-checkbox-h{display:none !important}.sc-qds-checkbox-h *.sc-qds-checkbox,.sc-qds-checkbox-h *.sc-qds-checkbox::before,.sc-qds-checkbox-h *.sc-qds-checkbox::after{box-sizing:inherit}.sc-qds-checkbox-h{display:inline-block;line-height:0}.icon.sc-qds-checkbox{display:none;color:var(--qds-theme-signature-color-contrast);inset-inline-start:0;pointer-events:none;position:absolute}.label.sc-qds-checkbox{cursor:pointer;display:inline-flex;position:relative}.checkbox.sc-qds-checkbox{align-items:center;-webkit-appearance:none;appearance:none;background-color:var(--qds-theme-control-input-background);border-radius:var(--qds-control-border-radius);border:var(--qds-control-border-width) solid var(--qds-theme-control-border);cursor:pointer;display:flex;flex-shrink:0;justify-content:center;margin:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}.checkbox.sc-qds-checkbox:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.checkbox.sc-qds-checkbox::before{content:'';height:10px;position:absolute;width:10px}.checkbox.sc-qds-checkbox:hover::before{box-shadow:inset 1em 1em var(--qds-theme-signature-color-hover)}.checkbox.sc-qds-checkbox:active::before{box-shadow:inset 1em 1em var(--qds-theme-signature-color-pressed)}.checkbox.sc-qds-checkbox:checked~.checked.sc-qds-checkbox,.checkbox.sc-qds-checkbox:indeterminate~.indeterminate.sc-qds-checkbox{display:inline-block}.checkbox.sc-qds-checkbox:checked,.checkbox.sc-qds-checkbox:indeterminate{background-color:var(--qds-theme-signature-color-default);border-color:transparent}.checkbox.sc-qds-checkbox:checked:hover,.checkbox.sc-qds-checkbox:indeterminate:hover{background-color:var(--qds-theme-signature-color-hover)}.checkbox.sc-qds-checkbox:checked:active,.checkbox.sc-qds-checkbox:indeterminate:active{background-color:var(--qds-theme-signature-color-pressed)}[aria-disabled='true'].sc-qds-checkbox{opacity:var(--qds-theme-disabled);pointer-events:none}.icon[data-size='small'].sc-qds-checkbox,.checkbox[data-size='small'].sc-qds-checkbox{width:var(--qds-control-small-icon-size);height:var(--qds-control-small-icon-size)}.inline[data-size='small'].sc-qds-checkbox{margin-block:var(--qds-control-small-padding-auto-height)}.label[data-size='small'].sc-qds-checkbox{gap:var(--qds-control-small-gap-siblings-related)}.icon[data-size='standard'].sc-qds-checkbox,.checkbox[data-size='standard'].sc-qds-checkbox{width:var(--qds-control-standard-icon-size);height:var(--qds-control-standard-icon-size)}.inline[data-size='standard'].sc-qds-checkbox{margin-block:var(--qds-control-standard-padding-auto-height)}.label[data-size='standard'].sc-qds-checkbox{gap:var(--qds-control-standard-gap-siblings-related)}.icon[data-size='large'].sc-qds-checkbox,.checkbox[data-size='large'].sc-qds-checkbox{width:var(--qds-control-large-icon-size);height:var(--qds-control-large-icon-size)}.inline[data-size='large'].sc-qds-checkbox{margin-block:var(--qds-control-large-padding-auto-height)}.label[data-size='large'].sc-qds-checkbox{gap:var(--qds-control-large-gap-siblings-related)}";
10
+ const checkboxCss = ":host([hidden]){display:none!important}:host{display:inline-block;line-height:0}.qds-box,.qds-checkbox,.qds-icon{grid-area:f;place-self:center}.qds-box,.qds-icon{display:none;pointer-events:none}.qds-box{border-radius:var(--qds-control-toggle-indicator-border-radius)}.qds-container{align-self:flex-start;display:grid;grid-template-areas:\"f\"}.qds-icon{color:var(--qds-theme-signature-color-contrast)}.qds-label{cursor:pointer;display:inline-flex}.qds-checkbox{-webkit-appearance:none;appearance:none;background-color:var(--qds-theme-control-input-background);border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius);cursor:pointer;margin:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}.qds-checkbox:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-checkbox:active~.qds-box,.qds-checkbox:hover~.qds-box{display:block}.qds-checkbox:hover~.qds-box{background-color:var(--qds-theme-signature-color-hover)}.qds-checkbox:active~.qds-box{background-color:var(--qds-theme-signature-color-pressed)}.qds-checkbox:checked~.qds-checked,.qds-checkbox:indeterminate~.qds-indeterminate{display:block}.qds-checkbox:checked,.qds-checkbox:indeterminate{background-color:var(--qds-theme-signature-color-default);border-color:#0000}.qds-checkbox:checked:hover,.qds-checkbox:indeterminate:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-checkbox:checked:active,.qds-checkbox:indeterminate:active{background-color:var(--qds-theme-signature-color-pressed)}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-checkbox[data-size=small]{height:var(--qds-control-toggle-box-small-size);width:var(--qds-control-toggle-box-small-size)}.qds-icon[data-size=small]{font-size:var(--qds-control-small-icon-size)}.qds-box[data-size=small]{height:var(--qds-control-toggle-indicator-small-size);width:var(--qds-control-toggle-indicator-small-size)}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height)}.qds-label[data-size=small]{gap:var(--qds-control-small-gap-siblings-related)}.qds-checkbox[data-size=standard]{height:var(--qds-control-toggle-box-standard-size);width:var(--qds-control-toggle-box-standard-size)}.qds-icon[data-size=standard]{font-size:var(--qds-control-standard-icon-size)}.qds-box[data-size=standard]{height:var(--qds-control-toggle-indicator-standard-size);width:var(--qds-control-toggle-indicator-standard-size)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height)}.qds-label[data-size=standard]{gap:var(--qds-control-standard-gap-siblings-related)}.qds-checkbox[data-size=large]{height:var(--qds-control-toggle-box-large-size);width:var(--qds-control-toggle-box-large-size)}.qds-icon[data-size=large]{font-size:var(--qds-control-large-icon-size)}.qds-box[data-size=large]{height:var(--qds-control-toggle-indicator-large-size);width:var(--qds-control-toggle-indicator-large-size)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height)}.qds-label[data-size=large]{gap:var(--qds-control-large-gap-siblings-related)}";
11
+ const QdsCheckboxStyle0 = checkboxCss;
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 __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
24
+ if (kind === "m")
25
+ throw new TypeError("Private method is not writable");
26
+ if (kind === "a" && !f)
27
+ throw new TypeError("Private accessor was defined without a setter");
28
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
29
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
30
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
31
+ };
32
+ var _Checkbox_instances, _Checkbox_inheritedAttributes, _Checkbox_computedChecked_get, _Checkbox_computedDisabled_get, _Checkbox_computedIndeterminate_get, _Checkbox_computedSize_get, _Checkbox_computedValue_get, _Checkbox_hasText_get, _Checkbox_onBlur, _Checkbox_onFocus, _Checkbox_defineGetter;
12
33
  const Checkbox = 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.ref = (checkbox) => {
20
- this.input = checkbox;
21
- };
22
- this.onBlur = (event) => {
23
- this.blurEmitter.emit(pickFocusEventAttributes(event));
24
- };
25
- this.onFocus = (event) => {
26
- this.focusEmitter.emit(pickFocusEventAttributes(event));
27
- };
28
- this.inline = false;
29
- this.size = 'standard';
30
- this.text = undefined;
31
- this.autoFocus = undefined;
32
- this.checked = undefined;
33
- this.disabled = undefined;
34
- this.form = undefined;
35
- this.indeterminate = undefined;
36
- this.name = `qds-checkbox-${autoIncrementingId}`;
37
- this.required = undefined;
38
- this.value = undefined;
39
- }
40
- get computedDisabled() {
41
- return this.disabled ?? false;
42
- }
43
- get computedIndeterminate() {
34
+ constructor(hostRef) {
35
+ registerInstance(this, hostRef);
36
+ this.blurEmitter = createEvent(this, "qdsBlur", 2);
37
+ this.changeEmitter = createEvent(this, "qdsChange", 6);
38
+ this.focusEmitter = createEvent(this, "qdsFocus", 2);
39
+ if (hostRef.$hostElement$["s-ei"]) {
40
+ this.internals = hostRef.$hostElement$["s-ei"];
41
+ }
42
+ else {
43
+ this.internals = hostRef.$hostElement$.attachInternals();
44
+ hostRef.$hostElement$["s-ei"] = this.internals;
45
+ }
46
+ _Checkbox_instances.add(this);
47
+ /**
48
+ * Adds vertical margin to the checkbox for alignment.
49
+ *
50
+ * This is useful when creating inline layouts so that the first lines have
51
+ * the correct vertical centering.
52
+ */
53
+ this.inline = false;
54
+ /**
55
+ * The checkbox's size.
56
+ */
57
+ this.size = 'standard';
58
+ /**
59
+ * The [`<form>`][] element to associate the checkbox with (its form owner).
60
+ *
61
+ * The value of this attribute must be the id of a `<form>` in the same
62
+ * document. If this attribute is not set, the `<qds-checkbox>` is associated
63
+ * with its ancestor `<form>` element, if any.
64
+ *
65
+ * This attribute lets you associate `<qds-checkbox>` elements to `<form>`s
66
+ * anywhere in the document, not just inside a `<form>`. It can also override
67
+ * an ancestor `<form>` element.
68
+ *
69
+ * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form
70
+ *
71
+ * @readonly
72
+ * @webnative
73
+ */
74
+ // eslint-disable-next-line unicorn/no-null
75
+ this.form = null;
76
+ /**
77
+ * The error message that would be shown to the user if the `<qds-checkbox>`
78
+ * was to be checked for validity.
79
+ *
80
+ * @readonly
81
+ * @webnative
82
+ */
83
+ this.validationMessage = '';
84
+ /**
85
+ * The [`ValidityState`][] object for this `<qds-checkbox>`.
86
+ *
87
+ * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState
88
+ *
89
+ * @readonly
90
+ * @webnative
91
+ */
92
+ this.validity = VALID_STATE;
93
+ /**
94
+ * The value of the checkbox, submitted as a name/value pair with form data.
95
+ *
96
+ * @webnative
97
+ */
98
+ this.value = 'on';
99
+ /**
100
+ * True if `<qds-checkbox>` will be validated when the form is submitted;
101
+ * false otherwise.
102
+ *
103
+ * @readonly
104
+ * @webnative
105
+ */
106
+ this.willValidate = false;
107
+ _Checkbox_inheritedAttributes.set(this, {});
108
+ this.checkValidity = () => this.internals.checkValidity();
109
+ this.reportValidity = () => this.internals.reportValidity();
110
+ this.setCustomValidity = (error) => {
111
+ if (error)
112
+ this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host);
113
+ else
114
+ this.internals.setValidity(NO_ERROR_FLAGS);
115
+ };
116
+ _Checkbox_onBlur.set(this, (event) => {
117
+ this.blurEmitter.emit(pickFocusEventAttributes(event));
118
+ });
119
+ _Checkbox_onFocus.set(this, (event) => {
120
+ this.focusEmitter.emit(pickFocusEventAttributes(event));
121
+ });
122
+ }
123
+ onClick(event) {
124
+ if (__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get)) {
125
+ event.stopImmediatePropagation();
126
+ return;
127
+ }
128
+ event.preventDefault();
129
+ this.checked = __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedIndeterminate_get) ? true : !__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedChecked_get);
130
+ this.changeEmitter.emit();
131
+ this.indeterminate = false;
132
+ }
133
+ checkedChanged() {
134
+ this.internals.setFormValue(__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedChecked_get) && !__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get)
135
+ ? __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedValue_get)
136
+ : // eslint-disable-next-line unicorn/no-null
137
+ null);
138
+ }
139
+ disabledChanged() {
140
+ if (__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedChecked_get) && !__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get))
141
+ this.internals.setFormValue(__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedValue_get));
142
+ // eslint-disable-next-line unicorn/no-null
143
+ else
144
+ this.internals.setFormValue(null);
145
+ }
146
+ tabindexChanged(newValue) {
147
+ const parsedValue = Number.parseInt(newValue, 10);
148
+ this.tabIndex =
149
+ parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue;
150
+ }
151
+ valueChanged() {
152
+ if (__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedChecked_get) && !__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get))
153
+ this.internals.setFormValue(__classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedValue_get));
154
+ }
155
+ componentWillLoad() {
156
+ this.valueChanged();
157
+ __classPrivateFieldGet(this, _Checkbox_instances, "m", _Checkbox_defineGetter).call(this, 'form', () => this.internals.form);
158
+ __classPrivateFieldGet(this, _Checkbox_instances, "m", _Checkbox_defineGetter).call(this, 'willValidate', () => this.internals.willValidate);
159
+ __classPrivateFieldGet(this, _Checkbox_instances, "m", _Checkbox_defineGetter).call(this, 'validity', () => this.internals.validity);
160
+ __classPrivateFieldGet(this, _Checkbox_instances, "m", _Checkbox_defineGetter).call(this, 'validationMessage', () => this.internals.validationMessage);
161
+ __classPrivateFieldSet(this, _Checkbox_inheritedAttributes, inheritAriaAttributes(this.host), "f");
162
+ this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0');
163
+ }
164
+ render() {
165
+ return (
166
+ // eslint-disable-next-line jsx-a11y/label-has-associated-control
167
+ h("label", { key: '15ceed36f1cab0a68c0a156ef3324943658bd6c0', "aria-disabled": __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get) ? 'true' : undefined, class: {
168
+ 'qds-inline': this.inline,
169
+ 'qds-label': true,
170
+ }, "data-size": __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedSize_get) }, h("div", { key: 'f08682656e01bba90296e992e60e10d2b6a5d6a9', class: "qds-container" }, h("input", { key: '505e5c9fa829f82c7d4cd3a6d9fd9ef32b7c2706',
171
+ // eslint-disable-next-line jsx-a11y/no-autofocus
172
+ autoFocus: this.host.autofocus, checked: __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedIndeterminate_get) ? false : this.checked, class: "qds-checkbox", "data-size": __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedSize_get), disabled: __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get), indeterminate: this.indeterminate, onBlur: __classPrivateFieldGet(this, _Checkbox_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Checkbox_onFocus, "f"), required: this.required, tabIndex: __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedDisabled_get) ? undefined : this.tabIndex, type: "checkbox", ...__classPrivateFieldGet(this, _Checkbox_inheritedAttributes, "f") }), h("qds-icon", { key: 'f6b89a9aa715138e08867252d899da135a2be4d1', "aria-hidden": "true", class: {
173
+ 'qds-icon': true,
174
+ 'qds-checked': true,
175
+ }, "data-size": __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedSize_get), library: "core", name: "checked" }), h("div", { key: 'ea3bf1f7c463e0503072df69504b3d36400964c2', class: "qds-box", "data-size": __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedSize_get) }), h("qds-icon", { key: '4ec05ce461af2c4e1d17a2536aa392c6c99c5996', "aria-hidden": "true", class: {
176
+ 'qds-icon': true,
177
+ 'qds-indeterminate': true,
178
+ }, "data-size": __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_computedSize_get), library: "core", name: "indeterminate" })), __classPrivateFieldGet(this, _Checkbox_instances, "a", _Checkbox_hasText_get) && (h("qds-label", { key: 'b147b3d0e47395032217b52763adef01ed70e144', required: this.required, size: this.size, text: this.text }))));
179
+ }
180
+ static get delegatesFocus() { return true; }
181
+ static get formAssociated() { return true; }
182
+ get host() { return getElement(this); }
183
+ static get watchers() { return {
184
+ "checked": ["checkedChanged"],
185
+ "disabled": ["disabledChanged"],
186
+ "tabindex": ["tabindexChanged"],
187
+ "value": ["valueChanged"]
188
+ }; }
189
+ };
190
+ _Checkbox_inheritedAttributes = new WeakMap(), _Checkbox_onBlur = new WeakMap(), _Checkbox_onFocus = new WeakMap(), _Checkbox_instances = new WeakSet(), _Checkbox_computedChecked_get = function _Checkbox_computedChecked_get() {
191
+ return this.checked ?? false;
192
+ }, _Checkbox_computedDisabled_get = function _Checkbox_computedDisabled_get() {
193
+ return ((this.host.matches(':disabled') || (this.disabled ?? false)) &&
194
+ this.host.getAttribute('disabled') !== 'false');
195
+ }, _Checkbox_computedIndeterminate_get = function _Checkbox_computedIndeterminate_get() {
44
196
  return this.indeterminate ?? false;
45
- }
46
- get hasText() {
197
+ }, _Checkbox_computedSize_get = function _Checkbox_computedSize_get() {
198
+ switch (this.size) {
199
+ case 'standard':
200
+ case 'small':
201
+ case 'large': {
202
+ return this.size;
203
+ }
204
+ default: {
205
+ return 'standard';
206
+ }
207
+ }
208
+ }, _Checkbox_computedValue_get = function _Checkbox_computedValue_get() {
209
+ // eslint-disable-next-line unicorn/no-null
210
+ return this.value == null ? null : this.value.toString();
211
+ }, _Checkbox_hasText_get = function _Checkbox_hasText_get() {
47
212
  return ((this.text !== undefined && this.text !== '') || this.required === true);
48
- }
49
- /**
50
- * Returns whether a form will validate this checkbox when it is submitted
51
- * without having to submit it.
52
- */
53
- async checkValidity() {
54
- invariant(this.input);
55
- return this.input.checkValidity();
56
- }
57
- /**
58
- * Returns true if the checkbox's value passes validity checks; otherwise,
59
- * returns false, and (if the event isn't canceled) reports the problem to
60
- * the user.
61
- */
62
- async reportValidity() {
63
- invariant(this.input);
64
- return this.input.reportValidity();
65
- }
66
- /**
67
- * Sets a custom validity message for the checkbox. If this message is not the
68
- * empty string, then the checkbox is considered invalid.
69
- */
70
- async setCustomValidity(message) {
71
- invariant(this.input);
72
- this.input.setCustomValidity(message);
73
- }
74
- onClick(event) {
75
- if (this.computedDisabled)
76
- return;
77
- event.preventDefault();
78
- this.checked = this.computedIndeterminate ? true : !(this.checked ?? false);
79
- this.changeEmitter.emit();
80
- this.indeterminate = false;
81
- }
82
- componentWillLoad() {
83
- autoIncrementingId += 1;
84
- this.inheritedAttributes = {
85
- ...inheritAriaAttributes(this.element),
86
- ...inheritAttributes(this.element, ['tabindex']),
87
- };
88
- }
89
- render() {
90
- return (
91
- // eslint-disable-next-line jsx-a11y/label-has-associated-control
92
- h("label", { "aria-disabled": this.computedDisabled ? 'true' : 'false', class: {
93
- inline: this.inline,
94
- label: true,
95
- }, "data-size": this.size }, h("input", {
96
- // eslint-disable-next-line jsx-a11y/no-autofocus
97
- autoFocus: this.autoFocus, checked: this.computedIndeterminate ? false : this.checked, class: "checkbox", "data-size": this.size, disabled: this.disabled, form: this.form, indeterminate: this.indeterminate, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, ref: this.ref, required: this.required, type: "checkbox", value: this.value ?? undefined, ...this.inheritedAttributes
98
- }), h("qds-icon", { "aria-hidden": "true", class: {
99
- icon: true,
100
- checked: true,
101
- }, "data-size": this.size, library: "core", name: "checked" }), h("qds-icon", { "aria-hidden": "true", class: {
102
- icon: true,
103
- indeterminate: true,
104
- }, "data-size": this.size, library: "core", name: "indeterminate" }), this.hasText && (h("qds-label", { required: this.required, size: this.size, text: this.text }))));
105
- }
106
- get element() { return getElement(this); }
213
+ }, _Checkbox_defineGetter = function _Checkbox_defineGetter(p, get) {
214
+ Object.defineProperty(this.host, p, { enumerable: true, get });
107
215
  };
108
- Checkbox.style = checkboxCss;
216
+ Checkbox.style = QdsCheckboxStyle0;
109
217
 
110
218
  export { Checkbox as qds_checkbox };
111
219
 
@@ -1 +1 @@
1
- {"file":"qds-checkbox.entry.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,+lGAA+lG;;AC0BnnG,IAAI,kBAAkB,GAAG,CAAC,CAAA;MAcb,QAAQ;;;;;;IAmHX,wBAAmB,GAAe,EAAE,CAAA;IAoI3B,QAAG,GAAG,CAAC,QAA2B;MACjD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAA;KACtB,CAAA;IAEgB,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;kBA1PyC,KAAK;gBAKe,UAAU;;;;;;;gBA4DzC,gBAAgB,kBAAkB,EAAE;;;;EA+CnE,IAAY,gBAAgB;IAC1B,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAA;GAC9B;EAED,IAAY,qBAAqB;IAC/B,OAAO,IAAI,CAAC,aAAa,IAAI,KAAK,CAAA;GACnC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AC,MAAM;QACnB,KAAK,EAAE,IAAI;OACZ,eACU,IAAI,CAAC,IAAI,IAEpB;;MAEE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,OAAO,EAAE,IAAI,CAAC,qBAAqB,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,EAC1D,KAAK,EAAC,UAAU,eACL,IAAI,CAAC,IAAI,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,KAE1B,IAAI,CAAC,mBAAmB;MAC5B,EACF,+BACc,MAAM,EAClB,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;OACd,eACU,IAAI,CAAC,IAAI,EACpB,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,SAAS,GACd,EACF,+BACc,MAAM,EAClB,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,IAAI;OACpB,eACU,IAAI,CAAC,IAAI,EACpB,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,eAAe,GACpB,EACD,IAAI,CAAC,OAAO,KACX,iBACE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,GACf,CACH,CACK,EACT;GACF;;;;;;;","names":[],"sources":["src/components/checkbox/checkbox.css?tag=qds-checkbox&encapsulation=scoped","src/components/checkbox/checkbox.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 line-height: 0;\n}\n\n.icon {\n display: none;\n color: var(--qds-theme-signature-color-contrast);\n inset-inline-start: 0;\n pointer-events: none;\n position: absolute;\n}\n\n.label {\n cursor: pointer;\n display: inline-flex;\n position: relative;\n}\n\n.checkbox {\n align-items: center;\n appearance: none;\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n margin: 0;\n print-color-adjust: exact;\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 &::before {\n content: '';\n height: 10px;\n position: absolute;\n width: 10px;\n }\n\n &:hover::before {\n box-shadow: inset 1em 1em var(--qds-theme-signature-color-hover);\n }\n\n &:active::before {\n box-shadow: inset 1em 1em var(--qds-theme-signature-color-pressed);\n }\n\n &:checked ~ .checked,\n &:indeterminate ~ .indeterminate {\n display: inline-block;\n }\n\n &:checked,\n &:indeterminate {\n background-color: var(--qds-theme-signature-color-default);\n border-color: transparent;\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[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &:is(.icon, .checkbox) {\n width: var(--qds-control-small-icon-size);\n height: 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\n[data-size='standard'] {\n &:is(.icon, .checkbox) {\n width: var(--qds-control-standard-icon-size);\n height: 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\n[data-size='large'] {\n &:is(.icon, .checkbox) {\n width: var(--qds-control-large-icon-size);\n height: 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","// SPDX-FileCopyrightText: © 2023 Schneider Electric\n//\n// SPDX-License-Identifier: LGPL-2.1-only\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n Component,\n Element,\n Event,\n h,\n Listen,\n Method,\n Prop,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n invariant,\n pickFocusEventAttributes,\n} from '../../helpers'\n\nexport type CheckboxValue = number | string | null\nexport type CheckboxSize = 'large' | 'small' | 'standard'\n\nlet autoIncrementingId = 1\n\n/**\n * `<qds-checkbox>` elements are rendered as boxes that are checked (ticked)\n * when activated, like you might see in an official government paper form. A\n * checkbox allows you to select single values for submission in a form (or not).\n *\n * @see https://quartz.se.com/build/components/checkbox\n */\n@Component({\n tag: 'qds-checkbox',\n scoped: true,\n styleUrl: 'checkbox.css',\n})\nexport class Checkbox implements ComponentInterface {\n /**\n * Adds vertical margin to the checkbox 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 checkbox's size.\n */\n @Prop({ reflect: true }) public readonly size: CheckboxSize = 'standard'\n\n /**\n * The checkbox's text.\n */\n @Prop({ mutable: true, reflect: true }) public readonly text?: string\n\n /**\n * Specify whether the checkbox should have focus when the page loads.\n *\n * @webnative\n */\n @Prop({ attribute: 'autofocus' }) public readonly autoFocus?: boolean\n\n /**\n * Sets the checkbox's state.\n *\n * @webnative\n */\n @Prop({ mutable: true, reflect: true }) public checked?: boolean\n\n /**\n * Prevents the checkbox 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 checkbox 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-checkbox>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This property lets you associate `<qds-checkbox>` 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 * Sets the checkbox to an indeterminate state. This is usually applied to\n * checkboxes that represents a \"select all/none\" behavior when associated\n * checkboxes have a mix of checked and unchecked states.\n *\n * @webnative\n */\n @Prop({ mutable: true, reflect: true }) public indeterminate?: boolean\n\n /**\n * The name of the checkbox, 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-checkbox-${autoIncrementingId}`\n\n /**\n * A value must be specified for the checkbox before the owning form can be\n * submitted.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The value of the checkbox, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: CheckboxValue\n\n /**\n * Emitted when the checkbox 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 checkbox'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 checkbox gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsCheckboxElement\n\n private inheritedAttributes: Attributes = {}\n\n private input?: HTMLInputElement\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n private get computedIndeterminate(): boolean {\n return this.indeterminate ?? false\n }\n\n private get hasText(): boolean {\n return (\n (this.text !== undefined && this.text !== '') || this.required === true\n )\n }\n\n /**\n * Returns whether a form will validate this checkbox when it is submitted\n * without having to submit it.\n */\n @Method()\n public async checkValidity(): Promise<boolean> {\n invariant(this.input)\n\n return this.input.checkValidity()\n }\n\n /**\n * Returns true if the checkbox's value passes validity checks; otherwise,\n * returns false, and (if the event isn't canceled) reports the problem to\n * the user.\n */\n @Method()\n public async reportValidity(): Promise<boolean> {\n invariant(this.input)\n\n return this.input.reportValidity()\n }\n\n /**\n * Sets a custom validity message for the checkbox. If this message is not the\n * empty string, then the checkbox is considered invalid.\n */\n @Method()\n public async setCustomValidity(message: string): Promise<void> {\n invariant(this.input)\n\n this.input.setCustomValidity(message)\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.computedIndeterminate ? true : !(this.checked ?? false)\n this.changeEmitter.emit()\n this.indeterminate = false\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 <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.autoFocus}\n checked={this.computedIndeterminate ? false : this.checked}\n class=\"checkbox\"\n data-size={this.size}\n disabled={this.disabled}\n form={this.form}\n indeterminate={this.indeterminate}\n name={this.name}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n ref={this.ref}\n required={this.required}\n type=\"checkbox\"\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n icon: true,\n checked: true,\n }}\n data-size={this.size}\n library=\"core\"\n name=\"checked\"\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n icon: true,\n indeterminate: true,\n }}\n data-size={this.size}\n library=\"core\"\n name=\"indeterminate\"\n />\n {this.hasText && (\n <qds-label\n required={this.required}\n size={this.size}\n text={this.text}\n />\n )}\n </label>\n )\n }\n\n private readonly ref = (checkbox?: HTMLInputElement): void => {\n this.input = checkbox\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-checkbox.entry.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,ypGAAypG,CAAC;AAC9qG,0BAAe,WAAW;;ACD1B;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,QAAQ;IANrB;;;;;;;;;;;;;;;;;;;QAa0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,SAAI,GAAU,UAAU,CAAA;;;;;;;;;;;;;;;;;;QAuCxB,SAAI,GAAsC,IAAI,CAAA;;;;;;;;QAwCtD,sBAAiB,GAA0C,EAAE,CAAA;;;;;;;;;QAUrD,aAAQ,GAAiC,WAAW,CAAA;;;;;;QAOpD,UAAK,GAAmB,IAAI,CAAA;;;;;;;;QAS5B,iBAAY,GAAqC,KAAK,CAAA;QA0B9E,wCAAmC,EAAE,EAAA;QAkK9B,kBAAa,GAAsC,MACxD,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAA;QAEzB,mBAAc,GAAuC,MAC1D,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAA;QAE1B,sBAAiB,GAA0C,CAAC,KAAK;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AAW,CAAC,KAAK,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,OAAO,EAC/C;AACH,CAAC;IAGC,OAAO,IAAI,CAAC,aAAa,IAAI,KAAK,CAAA;AACpC,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;IAGC,QACE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,KAAK,IAAI,CAAC,QAAQ,KAAK,IAAI,EACxE;AACH,CAAC,2DA8Ia,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;;;;;","names":[],"sources":["src/components/checkbox/checkbox.css?tag=qds-checkbox&encapsulation=shadow","src/components/checkbox/checkbox.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n.qds-checkbox,\n.qds-box,\n.qds-icon {\n grid-area: checkbox;\n place-self: center;\n}\n\n.qds-icon,\n.qds-box {\n display: none;\n pointer-events: none;\n}\n\n.qds-box {\n border-radius: var(--qds-control-toggle-indicator-border-radius);\n}\n\n.qds-container {\n display: grid;\n align-self: flex-start;\n grid-template-areas: 'checkbox';\n}\n\n.qds-icon {\n color: var(--qds-theme-signature-color-contrast);\n}\n\n.qds-label {\n cursor: pointer;\n display: inline-flex;\n}\n\n.qds-checkbox {\n appearance: none;\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n margin: 0;\n print-color-adjust: exact;\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 ~ .qds-box,\n &:active ~ .qds-box {\n display: block;\n }\n\n &:hover ~ .qds-box {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active ~ .qds-box {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n\n &:checked ~ .qds-checked,\n &:indeterminate ~ .qds-indeterminate {\n display: block;\n }\n\n &:checked,\n &:indeterminate {\n background-color: var(--qds-theme-signature-color-default);\n border-color: transparent;\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[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-small-size);\n height: var(--qds-control-toggle-box-small-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-small-size);\n height: var(--qds-control-toggle-indicator-small-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-small-gap-siblings-related);\n }\n}\n\n[data-size='standard'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-standard-size);\n height: var(--qds-control-toggle-box-standard-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-standard-size);\n height: var(--qds-control-toggle-indicator-standard-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-standard-gap-siblings-related);\n }\n}\n\n[data-size='large'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-large-size);\n height: var(--qds-control-toggle-box-large-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-large-size);\n height: var(--qds-control-toggle-indicator-large-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-large-gap-siblings-related);\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 { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type CheckboxValue = number | string | null\n\n/**\n * `<qds-checkbox>` elements are rendered as boxes that are checked (ticked)\n * when activated, like you might see in an official government paper form. A\n * checkbox allows you to select single values for submission in a form (or not).\n *\n * @see https://quartz.se.com/build/components/checkbox\n */\n@Component({\n tag: 'qds-checkbox',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'checkbox.css',\n})\nexport class Checkbox implements ComponentInterface {\n /**\n * Adds vertical margin to the checkbox 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 checkbox's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The checkbox's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Sets the checkbox's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the checkbox 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>`][] element to associate the checkbox with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-checkbox>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-checkbox>` 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 * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Sets the checkbox to an indeterminate state. This is usually applied to\n * checkboxes that represent a \"select all/none\" behavior when associated\n * checkboxes have a mix of checked and unchecked states.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public indeterminate?: boolean\n\n /**\n * The name of the checkbox, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * A value must be specified for the checkbox before the owning form can be\n * submitted.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The error message that would be shown to the user if the `<qds-checkbox>`\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-checkbox>`.\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 * The value of the checkbox, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: CheckboxValue = 'on'\n\n /**\n * True if `<qds-checkbox>` 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 checkbox 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 checkbox'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 checkbox 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 #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 #computedIndeterminate(): boolean {\n return this.indeterminate ?? false\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 get #hasText(): boolean {\n return (\n (this.text !== undefined && this.text !== '') || this.required === true\n )\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.#computedIndeterminate ? true : !this.#computedChecked\n this.changeEmitter.emit()\n this.indeterminate = false\n }\n\n @Watch('checked')\n protected checkedChanged(): 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 @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\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 if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\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' : undefined}\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-container\">\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.#computedIndeterminate ? false : this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n indeterminate={this.indeterminate}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n required={this.required}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-checked': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n <div class=\"qds-box\" data-size={this.#computedSize} />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-indeterminate': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"indeterminate\"\n />\n </div>\n {this.#hasText && (\n <qds-label\n required={this.required}\n size={this.size}\n text={this.text}\n />\n )}\n </label>\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"],"version":3}