@quartzds/core 1.0.0-beta.8 → 1.0.0-beta.81

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 +50 -0
  3. package/components/index.js +49 -27
  4. package/components/index.js.map +1 -1
  5. package/components/p-028b9d2e.js +96 -0
  6. package/components/p-028b9d2e.js.map +1 -0
  7. package/components/p-355efdb1.js +83 -0
  8. package/components/p-355efdb1.js.map +1 -0
  9. package/components/p-4141d6ed.js +204 -0
  10. package/components/p-4141d6ed.js.map +1 -0
  11. package/components/p-698edde1.js +321 -0
  12. package/components/p-698edde1.js.map +1 -0
  13. package/components/p-7b04d43e.js +1556 -0
  14. package/components/p-7b04d43e.js.map +1 -0
  15. package/components/p-7f6e797a.js +108 -0
  16. package/components/p-7f6e797a.js.map +1 -0
  17. package/components/p-82461767.js +328 -0
  18. package/components/p-82461767.js.map +1 -0
  19. package/components/p-9df62f97.js +89 -0
  20. package/components/p-9df62f97.js.map +1 -0
  21. package/components/p-b82bac0a.js +121 -0
  22. package/components/p-b82bac0a.js.map +1 -0
  23. package/components/p-d107c90c.js +27 -0
  24. package/components/p-d107c90c.js.map +1 -0
  25. package/components/p-d279ae53.js +86 -0
  26. package/components/p-d279ae53.js.map +1 -0
  27. package/components/p-f5ba28ff.js +372 -0
  28. package/components/p-f5ba28ff.js.map +1 -0
  29. package/components/p-f85b490c.js +217 -0
  30. package/components/p-f85b490c.js.map +1 -0
  31. package/components/{floating-ui.dom.esm.js → p-fdd0abae.js} +468 -416
  32. package/components/p-fdd0abae.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 +76 -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 +271 -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 +121 -0
  53. package/components/qds-dialog.js.map +1 -0
  54. package/components/qds-divider.d.ts +11 -0
  55. package/components/qds-divider.js +13 -0
  56. package/components/qds-divider.js.map +1 -0
  57. package/components/qds-dropdown.d.ts +2 -2
  58. package/components/qds-dropdown.js +266 -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 +102 -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 +135 -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 +426 -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 +207 -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 +111 -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 +146 -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 +135 -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 +140 -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 +273 -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 +167 -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 +172 -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 +339 -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 +384 -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 +73 -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 +77 -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 +276 -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-cdd65bd0.js +217 -0
  140. package/dist/cjs/helpers-cdd65bd0.js.map +1 -0
  141. package/dist/cjs/index-a9985af0.js +1699 -0
  142. package/dist/cjs/index-a9985af0.js.map +1 -0
  143. package/dist/cjs/index.cjs.js +27 -27
  144. package/dist/cjs/index.cjs.js.map +1 -1
  145. package/dist/cjs/library-57845012.js +117 -0
  146. package/dist/cjs/library-57845012.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_3.cjs.entry.js +445 -0
  150. package/dist/cjs/qds-badge-counter_3.cjs.entry.js.map +1 -0
  151. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +55 -0
  152. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -0
  153. package/dist/cjs/qds-button.cjs.entry.js +234 -87
  154. package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
  155. package/dist/cjs/qds-checkbox.cjs.entry.js +162 -99
  156. package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
  157. package/dist/cjs/qds-chip.cjs.entry.js +231 -0
  158. package/dist/cjs/qds-chip.cjs.entry.js.map +1 -0
  159. package/dist/cjs/qds-dialog.cjs.entry.js +103 -0
  160. package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -0
  161. package/dist/cjs/qds-divider.cjs.entry.js +69 -0
  162. package/dist/cjs/qds-divider.cjs.entry.js.map +1 -0
  163. package/dist/cjs/qds-dropdown.cjs.entry.js +225 -206
  164. package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
  165. package/dist/cjs/qds-form-message.cjs.entry.js +76 -0
  166. package/dist/cjs/qds-form-message.cjs.entry.js.map +1 -0
  167. package/dist/cjs/qds-icon.cjs.entry.js +111 -90
  168. package/dist/cjs/qds-icon.cjs.entry.js.map +1 -1
  169. package/dist/cjs/qds-inline-link.cjs.entry.js +98 -46
  170. package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
  171. package/dist/cjs/qds-input.cjs.entry.js +337 -185
  172. package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
  173. package/dist/cjs/qds-label.cjs.entry.js +58 -24
  174. package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
  175. package/dist/cjs/qds-list-item.cjs.entry.js +158 -0
  176. package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -0
  177. package/dist/cjs/qds-loader.cjs.entry.js +92 -0
  178. package/dist/cjs/qds-loader.cjs.entry.js.map +1 -0
  179. package/dist/cjs/qds-nav-list-item.cjs.entry.js +108 -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 +117 -0
  182. package/dist/cjs/qds-progress-bar.cjs.entry.js.map +1 -0
  183. package/dist/cjs/qds-radio.cjs.entry.js +101 -57
  184. package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
  185. package/dist/cjs/qds-select.cjs.entry.js +233 -0
  186. package/dist/cjs/qds-select.cjs.entry.js.map +1 -0
  187. package/dist/cjs/qds-standalone-link.cjs.entry.js +127 -0
  188. package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -0
  189. package/dist/cjs/qds-switch.cjs.entry.js +143 -64
  190. package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
  191. package/dist/cjs/qds-tab.cjs.entry.js +260 -0
  192. package/dist/cjs/qds-tab.cjs.entry.js.map +1 -0
  193. package/dist/cjs/qds-tabbar.cjs.entry.js +326 -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 +56 -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 +58 -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 +163 -0
  208. package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -0
  209. package/dist/cjs/qds-textarea.cjs.entry.js +229 -153
  210. package/dist/cjs/qds-textarea.cjs.entry.js.map +1 -1
  211. package/dist/cjs/qds.cjs.js +15 -13
  212. package/dist/cjs/qds.cjs.js.map +1 -1
  213. package/dist/custom-elements.json +8403 -1931
  214. package/dist/docs.d.ts +336 -240
  215. package/dist/docs.json +8819 -2762
  216. package/dist/esm/app-globals-8ced3a41.js +10 -0
  217. package/dist/esm/app-globals-8ced3a41.js.map +1 -0
  218. package/dist/esm/controls-a4768aaf.js +27 -0
  219. package/dist/esm/controls-a4768aaf.js.map +1 -0
  220. package/dist/esm/{floating-ui.dom.esm-f96ac766.js → floating-ui.dom.esm-61986f35.js} +468 -416
  221. package/dist/esm/floating-ui.dom.esm-61986f35.js.map +1 -0
  222. package/dist/esm/helpers-4eb4fa44.js +204 -0
  223. package/dist/esm/helpers-4eb4fa44.js.map +1 -0
  224. package/dist/esm/index-5291e8ff.js +1668 -0
  225. package/dist/esm/index-5291e8ff.js.map +1 -0
  226. package/dist/esm/index.js +27 -27
  227. package/dist/esm/index.js.map +1 -1
  228. package/dist/esm/library-9edbe354.js +113 -0
  229. package/dist/esm/library-9edbe354.js.map +1 -0
  230. package/dist/esm/loader.js +9 -7
  231. package/dist/esm/loader.js.map +1 -1
  232. package/dist/esm/qds-badge-counter_3.entry.js +439 -0
  233. package/dist/esm/qds-badge-counter_3.entry.js.map +1 -0
  234. package/dist/esm/qds-breadcrumb-item.entry.js +51 -0
  235. package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -0
  236. package/dist/esm/qds-button.entry.js +234 -87
  237. package/dist/esm/qds-button.entry.js.map +1 -1
  238. package/dist/esm/qds-checkbox.entry.js +162 -99
  239. package/dist/esm/qds-checkbox.entry.js.map +1 -1
  240. package/dist/esm/qds-chip.entry.js +227 -0
  241. package/dist/esm/qds-chip.entry.js.map +1 -0
  242. package/dist/esm/qds-dialog.entry.js +99 -0
  243. package/dist/esm/qds-dialog.entry.js.map +1 -0
  244. package/dist/esm/qds-divider.entry.js +65 -0
  245. package/dist/esm/qds-divider.entry.js.map +1 -0
  246. package/dist/esm/qds-dropdown.entry.js +225 -206
  247. package/dist/esm/qds-dropdown.entry.js.map +1 -1
  248. package/dist/esm/qds-form-message.entry.js +72 -0
  249. package/dist/esm/qds-form-message.entry.js.map +1 -0
  250. package/dist/esm/qds-icon.entry.js +111 -90
  251. package/dist/esm/qds-icon.entry.js.map +1 -1
  252. package/dist/esm/qds-inline-link.entry.js +98 -46
  253. package/dist/esm/qds-inline-link.entry.js.map +1 -1
  254. package/dist/esm/qds-input.entry.js +337 -185
  255. package/dist/esm/qds-input.entry.js.map +1 -1
  256. package/dist/esm/qds-label.entry.js +58 -24
  257. package/dist/esm/qds-label.entry.js.map +1 -1
  258. package/dist/esm/qds-list-item.entry.js +154 -0
  259. package/dist/esm/qds-list-item.entry.js.map +1 -0
  260. package/dist/esm/qds-loader.entry.js +88 -0
  261. package/dist/esm/qds-loader.entry.js.map +1 -0
  262. package/dist/esm/qds-nav-list-item.entry.js +104 -0
  263. package/dist/esm/qds-nav-list-item.entry.js.map +1 -0
  264. package/dist/esm/qds-progress-bar.entry.js +113 -0
  265. package/dist/esm/qds-progress-bar.entry.js.map +1 -0
  266. package/dist/esm/qds-radio.entry.js +101 -57
  267. package/dist/esm/qds-radio.entry.js.map +1 -1
  268. package/dist/esm/qds-select.entry.js +229 -0
  269. package/dist/esm/qds-select.entry.js.map +1 -0
  270. package/dist/esm/qds-standalone-link.entry.js +123 -0
  271. package/dist/esm/qds-standalone-link.entry.js.map +1 -0
  272. package/dist/esm/qds-switch.entry.js +143 -64
  273. package/dist/esm/qds-switch.entry.js.map +1 -1
  274. package/dist/esm/qds-tab.entry.js +256 -0
  275. package/dist/esm/qds-tab.entry.js.map +1 -0
  276. package/dist/esm/qds-tabbar.entry.js +322 -0
  277. package/dist/esm/qds-tabbar.entry.js.map +1 -0
  278. package/dist/esm/qds-table-body.entry.js +50 -0
  279. package/dist/esm/qds-table-body.entry.js.map +1 -0
  280. package/dist/esm/qds-table-cell.entry.js +52 -0
  281. package/dist/esm/qds-table-cell.entry.js.map +1 -0
  282. package/dist/esm/qds-table-head-cell.entry.js +54 -0
  283. package/dist/esm/qds-table-head-cell.entry.js.map +1 -0
  284. package/dist/esm/qds-table-head.entry.js +50 -0
  285. package/dist/esm/qds-table-head.entry.js.map +1 -0
  286. package/dist/esm/qds-table-row.entry.js +50 -0
  287. package/dist/esm/qds-table-row.entry.js.map +1 -0
  288. package/dist/esm/qds-table.entry.js +50 -0
  289. package/dist/esm/qds-table.entry.js.map +1 -0
  290. package/dist/esm/qds-tag_2.entry.js +158 -0
  291. package/dist/esm/qds-tag_2.entry.js.map +1 -0
  292. package/dist/esm/qds-textarea.entry.js +229 -153
  293. package/dist/esm/qds-textarea.entry.js.map +1 -1
  294. package/dist/esm/qds.js +16 -14
  295. package/dist/esm/qds.js.map +1 -1
  296. package/dist/types/components/badge-counter/badge-counter.d.ts +40 -0
  297. package/dist/types/components/badge-indicator/badge-indicator.d.ts +36 -0
  298. package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +156 -0
  299. package/dist/types/components/button/button.d.ts +232 -194
  300. package/dist/types/components/checkbox/checkbox.d.ts +136 -124
  301. package/dist/types/components/chip/chip.d.ts +114 -0
  302. package/dist/types/components/controls.d.ts +4 -1
  303. package/dist/types/components/dialog/dialog.d.ts +35 -0
  304. package/dist/types/components/divider/divider.d.ts +26 -0
  305. package/dist/types/components/dropdown/dropdown.d.ts +107 -125
  306. package/dist/types/components/form-message/form-message.d.ts +42 -0
  307. package/dist/types/components/icon/icon.d.ts +24 -24
  308. package/dist/types/components/icon/library.d.ts +3 -3
  309. package/dist/types/components/icon/request.d.ts +5 -9
  310. package/dist/types/components/inline-link/inline-link.d.ts +208 -191
  311. package/dist/types/components/input/input.d.ts +444 -368
  312. package/dist/types/components/label/label.d.ts +24 -24
  313. package/dist/types/components/list-item/list-item.d.ts +100 -0
  314. package/dist/types/components/loader/loader.d.ts +27 -0
  315. package/dist/types/components/nav-list-item/nav-list-item.d.ts +67 -0
  316. package/dist/types/components/progress-bar/progress-bar.d.ts +60 -0
  317. package/dist/types/components/radio/radio.d.ts +90 -95
  318. package/dist/types/components/select/select.d.ts +210 -0
  319. package/dist/types/components/shared.d.ts +6 -0
  320. package/dist/types/components/standalone-link/standalone-link.d.ts +233 -0
  321. package/dist/types/components/switch/switch.d.ts +120 -107
  322. package/dist/types/components/tab/tab.d.ts +158 -0
  323. package/dist/types/components/tabbar/tabbar.d.ts +46 -0
  324. package/dist/types/components/table/table.d.ts +15 -0
  325. package/dist/types/components/table-body/table-body.d.ts +15 -0
  326. package/dist/types/components/table-cell/table-cell.d.ts +32 -0
  327. package/dist/types/components/table-head/table-head.d.ts +15 -0
  328. package/dist/types/components/table-head-cell/table-head-cell.d.ts +56 -0
  329. package/dist/types/components/table-row/table-row.d.ts +15 -0
  330. package/dist/types/components/tag/tag.d.ts +46 -0
  331. package/dist/types/components/textarea/textarea.d.ts +313 -300
  332. package/dist/types/components/title/title.d.ts +39 -32
  333. package/dist/types/components/tooltip/tooltip.d.ts +121 -137
  334. package/dist/types/components.d.ts +3320 -783
  335. package/dist/types/helpers.d.ts +15 -16
  336. package/dist/types/index.d.ts +1 -0
  337. package/dist/types/interface-overrides.d.ts +211 -0
  338. package/dist/types/qds-test.d.ts +22 -11
  339. package/dist/types/stencil-public-runtime.d.ts +49 -15
  340. package/dist/types/utils.d.ts +4 -4
  341. package/dist/vscode.html-custom-data.json +1580 -167
  342. package/hydrate/index.d.ts +36 -18
  343. package/hydrate/index.js +24050 -9160
  344. package/hydrate/index.mjs +24769 -0
  345. package/hydrate/package.json +7 -1
  346. package/loader/cdn.js +3 -4
  347. package/loader/index.cjs.js +3 -4
  348. package/loader/index.d.ts +4 -1
  349. package/loader/index.es2017.js +3 -4
  350. package/loader/index.js +3 -4
  351. package/package.json +53 -89
  352. package/styles/core.css +137 -14
  353. package/components/floating-ui.dom.esm.js.map +0 -1
  354. package/components/helpers.js +0 -175
  355. package/components/helpers.js.map +0 -1
  356. package/components/icon.js +0 -175
  357. package/components/icon.js.map +0 -1
  358. package/components/label.js +0 -55
  359. package/components/label.js.map +0 -1
  360. package/dist/cjs/floating-ui.dom.esm-71fa96af.js.map +0 -1
  361. package/dist/cjs/helpers-452256e8.js +0 -185
  362. package/dist/cjs/helpers-452256e8.js.map +0 -1
  363. package/dist/cjs/index-d181f952.js +0 -2039
  364. package/dist/cjs/index-d181f952.js.map +0 -1
  365. package/dist/cjs/library-0a619eeb.js +0 -62
  366. package/dist/cjs/library-0a619eeb.js.map +0 -1
  367. package/dist/cjs/qds-title.cjs.entry.js +0 -66
  368. package/dist/cjs/qds-title.cjs.entry.js.map +0 -1
  369. package/dist/cjs/qds-tooltip.cjs.entry.js +0 -284
  370. package/dist/cjs/qds-tooltip.cjs.entry.js.map +0 -1
  371. package/dist/esm/floating-ui.dom.esm-f96ac766.js.map +0 -1
  372. package/dist/esm/helpers-76b84f45.js +0 -175
  373. package/dist/esm/helpers-76b84f45.js.map +0 -1
  374. package/dist/esm/index-d7183092.js +0 -2009
  375. package/dist/esm/index-d7183092.js.map +0 -1
  376. package/dist/esm/library-021aca11.js +0 -58
  377. package/dist/esm/library-021aca11.js.map +0 -1
  378. package/dist/esm/polyfills/core-js.js +0 -11
  379. package/dist/esm/polyfills/dom.js +0 -79
  380. package/dist/esm/polyfills/es5-html-element.js +0 -1
  381. package/dist/esm/polyfills/index.js +0 -34
  382. package/dist/esm/polyfills/system.js +0 -6
  383. package/dist/esm/qds-title.entry.js +0 -62
  384. package/dist/esm/qds-title.entry.js.map +0 -1
  385. package/dist/esm/qds-tooltip.entry.js +0 -280
  386. package/dist/esm/qds-tooltip.entry.js.map +0 -1
  387. package/dist/types/components/create-story.d.ts +0 -5
@@ -1,109 +1,256 @@
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
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-d181f952.js');
11
- const helpers = require('./helpers-452256e8.js');
10
+ const index = require('./index-a9985af0.js');
11
+ const helpers = require('./helpers-cdd65bd0.js');
12
12
 
13
- const buttonCss = ":host{box-sizing:border-box}:host([hidden]){display:none !important}:host([hidden]){}:host *,:host *::before,:host *::after{box-sizing:inherit}:host{display:inline-block}.button{-webkit-appearance:none;appearance:none;background-color:transparent;background-color:initial;border:none;padding-block:0;align-items:center;border-radius:var(--qds-control-border-radius);cursor:pointer;display:inline-flex;gap:var(--qds-control-button-gap-internal);justify-content:center;padding-inline:var(--qds-control-button-padding-horizontal);-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;user-select:none;white-space:nowrap;width:100%}.button.icon-only{padding-inline:0}.button:link,.button:visited,area[href].button{-webkit-text-decoration:none;text-decoration:none}.button:any-link{-webkit-text-decoration:none;text-decoration:none}.button:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}[data-size='small']{font:var(--qds-control-small-text);height:var(--qds-control-small-height)}.icon-only[data-size='small']{width:var(--qds-control-small-height)}.icon[data-size='small']{font-size:var(--qds-control-small-icon-size)}[data-size='standard']{font:var(--qds-control-standard-text);height:var(--qds-control-standard-height)}.icon-only[data-size='standard']{width:var(--qds-control-standard-height)}.icon[data-size='standard']{font-size:var(--qds-control-standard-icon-size)}[data-size='large']{font:var(--qds-control-large-text);height:var(--qds-control-large-height)}.icon-only[data-size='large']{width:var(--qds-control-large-height)}.icon[data-size='large']{font-size:var(--qds-control-large-icon-size)}[data-importance='subdued']{border:var(--qds-control-border-width) solid transparent;color:var(--qds-theme-link-default)}.icon-only[data-importance='subdued']{color:var(--qds-theme-control-text-standard)}[data-importance='subdued']:hover{border:var(--qds-control-border-width) solid var(--qds-theme-link-default)}.icon-only[data-importance='subdued']:hover{background-color:var(--qds-theme-interactive-background-hover);border:none;color:var(--qds-theme-control-text-standard)}[data-importance='subdued']:active{border:var(--qds-control-border-width) solid var(--qds-theme-link-pressed);color:var(--qds-theme-link-pressed)}.icon-only[data-importance='subdued']:active{background-color:var(--qds-theme-interactive-background-pressed);border:none;color:var(--qds-theme-control-text-standard)}[data-importance='standard']{border:var(--qds-control-border-width) solid var(--qds-theme-control-border);color:var(--qds-theme-control-text-standard)}[data-importance='standard']:hover{background-color:var(--qds-theme-interactive-background-hover)}[data-importance='standard']:active{background-color:var(--qds-theme-interactive-background-pressed)}[data-importance='emphasized']{background-color:var(--qds-theme-signature-color-default);color:var(--qds-theme-signature-color-contrast)}[data-importance='emphasized']:hover{background-color:var(--qds-theme-signature-color-hover)}[data-importance='emphasized']:active{background-color:var(--qds-theme-signature-color-pressed)}[data-importance='destructive']{background-color:var(--qds-theme-feedback-action-destructive-default);color:var(--qds-theme-feedback-action-destructive-contrast)}[data-importance='destructive']:hover{background-color:var(--qds-theme-feedback-action-destructive-hover)}[data-importance='destructive']:active{background-color:var(--qds-theme-feedback-action-destructive-pressed)}";
13
+ const buttonCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-button,.qds-container,.qds-overflow{width:inherit}.qds-button:disabled,[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-overflow{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-action{transform:scaleX(var(--qds-direction-factor,1))}.qds-container{display:grid;grid-template-areas:\"h\"}.qds-focus-ring{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n ));grid-area:h;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width-block-end, var(--qds-control-border-width)));isolation:isolate;outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset);pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n ))}.qds-button{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:none;border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n ) var(--qds-control-border-radius-top-right,var(--qds-control-border-radius)) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n );box-sizing:border-box;cursor:pointer;display:inline-flex;grid-area:h;justify-content:center;outline:none;padding-block:0;position:relative;-webkit-print-color-adjust:exact;print-color-adjust:exact;text-align:center;-webkit-user-select:none;user-select:none}.qds-button:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-button:focus-visible~.qds-focus-ring{visibility:visible}.qds-icon{flex-shrink:0}.qds-indicator{inset-block-start:0;inset-inline-end:0;position:absolute;transform:translate(50%,-50%)}[data-size=small]{font:var(--qds-control-small-text)}.qds-button[data-size=small]{gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height);padding-inline:var(--qds-control-button-small-padding-horizontal)}.qds-button.qds-icon-only[data-size=small]{padding-inline:0;width:var(--qds-control-small-height)}.qds-icon[data-size=small]{font-size:var(--qds-control-small-icon-size)}[data-size=standard]{font:var(--qds-control-standard-text)}.qds-button[data-size=standard]{gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height);padding-inline:var(--qds-control-button-standard-padding-horizontal)}.qds-button.qds-icon-only[data-size=standard]{padding-inline:0;width:var(--qds-control-standard-height)}.qds-icon[data-size=standard]{font-size:var(--qds-control-standard-icon-size)}[data-size=large]{font:var(--qds-control-large-text)}.qds-button[data-size=large]{gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height);padding-inline:var(--qds-control-button-large-padding-horizontal)}.qds-button.qds-icon-only[data-size=large]{padding-inline:0;width:var(--qds-control-large-height)}.qds-icon[data-size=large]{font-size:var(--qds-control-large-icon-size)}[data-size=hero]{font:var(--qds-control-hero-text)}.qds-button[data-size=hero]{border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-top-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n );gap:var(--qds-control-hero-gap-internal);padding-block:var(--qds-control-hero-padding-auto-height);padding-inline:var(--qds-control-button-hero-padding-horizontal)}.qds-button.qds-icon-only[data-size=hero]{height:var(--qds-control-hero-height);padding-inline:0;width:var(--qds-control-hero-height)}.qds-focus-ring[data-size=hero]{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n ))}.qds-icon[data-size=hero]{font-size:var(--qds-control-hero-icon-size)}[data-importance=subdued]{color:var(--qds-theme-link-standard-default)}.qds-button[data-importance=subdued]{border-block-end:var(--qds-control-border-width) solid #0000;padding-inline:0}.qds-button[data-importance=subdued]:hover{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-link-standard-hover);color:var(--qds-theme-link-standard-hover)}.qds-button[data-importance=subdued]:active{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-link-standard-pressed);color:var(--qds-theme-link-standard-pressed)}.qds-button[data-importance=subdued]:not(.qds-icon-only){border-radius:0}.qds-button.qds-icon-only[data-importance=subdued]{border:none;color:var(--qds-theme-control-text-standard)}.qds-button.qds-icon-only[data-importance=subdued]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button.qds-icon-only[data-importance=subdued]:active{background-color:var(--qds-theme-interactive-background-pressed)}[data-importance=standard]{color:var(--qds-theme-control-text-standard)}.qds-button[data-importance=standard]{border-color:var(--qds-theme-control-border);border-style:solid;border-width:var(--qds-control-border-width) var(\n --qds-control-border-width-inline-end,var(--qds-control-border-width)\n ) var(--qds-control-border-width-block-end,var(--qds-control-border-width)) var(--qds-control-border-width)}.qds-button[data-importance=standard]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance=standard]:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-button[data-importance=emphasized]{background-color:var(--qds-theme-signature-color-default);color:var(--qds-theme-signature-color-contrast)}.qds-button[data-importance=emphasized]:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance=emphasized]:active{background-color:var(--qds-theme-signature-color-pressed)}.qds-button[data-importance=destructive]{background-color:var(--qds-theme-feedback-action-destructive-default);color:var(--qds-theme-feedback-action-destructive-contrast)}.qds-button[data-importance=destructive]:hover{background-color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-importance=destructive]:active{background-color:var(--qds-theme-feedback-action-destructive-pressed)}[data-importance=subdued-destructive]{color:var(--qds-theme-feedback-action-destructive-default)}.qds-button[data-importance=subdued-destructive]{border-block-end:var(--qds-control-border-width) solid #0000;padding-inline:0}.qds-button[data-importance=subdued-destructive]:hover{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-feedback-action-destructive-hover);color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-importance=subdued-destructive]:active{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-feedback-action-destructive-pressed);color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-importance=subdued-destructive]:not(.qds-icon-only){border-radius:0}.qds-button.qds-icon-only[data-importance=subdued-destructive]{border:none}.qds-button.qds-icon-only[data-importance=subdued-destructive]:hover{background-color:var(--qds-theme-interactive-background-hover);color:var(--qds-theme-feedback-action-destructive-default)}.qds-button.qds-icon-only[data-importance=subdued-destructive]:active{background-color:var(--qds-theme-interactive-background-pressed);color:var(--qds-theme-feedback-action-destructive-default)}:is([data-action=dropdown],[data-action=dropdown-close]) .qds-action{margin-inline-start:auto;transition-duration:.3s;transition-property:transform}[data-importance=standard]:is([data-action=dropdown],[data-action=dropdown-close]){background-color:var(--qds-theme-control-input-background)}:is([data-action=dropdown],[data-action=dropdown-close]):not([data-importance=subdued]):not([data-importance=subdued-destructive]){padding-inline:var(--qds-control-input-padding-horizontal)}[data-action=dropdown-close] .qds-action{transform:rotate(-180deg)}";
14
+ const QdsButtonStyle0 = buttonCss;
14
15
 
16
+ // SPDX-FileCopyrightText: © 2024 Schneider Electric
17
+ //
18
+ // SPDX-License-Identifier: Apache-2.0
19
+ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
20
+ if (kind === "m")
21
+ throw new TypeError("Private method is not writable");
22
+ if (kind === "a" && !f)
23
+ throw new TypeError("Private accessor was defined without a setter");
24
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
25
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
26
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
27
+ };
28
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
29
+ if (kind === "a" && !f)
30
+ throw new TypeError("Private accessor was defined without a getter");
31
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
32
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
33
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
34
+ };
35
+ var _Button_instances, _Button_button, _Button_span, _Button_ro, _Button_inheritedAttributes, _Button_ariaExpanded_get, _Button_ariaHaspopup_get, _Button_formElement_get, _Button_buttonType_get, _Button_iconOnly_get, _Button_computedAction_get, _Button_computedActionIcon_get, _Button_computedDisabled_get, _Button_computedImportance_get, _Button_computedSize_get, _Button_onBlur, _Button_onFocus, _Button_buttonRef, _Button_spanRef, _Button_tooltipRef;
36
+ const isCounter = (value) => typeof value === 'string'
37
+ ? !Number.isNaN(Number.parseFloat(value))
38
+ : typeof value === 'number';
39
+ const isIndicator = (value) => value === '' || value === true;
15
40
  const Button = class {
16
- constructor(hostRef) {
17
- index.registerInstance(this, hostRef);
18
- this.blurEmitter = index.createEvent(this, "qdsBlur", 2);
19
- this.focusEmitter = index.createEvent(this, "qdsFocus", 2);
20
- this.inheritedAttributes = {};
21
- this.onClick = (event) => {
22
- if (this.computedDisabled) {
41
+ constructor(hostRef) {
42
+ index.registerInstance(this, hostRef);
43
+ this.blurEmitter = index.createEvent(this, "qdsBlur", 2);
44
+ this.focusEmitter = index.createEvent(this, "qdsFocus", 2);
45
+ _Button_instances.add(this);
46
+ _Button_button.set(this, void 0);
47
+ _Button_span.set(this, void 0);
48
+ _Button_ro.set(this, void 0);
49
+ _Button_inheritedAttributes.set(this, {});
50
+ _Button_onBlur.set(this, (event) => {
51
+ this.blurEmitter.emit(helpers.pickFocusEventAttributes(event));
52
+ });
53
+ _Button_onFocus.set(this, (event) => {
54
+ this.focusEmitter.emit(helpers.pickFocusEventAttributes(event));
55
+ });
56
+ _Button_buttonRef.set(this, (button) => {
57
+ __classPrivateFieldSet(this, _Button_button, button, "f");
58
+ });
59
+ _Button_spanRef.set(this, (span) => {
60
+ __classPrivateFieldSet(this, _Button_span, span, "f");
61
+ });
62
+ _Button_tooltipRef.set(this, (tooltip) => {
63
+ if (tooltip)
64
+ // eslint-disable-next-line no-param-reassign
65
+ tooltip.target = __classPrivateFieldGet(this, _Button_button, "f");
66
+ });
67
+ this.action = undefined;
68
+ this.badge = undefined;
69
+ this.badgeDescription = undefined;
70
+ this.badgeIndicatorStatus = 'neutral';
71
+ this.iconName = undefined;
72
+ this.iconLibrary = 'default';
73
+ this.importance = 'standard';
74
+ this.popupType = undefined;
75
+ this.size = 'standard';
76
+ this.text = undefined;
77
+ this.disabled = undefined;
78
+ this.download = undefined;
79
+ this.form = undefined;
80
+ this.formAction = undefined;
81
+ this.formMethod = undefined;
82
+ this.formNoValidate = false;
83
+ this.formTarget = '_self';
84
+ this.href = undefined;
85
+ this.rel = 'noopener';
86
+ this.name = undefined;
87
+ this.target = undefined;
88
+ this.type = undefined;
89
+ this.value = undefined;
90
+ this.tabIndex = undefined;
91
+ this.tooltip = false;
92
+ }
93
+ onClick(event) {
94
+ if (__classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get)) {
95
+ event.stopImmediatePropagation();
96
+ return;
97
+ }
98
+ if (__classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get) === 'button' || !__classPrivateFieldGet(this, _Button_instances, "a", _Button_formElement_get))
99
+ return;
23
100
  event.preventDefault();
24
- event.stopPropagation();
25
- return;
26
- }
27
- if (this.buttonType === 'button' || !this.formElement)
28
- return;
29
- event.preventDefault();
30
- const fakeButton = document.createElement('button');
31
- fakeButton.type = this.buttonType;
32
- if (this.name !== undefined)
33
- fakeButton.name = this.name;
34
- if (this.value !== undefined)
35
- fakeButton.value = this.value;
36
- if (this.formAction !== undefined)
37
- fakeButton.formAction = this.formAction;
38
- if (this.formMethod !== undefined)
39
- fakeButton.formMethod = this.formMethod;
40
- fakeButton.formNoValidate = this.formNoValidate;
41
- fakeButton.formTarget = this.formTarget;
42
- fakeButton.style.display = 'none';
43
- this.formElement.append(fakeButton);
44
- fakeButton.click();
45
- fakeButton.remove();
46
- };
47
- this.onBlur = (event) => {
48
- this.blurEmitter.emit(helpers.pickFocusEventAttributes(event));
49
- };
50
- this.onFocus = (event) => {
51
- this.focusEmitter.emit(helpers.pickFocusEventAttributes(event));
52
- };
53
- this.iconName = undefined;
54
- this.iconLibrary = 'default';
55
- this.importance = 'standard';
56
- this.size = 'standard';
57
- this.text = undefined;
58
- this.disabled = undefined;
59
- this.download = undefined;
60
- this.form = undefined;
61
- this.formAction = undefined;
62
- this.formMethod = undefined;
63
- this.formNoValidate = false;
64
- this.formTarget = '_self';
65
- this.href = undefined;
66
- this.name = undefined;
67
- this.target = '_self';
68
- this.type = undefined;
69
- this.value = undefined;
70
- }
71
- get formElement() {
101
+ const fakeButton = document.createElement('button');
102
+ fakeButton.type = __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get);
103
+ if (this.name !== undefined)
104
+ fakeButton.name = this.name;
105
+ if (this.value !== undefined)
106
+ fakeButton.value = this.value;
107
+ if (this.formAction !== undefined)
108
+ fakeButton.formAction = this.formAction;
109
+ if (this.formMethod !== undefined)
110
+ fakeButton.formMethod = this.formMethod;
111
+ fakeButton.formNoValidate = this.formNoValidate;
112
+ fakeButton.formTarget = this.formTarget;
113
+ fakeButton.style.display = 'none';
114
+ __classPrivateFieldGet(this, _Button_instances, "a", _Button_formElement_get).append(fakeButton);
115
+ fakeButton.click();
116
+ fakeButton.remove();
117
+ }
118
+ tabindexChanged(newValue) {
119
+ const parsedValue = Number.parseInt(newValue, 10);
120
+ this.tabIndex =
121
+ parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue;
122
+ }
123
+ textChanged() {
124
+ if (__classPrivateFieldGet(this, _Button_ro, "f"))
125
+ __classPrivateFieldGet(this, _Button_ro, "f").disconnect();
126
+ if (!__classPrivateFieldGet(this, _Button_span, "f"))
127
+ return;
128
+ this.tooltip = helpers.isOverflowing(__classPrivateFieldGet(this, _Button_span, "f"));
129
+ __classPrivateFieldSet(this, _Button_ro, new ResizeObserver(([spanEntry]) => {
130
+ this.tooltip = helpers.isOverflowing(spanEntry.target);
131
+ }), "f");
132
+ __classPrivateFieldGet(this, _Button_ro, "f").observe(__classPrivateFieldGet(this, _Button_span, "f"));
133
+ }
134
+ componentWillLoad() {
135
+ __classPrivateFieldSet(this, _Button_inheritedAttributes, helpers.inheritAriaAttributes(this.host), "f");
136
+ this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0');
137
+ }
138
+ componentDidLoad() {
139
+ this.textChanged();
140
+ }
141
+ disconnectedCallback() {
142
+ if (__classPrivateFieldGet(this, _Button_ro, "f"))
143
+ __classPrivateFieldGet(this, _Button_ro, "f").disconnect();
144
+ }
145
+ render() {
146
+ const Tag = this.href === undefined ? 'button' : 'a';
147
+ const ariaDisabled = __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) ? 'true' : undefined;
148
+ const disabledTabIndex = Tag === 'a' ? -1 : undefined;
149
+ return (index.h("div", { key: 'a84866ec38f20b47420f19519f5e6a5e2e4e35c6', class: "qds-container" }, index.h(Tag, { key: '91032860d188045a2ac18a359ea4cffd96c285a8', "aria-disabled": Tag === 'a' ? ariaDisabled : undefined, class: {
150
+ 'qds-button': true,
151
+ 'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
152
+ }, "aria-expanded": __classPrivateFieldGet(this, _Button_instances, "a", _Button_ariaExpanded_get), "aria-haspopup": __classPrivateFieldGet(this, _Button_instances, "a", _Button_ariaHaspopup_get), "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), "data-action": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedAction_get), disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, onBlur: __classPrivateFieldGet(this, _Button_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Button_onFocus, "f"), ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, role: Tag === 'a' && this.download !== undefined ? 'button' : undefined, tabIndex: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) ? disabledTabIndex : this.tabIndex, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value, ...__classPrivateFieldGet(this, _Button_inheritedAttributes, "f") }, this.iconName !== undefined && this.iconName !== '' && (index.h("qds-icon", { key: 'ce954df6c6900de8b6a7bf22ef89d2a01c8073bf', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: this.iconLibrary, name: this.iconName })), this.text !== undefined && this.text !== '' && (index.h("span", { key: '80d260622ec9e49a3373b63f4bf6ecf35df11bcc', class: { 'qds-overflow': __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) !== 'hero' }, ref: __classPrivateFieldGet(this, _Button_spanRef, "f") }, this.text)), isIndicator(this.badge) && (index.h("qds-badge-indicator", { key: '04989f27c181ddb128ad9154a6bfbb9fdad6fd18', class: "qds-indicator", status: this.badgeIndicatorStatus, description: this.badgeDescription, size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true })), isCounter(this.badge) && (index.h("qds-badge-counter", { key: 'b36c3e954b09b2353447d1b1fcc51a1972e24abe', class: {
153
+ 'qds-indicator': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
154
+ }, description: this.badgeDescription, importance: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true, value: this.badge })), __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) !== undefined && (index.h("qds-icon", { key: 'aa1a1dbe8fe6b5503c80414a2969f202352e04a3', "aria-hidden": "true", class: "qds-icon qds-action", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: "core", name: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) }))), index.h("div", { key: '4ebdc7e6ad9f8acd5f80b3bd0bd07ca2e6d785ac', class: {
155
+ 'qds-focus-ring': true,
156
+ 'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
157
+ }, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) }), this.tooltip && (index.h("qds-tooltip", { key: '402615a2b1f4a93674f3018a8c1e620674810b95', ref: __classPrivateFieldGet(this, _Button_tooltipRef, "f") }, this.text))));
158
+ }
159
+ static get delegatesFocus() { return true; }
160
+ get host() { return index.getElement(this); }
161
+ static get watchers() { return {
162
+ "tabindex": ["tabindexChanged"],
163
+ "text": ["textChanged"]
164
+ }; }
165
+ };
166
+ _Button_button = new WeakMap(), _Button_span = new WeakMap(), _Button_ro = new WeakMap(), _Button_inheritedAttributes = new WeakMap(), _Button_onBlur = new WeakMap(), _Button_onFocus = new WeakMap(), _Button_buttonRef = new WeakMap(), _Button_spanRef = new WeakMap(), _Button_tooltipRef = new WeakMap(), _Button_instances = new WeakSet(), _Button_ariaExpanded_get = function _Button_ariaExpanded_get() {
167
+ switch (__classPrivateFieldGet(this, _Button_instances, "a", _Button_computedAction_get)) {
168
+ case 'dropdown': {
169
+ return 'false';
170
+ }
171
+ case 'dropdown-close': {
172
+ return 'true';
173
+ }
174
+ default: {
175
+ return undefined;
176
+ }
177
+ }
178
+ }, _Button_ariaHaspopup_get = function _Button_ariaHaspopup_get() {
179
+ switch (this.popupType) {
180
+ case 'dialog':
181
+ case 'grid':
182
+ case 'menu':
183
+ case 'tree':
184
+ case 'true': {
185
+ return this.popupType;
186
+ }
187
+ default: {
188
+ return undefined;
189
+ }
190
+ }
191
+ }, _Button_formElement_get = function _Button_formElement_get() {
72
192
  return this.form !== undefined && this.form !== ''
73
- ? document.querySelector(`#${this.form}`)
74
- : this.element.closest('form');
75
- }
76
- get buttonType() {
193
+ ? document.querySelector(`#${this.form}`)
194
+ : this.host.closest('form');
195
+ }, _Button_buttonType_get = function _Button_buttonType_get() {
77
196
  if (this.type === undefined)
78
- return this.formElement ? 'submit' : 'button';
197
+ return __classPrivateFieldGet(this, _Button_instances, "a", _Button_formElement_get) ? 'submit' : 'button';
79
198
  return this.type;
80
- }
81
- get iconOnly() {
199
+ }, _Button_iconOnly_get = function _Button_iconOnly_get() {
82
200
  const hasIcon = this.iconName !== undefined && this.iconName !== '';
83
201
  const hasNoLabel = this.text === undefined || this.text === '';
84
202
  return hasIcon && hasNoLabel;
85
- }
86
- get computedDisabled() {
203
+ }, _Button_computedAction_get = function _Button_computedAction_get() {
204
+ switch (this.action) {
205
+ case 'dropdown':
206
+ case 'dropdown-close':
207
+ case 'next': {
208
+ return this.action;
209
+ }
210
+ default: {
211
+ return undefined;
212
+ }
213
+ }
214
+ }, _Button_computedActionIcon_get = function _Button_computedActionIcon_get() {
215
+ switch (this.action) {
216
+ case 'dropdown':
217
+ case 'next': {
218
+ return this.action;
219
+ }
220
+ case 'dropdown-close': {
221
+ return 'dropdown';
222
+ }
223
+ default: {
224
+ return undefined;
225
+ }
226
+ }
227
+ }, _Button_computedDisabled_get = function _Button_computedDisabled_get() {
87
228
  return this.disabled ?? false;
88
- }
89
- get computedTabIndex() {
90
- const parsedValue = Number.parseInt(this.inheritedAttributes.tabindex, 10);
91
- return Number.isNaN(parsedValue) ? 0 : parsedValue;
92
- }
93
- componentWillLoad() {
94
- this.inheritedAttributes = helpers.inheritAriaAttributes(this.element);
95
- }
96
- render() {
97
- const Tag = this.href === undefined ? 'button' : 'a';
98
- return (index.h(Tag, { "aria-disabled": this.computedDisabled ? 'true' : 'false', class: {
99
- button: true,
100
- 'icon-only': this.iconOnly,
101
- }, "data-importance": this.importance, "data-size": this.size, disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, onBlur: this.onBlur, onClick: this.onClick, onFocus: this.onFocus, rel: Tag === 'a' ? 'noreferrer noopener' : undefined, role: Tag === 'a' ? 'button' : undefined, tabIndex: this.computedDisabled ? -1 : this.computedTabIndex, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : this.buttonType, value: Tag === 'a' ? undefined : this.value, ...this.inheritedAttributes }, this.iconName !== undefined && this.iconName !== '' && (index.h("qds-icon", { class: "icon", "data-size": this.size, library: this.iconLibrary, name: this.iconName })), this.text));
102
- }
103
- static get delegatesFocus() { return true; }
104
- get element() { return index.getElement(this); }
229
+ }, _Button_computedImportance_get = function _Button_computedImportance_get() {
230
+ switch (this.importance) {
231
+ case 'emphasized':
232
+ case 'subdued':
233
+ case 'destructive':
234
+ case 'subdued-destructive': {
235
+ return this.importance;
236
+ }
237
+ default: {
238
+ return 'standard';
239
+ }
240
+ }
241
+ }, _Button_computedSize_get = function _Button_computedSize_get() {
242
+ switch (this.size) {
243
+ case 'small':
244
+ case 'large':
245
+ case 'hero': {
246
+ return this.size;
247
+ }
248
+ default: {
249
+ return 'standard';
250
+ }
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AK,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,KAClDA,sBACE,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":["pickFocusEventAttributes","inheritAriaAttributes","h"],"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(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
1
+ {"file":"qds-button.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,SAAS,GAAG,40RAA40R,CAAC;AAC/1R,wBAAe,SAAS;;ACDxB;AACA;AACA;;;;;;;;;;;;;;;;;;AAkCA,MAAM,SAAS,GAAG,CAAC,KAAc,KAC/B,OAAO,KAAK,KAAK,QAAQ;MACrB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;MACvC,OAAO,KAAK,KAAK,QAAQ,CAAA;AAE/B,MAAM,WAAW,GAAG,CAAC,KAAc,KACjC,KAAK,KAAK,EAAE,IA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,IAAI,KAAK,CAAA;AAC/B,CAAC;IAGC,QAAQ,IAAI,CAAC,UAAU;QACrB,KAAK,YAAY,CAAC;QAClB,KAAK,SAAS,CAAC;QACf,KAAK,aAAa,CAAC;QACnB,KAAK,qBAAqB,EAAE;YAC1B,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;","names":["pickFocusEventAttributes","isOverflowing","inheritAriaAttributes","h"],"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-container,\n.qds-button,\n.qds-overflow {\n width: inherit;\n}\n\n.qds-button:disabled,\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-overflow {\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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 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 padding-inline: 0;\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 padding-inline: 0;\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 padding-inline: 0;\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='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 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 { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n isOverflowing,\n pickFocusEventAttributes,\n} from '../../helpers'\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'\nexport type PopupType = 'dialog' | 'grid' | 'menu' | 'tree' | 'true'\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 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 * Indicates the type of interactive popup element that can be triggered by\n * the `qds-button`.\n */\n @Prop() public readonly popupType?: PopupType\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 * 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>`](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][] 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 * 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 * 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 host!: HTMLQdsButtonElement\n\n @State() private tabIndex?: number\n\n @State() private tooltip = false\n\n #button?: HTMLAnchorElement | HTMLButtonElement\n\n #span?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #inheritedAttributes: Attributes = {}\n\n get #ariaExpanded(): 'false' | 'true' | undefined {\n switch (this.#computedAction) {\n case 'dropdown': {\n return 'false'\n }\n case 'dropdown-close': {\n return 'true'\n }\n default: {\n return undefined\n }\n }\n }\n\n get #ariaHaspopup(): PopupType | undefined {\n switch (this.popupType) {\n case 'dialog':\n case 'grid':\n case 'menu':\n case 'tree':\n case 'true': {\n return this.popupType\n }\n default: {\n return undefined\n }\n }\n }\n\n get #formElement(): HTMLElement | null {\n return this.form !== undefined && this.form !== ''\n ? document.querySelector(`#${this.form}`)\n : this.host.closest('form')\n }\n\n get #buttonType(): ButtonType {\n if (this.type === undefined) return this.#formElement ? 'submit' : 'button'\n return this.type\n }\n\n 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 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.#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 @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 if (this.#ro) this.#ro.disconnect()\n\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.#inheritedAttributes = inheritAriaAttributes(this.host)\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 ariaDisabled = this.#computedDisabled ? 'true' : undefined\n const disabledTabIndex = Tag === 'a' ? -1 : undefined\n\n return (\n <div class=\"qds-container\">\n <Tag\n aria-disabled={Tag === 'a' ? ariaDisabled : undefined}\n class={{\n 'qds-button': true,\n 'qds-icon-only': this.#iconOnly,\n }}\n aria-expanded={this.#ariaExpanded}\n aria-haspopup={this.#ariaHaspopup}\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 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 role={\n Tag === 'a' && this.download !== undefined ? 'button' : undefined\n }\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 // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\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.text !== undefined && this.text !== '' && (\n <span\n class={{ 'qds-overflow': this.#computedSize !== 'hero' }}\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 ref={this.#tooltipRef}>{this.text}</qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #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"],"version":3}