@six-group/ui-library 0.0.0-insider.afba913 → 0.0.0-insider.b0fd8e9

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 (632) hide show
  1. package/dist/cjs/animation-ZgWV0fC6.js +54 -0
  2. package/dist/cjs/animation-ZgWV0fC6.js.map +1 -0
  3. package/dist/cjs/{form-control-Ditp8yHw.js → form-control-CX8QRq9v.js} +3 -3
  4. package/dist/cjs/{form-control-Ditp8yHw.js.map → form-control-CX8QRq9v.js.map} +1 -1
  5. package/dist/cjs/icon-4irykc7V.js +17 -0
  6. package/dist/cjs/icon-4irykc7V.js.map +1 -0
  7. package/dist/cjs/{index-BKTrCUjx.js → index-C8rK7OAe.js} +19 -11
  8. package/dist/{esm/index-D0Go1Zjj.js.map → cjs/index-C8rK7OAe.js.map} +1 -1
  9. package/dist/cjs/index.cjs.js +3 -0
  10. package/dist/cjs/index.cjs.js.map +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/six-alert.cjs.entry.js +1 -1
  13. package/dist/cjs/six-avatar.cjs.entry.js +3 -3
  14. package/dist/cjs/six-badge.cjs.entry.js +3 -3
  15. package/dist/cjs/six-breadcrumbs-item.cjs.entry.js +25 -0
  16. package/dist/cjs/six-breadcrumbs-item.cjs.entry.js.map +1 -0
  17. package/dist/cjs/six-breadcrumbs-item.entry.cjs.js.map +1 -0
  18. package/dist/cjs/six-breadcrumbs.cjs.entry.js +73 -0
  19. package/dist/cjs/six-breadcrumbs.cjs.entry.js.map +1 -0
  20. package/dist/cjs/six-breadcrumbs.entry.cjs.js.map +1 -0
  21. package/dist/cjs/six-button.six-spinner.entry.cjs.js.map +1 -0
  22. package/dist/cjs/{six-button.cjs.entry.js → six-button_2.cjs.entry.js} +56 -5
  23. package/dist/cjs/six-button_2.cjs.entry.js.map +1 -0
  24. package/dist/cjs/six-card.cjs.entry.js +2 -2
  25. package/dist/cjs/six-checkbox_2.cjs.entry.js +6 -6
  26. package/dist/cjs/six-date.cjs.entry.js +59 -52
  27. package/dist/cjs/six-date.cjs.entry.js.map +1 -1
  28. package/dist/cjs/six-date.entry.cjs.js.map +1 -1
  29. package/dist/cjs/six-datepicker.cjs.entry.js +4 -4
  30. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  31. package/dist/cjs/six-datepicker.entry.cjs.js.map +1 -1
  32. package/dist/cjs/six-details.cjs.entry.js +4 -4
  33. package/dist/cjs/six-dialog.cjs.entry.js +16 -10
  34. package/dist/cjs/six-dialog.cjs.entry.js.map +1 -1
  35. package/dist/cjs/six-dialog.entry.cjs.js.map +1 -1
  36. package/dist/cjs/six-drawer.cjs.entry.js +16 -10
  37. package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
  38. package/dist/cjs/six-drawer.entry.cjs.js.map +1 -1
  39. package/dist/cjs/six-dropdown.six-menu.entry.cjs.js.map +1 -1
  40. package/dist/cjs/six-dropdown_2.cjs.entry.js +9 -9
  41. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  42. package/dist/cjs/six-error-page.cjs.entry.js +2 -2
  43. package/dist/cjs/six-error.cjs.entry.js +2 -2
  44. package/dist/cjs/six-file-list-item.cjs.entry.js +3 -3
  45. package/dist/cjs/six-file-list.cjs.entry.js +2 -2
  46. package/dist/cjs/six-file-upload.cjs.entry.js +13 -8
  47. package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
  48. package/dist/cjs/six-file-upload.entry.cjs.js.map +1 -1
  49. package/dist/cjs/six-footer.cjs.entry.js +2 -2
  50. package/dist/cjs/six-group-label.cjs.entry.js +3 -3
  51. package/dist/cjs/six-header-dropdown-item.cjs.entry.js +3 -3
  52. package/dist/cjs/six-header-item.cjs.entry.js +2 -2
  53. package/dist/cjs/six-header-menu-button.cjs.entry.js +2 -2
  54. package/dist/cjs/six-header.cjs.entry.js +3 -3
  55. package/dist/cjs/six-icon-button.cjs.entry.js +4 -4
  56. package/dist/cjs/six-icon.cjs.entry.js +16 -7
  57. package/dist/cjs/six-icon.cjs.entry.js.map +1 -1
  58. package/dist/cjs/six-icon.entry.cjs.js.map +1 -1
  59. package/dist/cjs/six-input.cjs.entry.js +5 -5
  60. package/dist/cjs/six-item-picker.cjs.entry.js +1 -1
  61. package/dist/cjs/six-language-switcher.cjs.entry.js +2 -2
  62. package/dist/cjs/six-layout-grid.cjs.entry.js +2 -2
  63. package/dist/cjs/six-logo.cjs.entry.js +1 -1
  64. package/dist/cjs/six-main-container.cjs.entry.js +2 -2
  65. package/dist/cjs/six-menu-divider.cjs.entry.js +2 -2
  66. package/dist/cjs/six-menu-label.cjs.entry.js +2 -2
  67. package/dist/cjs/six-picto.cjs.entry.js +2 -2
  68. package/dist/cjs/six-progress-bar.cjs.entry.js +4 -4
  69. package/dist/cjs/six-progress-ring.cjs.entry.js +2 -2
  70. package/dist/cjs/six-radio.cjs.entry.js +3 -3
  71. package/dist/cjs/six-range.cjs.entry.js +4 -4
  72. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  73. package/dist/cjs/six-range.entry.cjs.js.map +1 -1
  74. package/dist/cjs/six-rating.cjs.entry.js +126 -0
  75. package/dist/cjs/six-rating.cjs.entry.js.map +1 -0
  76. package/dist/cjs/six-rating.entry.cjs.js.map +1 -0
  77. package/dist/cjs/six-root.cjs.entry.js +2 -2
  78. package/dist/cjs/six-search-field.cjs.entry.js +2 -2
  79. package/dist/cjs/six-select.cjs.entry.js +8 -8
  80. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +1 -1
  81. package/dist/cjs/six-sidebar-item.cjs.entry.js +3 -3
  82. package/dist/cjs/six-sidebar.cjs.entry.js +3 -3
  83. package/dist/cjs/six-stage-indicator.cjs.entry.js +1 -1
  84. package/dist/cjs/six-switch.cjs.entry.js +4 -4
  85. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  86. package/dist/cjs/six-switch.entry.cjs.js.map +1 -1
  87. package/dist/cjs/six-tab-group.cjs.entry.js +5 -38
  88. package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
  89. package/dist/cjs/six-tab-group.entry.cjs.js.map +1 -1
  90. package/dist/cjs/six-tab-panel.cjs.entry.js +2 -2
  91. package/dist/cjs/six-tab.cjs.entry.js +4 -4
  92. package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
  93. package/dist/cjs/six-tab.entry.cjs.js.map +1 -1
  94. package/dist/cjs/six-tag.cjs.entry.js +3 -3
  95. package/dist/cjs/six-textarea.cjs.entry.js +4 -4
  96. package/dist/cjs/six-tile.cjs.entry.js +6 -6
  97. package/dist/cjs/six-timepicker.cjs.entry.js +19 -11
  98. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  99. package/dist/cjs/six-timepicker.entry.cjs.js.map +1 -1
  100. package/dist/cjs/six-tooltip.cjs.entry.js +3 -3
  101. package/dist/cjs/ui-library.cjs.js +3 -3
  102. package/dist/cjs/ui-library.cjs.js.map +1 -1
  103. package/dist/collection/collection-manifest.json +6 -3
  104. package/dist/collection/components/six-avatar/six-avatar.js +2 -2
  105. package/dist/collection/components/six-badge/six-badge.js +2 -2
  106. package/dist/collection/components/six-breadcrumbs/six-breadcrumbs.css +27 -0
  107. package/dist/collection/components/six-breadcrumbs/six-breadcrumbs.js +109 -0
  108. package/dist/collection/components/six-breadcrumbs/six-breadcrumbs.js.map +1 -0
  109. package/dist/collection/components/six-breadcrumbs-item/six-breadcrumbs-item.css +61 -0
  110. package/dist/collection/components/six-breadcrumbs-item/six-breadcrumbs-item.js +123 -0
  111. package/dist/collection/components/six-breadcrumbs-item/six-breadcrumbs-item.js.map +1 -0
  112. package/dist/collection/components/six-button/six-button.js +2 -2
  113. package/dist/collection/components/six-card/six-card.js +1 -1
  114. package/dist/collection/components/six-checkbox/six-checkbox.js +2 -2
  115. package/dist/collection/components/six-date/iso-date.js +34 -2
  116. package/dist/collection/components/six-date/iso-date.js.map +1 -1
  117. package/dist/collection/components/six-date/six-date.js +28 -73
  118. package/dist/collection/components/six-date/six-date.js.map +1 -1
  119. package/dist/collection/components/six-datepicker/six-datepicker.js +4 -4
  120. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  121. package/dist/collection/components/six-details/six-details.js +3 -3
  122. package/dist/collection/components/six-dialog/six-dialog.js +23 -17
  123. package/dist/collection/components/six-dialog/six-dialog.js.map +1 -1
  124. package/dist/collection/components/six-drawer/six-drawer.js +23 -17
  125. package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
  126. package/dist/collection/components/six-dropdown/six-dropdown.js +5 -5
  127. package/dist/collection/components/six-error/six-error.js +1 -1
  128. package/dist/collection/components/six-error-page/six-error-page.js +1 -1
  129. package/dist/collection/components/six-file-list/six-file-list.js +1 -1
  130. package/dist/collection/components/six-file-list-item/six-file-list-item.js +2 -2
  131. package/dist/collection/components/six-file-upload/six-file-upload.js +12 -7
  132. package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -1
  133. package/dist/collection/components/six-footer/six-footer.js +1 -1
  134. package/dist/collection/components/six-group-label/six-group-label.js +1 -1
  135. package/dist/collection/components/six-header/six-header.js +2 -2
  136. package/dist/collection/components/six-header-dropdown-item/six-header-dropdown-item.js +2 -2
  137. package/dist/collection/components/six-header-item/six-header-item.js +1 -1
  138. package/dist/collection/components/six-header-menu-button/six-header-menu-button.js +1 -1
  139. package/dist/collection/components/six-icon/six-icon.css +46 -29
  140. package/dist/collection/components/six-icon/six-icon.js +39 -5
  141. package/dist/collection/components/six-icon/six-icon.js.map +1 -1
  142. package/dist/collection/components/six-icon-button/six-icon-button.js +3 -3
  143. package/dist/collection/components/six-input/six-input.js +3 -3
  144. package/dist/collection/components/six-language-switcher/six-language-switcher.js +1 -1
  145. package/dist/collection/components/six-layout-grid/six-layout-grid.js +1 -1
  146. package/dist/collection/components/six-main-container/six-main-container.js +1 -1
  147. package/dist/collection/components/six-menu/six-menu.js +3 -3
  148. package/dist/collection/components/six-menu/six-menu.js.map +1 -1
  149. package/dist/collection/components/six-menu-divider/six-menu-divider.js +1 -1
  150. package/dist/collection/components/six-menu-item/six-menu-item.js +2 -2
  151. package/dist/collection/components/six-menu-label/six-menu-label.js +1 -1
  152. package/dist/collection/components/six-picto/six-picto.js +1 -1
  153. package/dist/collection/components/six-progress-bar/six-progress-bar.js +3 -3
  154. package/dist/collection/components/six-progress-ring/six-progress-ring.js +1 -1
  155. package/dist/collection/components/six-radio/six-radio.js +2 -2
  156. package/dist/collection/components/six-range/six-range.js +2 -2
  157. package/dist/collection/components/six-rating/six-rating.css +125 -0
  158. package/dist/collection/components/six-rating/six-rating.js +432 -0
  159. package/dist/collection/components/six-rating/six-rating.js.map +1 -0
  160. package/dist/collection/components/six-root/six-root.js +1 -1
  161. package/dist/collection/components/six-search-field/six-search-field.js +1 -1
  162. package/dist/collection/components/six-select/six-select.js +6 -6
  163. package/dist/collection/components/six-sidebar/six-sidebar.js +2 -2
  164. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
  165. package/dist/collection/components/six-switch/six-switch.js +2 -2
  166. package/dist/collection/components/six-tab/six-tab.css +12 -0
  167. package/dist/collection/components/six-tab/six-tab.js +2 -2
  168. package/dist/collection/components/six-tab/six-tab.js.map +1 -1
  169. package/dist/collection/components/six-tab-group/six-tab-group.js +2 -2
  170. package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
  171. package/dist/collection/components/six-tag/six-tag.js +2 -2
  172. package/dist/collection/components/six-textarea/six-textarea.js +2 -2
  173. package/dist/collection/components/six-tile/six-tile.js +5 -5
  174. package/dist/collection/components/six-timepicker/six-timepicker.js +18 -10
  175. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  176. package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
  177. package/dist/collection/files/material-symbols-outlined-latin-fill-normal.woff2 +0 -0
  178. package/dist/collection/files/material-symbols-outlined-latin-full-normal.woff2 +0 -0
  179. package/dist/collection/files/material-symbols-outlined-latin-grad-normal.woff2 +0 -0
  180. package/dist/collection/files/material-symbols-outlined-latin-opsz-normal.woff2 +0 -0
  181. package/dist/collection/files/material-symbols-outlined-latin-standard-normal.woff2 +0 -0
  182. package/dist/collection/files/material-symbols-outlined-latin-wght-normal.woff2 +0 -0
  183. package/dist/collection/files/material-symbols-rounded-latin-fill-normal.woff2 +0 -0
  184. package/dist/collection/files/material-symbols-rounded-latin-full-normal.woff2 +0 -0
  185. package/dist/collection/files/material-symbols-rounded-latin-grad-normal.woff2 +0 -0
  186. package/dist/collection/files/material-symbols-rounded-latin-opsz-normal.woff2 +0 -0
  187. package/dist/collection/files/material-symbols-rounded-latin-standard-normal.woff2 +0 -0
  188. package/dist/collection/files/material-symbols-rounded-latin-wght-normal.woff2 +0 -0
  189. package/dist/collection/files/material-symbols-sharp-latin-fill-normal.woff2 +0 -0
  190. package/dist/collection/files/material-symbols-sharp-latin-full-normal.woff2 +0 -0
  191. package/dist/collection/files/material-symbols-sharp-latin-grad-normal.woff2 +0 -0
  192. package/dist/collection/files/material-symbols-sharp-latin-opsz-normal.woff2 +0 -0
  193. package/dist/collection/files/material-symbols-sharp-latin-standard-normal.woff2 +0 -0
  194. package/dist/collection/files/material-symbols-sharp-latin-wght-normal.woff2 +0 -0
  195. package/dist/collection/index.js +1 -0
  196. package/dist/collection/index.js.map +1 -1
  197. package/dist/collection/utils/animation.js +13 -0
  198. package/dist/collection/utils/animation.js.map +1 -1
  199. package/dist/collection/utils/icon.js +10 -0
  200. package/dist/collection/utils/icon.js.map +1 -0
  201. package/dist/components/index.js +8 -1
  202. package/dist/components/index.js.map +1 -1
  203. package/dist/components/{p-DV46ui1Q.js → p-BB2rei7y.js} +3 -3
  204. package/dist/components/{p-DV46ui1Q.js.map → p-BB2rei7y.js.map} +1 -1
  205. package/dist/components/{p-Cemjz04k.js → p-BDCdPEjW.js} +6 -6
  206. package/dist/components/p-BDCdPEjW.js.map +1 -0
  207. package/dist/components/{p-eZGoeOrd.js → p-BFxDUwBI.js} +5 -5
  208. package/dist/components/{p-eZGoeOrd.js.map → p-BFxDUwBI.js.map} +1 -1
  209. package/dist/components/{p-D45ehsSM.js → p-BKl-wAjt.js} +7 -7
  210. package/dist/components/{p-D45ehsSM.js.map → p-BKl-wAjt.js.map} +1 -1
  211. package/dist/components/{p-Cr6sHYme.js → p-BLocui1Z.js} +4 -4
  212. package/dist/components/{p-Cr6sHYme.js.map → p-BLocui1Z.js.map} +1 -1
  213. package/dist/components/{p-Dl9jKaw7.js → p-C-TgkYhI.js} +9 -9
  214. package/dist/components/{p-Dl9jKaw7.js.map → p-C-TgkYhI.js.map} +1 -1
  215. package/dist/components/{p-CT9Wgs8K.js → p-C6ozoFuw.js} +15 -15
  216. package/dist/components/{p-CT9Wgs8K.js.map → p-C6ozoFuw.js.map} +1 -1
  217. package/dist/components/p-C84iXIFp.js +71 -0
  218. package/dist/components/p-C84iXIFp.js.map +1 -0
  219. package/dist/components/{p-DXhOme6Y.js → p-CH82uB3t.js} +4 -4
  220. package/dist/components/{p-DXhOme6Y.js.map → p-CH82uB3t.js.map} +1 -1
  221. package/dist/components/{p-ltzGzaAu.js → p-CKhg9ibv.js} +3 -3
  222. package/dist/components/{p-ltzGzaAu.js.map → p-CKhg9ibv.js.map} +1 -1
  223. package/dist/components/{p-eW-dQ-wI.js → p-CSfxA66i.js} +7 -7
  224. package/dist/components/{p-eW-dQ-wI.js.map → p-CSfxA66i.js.map} +1 -1
  225. package/dist/components/{p-DdgOKe4B.js → p-CXsF3egB.js} +11 -11
  226. package/dist/components/{p-DdgOKe4B.js.map → p-CXsF3egB.js.map} +1 -1
  227. package/dist/components/{p-B-jadcQD.js → p-C_slMKPO.js} +26 -18
  228. package/dist/components/p-C_slMKPO.js.map +1 -0
  229. package/dist/components/{p-BtF2Ym6T.js → p-D512q9rn.js} +17 -4
  230. package/dist/components/p-D512q9rn.js.map +1 -0
  231. package/dist/components/{p-BmW8cpEG.js → p-DIkvCBxr.js} +3 -3
  232. package/dist/components/{p-BmW8cpEG.js.map → p-DIkvCBxr.js.map} +1 -1
  233. package/dist/components/{p-CLtU4Br-.js → p-DQrAnsWb.js} +4 -4
  234. package/dist/components/{p-CLtU4Br-.js.map → p-DQrAnsWb.js.map} +1 -1
  235. package/dist/components/{p-DT1sZALq.js → p-DrZr0hMT.js} +7 -7
  236. package/dist/components/{p-DT1sZALq.js.map → p-DrZr0hMT.js.map} +1 -1
  237. package/dist/components/p-SLlDVtvF.js +51 -0
  238. package/dist/components/p-SLlDVtvF.js.map +1 -0
  239. package/dist/components/{p-6HRX2kde.js → p-SZP6K3B0.js} +8 -8
  240. package/dist/components/{p-6HRX2kde.js.map → p-SZP6K3B0.js.map} +1 -1
  241. package/dist/components/{p-CYrYPnLQ.js → p-jflTvJ8E.js} +5 -5
  242. package/dist/components/{p-CYrYPnLQ.js.map → p-jflTvJ8E.js.map} +1 -1
  243. package/dist/components/six-alert.js +3 -3
  244. package/dist/components/six-avatar.js +4 -4
  245. package/dist/components/six-badge.js +3 -3
  246. package/dist/components/six-breadcrumbs-item.d.ts +11 -0
  247. package/dist/components/six-breadcrumbs-item.js +58 -0
  248. package/dist/components/six-breadcrumbs-item.js.map +1 -0
  249. package/dist/components/six-breadcrumbs.d.ts +11 -0
  250. package/dist/components/six-breadcrumbs.js +97 -0
  251. package/dist/components/six-breadcrumbs.js.map +1 -0
  252. package/dist/components/six-button.js +1 -1
  253. package/dist/components/six-card.js +2 -2
  254. package/dist/components/six-checkbox.js +1 -1
  255. package/dist/components/six-date.js +63 -57
  256. package/dist/components/six-date.js.map +1 -1
  257. package/dist/components/six-datepicker.js +10 -10
  258. package/dist/components/six-datepicker.js.map +1 -1
  259. package/dist/components/six-details.js +1 -1
  260. package/dist/components/six-dialog.js +18 -12
  261. package/dist/components/six-dialog.js.map +1 -1
  262. package/dist/components/six-drawer.js +18 -12
  263. package/dist/components/six-drawer.js.map +1 -1
  264. package/dist/components/six-dropdown.js +1 -1
  265. package/dist/components/six-error-page.js +3 -3
  266. package/dist/components/six-error.js +1 -1
  267. package/dist/components/six-file-list-item.js +4 -4
  268. package/dist/components/six-file-list.js +2 -2
  269. package/dist/components/six-file-upload.js +16 -11
  270. package/dist/components/six-file-upload.js.map +1 -1
  271. package/dist/components/six-footer.js +2 -2
  272. package/dist/components/six-group-label.js +4 -4
  273. package/dist/components/six-header-dropdown-item.js +10 -10
  274. package/dist/components/six-header-item.js +2 -2
  275. package/dist/components/six-header-menu-button.js +4 -4
  276. package/dist/components/six-header.js +3 -3
  277. package/dist/components/six-icon-button.js +1 -1
  278. package/dist/components/six-icon.js +1 -1
  279. package/dist/components/six-input.js +1 -1
  280. package/dist/components/six-item-picker.js +1 -1
  281. package/dist/components/six-language-switcher.js +2 -2
  282. package/dist/components/six-layout-grid.js +2 -2
  283. package/dist/components/six-logo.js +1 -1
  284. package/dist/components/six-main-container.js +2 -2
  285. package/dist/components/six-menu-divider.js +2 -2
  286. package/dist/components/six-menu-item.js +1 -1
  287. package/dist/components/six-menu-label.js +2 -2
  288. package/dist/components/six-menu.js +1 -1
  289. package/dist/components/six-picto.js +1 -1
  290. package/dist/components/six-progress-bar.js +4 -4
  291. package/dist/components/six-progress-ring.js +2 -2
  292. package/dist/components/six-radio.js +3 -3
  293. package/dist/components/six-range.js +5 -5
  294. package/dist/components/six-range.js.map +1 -1
  295. package/dist/components/six-rating.d.ts +11 -0
  296. package/dist/components/six-rating.js +173 -0
  297. package/dist/components/six-rating.js.map +1 -0
  298. package/dist/components/six-root.js +4 -4
  299. package/dist/components/six-search-field.js +6 -6
  300. package/dist/components/six-select.js +19 -19
  301. package/dist/components/six-sidebar-item-group.js +3 -3
  302. package/dist/components/six-sidebar-item.js +4 -4
  303. package/dist/components/six-sidebar.js +3 -3
  304. package/dist/components/six-spinner.js +1 -1
  305. package/dist/components/six-stage-indicator.js +1 -1
  306. package/dist/components/six-switch.js +5 -5
  307. package/dist/components/six-switch.js.map +1 -1
  308. package/dist/components/six-tab-group.js +6 -39
  309. package/dist/components/six-tab-group.js.map +1 -1
  310. package/dist/components/six-tab-panel.js +2 -2
  311. package/dist/components/six-tab.js +6 -6
  312. package/dist/components/six-tab.js.map +1 -1
  313. package/dist/components/six-tag.js +7 -7
  314. package/dist/components/six-textarea.js +5 -5
  315. package/dist/components/six-tile.js +9 -9
  316. package/dist/components/six-timepicker.js +1 -1
  317. package/dist/components/six-tooltip.js +1 -1
  318. package/dist/components.json +3044 -687
  319. package/dist/esm/animation-SLlDVtvF.js +51 -0
  320. package/dist/esm/animation-SLlDVtvF.js.map +1 -0
  321. package/dist/esm/{execution-control-ltzGzaAu.js → execution-control-CKhg9ibv.js} +3 -3
  322. package/dist/esm/{execution-control-ltzGzaAu.js.map → execution-control-CKhg9ibv.js.map} +1 -1
  323. package/dist/esm/{form-control-D_uS8E6o.js → form-control-DI6V1ZhR.js} +3 -3
  324. package/dist/esm/{form-control-D_uS8E6o.js.map → form-control-DI6V1ZhR.js.map} +1 -1
  325. package/dist/esm/icon-DqHJRLQQ.js +14 -0
  326. package/dist/esm/icon-DqHJRLQQ.js.map +1 -0
  327. package/dist/esm/{index-D0Go1Zjj.js → index-JoG9I7EO.js} +19 -11
  328. package/dist/{cjs/index-BKTrCUjx.js.map → esm/index-JoG9I7EO.js.map} +1 -1
  329. package/dist/esm/index.js +1 -0
  330. package/dist/esm/index.js.map +1 -1
  331. package/dist/esm/loader.js +3 -3
  332. package/dist/esm/six-alert.entry.js +1 -1
  333. package/dist/esm/six-avatar.entry.js +3 -3
  334. package/dist/esm/six-badge.entry.js +3 -3
  335. package/dist/esm/six-breadcrumbs-item.entry.js +23 -0
  336. package/dist/esm/six-breadcrumbs-item.entry.js.map +1 -0
  337. package/dist/esm/six-breadcrumbs.entry.js +71 -0
  338. package/dist/esm/six-breadcrumbs.entry.js.map +1 -0
  339. package/dist/esm/six-button.six-spinner.entry.js.map +1 -0
  340. package/dist/esm/{six-button.entry.js → six-button_2.entry.js} +56 -6
  341. package/dist/esm/six-button_2.entry.js.map +1 -0
  342. package/dist/esm/six-card.entry.js +2 -2
  343. package/dist/esm/six-checkbox_2.entry.js +6 -6
  344. package/dist/esm/six-date.entry.js +59 -52
  345. package/dist/esm/six-date.entry.js.map +1 -1
  346. package/dist/esm/six-datepicker.entry.js +5 -5
  347. package/dist/esm/six-datepicker.entry.js.map +1 -1
  348. package/dist/esm/six-details.entry.js +4 -4
  349. package/dist/esm/six-dialog.entry.js +16 -10
  350. package/dist/esm/six-dialog.entry.js.map +1 -1
  351. package/dist/esm/six-drawer.entry.js +16 -10
  352. package/dist/esm/six-drawer.entry.js.map +1 -1
  353. package/dist/esm/six-dropdown.six-menu.entry.js.map +1 -1
  354. package/dist/esm/six-dropdown_2.entry.js +10 -10
  355. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  356. package/dist/esm/six-error-page.entry.js +2 -2
  357. package/dist/esm/six-error.entry.js +2 -2
  358. package/dist/esm/six-file-list-item.entry.js +3 -3
  359. package/dist/esm/six-file-list.entry.js +2 -2
  360. package/dist/esm/six-file-upload.entry.js +13 -8
  361. package/dist/esm/six-file-upload.entry.js.map +1 -1
  362. package/dist/esm/six-footer.entry.js +2 -2
  363. package/dist/esm/six-group-label.entry.js +3 -3
  364. package/dist/esm/six-header-dropdown-item.entry.js +3 -3
  365. package/dist/esm/six-header-item.entry.js +2 -2
  366. package/dist/esm/six-header-menu-button.entry.js +2 -2
  367. package/dist/esm/six-header.entry.js +3 -3
  368. package/dist/esm/six-icon-button.entry.js +4 -4
  369. package/dist/esm/six-icon.entry.js +16 -7
  370. package/dist/esm/six-icon.entry.js.map +1 -1
  371. package/dist/esm/six-input.entry.js +5 -5
  372. package/dist/esm/six-item-picker.entry.js +2 -2
  373. package/dist/esm/six-language-switcher.entry.js +2 -2
  374. package/dist/esm/six-layout-grid.entry.js +2 -2
  375. package/dist/esm/six-logo.entry.js +1 -1
  376. package/dist/esm/six-main-container.entry.js +2 -2
  377. package/dist/esm/six-menu-divider.entry.js +2 -2
  378. package/dist/esm/six-menu-label.entry.js +2 -2
  379. package/dist/esm/six-picto.entry.js +2 -2
  380. package/dist/esm/six-progress-bar.entry.js +4 -4
  381. package/dist/esm/six-progress-ring.entry.js +2 -2
  382. package/dist/esm/six-radio.entry.js +3 -3
  383. package/dist/esm/six-range.entry.js +4 -4
  384. package/dist/esm/six-range.entry.js.map +1 -1
  385. package/dist/esm/six-rating.entry.js +124 -0
  386. package/dist/esm/six-rating.entry.js.map +1 -0
  387. package/dist/esm/six-root.entry.js +2 -2
  388. package/dist/esm/six-search-field.entry.js +3 -3
  389. package/dist/esm/six-select.entry.js +9 -9
  390. package/dist/esm/six-sidebar-item-group.entry.js +1 -1
  391. package/dist/esm/six-sidebar-item.entry.js +3 -3
  392. package/dist/esm/six-sidebar.entry.js +3 -3
  393. package/dist/esm/six-stage-indicator.entry.js +1 -1
  394. package/dist/esm/six-switch.entry.js +4 -4
  395. package/dist/esm/six-switch.entry.js.map +1 -1
  396. package/dist/esm/six-tab-group.entry.js +4 -37
  397. package/dist/esm/six-tab-group.entry.js.map +1 -1
  398. package/dist/esm/six-tab-panel.entry.js +2 -2
  399. package/dist/esm/six-tab.entry.js +4 -4
  400. package/dist/esm/six-tab.entry.js.map +1 -1
  401. package/dist/esm/six-tag.entry.js +4 -4
  402. package/dist/esm/six-textarea.entry.js +4 -4
  403. package/dist/esm/six-tile.entry.js +6 -6
  404. package/dist/esm/six-timepicker.entry.js +20 -12
  405. package/dist/esm/six-timepicker.entry.js.map +1 -1
  406. package/dist/esm/six-tooltip.entry.js +3 -3
  407. package/dist/esm/ui-library.js +4 -4
  408. package/dist/esm/ui-library.js.map +1 -1
  409. package/dist/types/components/six-breadcrumbs/six-breadcrumbs.d.ts +20 -0
  410. package/dist/types/components/six-breadcrumbs-item/six-breadcrumbs-item.d.ts +27 -0
  411. package/dist/types/components/six-date/iso-date.d.ts +2 -0
  412. package/dist/types/components/six-date/six-date.d.ts +9 -7
  413. package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
  414. package/dist/types/components/six-dialog/six-dialog.d.ts +10 -2
  415. package/dist/types/components/six-drawer/six-drawer.d.ts +10 -2
  416. package/dist/types/components/six-file-upload/six-file-upload.d.ts +1 -0
  417. package/dist/types/components/six-icon/six-icon.d.ts +16 -0
  418. package/dist/types/components/six-rating/six-rating.d.ts +52 -0
  419. package/dist/types/components.d.ts +912 -24
  420. package/dist/types/index.d.ts +1 -0
  421. package/dist/types/stencil-public-runtime.d.ts +19 -0
  422. package/dist/types/types.d.ts +1 -0
  423. package/dist/types/utils/animation.d.ts +4 -0
  424. package/dist/types/utils/icon.d.ts +5 -0
  425. package/dist/ui-library/files/material-symbols-outlined-latin-fill-normal.woff2 +0 -0
  426. package/dist/ui-library/files/material-symbols-outlined-latin-full-normal.woff2 +0 -0
  427. package/dist/ui-library/files/material-symbols-outlined-latin-grad-normal.woff2 +0 -0
  428. package/dist/ui-library/files/material-symbols-outlined-latin-opsz-normal.woff2 +0 -0
  429. package/dist/ui-library/files/material-symbols-outlined-latin-standard-normal.woff2 +0 -0
  430. package/dist/ui-library/files/material-symbols-outlined-latin-wght-normal.woff2 +0 -0
  431. package/dist/ui-library/files/material-symbols-rounded-latin-fill-normal.woff2 +0 -0
  432. package/dist/ui-library/files/material-symbols-rounded-latin-full-normal.woff2 +0 -0
  433. package/dist/ui-library/files/material-symbols-rounded-latin-grad-normal.woff2 +0 -0
  434. package/dist/ui-library/files/material-symbols-rounded-latin-opsz-normal.woff2 +0 -0
  435. package/dist/ui-library/files/material-symbols-rounded-latin-standard-normal.woff2 +0 -0
  436. package/dist/ui-library/files/material-symbols-rounded-latin-wght-normal.woff2 +0 -0
  437. package/dist/ui-library/files/material-symbols-sharp-latin-fill-normal.woff2 +0 -0
  438. package/dist/ui-library/files/material-symbols-sharp-latin-full-normal.woff2 +0 -0
  439. package/dist/ui-library/files/material-symbols-sharp-latin-grad-normal.woff2 +0 -0
  440. package/dist/ui-library/files/material-symbols-sharp-latin-opsz-normal.woff2 +0 -0
  441. package/dist/ui-library/files/material-symbols-sharp-latin-standard-normal.woff2 +0 -0
  442. package/dist/ui-library/files/material-symbols-sharp-latin-wght-normal.woff2 +0 -0
  443. package/dist/ui-library/index.esm.js +1 -1
  444. package/dist/ui-library/index.esm.js.map +1 -1
  445. package/dist/ui-library/{p-1323f2cb.entry.js → p-014f44f4.entry.js} +2 -2
  446. package/dist/ui-library/p-014f44f4.entry.js.map +1 -0
  447. package/dist/ui-library/p-05ca516d.entry.js +2 -0
  448. package/dist/ui-library/{p-73b64625.entry.js → p-06c6b189.entry.js} +2 -2
  449. package/dist/ui-library/p-0eb90caf.entry.js +2 -0
  450. package/dist/ui-library/p-0eb90caf.entry.js.map +1 -0
  451. package/dist/ui-library/{p-4a4a0751.entry.js → p-12a2cc6b.entry.js} +2 -2
  452. package/dist/ui-library/{p-6990e5ed.entry.js → p-194037e9.entry.js} +2 -2
  453. package/dist/ui-library/{p-ad558904.entry.js → p-22ad3353.entry.js} +2 -2
  454. package/dist/ui-library/p-22f924a1.entry.js +2 -0
  455. package/dist/ui-library/{p-df05b23b.entry.js → p-26219330.entry.js} +2 -2
  456. package/dist/ui-library/{p-16028bce.entry.js → p-29994dc3.entry.js} +2 -2
  457. package/dist/ui-library/{p-cc44af70.entry.js → p-29aac7ea.entry.js} +2 -2
  458. package/dist/ui-library/p-29aac7ea.entry.js.map +1 -0
  459. package/dist/ui-library/{p-1e4d1252.entry.js → p-2a245a37.entry.js} +2 -2
  460. package/dist/ui-library/p-38c51fd1.entry.js +2 -0
  461. package/dist/ui-library/p-38c51fd1.entry.js.map +1 -0
  462. package/dist/ui-library/p-39109b96.entry.js +2 -0
  463. package/dist/ui-library/p-39109b96.entry.js.map +1 -0
  464. package/dist/ui-library/{p-84964501.entry.js → p-3c1285ad.entry.js} +2 -2
  465. package/dist/ui-library/{p-8fe7ecdd.entry.js → p-3d9e03b5.entry.js} +2 -2
  466. package/dist/ui-library/{p-55c15301.entry.js → p-4152b371.entry.js} +2 -2
  467. package/dist/ui-library/{p-81af96f2.entry.js → p-4d9785bd.entry.js} +2 -2
  468. package/dist/ui-library/p-4decf969.entry.js +2 -0
  469. package/dist/ui-library/p-4decf969.entry.js.map +1 -0
  470. package/dist/ui-library/{p-d7616f27.entry.js → p-54490d28.entry.js} +2 -2
  471. package/dist/ui-library/p-56e172e0.entry.js +2 -0
  472. package/dist/ui-library/p-56e172e0.entry.js.map +1 -0
  473. package/dist/ui-library/{p-9f55534a.entry.js → p-59568c0f.entry.js} +2 -2
  474. package/dist/ui-library/{p-9f55534a.entry.js.map → p-59568c0f.entry.js.map} +1 -1
  475. package/dist/ui-library/{p-1f86bd3e.entry.js → p-6607d03a.entry.js} +2 -2
  476. package/dist/ui-library/{p-baf698e1.entry.js → p-664ddbab.entry.js} +2 -2
  477. package/dist/ui-library/{p-830ed202.entry.js → p-66b94978.entry.js} +2 -2
  478. package/dist/ui-library/{p-36a316e0.entry.js → p-66d616e8.entry.js} +2 -2
  479. package/dist/ui-library/{p-5ed5842b.entry.js → p-6cd4fbd8.entry.js} +2 -2
  480. package/dist/ui-library/{p-85aacb7c.entry.js → p-6dd3f54c.entry.js} +2 -2
  481. package/dist/ui-library/{p-01306147.entry.js → p-70388108.entry.js} +2 -2
  482. package/dist/ui-library/p-72d3f332.entry.js +2 -0
  483. package/dist/ui-library/p-72d3f332.entry.js.map +1 -0
  484. package/dist/ui-library/p-7f7413db.entry.js +2 -0
  485. package/dist/ui-library/p-7f7413db.entry.js.map +1 -0
  486. package/dist/ui-library/p-83d5fa7c.entry.js +2 -0
  487. package/dist/ui-library/p-83d5fa7c.entry.js.map +1 -0
  488. package/dist/ui-library/{p-b8db5638.entry.js → p-8c2edb7f.entry.js} +2 -2
  489. package/dist/ui-library/{p-b09e3895.entry.js → p-91c195d3.entry.js} +2 -2
  490. package/dist/ui-library/{p-9f0ed997.entry.js → p-984a1f6d.entry.js} +2 -2
  491. package/dist/ui-library/p-9b75e009.entry.js +2 -0
  492. package/dist/ui-library/p-9b75e009.entry.js.map +1 -0
  493. package/dist/ui-library/{p-22ad5b1e.entry.js → p-9deca0d0.entry.js} +2 -2
  494. package/dist/ui-library/{p-ltzGzaAu.js → p-CKhg9ibv.js} +2 -2
  495. package/dist/ui-library/{p-ltzGzaAu.js.map → p-CKhg9ibv.js.map} +1 -1
  496. package/dist/ui-library/{p-IBmarOIS.js → p-Dg9366Gk.js} +2 -2
  497. package/dist/ui-library/{p-IBmarOIS.js.map → p-Dg9366Gk.js.map} +1 -1
  498. package/dist/ui-library/p-DqHJRLQQ.js +2 -0
  499. package/dist/ui-library/p-DqHJRLQQ.js.map +1 -0
  500. package/dist/ui-library/{p-D0Go1Zjj.js → p-JoG9I7EO.js} +1 -1
  501. package/dist/ui-library/{p-D0Go1Zjj.js.map → p-JoG9I7EO.js.map} +1 -1
  502. package/dist/ui-library/p-SLlDVtvF.js +2 -0
  503. package/dist/ui-library/p-SLlDVtvF.js.map +1 -0
  504. package/dist/ui-library/{p-97b78889.entry.js → p-a6d7d618.entry.js} +2 -2
  505. package/dist/ui-library/p-a7f9c92d.entry.js +2 -0
  506. package/dist/ui-library/{p-79a79513.entry.js.map → p-a7f9c92d.entry.js.map} +1 -1
  507. package/dist/ui-library/{p-071ed780.entry.js → p-aaea0f73.entry.js} +2 -2
  508. package/dist/ui-library/{p-c2ec443c.entry.js → p-ab043a8c.entry.js} +2 -2
  509. package/dist/ui-library/{p-1e67ac05.entry.js → p-b37d9771.entry.js} +2 -2
  510. package/dist/ui-library/{p-9713ecff.entry.js → p-bea434d1.entry.js} +2 -2
  511. package/dist/ui-library/p-bea434d1.entry.js.map +1 -0
  512. package/dist/ui-library/{p-ba68b30c.entry.js → p-ccc7e227.entry.js} +2 -2
  513. package/dist/ui-library/{p-f52715e8.entry.js → p-d81265f4.entry.js} +2 -2
  514. package/dist/ui-library/{p-537a8953.entry.js → p-da5f40ed.entry.js} +2 -2
  515. package/dist/ui-library/p-dc694314.entry.js +2 -0
  516. package/dist/ui-library/p-dc694314.entry.js.map +1 -0
  517. package/dist/ui-library/{p-c04affa2.entry.js → p-df2b8f01.entry.js} +2 -2
  518. package/dist/ui-library/p-e100aff2.entry.js +2 -0
  519. package/dist/ui-library/p-e56c5237.entry.js +2 -0
  520. package/dist/ui-library/p-e56c5237.entry.js.map +1 -0
  521. package/dist/ui-library/{p-679f1e08.entry.js → p-e8e5445e.entry.js} +2 -2
  522. package/dist/ui-library/{p-68c50fb7.entry.js → p-e92df84a.entry.js} +2 -2
  523. package/dist/ui-library/{p-8d60c1fd.entry.js → p-ed6625e6.entry.js} +2 -2
  524. package/dist/ui-library/p-fc2d893f.entry.js +2 -0
  525. package/dist/ui-library/p-fcd3305f.entry.js +2 -0
  526. package/dist/ui-library/{p-0d97e592.entry.js.map → p-fcd3305f.entry.js.map} +1 -1
  527. package/dist/ui-library/p-fd97bc8a.entry.js +2 -0
  528. package/dist/ui-library/p-fd97bc8a.entry.js.map +1 -0
  529. package/dist/ui-library/{p-5ad81261.entry.js → p-fe2ef0a4.entry.js} +2 -2
  530. package/dist/ui-library/six-breadcrumbs-item.entry.esm.js.map +1 -0
  531. package/dist/ui-library/six-breadcrumbs.entry.esm.js.map +1 -0
  532. package/dist/ui-library/six-button.six-spinner.entry.esm.js.map +1 -0
  533. package/dist/ui-library/six-date.entry.esm.js.map +1 -1
  534. package/dist/ui-library/six-datepicker.entry.esm.js.map +1 -1
  535. package/dist/ui-library/six-dialog.entry.esm.js.map +1 -1
  536. package/dist/ui-library/six-drawer.entry.esm.js.map +1 -1
  537. package/dist/ui-library/six-dropdown.six-menu.entry.esm.js.map +1 -1
  538. package/dist/ui-library/six-file-upload.entry.esm.js.map +1 -1
  539. package/dist/ui-library/six-icon.entry.esm.js.map +1 -1
  540. package/dist/ui-library/six-range.entry.esm.js.map +1 -1
  541. package/dist/ui-library/six-rating.entry.esm.js.map +1 -0
  542. package/dist/ui-library/six-switch.entry.esm.js.map +1 -1
  543. package/dist/ui-library/six-tab-group.entry.esm.js.map +1 -1
  544. package/dist/ui-library/six-tab.entry.esm.js.map +1 -1
  545. package/dist/ui-library/six-timepicker.entry.esm.js.map +1 -1
  546. package/dist/ui-library/ui-library.css +1 -1
  547. package/dist/ui-library/ui-library.esm.js +1 -1
  548. package/dist/ui-library/ui-library.esm.js.map +1 -1
  549. package/package.json +9 -6
  550. package/dist/cjs/six-button.cjs.entry.js.map +0 -1
  551. package/dist/cjs/six-button.entry.cjs.js.map +0 -1
  552. package/dist/cjs/six-spinner.cjs.entry.js +0 -58
  553. package/dist/cjs/six-spinner.cjs.entry.js.map +0 -1
  554. package/dist/cjs/six-spinner.entry.cjs.js.map +0 -1
  555. package/dist/components/p-B-jadcQD.js.map +0 -1
  556. package/dist/components/p-BtF2Ym6T.js.map +0 -1
  557. package/dist/components/p-Cemjz04k.js.map +0 -1
  558. package/dist/components/p-Mse5vRUS.js +0 -52
  559. package/dist/components/p-Mse5vRUS.js.map +0 -1
  560. package/dist/esm/six-button.entry.js.map +0 -1
  561. package/dist/esm/six-spinner.entry.js +0 -56
  562. package/dist/esm/six-spinner.entry.js.map +0 -1
  563. package/dist/ui-library/p-0b438d5a.entry.js +0 -2
  564. package/dist/ui-library/p-0b438d5a.entry.js.map +0 -1
  565. package/dist/ui-library/p-0d97e592.entry.js +0 -2
  566. package/dist/ui-library/p-1323f2cb.entry.js.map +0 -1
  567. package/dist/ui-library/p-27e8e8a6.entry.js +0 -2
  568. package/dist/ui-library/p-27e8e8a6.entry.js.map +0 -1
  569. package/dist/ui-library/p-5a579e9f.entry.js +0 -2
  570. package/dist/ui-library/p-5a579e9f.entry.js.map +0 -1
  571. package/dist/ui-library/p-5e70085d.entry.js +0 -2
  572. package/dist/ui-library/p-5e70085d.entry.js.map +0 -1
  573. package/dist/ui-library/p-666b3e45.entry.js +0 -2
  574. package/dist/ui-library/p-666b3e45.entry.js.map +0 -1
  575. package/dist/ui-library/p-695e450e.entry.js +0 -2
  576. package/dist/ui-library/p-6d212bc0.entry.js +0 -2
  577. package/dist/ui-library/p-798fb03a.entry.js +0 -2
  578. package/dist/ui-library/p-798fb03a.entry.js.map +0 -1
  579. package/dist/ui-library/p-79a79513.entry.js +0 -2
  580. package/dist/ui-library/p-868fab98.entry.js +0 -2
  581. package/dist/ui-library/p-9713ecff.entry.js.map +0 -1
  582. package/dist/ui-library/p-b2092cd0.entry.js +0 -2
  583. package/dist/ui-library/p-b2092cd0.entry.js.map +0 -1
  584. package/dist/ui-library/p-cc44af70.entry.js.map +0 -1
  585. package/dist/ui-library/p-d1bd67af.entry.js +0 -2
  586. package/dist/ui-library/p-d1bd67af.entry.js.map +0 -1
  587. package/dist/ui-library/p-f0c10d20.entry.js +0 -2
  588. package/dist/ui-library/p-f0c10d20.entry.js.map +0 -1
  589. package/dist/ui-library/p-f4e2ddfc.entry.js +0 -2
  590. package/dist/ui-library/p-f585a5ab.entry.js +0 -2
  591. package/dist/ui-library/p-f585a5ab.entry.js.map +0 -1
  592. package/dist/ui-library/six-button.entry.esm.js.map +0 -1
  593. package/dist/ui-library/six-spinner.entry.esm.js.map +0 -1
  594. /package/dist/ui-library/{p-695e450e.entry.js.map → p-05ca516d.entry.js.map} +0 -0
  595. /package/dist/ui-library/{p-73b64625.entry.js.map → p-06c6b189.entry.js.map} +0 -0
  596. /package/dist/ui-library/{p-4a4a0751.entry.js.map → p-12a2cc6b.entry.js.map} +0 -0
  597. /package/dist/ui-library/{p-6990e5ed.entry.js.map → p-194037e9.entry.js.map} +0 -0
  598. /package/dist/ui-library/{p-ad558904.entry.js.map → p-22ad3353.entry.js.map} +0 -0
  599. /package/dist/ui-library/{p-f4e2ddfc.entry.js.map → p-22f924a1.entry.js.map} +0 -0
  600. /package/dist/ui-library/{p-df05b23b.entry.js.map → p-26219330.entry.js.map} +0 -0
  601. /package/dist/ui-library/{p-16028bce.entry.js.map → p-29994dc3.entry.js.map} +0 -0
  602. /package/dist/ui-library/{p-1e4d1252.entry.js.map → p-2a245a37.entry.js.map} +0 -0
  603. /package/dist/ui-library/{p-84964501.entry.js.map → p-3c1285ad.entry.js.map} +0 -0
  604. /package/dist/ui-library/{p-8fe7ecdd.entry.js.map → p-3d9e03b5.entry.js.map} +0 -0
  605. /package/dist/ui-library/{p-55c15301.entry.js.map → p-4152b371.entry.js.map} +0 -0
  606. /package/dist/ui-library/{p-81af96f2.entry.js.map → p-4d9785bd.entry.js.map} +0 -0
  607. /package/dist/ui-library/{p-d7616f27.entry.js.map → p-54490d28.entry.js.map} +0 -0
  608. /package/dist/ui-library/{p-1f86bd3e.entry.js.map → p-6607d03a.entry.js.map} +0 -0
  609. /package/dist/ui-library/{p-baf698e1.entry.js.map → p-664ddbab.entry.js.map} +0 -0
  610. /package/dist/ui-library/{p-830ed202.entry.js.map → p-66b94978.entry.js.map} +0 -0
  611. /package/dist/ui-library/{p-36a316e0.entry.js.map → p-66d616e8.entry.js.map} +0 -0
  612. /package/dist/ui-library/{p-5ed5842b.entry.js.map → p-6cd4fbd8.entry.js.map} +0 -0
  613. /package/dist/ui-library/{p-85aacb7c.entry.js.map → p-6dd3f54c.entry.js.map} +0 -0
  614. /package/dist/ui-library/{p-01306147.entry.js.map → p-70388108.entry.js.map} +0 -0
  615. /package/dist/ui-library/{p-b8db5638.entry.js.map → p-8c2edb7f.entry.js.map} +0 -0
  616. /package/dist/ui-library/{p-b09e3895.entry.js.map → p-91c195d3.entry.js.map} +0 -0
  617. /package/dist/ui-library/{p-9f0ed997.entry.js.map → p-984a1f6d.entry.js.map} +0 -0
  618. /package/dist/ui-library/{p-22ad5b1e.entry.js.map → p-9deca0d0.entry.js.map} +0 -0
  619. /package/dist/ui-library/{p-97b78889.entry.js.map → p-a6d7d618.entry.js.map} +0 -0
  620. /package/dist/ui-library/{p-071ed780.entry.js.map → p-aaea0f73.entry.js.map} +0 -0
  621. /package/dist/ui-library/{p-c2ec443c.entry.js.map → p-ab043a8c.entry.js.map} +0 -0
  622. /package/dist/ui-library/{p-1e67ac05.entry.js.map → p-b37d9771.entry.js.map} +0 -0
  623. /package/dist/ui-library/{p-ba68b30c.entry.js.map → p-ccc7e227.entry.js.map} +0 -0
  624. /package/dist/ui-library/{p-f52715e8.entry.js.map → p-d81265f4.entry.js.map} +0 -0
  625. /package/dist/ui-library/{p-537a8953.entry.js.map → p-da5f40ed.entry.js.map} +0 -0
  626. /package/dist/ui-library/{p-c04affa2.entry.js.map → p-df2b8f01.entry.js.map} +0 -0
  627. /package/dist/ui-library/{p-6d212bc0.entry.js.map → p-e100aff2.entry.js.map} +0 -0
  628. /package/dist/ui-library/{p-679f1e08.entry.js.map → p-e8e5445e.entry.js.map} +0 -0
  629. /package/dist/ui-library/{p-68c50fb7.entry.js.map → p-e92df84a.entry.js.map} +0 -0
  630. /package/dist/ui-library/{p-8d60c1fd.entry.js.map → p-ed6625e6.entry.js.map} +0 -0
  631. /package/dist/ui-library/{p-868fab98.entry.js.map → p-fc2d893f.entry.js.map} +0 -0
  632. /package/dist/ui-library/{p-5ad81261.entry.js.map → p-fe2ef0a4.entry.js.map} +0 -0
@@ -138,15 +138,15 @@ export class SixDetails {
138
138
  }
139
139
  render() {
140
140
  const summaryIcon = this.hasContent && (this.summaryIcon || 'expand_more');
141
- return (h("div", { key: '9da333bcd1a3a6516672fbce89348a830bdc3af3', ref: (el) => (this.details = el), part: "base", class: {
141
+ return (h("div", { key: '27ca22526d4341950e4db0d33b6f0f0af96ea867', ref: (el) => (this.details = el), part: "base", class: {
142
142
  details: true,
143
143
  'details--open': this.open,
144
144
  'details--disabled': this.disabled,
145
145
  inline: this.inline,
146
- } }, h("header", { key: '110254ed5654bce7be595ba48af712a388f20e21', ref: (el) => (this.header = el), part: "header", id: `${this.componentId}-header`, class: "details__header", role: "button", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": `${this.componentId}-content`, "aria-disabled": this.disabled ? 'true' : 'false', tabIndex: this.disabled ? -1 : 0, onClick: this.handleSummaryClick, onKeyDown: this.handleSummaryKeyDown }, h("div", { key: 'c238f0178735a5416a4a713d10932940a8120dfc', part: "summary", class: "details__summary" }, h("slot", { key: '7918cfa06d9d6b35d3fd870f56ed271d9c5fc2a8', name: "summary" }, this.summary)), h("span", { key: '9121d0b4feff38685330196e4a48910b0278741d', part: "summary-icon", class: {
146
+ } }, h("header", { key: 'f9f14d79ddff8b73ae0b6a3e959f5db892f4a31f', ref: (el) => (this.header = el), part: "header", id: `${this.componentId}-header`, class: "details__header", role: "button", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": `${this.componentId}-content`, "aria-disabled": this.disabled ? 'true' : 'false', tabIndex: this.disabled ? -1 : 0, onClick: this.handleSummaryClick, onKeyDown: this.handleSummaryKeyDown }, h("div", { key: 'aec9b05ea1bb7eb2c42be7c95d584e35645fec64', part: "summary", class: "details__summary" }, h("slot", { key: '0ce0ee53a8cd67a3b2b92ba3fa51d79818b294e4', name: "summary" }, this.summary)), h("span", { key: '8cd7f1957b3498575654f5dbdb4664b503d71862', part: "summary-icon", class: {
147
147
  'details__summary-icon': true,
148
148
  'details__summary-icon--animate': this.animateSummaryIcon,
149
- } }, h("slot", { key: '933ebb5f0b7a4a0fbf6cba6fb4009ac6305f27c5', name: "summary-icon", onSlotchange: () => (this.animateSummaryIcon = false) }, summaryIcon && h("six-icon", { key: '9b16a435526ca7558a323e45d6bcabf242b232b1', size: this.summaryIconSize }, summaryIcon)))), h("div", { key: '368f68c2078ebe9b3ae82b1c4023ad40b4b33757', ref: (el) => (this.body = el), class: "details__body", onTransitionEnd: this.handleBodyTransitionEnd }, h("div", { key: '278aa0b3496672fd5a4414b990ff77edd1c758f3', part: "content", id: `${this.componentId}-content`, class: "details__content", role: "region", "aria-labelledby": `${this.componentId}-header` }, h("slot", { key: 'e5d3ef50d1097cb7ce79ed5fafaa78901f6d1352' })))));
149
+ } }, h("slot", { key: 'ec46c283b39907c65e996935a57d4580b0436306', name: "summary-icon", onSlotchange: () => (this.animateSummaryIcon = false) }, summaryIcon && h("six-icon", { key: '4a0ef8739c3a4503ca443f945086e9f6cc74b036', size: this.summaryIconSize }, summaryIcon)))), h("div", { key: '1cc71be309bffcb693e04ca86d4449db683b2f26', ref: (el) => (this.body = el), class: "details__body", onTransitionEnd: this.handleBodyTransitionEnd }, h("div", { key: '514ed3c5f7e5f762986c6ab9d274eb6251ecbf99', part: "content", id: `${this.componentId}-content`, class: "details__content", role: "region", "aria-labelledby": `${this.componentId}-header` }, h("slot", { key: '1af14b8843cdae96fa13decc6a6ba51613d477ad' })))));
150
150
  }
151
151
  static get is() { return "six-details"; }
152
152
  static get encapsulation() { return "shadow"; }
@@ -2,6 +2,7 @@ import { h } from "@stencil/core";
2
2
  import { lockBodyScrolling, unlockBodyScrolling } from "../../utils/scroll";
3
3
  import { hasSlot } from "../../utils/slot";
4
4
  import Modal from "../../utils/modal";
5
+ import { animateTo } from "../../utils/animation";
5
6
  let id = 0;
6
7
  /**
7
8
  * @since 1.0
@@ -43,18 +44,15 @@ export class SixDialog {
43
44
  */
44
45
  this.noHeader = false;
45
46
  this.handleCloseClick = () => {
46
- this.hide();
47
+ this.preventClose('close-button');
47
48
  };
48
49
  this.handleKeyDown = (event) => {
49
50
  if (event.key === 'Escape') {
50
- this.hide();
51
+ this.preventClose('keyboard');
51
52
  }
52
53
  };
53
54
  this.handleOverlayClick = () => {
54
- const sixOverlayDismiss = this.sixOverlayDismiss.emit();
55
- if (!sixOverlayDismiss.defaultPrevented) {
56
- this.hide();
57
- }
55
+ this.preventClose('overlay');
58
56
  };
59
57
  this.handleSlotChange = () => {
60
58
  this.hasFooter = hasSlot(this.host, 'footer');
@@ -130,13 +128,21 @@ export class SixDialog {
130
128
  this.modal.deactivate();
131
129
  unlockBodyScrolling(this.host);
132
130
  }
131
+ preventClose(source) {
132
+ const sixRequestClose = this.sixRequestClose.emit({ source });
133
+ if (sixRequestClose.defaultPrevented && this.panel) {
134
+ animateTo(this.panel, [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }], { duration: 250 });
135
+ return;
136
+ }
137
+ this.hide();
138
+ }
133
139
  render() {
134
- return (h("div", { key: '4fb15d0b1b8cb52082d6faadd337f92c51d4a6ba', ref: (el) => (this.dialog = el), part: "base", class: {
140
+ return (h("div", { key: 'b97915d5076bb83782212b61b1f65f694fd84b63', ref: (el) => (this.dialog = el), part: "base", class: {
135
141
  dialog: true,
136
142
  'dialog--open': this.open,
137
143
  'dialog--visible': this.isVisible,
138
144
  'dialog--has-footer': this.hasFooter,
139
- }, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: 'f1f7f2f0c69dda4f3a9fe464aef1880a3ccc8435', part: "overlay", class: "dialog__overlay", onClick: this.handleOverlayClick }), h("div", { key: '988baac44c75d2299f55e4dd848155ac535679cc', ref: (el) => (this.panel = el), part: "panel", class: "dialog__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader ? this.label : null, "aria-labelledby": !this.noHeader ? `${this.componentId}-title` : null, tabIndex: 0 }, !this.noHeader && (h("header", { key: 'a167200e75358f3b7b778f7475ca437f23a58797', part: "header", class: "dialog__header" }, h("span", { key: '3c3edc39e39eb0bda2c745719476278b8db86037', part: "title", class: "dialog__title", id: `${this.componentId}-title` }, h("slot", { key: '3cd726aaebef3f72bcfda02cbd98c16c38fd6d6e', name: "label" }, this.label || String.fromCharCode(65279))), h("six-icon-button", { key: 'e1110789a7bdb41cef385814d53bbed678aa99e8', exportparts: "base:close-button", class: "dialog__close", name: "close", onClick: this.handleCloseClick }))), h("div", { key: '7c0c4a8388d2e6ff53e8dffce614314c327c311d', part: "body", class: "dialog__body" }, h("slot", { key: 'ed90c7246c3922ef3ee0cea389879ff52c910120' })), h("footer", { key: 'cbc879ecfe209e9be681bbc8d34d2defb1cc6f45', part: "footer", class: "dialog__footer" }, h("slot", { key: '0d86102a449cef6ebaaf1c7738fd444e249bbe86', name: "footer", onSlotchange: this.handleSlotChange })))));
145
+ }, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: '153379e70061e86842f65f3588329dc9c6d592db', part: "overlay", class: "dialog__overlay", onClick: this.handleOverlayClick }), h("div", { key: 'd0b78c413a70eeb6e6cbf75be7829a7d1f2ad715', ref: (el) => (this.panel = el), part: "panel", class: "dialog__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader ? this.label : null, "aria-labelledby": !this.noHeader ? `${this.componentId}-title` : null, tabIndex: 0 }, !this.noHeader && (h("header", { key: '94e7d993356ea718e1ed87d4fe9e1d3faf0574f8', part: "header", class: "dialog__header" }, h("span", { key: '600591c9266dda80c457f41c54c92a8134d89bb8', part: "title", class: "dialog__title", id: `${this.componentId}-title` }, h("slot", { key: '4ad2904648821134ce3851682768b01086a68359', name: "label" }, this.label || String.fromCharCode(65279))), h("six-icon-button", { key: '4d793b14b41f7d9c43d5f9949cba6bfe7c6a442c', exportparts: "base:close-button", class: "dialog__close", name: "close", onClick: this.handleCloseClick }))), h("div", { key: '729f6cc36802fccf46958b2c259213aa9369fb94', part: "body", class: "dialog__body" }, h("slot", { key: 'ba299ae12ba958c705a807639aee911167997b38' })), h("footer", { key: '92cb57fa4c4dc066a49dd259832e43be619cc945', part: "footer", class: "dialog__footer" }, h("slot", { key: '63ea68abef52d91c04608ad1bf6d508a31012ed9', name: "footer", onSlotchange: this.handleSlotChange })))));
140
146
  }
141
147
  static get is() { return "six-dialog"; }
142
148
  static get encapsulation() { return "shadow"; }
@@ -327,23 +333,23 @@ export class SixDialog {
327
333
  }
328
334
  }
329
335
  }, {
330
- "method": "sixOverlayDismiss",
331
- "name": "six-dialog-overlay-dismiss",
336
+ "method": "sixRequestClose",
337
+ "name": "six-dialog-request-close",
332
338
  "bubbles": true,
333
339
  "cancelable": true,
334
340
  "composed": true,
335
341
  "docs": {
336
342
  "tags": [],
337
- "text": "Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the dialog from closing."
343
+ "text": "Emitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or\npressing escape. Calling `event.preventDefault()` will keep the drawer open. Avoid using this unless closing\nthe drawer will result in destructive behavior such as data loss."
338
344
  },
339
345
  "complexType": {
340
- "original": "EmptyPayload",
341
- "resolved": "undefined",
346
+ "original": "SixDialogRequestClose",
347
+ "resolved": "SixDialogRequestClose",
342
348
  "references": {
343
- "EmptyPayload": {
344
- "location": "import",
345
- "path": "../../utils/types",
346
- "id": "src/utils/types.ts::EmptyPayload"
349
+ "SixDialogRequestClose": {
350
+ "location": "local",
351
+ "path": "/home/runner/work/six-webcomponents/six-webcomponents/libraries/ui-library/src/components/six-dialog/six-dialog.tsx",
352
+ "id": "src/components/six-dialog/six-dialog.tsx::SixDialogRequestClose"
347
353
  }
348
354
  }
349
355
  }
@@ -1 +1 @@
1
- {"version":3,"file":"six-dialog.js","sourceRoot":"","sources":["../../../src/components/six-dialog/six-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAGtC,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,MAAM,OAAO,SAAS;IALtB;QAMU,gBAAW,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;QAI/B,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAE3B,+FAA+F;QACvD,SAAI,GAAG,KAAK,CAAC;QAErD;;;WAGG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAoGjB,qBAAgB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,IAAI,EAAE,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll';\nimport { hasSlot } from '../../utils/slot';\nimport Modal from '../../utils/modal';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The dialog's content.\n * @slot label - The dialog's label. Alternatively, you can use the label prop.\n * @slot footer - The dialog's footer, usually one or more buttons representing various options.\n *\n * @part base - The component's base wrapper.\n * @part overlay - The overlay.\n * @part panel - The dialog panel (where the dialog and its content is rendered).\n * @part header - The dialog header.\n * @part title - The dialog title.\n * @part close-button - The close button.\n * @part body - The dialog body.\n * @part footer - The dialog footer.\n *\n */\n@Component({\n tag: 'six-dialog',\n styleUrl: 'six-dialog.scss',\n shadow: true,\n})\nexport class SixDialog {\n private componentId = `dialog-${++id}`;\n private dialog?: HTMLElement;\n private modal?: Modal;\n private panel?: HTMLElement;\n private willShow = false;\n private willHide = false;\n\n @Element() host!: HTMLSixDialogElement;\n\n @State() hasFooter = false;\n @State() isVisible = false;\n\n /** Indicates whether the dialog is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /**\n * The dialog's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility.\n */\n @Prop() label = '';\n\n /**\n * Set to true to disable the header. This will also remove the default close button, so please ensure you provide an\n * easy, accessible way for users to dismiss the dialog.\n */\n @Prop() noHeader = false;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the dialog opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-dialog-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the dialog opens and all transitions are complete. */\n @Event({ eventName: 'six-dialog-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the dialog closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-dialog-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the dialog closes and all transitions are complete. */\n @Event({ eventName: 'six-dialog-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the dialog opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the dialog, such as an input or button.\n */\n @Event({ eventName: 'six-dialog-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the dialog from closing. */\n @Event({ eventName: 'six-dialog-overlay-dismiss' }) sixOverlayDismiss!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.modal = new Modal(this.host, {\n onFocusOut: () => this.panel?.focus(),\n });\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n // Show on init if open\n if (this.open) {\n this.show();\n }\n }\n\n disconnectedCallback() {\n unlockBodyScrolling(this.host);\n }\n\n /** Shows the dialog */\n @Method()\n async show() {\n if (this.willShow || this.modal == null || this.panel == null || this.dialog == null) {\n return;\n }\n const panel = this.panel;\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n this.modal.activate();\n\n lockBodyScrolling(this.host);\n\n if (this.open) {\n requestAnimationFrame(() => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus({ preventScroll: true });\n }\n });\n }\n }\n\n /** Hides the dialog */\n @Method()\n async hide() {\n if (this.willHide || this.modal == null) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n this.modal.deactivate();\n\n unlockBodyScrolling(this.host);\n }\n\n private handleCloseClick = () => {\n this.hide();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.hide();\n }\n };\n\n private handleOverlayClick = () => {\n const sixOverlayDismiss = this.sixOverlayDismiss.emit();\n\n if (!sixOverlayDismiss.defaultPrevented) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n this.hasFooter = hasSlot(this.host, 'footer');\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'opacity' && target.classList.contains('dialog__panel')) {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n };\n\n render() {\n return (\n <div\n ref={(el) => (this.dialog = el)}\n part=\"base\"\n class={{\n dialog: true,\n 'dialog--open': this.open,\n 'dialog--visible': this.isVisible,\n 'dialog--has-footer': this.hasFooter,\n }}\n onKeyDown={this.handleKeyDown}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <div part=\"overlay\" class=\"dialog__overlay\" onClick={this.handleOverlayClick} />\n\n <div\n ref={(el) => (this.panel = el)}\n part=\"panel\"\n class=\"dialog__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n aria-label={this.noHeader ? this.label : null}\n aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}\n tabIndex={0}\n >\n {!this.noHeader && (\n <header part=\"header\" class=\"dialog__header\">\n <span part=\"title\" class=\"dialog__title\" id={`${this.componentId}-title`}>\n <slot name=\"label\">\n {/* If there's no label, use an invisible character to prevent the heading from collapsing */}\n {this.label || String.fromCharCode(65279)}\n </slot>\n </span>\n <six-icon-button\n exportparts=\"base:close-button\"\n class=\"dialog__close\"\n name=\"close\"\n onClick={this.handleCloseClick}\n />\n </header>\n )}\n\n <div part=\"body\" class=\"dialog__body\">\n <slot />\n </div>\n\n <footer part=\"footer\" class=\"dialog__footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </footer>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-dialog.js","sourceRoot":"","sources":["../../../src/components/six-dialog/six-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMlD,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,MAAM,OAAO,SAAS;IALtB;QAMU,gBAAW,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;QAI/B,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAE3B,+FAA+F;QACvD,SAAI,GAAG,KAAK,CAAC;QAErD;;;WAGG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAwGjB,qBAAgB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,YAAY,C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EAAC,OAAO,EACZ,OAAO,EAAE,IAAI,CAAC,gBAAgB,GAC9B,CACK,CACV;gBAED,4DAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,cAAc;oBACnC,8DAAQ,CACJ;gBAEN,+DAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;oBAC1C,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpD,CACL,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll';\nimport { hasSlot } from '../../utils/slot';\nimport Modal from '../../utils/modal';\nimport { EmptyPayload } from '../../utils/types';\nimport { animateTo } from '../../utils/animation';\n\nexport interface SixDialogRequestClose {\n source: 'close-button' | 'keyboard' | 'overlay';\n}\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The dialog's content.\n * @slot label - The dialog's label. Alternatively, you can use the label prop.\n * @slot footer - The dialog's footer, usually one or more buttons representing various options.\n *\n * @part base - The component's base wrapper.\n * @part overlay - The overlay.\n * @part panel - The dialog panel (where the dialog and its content is rendered).\n * @part header - The dialog header.\n * @part title - The dialog title.\n * @part close-button - The close button.\n * @part body - The dialog body.\n * @part footer - The dialog footer.\n *\n */\n@Component({\n tag: 'six-dialog',\n styleUrl: 'six-dialog.scss',\n shadow: true,\n})\nexport class SixDialog {\n private componentId = `dialog-${++id}`;\n private dialog?: HTMLElement;\n private modal?: Modal;\n private panel?: HTMLElement;\n private willShow = false;\n private willHide = false;\n\n @Element() host!: HTMLSixDialogElement;\n\n @State() hasFooter = false;\n @State() isVisible = false;\n\n /** Indicates whether the dialog is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /**\n * The dialog's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility.\n */\n @Prop() label = '';\n\n /**\n * Set to true to disable the header. This will also remove the default close button, so please ensure you provide an\n * easy, accessible way for users to dismiss the dialog.\n */\n @Prop() noHeader = false;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the dialog opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-dialog-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the dialog opens and all transitions are complete. */\n @Event({ eventName: 'six-dialog-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the dialog closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-dialog-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the dialog closes and all transitions are complete. */\n @Event({ eventName: 'six-dialog-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the dialog opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the dialog, such as an input or button.\n */\n @Event({ eventName: 'six-dialog-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or\n * pressing escape. Calling `event.preventDefault()` will keep the drawer open. Avoid using this unless closing\n * the drawer will result in destructive behavior such as data loss.\n */\n @Event({ eventName: 'six-dialog-request-close' }) sixRequestClose!: EventEmitter<SixDialogRequestClose>;\n\n connectedCallback() {\n this.modal = new Modal(this.host, {\n onFocusOut: () => this.panel?.focus(),\n });\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n // Show on init if open\n if (this.open) {\n this.show();\n }\n }\n\n disconnectedCallback() {\n unlockBodyScrolling(this.host);\n }\n\n /** Shows the dialog */\n @Method()\n async show() {\n if (this.willShow || this.modal == null || this.panel == null || this.dialog == null) {\n return;\n }\n const panel = this.panel;\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n this.modal.activate();\n\n lockBodyScrolling(this.host);\n\n if (this.open) {\n requestAnimationFrame(() => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus({ preventScroll: true });\n }\n });\n }\n }\n\n /** Hides the dialog */\n @Method()\n async hide() {\n if (this.willHide || this.modal == null) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n this.modal.deactivate();\n\n unlockBodyScrolling(this.host);\n }\n\n private handleCloseClick = () => {\n this.preventClose('close-button');\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.preventClose('keyboard');\n }\n };\n\n private handleOverlayClick = () => {\n this.preventClose('overlay');\n };\n\n private preventClose(source: 'close-button' | 'keyboard' | 'overlay') {\n const sixRequestClose = this.sixRequestClose.emit({ source });\n\n if (sixRequestClose.defaultPrevented && this.panel) {\n animateTo(this.panel, [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }], { duration: 250 });\n return;\n }\n\n this.hide();\n }\n\n private handleSlotChange = () => {\n this.hasFooter = hasSlot(this.host, 'footer');\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'opacity' && target.classList.contains('dialog__panel')) {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n };\n\n render() {\n return (\n <div\n ref={(el) => (this.dialog = el)}\n part=\"base\"\n class={{\n dialog: true,\n 'dialog--open': this.open,\n 'dialog--visible': this.isVisible,\n 'dialog--has-footer': this.hasFooter,\n }}\n onKeyDown={this.handleKeyDown}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <div part=\"overlay\" class=\"dialog__overlay\" onClick={this.handleOverlayClick} />\n\n <div\n ref={(el) => (this.panel = el)}\n part=\"panel\"\n class=\"dialog__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n aria-label={this.noHeader ? this.label : null}\n aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}\n tabIndex={0}\n >\n {!this.noHeader && (\n <header part=\"header\" class=\"dialog__header\">\n <span part=\"title\" class=\"dialog__title\" id={`${this.componentId}-title`}>\n <slot name=\"label\">\n {/* If there's no label, use an invisible character to prevent the heading from collapsing */}\n {this.label || String.fromCharCode(65279)}\n </slot>\n </span>\n <six-icon-button\n exportparts=\"base:close-button\"\n class=\"dialog__close\"\n name=\"close\"\n onClick={this.handleCloseClick}\n />\n </header>\n )}\n\n <div part=\"body\" class=\"dialog__body\">\n <slot />\n </div>\n\n <footer part=\"footer\" class=\"dialog__footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </footer>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { h } from "@stencil/core";
2
2
  import { lockBodyScrolling, unlockBodyScrolling } from "../../utils/scroll";
3
3
  import { hasSlot } from "../../utils/slot";
4
4
  import Modal from "../../utils/modal";
5
+ import { animateTo } from "../../utils/animation";
5
6
  let id = 0;
6
7
  /**
7
8
  * @since 1.0
@@ -49,18 +50,15 @@ export class SixDrawer {
49
50
  */
50
51
  this.noHeader = false;
51
52
  this.handleCloseClick = () => {
52
- this.hide();
53
+ this.preventClose('close-button');
53
54
  };
54
55
  this.handleKeyDown = (event) => {
55
56
  if (event.key === 'Escape') {
56
- this.hide();
57
+ this.preventClose('keyboard');
57
58
  }
58
59
  };
59
60
  this.handleOverlayClick = () => {
60
- const sixOverlayDismiss = this.sixOverlayDismiss.emit();
61
- if (!sixOverlayDismiss.defaultPrevented) {
62
- this.hide();
63
- }
61
+ this.preventClose('overlay');
64
62
  };
65
63
  this.handleSlotChange = () => {
66
64
  this.hasFooter = hasSlot(this.host, 'footer');
@@ -138,6 +136,14 @@ export class SixDrawer {
138
136
  this.modal.deactivate();
139
137
  unlockBodyScrolling(this.host);
140
138
  }
139
+ preventClose(source) {
140
+ const sixRequestClose = this.sixRequestClose.emit({ source });
141
+ if (sixRequestClose.defaultPrevented && this.panel) {
142
+ animateTo(this.panel, [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }], { duration: 250 });
143
+ return;
144
+ }
145
+ this.hide();
146
+ }
141
147
  resetTransitionVariables() {
142
148
  this.isVisible = this.open;
143
149
  this.willShow = false;
@@ -145,7 +151,7 @@ export class SixDrawer {
145
151
  this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();
146
152
  }
147
153
  render() {
148
- return (h("div", { key: 'f35600ecd84f97b647ab9cc98d56c360f2f03408', ref: (el) => (this.drawer = el), part: "base", class: {
154
+ return (h("div", { key: '17d045e1a06aa424bc59f7316525df73ae031227', ref: (el) => (this.drawer = el), part: "base", class: {
149
155
  drawer: true,
150
156
  'drawer--open': this.open,
151
157
  'drawer--visible': this.isVisible,
@@ -156,7 +162,7 @@ export class SixDrawer {
156
162
  'drawer--contained': this.contained,
157
163
  'drawer--fixed': !this.contained,
158
164
  'drawer--has-footer': this.hasFooter,
159
- }, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: '178e61c83b4c635041c51c89553ed834f6424cd2', part: "overlay", class: "drawer__overlay", onClick: this.handleOverlayClick, tabIndex: -1 }), h("div", { key: '71374a7cae137e002760f3ff5b5ee69ad4ac4675', ref: (el) => (this.panel = el), part: "panel", class: "drawer__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader ? this.label : null, "aria-labelledby": !this.noHeader ? `${this.componentId}-title` : null, tabIndex: 0 }, !this.noHeader && (h("header", { key: '3a66c231ad202b211c2df81b74a8a6e937be661b', part: "header", class: "drawer__header" }, h("span", { key: '80205d6fccb2510b23473dba6098462221f9d43e', part: "title", class: "drawer__title", id: `${this.componentId}-title` }, h("slot", { key: '13d986fb13c2cded9ce9980cf12da1b34de9ef28', name: "label" }, this.label || String.fromCharCode(65279))), h("six-icon-button", { key: 'd62b14dc24849d16f1dffbba0f98126fc95de336', exportparts: "base:close-button", class: "drawer__close", name: "close", onClick: this.handleCloseClick }))), h("div", { key: 'd0f5b6df5230e996d6b196095589a6629b271fab', part: "body", class: "drawer__body" }, h("slot", { key: '6eda0430f1fe27d28a85a6e689fbb9025ee773e7' })), h("footer", { key: '8c71f25b2bbb980a7aabee038ea4d7a58f177970', part: "footer", class: "drawer__footer" }, h("slot", { key: 'e7dfb09c1cd30deccfd30ce28849e32cdaebe69f', name: "footer", onSlotchange: this.handleSlotChange })))));
165
+ }, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: '804fcb75cc49156bfcb6af8958a40c33c20f8202', part: "overlay", class: "drawer__overlay", onClick: this.handleOverlayClick, tabIndex: -1 }), h("div", { key: 'e5095b200d370fe98163b3f0fa2bbf42ece7fa5f', ref: (el) => (this.panel = el), part: "panel", class: "drawer__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader ? this.label : null, "aria-labelledby": !this.noHeader ? `${this.componentId}-title` : null, tabIndex: 0 }, !this.noHeader && (h("header", { key: 'c479cfa062277a6f1cf0f7433cff73e94139faea', part: "header", class: "drawer__header" }, h("span", { key: '8d60e0eb1cecc9c8f2091b5b8c9aefaa2aac3c91', part: "title", class: "drawer__title", id: `${this.componentId}-title` }, h("slot", { key: '26c5fb0feb42c9db7625e98f10cd5cbd0acfd742', name: "label" }, this.label || String.fromCharCode(65279))), h("six-icon-button", { key: '454ee7cea511b470ae224c6559ee99f10e9cf095', exportparts: "base:close-button", class: "drawer__close", name: "close", onClick: this.handleCloseClick }))), h("div", { key: '4f07be9128e7d2a292298b3e22ec0e5105adc3f3', part: "body", class: "drawer__body" }, h("slot", { key: '856a4bd2ee8dacc8b6124d87d8e501a8bd8c3f23' })), h("footer", { key: '721ca11e6b5470d2170d9bc929ba2d973faf9117', part: "footer", class: "drawer__footer" }, h("slot", { key: 'afb8d35c7fee0fa3e9833ea1b381c2d81f8cb5b0', name: "footer", onSlotchange: this.handleSlotChange })))));
160
166
  }
161
167
  static get is() { return "six-drawer"; }
162
168
  static get encapsulation() { return "shadow"; }
@@ -387,23 +393,23 @@ export class SixDrawer {
387
393
  }
388
394
  }
389
395
  }, {
390
- "method": "sixOverlayDismiss",
391
- "name": "six-drawer-overlay-dismiss",
396
+ "method": "sixRequestClose",
397
+ "name": "six-drawer-request-close",
392
398
  "bubbles": true,
393
399
  "cancelable": true,
394
400
  "composed": true,
395
401
  "docs": {
396
402
  "tags": [],
397
- "text": "Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the drawer from closing."
403
+ "text": "Emitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or\npressing escape. Calling `event.preventDefault()` will keep the drawer open. Avoid using this unless closing\nthe drawer will result in destructive behavior such as data loss."
398
404
  },
399
405
  "complexType": {
400
- "original": "EmptyPayload",
401
- "resolved": "undefined",
406
+ "original": "SixDrawerRequestClose",
407
+ "resolved": "SixDrawerRequestClose",
402
408
  "references": {
403
- "EmptyPayload": {
404
- "location": "import",
405
- "path": "../../utils/types",
406
- "id": "src/utils/types.ts::EmptyPayload"
409
+ "SixDrawerRequestClose": {
410
+ "location": "local",
411
+ "path": "/home/runner/work/six-webcomponents/six-webcomponents/libraries/ui-library/src/components/six-drawer/six-drawer.tsx",
412
+ "id": "src/components/six-drawer/six-drawer.tsx::SixDrawerRequestClose"
407
413
  }
408
414
  }
409
415
  }
@@ -1 +1 @@
1
- {"version":3,"file":"six-drawer.js","sourceRoot":"","sources":["../../../src/components/six-drawer/six-drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAGtC,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,OAAO,SAAS;IALtB;QAMU,gBAAW,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;QAI/B,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAE3B,+FAA+F;QACvD,SAAI,GAAG,KAAK,CAAC;QAErD;;;WAGG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB,qDAAqD;QAC7C,cAAS,GAAwC,OAAO,CAAC;QAEjE;;;WAGG;QACK,cAAS,GAAG,KAAK,CAAC;QAE1B;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QAyGjB,qBAAgB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;QAEM,kBAAa,GAAG,CAAC,KAAoB,EAAE,EAAE;YAC/C,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE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CAAC,KAAK,CAAC,CACpC,CACF;oBACP,wEACE,WAAW,EAAC,mBAAmB,EAC/B,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,IAAI,CAAC,gBAAgB,GAC9B,CACK,CACV;gBAED,4DAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,cAAc;oBACnC,8DAAQ,CACJ;gBAEN,+DAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;oBAC1C,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpD,CACL,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll';\nimport { hasSlot } from '../../utils/slot';\nimport Modal from '../../utils/modal';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The drawer's content.\n * @slot label - The drawer's label. Alternatively, you can use the label prop.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @part base - The component's base wrapper.\n * @part overlay - The overlay.\n * @part panel - The drawer panel (where the drawer and its content is rendered).\n * @part header - The drawer header.\n * @part title - The drawer title.\n * @part close-button - The close button.\n * @part body - The drawer body.\n * @part footer - The drawer footer.\n */\n\n@Component({\n tag: 'six-drawer',\n styleUrl: 'six-drawer.scss',\n shadow: true,\n})\nexport class SixDrawer {\n private componentId = `drawer-${++id}`;\n private drawer?: HTMLElement;\n private modal?: Modal;\n private panel?: HTMLElement;\n private willShow = false;\n private willHide = false;\n\n @Element() host!: HTMLSixDrawerElement;\n\n @State() hasFooter = false;\n @State() isVisible = false;\n\n /** Indicates whether the drawer is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility.\n */\n @Prop() label = '';\n\n /** The direction from which the drawer will open. */\n @Prop() placement: 'top' | 'right' | 'bottom' | 'left' = 'right';\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this prop and add `position: relative` to the parent.\n */\n @Prop() contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @Prop() noHeader = false;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the drawer opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-drawer-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer opens and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the drawer closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-drawer-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer closes and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the drawer opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the drawer, such as an input or button.\n */\n @Event({ eventName: 'six-drawer-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the drawer from closing. */\n @Event({ eventName: 'six-drawer-overlay-dismiss' }) sixOverlayDismiss!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.modal = new Modal(this.host, {\n onFocusOut: () => (this.contained ? null : this.panel?.focus()),\n });\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n\n // Show on init if open\n if (this.open) {\n this.show();\n // if the sidebar is open by default we need to manually reset the\n // transition variables since there will be no transition event\n this.resetTransitionVariables();\n }\n }\n\n disconnectedCallback() {\n unlockBodyScrolling(this.host);\n }\n\n /** Shows the drawer */\n @Method()\n async show() {\n if (this.willShow || this.modal == null || this.panel == null || this.drawer == null) {\n return;\n }\n const panel = this.panel;\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n this.modal.activate();\n lockBodyScrolling(this.host);\n }\n\n if (this.open) {\n // Wait for the next frame before setting initial focus so the dialog is technically visible\n requestAnimationFrame(() => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus({ preventScroll: true });\n }\n });\n }\n }\n\n /** Hides the drawer */\n @Method()\n async hide() {\n if (this.willHide || this.modal == null) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n this.modal.deactivate();\n\n unlockBodyScrolling(this.host);\n }\n\n private handleCloseClick = () => {\n this.hide();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.hide();\n }\n };\n\n private handleOverlayClick = () => {\n const sixOverlayDismiss = this.sixOverlayDismiss.emit();\n\n if (!sixOverlayDismiss.defaultPrevented) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n this.hasFooter = hasSlot(this.host, 'footer');\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'transform' && target.classList.contains('drawer__panel')) {\n this.resetTransitionVariables();\n }\n };\n\n private resetTransitionVariables() {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n\n render() {\n return (\n <div\n ref={(el) => (this.drawer = el)}\n part=\"base\"\n class={{\n drawer: true,\n 'drawer--open': this.open,\n 'drawer--visible': this.isVisible,\n 'drawer--top': this.placement === 'top',\n 'drawer--right': this.placement === 'right',\n 'drawer--bottom': this.placement === 'bottom',\n 'drawer--left': this.placement === 'left',\n 'drawer--contained': this.contained,\n 'drawer--fixed': !this.contained,\n 'drawer--has-footer': this.hasFooter,\n }}\n onKeyDown={this.handleKeyDown}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <div part=\"overlay\" class=\"drawer__overlay\" onClick={this.handleOverlayClick} tabIndex={-1} />\n\n <div\n ref={(el) => (this.panel = el)}\n part=\"panel\"\n class=\"drawer__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n aria-label={this.noHeader ? this.label : null}\n aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}\n tabIndex={0}\n >\n {!this.noHeader && (\n <header part=\"header\" class=\"drawer__header\">\n <span part=\"title\" class=\"drawer__title\" id={`${this.componentId}-title`}>\n <slot name=\"label\">\n {/* If there's no label, use an invisible character to prevent the heading from collapsing */}\n {this.label || String.fromCharCode(65279)}\n </slot>\n </span>\n <six-icon-button\n exportparts=\"base:close-button\"\n class=\"drawer__close\"\n name=\"close\"\n onClick={this.handleCloseClick}\n />\n </header>\n )}\n\n <div part=\"body\" class=\"drawer__body\">\n <slot />\n </div>\n\n <footer part=\"footer\" class=\"drawer__footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </footer>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-drawer.js","sourceRoot":"","sources":["../../../src/components/six-drawer/six-drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMlD,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,OAAO,SAAS;IALtB;QAMU,gBAAW,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;QAI/B,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAE3B,+FAA+F;QACvD,SAAI,GAAG,KAAK,CAAC;QAErD;;;WAGG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB,qDAAqD;QAC7C,cAAS,GAAwC,OAAO,CAAC;QAEjE;;;WAGG;QACK,cAAS,GAAG,KAAK,CAAC;QAE1B;;;WAGG;QACK,aAAQ,GAAG,KAAK,CAAC;QA6GjB,qBAAgB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;QACpC,CAAC,CAAC;QAEM,kBAAa,GAAG,CAAC,KAAoB,EAAE,EAAE;YAC/C,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;gB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AQ,CAAC,CAAC,CAAC,IAAI,EACpE,QAAQ,EAAE,CAAC;gBAEV,CAAC,IAAI,CAAC,QAAQ,IAAI,CACjB,+DAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;oBAC1C,6DAAM,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,QAAQ;wBACtE,6DAAM,IAAI,EAAC,OAAO,IAEf,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CACpC,CACF;oBACP,wEACE,WAAW,EAAC,mBAAmB,EAC/B,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,IAAI,CAAC,gBAAgB,GAC9B,CACK,CACV;gBAED,4DAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,cAAc;oBACnC,8DAAQ,CACJ;gBAEN,+DAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;oBAC1C,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpD,CACL,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll';\nimport { hasSlot } from '../../utils/slot';\nimport Modal from '../../utils/modal';\nimport { EmptyPayload } from '../../utils/types';\nimport { animateTo } from '../../utils/animation';\n\nexport interface SixDrawerRequestClose {\n source: 'close-button' | 'keyboard' | 'overlay';\n}\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The drawer's content.\n * @slot label - The drawer's label. Alternatively, you can use the label prop.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @part base - The component's base wrapper.\n * @part overlay - The overlay.\n * @part panel - The drawer panel (where the drawer and its content is rendered).\n * @part header - The drawer header.\n * @part title - The drawer title.\n * @part close-button - The close button.\n * @part body - The drawer body.\n * @part footer - The drawer footer.\n */\n\n@Component({\n tag: 'six-drawer',\n styleUrl: 'six-drawer.scss',\n shadow: true,\n})\nexport class SixDrawer {\n private componentId = `drawer-${++id}`;\n private drawer?: HTMLElement;\n private modal?: Modal;\n private panel?: HTMLElement;\n private willShow = false;\n private willHide = false;\n\n @Element() host!: HTMLSixDrawerElement;\n\n @State() hasFooter = false;\n @State() isVisible = false;\n\n /** Indicates whether the drawer is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility.\n */\n @Prop() label = '';\n\n /** The direction from which the drawer will open. */\n @Prop() placement: 'top' | 'right' | 'bottom' | 'left' = 'right';\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this prop and add `position: relative` to the parent.\n */\n @Prop() contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @Prop() noHeader = false;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the drawer opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-drawer-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer opens and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the drawer closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-drawer-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer closes and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the drawer opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the drawer, such as an input or button.\n */\n @Event({ eventName: 'six-drawer-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or\n * pressing escape. Calling `event.preventDefault()` will keep the drawer open. Avoid using this unless closing\n * the drawer will result in destructive behavior such as data loss.\n */\n @Event({ eventName: 'six-drawer-request-close' }) sixRequestClose!: EventEmitter<SixDrawerRequestClose>;\n\n connectedCallback() {\n this.modal = new Modal(this.host, {\n onFocusOut: () => (this.contained ? null : this.panel?.focus()),\n });\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n\n // Show on init if open\n if (this.open) {\n this.show();\n // if the sidebar is open by default we need to manually reset the\n // transition variables since there will be no transition event\n this.resetTransitionVariables();\n }\n }\n\n disconnectedCallback() {\n unlockBodyScrolling(this.host);\n }\n\n /** Shows the drawer */\n @Method()\n async show() {\n if (this.willShow || this.modal == null || this.panel == null || this.drawer == null) {\n return;\n }\n const panel = this.panel;\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n this.modal.activate();\n lockBodyScrolling(this.host);\n }\n\n if (this.open) {\n // Wait for the next frame before setting initial focus so the dialog is technically visible\n requestAnimationFrame(() => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus({ preventScroll: true });\n }\n });\n }\n }\n\n /** Hides the drawer */\n @Method()\n async hide() {\n if (this.willHide || this.modal == null) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n this.modal.deactivate();\n\n unlockBodyScrolling(this.host);\n }\n\n private handleCloseClick = () => {\n this.preventClose('close-button');\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.preventClose('keyboard');\n }\n };\n\n private handleOverlayClick = () => {\n this.preventClose('overlay');\n };\n\n private preventClose(source: 'close-button' | 'keyboard' | 'overlay') {\n const sixRequestClose = this.sixRequestClose.emit({ source });\n\n if (sixRequestClose.defaultPrevented && this.panel) {\n animateTo(this.panel, [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }], { duration: 250 });\n return;\n }\n\n this.hide();\n }\n\n private handleSlotChange = () => {\n this.hasFooter = hasSlot(this.host, 'footer');\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'transform' && target.classList.contains('drawer__panel')) {\n this.resetTransitionVariables();\n }\n };\n\n private resetTransitionVariables() {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n\n render() {\n return (\n <div\n ref={(el) => (this.drawer = el)}\n part=\"base\"\n class={{\n drawer: true,\n 'drawer--open': this.open,\n 'drawer--visible': this.isVisible,\n 'drawer--top': this.placement === 'top',\n 'drawer--right': this.placement === 'right',\n 'drawer--bottom': this.placement === 'bottom',\n 'drawer--left': this.placement === 'left',\n 'drawer--contained': this.contained,\n 'drawer--fixed': !this.contained,\n 'drawer--has-footer': this.hasFooter,\n }}\n onKeyDown={this.handleKeyDown}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <div part=\"overlay\" class=\"drawer__overlay\" onClick={this.handleOverlayClick} tabIndex={-1} />\n\n <div\n ref={(el) => (this.panel = el)}\n part=\"panel\"\n class=\"drawer__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n aria-label={this.noHeader ? this.label : null}\n aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}\n tabIndex={0}\n >\n {!this.noHeader && (\n <header part=\"header\" class=\"drawer__header\">\n <span part=\"title\" class=\"drawer__title\" id={`${this.componentId}-title`}>\n <slot name=\"label\">\n {/* If there's no label, use an invisible character to prevent the heading from collapsing */}\n {this.label || String.fromCharCode(65279)}\n </slot>\n </span>\n <six-icon-button\n exportparts=\"base:close-button\"\n class=\"drawer__close\"\n name=\"close\"\n onClick={this.handleCloseClick}\n />\n </header>\n )}\n\n <div part=\"body\" class=\"drawer__body\">\n <slot />\n </div>\n\n <footer part=\"footer\" class=\"drawer__footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </footer>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -482,19 +482,19 @@ export class SixDropdown {
482
482
  }
483
483
  }
484
484
  render() {
485
- return (h("div", { key: '04210ff1a4689e32c72f73ee76a94cbe9867b0de', part: "base", id: this.componentId, class: {
485
+ return (h("div", { key: '46305375a199fb17ae66ca3b6678634844d0b8a2', part: "base", id: this.componentId, class: {
486
486
  dropdown: true,
487
487
  'dropdown--open': this.open,
488
- } }, h("span", { key: '9eb3c0e703b08734e9458b25021c0844d255ec6e', part: "trigger", class: "dropdown__trigger", ref: (el) => (this.trigger = el), onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown, onKeyUp: this.handleTriggerKeyUp }, h("slot", { key: '5cec1b43f07f830dfdebb3a71eb56f3233a539c4', name: "trigger", ref: (el) => (this.triggerSlot = el), onSlotchange: this.handleTriggerSlotChange })), h("div", { key: '8761367cfff9b66fdd4a7733f1c59440a507178b', ref: (el) => (this.positioner = el), class: {
488
+ } }, h("span", { key: '2a53d2cf2b75607614f39675cabfe1362b297e70', part: "trigger", class: "dropdown__trigger", ref: (el) => (this.trigger = el), onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown, onKeyUp: this.handleTriggerKeyUp }, h("slot", { key: 'd8abcd455c768fded48df4c18b8191e365db4ab1', name: "trigger", ref: (el) => (this.triggerSlot = el), onSlotchange: this.handleTriggerSlotChange })), h("div", { key: 'fd0e0352800daebdc9843442901cad9769d3199a', ref: (el) => (this.positioner = el), class: {
489
489
  dropdown__positioner: true,
490
490
  dropdown__positioner__filtered: (this.filter || this.asyncFilter) && !this.hoist,
491
- } }, h("div", { key: '2ab6c7166cea3892e429db21f3b56e7a81e94735', ref: (el) => (this.panel = el), part: "panel", class: "dropdown__panel", role: "menu", "aria-hidden": this.open ? 'false' : 'true', "aria-labelledby": this.componentId }, this.filterEnabled && (h("six-input", { key: 'f7425daad22c1a756dfda4ecefa6293ac5cdcca5', class: {
491
+ } }, h("div", { key: '2d72ca0ba1a5cbb480727e325048f7a171fb7af8', ref: (el) => (this.panel = el), part: "panel", class: "dropdown__panel", role: "menu", "aria-hidden": this.open ? 'false' : 'true', "aria-labelledby": this.componentId }, this.filterEnabled && (h("six-input", { key: 'a22263fb924be51081598579391774c82a09852f', class: {
492
492
  filter: true,
493
493
  'filter-hidden': !this.open,
494
- }, "dropdown-search": true, "aria-hidden": this.open ? 'false' : 'true', ref: (el) => (this.filterInputElement = el), placeholder: this.filterPlaceholder }, h("six-icon", { key: '6416f4e28bc437c18b1cff0e0a9eaa54c9aba3d5', class: "filter__icon", slot: "suffix", size: "small" }, "search"))), h("div", { key: '479140f2107baad72960b415bd69d9ac80bb6f64', class: {
494
+ }, "dropdown-search": true, "aria-hidden": this.open ? 'false' : 'true', ref: (el) => (this.filterInputElement = el), placeholder: this.filterPlaceholder }, h("six-icon", { key: '7a8fc9e25e7e209b5b0aa05af5dcefca87e3b9d5', class: "filter__icon", slot: "suffix", size: "small" }, "search"))), h("div", { key: 'bedcab39d656be8ce064852ef9344b4fbbf60b17', class: {
495
495
  dropdown__panel__scroll: true,
496
496
  'dropdown__panel__scroll--virtual': this.virtualScroll,
497
- }, onScroll: this.handleDropdownScroll, ref: (el) => (this.scrollPanel = el) }, h("slot", { key: '539cda534eb5ef042526b66487bec3d22c89fdd7', ref: (el) => (this.panelSlot = el) }), this.options.length > 0 && (h("six-menu", { key: '6294182636491e13514380d9516f904f8a9b2204', part: "menu", items: this.renderedOptions, virtualScroll: this.virtualScroll }))), h("slot", { key: '9029f9f9a69d2b6fd19b36755ab9771181a7d1c6', name: "dropdown-footer" })))));
497
+ }, onScroll: this.handleDropdownScroll, ref: (el) => (this.scrollPanel = el) }, h("slot", { key: '21acba56de1fba98afdfda60e8b09816a70ac057', ref: (el) => (this.panelSlot = el) }), this.options.length > 0 && (h("six-menu", { key: 'd7d429d062bf111ffdaf667ada0efe640136871a', part: "menu", items: this.renderedOptions, virtualScroll: this.virtualScroll }))), h("slot", { key: 'e23be3aa659ed7fa4a513d82c982733b58a6e9db', name: "dropdown-footer" })))));
498
498
  }
499
499
  static get is() { return "six-dropdown"; }
500
500
  static get encapsulation() { return "shadow"; }
@@ -7,7 +7,7 @@ import { h } from "@stencil/core";
7
7
  */
8
8
  export class SixError {
9
9
  render() {
10
- return (h("div", { key: '35e774adc232f29f26ed0dcc98f6befe1f2a6735', class: "six-error-container" }, h("slot", { key: '3ef7bc24a95509089baaf676986a5a6c91d32274' })));
10
+ return (h("div", { key: 'c58e9de60b37b5b3cd9744b606136edcf0d58d9c', class: "six-error-container" }, h("slot", { key: '7dd0aa74aad5b8b2be2e9aed41f44b29e7ffed7c' })));
11
11
  }
12
12
  static get is() { return "six-error"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -94,7 +94,7 @@ export class SixErrorPage {
94
94
  return DESCRIPTION_PER_ERROR_CODE[this.errorCode][this.language];
95
95
  }
96
96
  render() {
97
- return (h("div", { key: '4ea2ec6cfd20308f5436337b7c76c5fe754aa24f', part: "container" }, h("div", { key: '1324fd2555df87799bdd23d36adcb7b00885a076', class: "six-error-page__icon-container", part: "icon-container" }, h("six-picto", { key: 'e7efd056f880c92385a9945d46c1c04c46872fc3', size: "4xl", class: "six-error-page__icon", part: "icon" }, this.getIconName())), h("div", { key: '75d52fbe4b3561c226c5830e15793d71ec877d46', class: "six-error-page__title", part: "title" }, this.getErrorTitle()), h("div", { key: 'f8ac2279ec7bda15115f2a8ffdad4e80ccdc9b42', class: "six-error-page__description", part: "description" }, this.getErrorDescription())));
97
+ return (h("div", { key: 'b48ab908b37b2b4d6d6ee80b2d1f73038800a0dc', part: "container" }, h("div", { key: 'd0fd1370a7b3500a1bbf4a798d5d64b2a309fabf', class: "six-error-page__icon-container", part: "icon-container" }, h("six-picto", { key: '88a00b48d434b687f270ee50e6506e23a21b0414', size: "4xl", class: "six-error-page__icon", part: "icon" }, this.getIconName())), h("div", { key: '275010c6651665efd03f3a9b36b074d0b72a9111', class: "six-error-page__title", part: "title" }, this.getErrorTitle()), h("div", { key: 'efc23d90edea6ce0bc3843a704a4ffb788f84042', class: "six-error-page__description", part: "description" }, this.getErrorDescription())));
98
98
  }
99
99
  static get is() { return "six-error-page"; }
100
100
  static get encapsulation() { return "shadow"; }
@@ -6,7 +6,7 @@ import { h } from "@stencil/core";
6
6
  */
7
7
  export class SixFileList {
8
8
  render() {
9
- return (h("div", { key: '38755b01aeafb28e3f268925a347fabdb53cac9b', class: "six-files-list__container" }, h("slot", { key: '7e9e866c6b7f6dffbe26ba5b10c46b135cc1c389' })));
9
+ return (h("div", { key: 'cf80dfd0ccfbe849dd17bfd4d940fd8ef0d1930e', class: "six-files-list__container" }, h("slot", { key: 'cb9149f512f113f2012328a102a5eac8fef55f74' })));
10
10
  }
11
11
  static get is() { return "six-file-list"; }
12
12
  static get encapsulation() { return "shadow"; }
@@ -30,10 +30,10 @@ export class SixFileListItem {
30
30
  };
31
31
  }
32
32
  render() {
33
- return (h("div", { key: '65ea17f1ce1ff3d9cb48696bbf25465f126ca879', class: "six-files-list-item" }, h("span", { key: '53749104860721fd92bbb07b84029e2d3a22c0c0', class: {
33
+ return (h("div", { key: '31722bec6e2a0956f4d1b14c7ee26330cae7e8cc', class: "six-files-list-item" }, h("span", { key: 'dfa90db55fd78720884ac4f67e5579b0eb184d40', class: {
34
34
  'six-files-list-item__name': true,
35
35
  'six-files-list-item__name--disabled': this.nodownload,
36
- }, onClick: this.downloadFile }, this.name), h("span", { key: '637a12f8bb040e3cf5392ebe7ac488e3d08ae6fb', class: "six-files-list-item__date" }, this.date), this.size != null && h("span", { key: '208e19ce7a5fa642b0b860fdba2d0dc83feb12fc', class: "six-files-list-item__size" }, Math.round(this.size / 1024), " KB"), h("six-icon", { key: 'ecca120c27d87cd450f99ab24ec26f056d014d71', class: {
36
+ }, onClick: this.downloadFile }, this.name), h("span", { key: '401f4ef61bd59467c074dcdd1b1393724b56b30f', class: "six-files-list-item__date" }, this.date), this.size != null && h("span", { key: 'c9a2df206e02dfe5187f072c59e2c9d4cb59bf19', class: "six-files-list-item__size" }, Math.round(this.size / 1024), " KB"), h("six-icon", { key: '85857613cb52b6cc117e983573dfa27cd6e78c15', class: {
37
37
  'six-files-list-item__icon': true,
38
38
  'six-files-list-item__icon--disabled': this.nodelete,
39
39
  }, size: "small", onClick: this.removeFile }, "delete")));
@@ -36,7 +36,10 @@ export class SixFileUpload {
36
36
  return;
37
37
  }
38
38
  if (!this.multiple && files.length > 1) {
39
- return this.failure.emit({ reason: 'Only one file is allowed.' });
39
+ return this.failure.emit({
40
+ reason: 'Only one file is allowed.',
41
+ code: 'ONLY_ONE_FILE_ALLOWED',
42
+ });
40
43
  }
41
44
  for (const file of files) {
42
45
  if (file == null) {
@@ -48,11 +51,13 @@ export class SixFileUpload {
48
51
  }
49
52
  if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {
50
53
  const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';
51
- return this.failure.emit({ reason });
54
+ const code = files.length > 1 ? 'ONE_OR_MORE_FILES_HAVE_INVALID_MIME_TYPE' : 'INVALID_MIME_TYPE';
55
+ return this.failure.emit({ reason, code });
52
56
  }
53
57
  if (this.maxFileSize != null && file.size > this.maxFileSize) {
54
58
  const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';
55
- return this.failure.emit({ reason });
59
+ const code = files.length > 1 ? 'ONE_OR_MULTIPLE_FILES_TOO_BIG' : 'FILE_TOO_BIG';
60
+ return this.failure.emit({ reason, code });
56
61
  }
57
62
  }
58
63
  this.success.emit({ files });
@@ -116,17 +121,17 @@ export class SixFileUpload {
116
121
  render() {
117
122
  const Container = this.compact ? 'six-button' : 'six-card';
118
123
  const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter((text) => text != null && text.trim() !== '');
119
- return (h("div", { key: '9a218054b8c8ebb757b52443eec09a1d0aeaed9f', class: {
124
+ return (h("div", { key: '5e0eadc451195cb2c4d5c4f383e1a27b19a80dc4', class: {
120
125
  'six-file-upload': true,
121
126
  'six-file-upload--disabled': this.disabled || this.uploading,
122
- } }, h(Container, { key: 'b46e0045f3c2a5b4500dc427cf26958a0e9c95db', disabled: this.disabled || this.uploading, "aria-invalid": this.invalid ? 'true' : 'false', class: {
127
+ } }, h(Container, { key: '16c443d8a887a3098cc04956bc607577ac3630b0', disabled: this.disabled || this.uploading, "aria-invalid": this.invalid ? 'true' : 'false', class: {
123
128
  'six-file-upload__container--compact': this.compact,
124
129
  'six-file-upload__container--full': !this.compact,
125
- } }, this.compact && !this.uploading && h("six-icon", { key: '5554e0b4f58b9070e5f187c3fb398c7799d3e2cb', slot: "prefix" }, "arrow_circle_up"), h("div", { key: 'fd1c35f6ae2bf980b50725af2c8de5caf6d23ca0', class: {
130
+ } }, this.compact && !this.uploading && h("six-icon", { key: '9fe02f54c63e61928f0c1f5886982f568b926d0d', slot: "prefix" }, "arrow_circle_up"), h("div", { key: '45350fcd292a61ddc6997019448b41d4bc94d5c8', class: {
126
131
  'six-file-upload__drop-zone': true,
127
132
  'six-file-upload__drop-zone--hover': this.isOver,
128
133
  'six-file-upload__drop-zone--compact': this.compact,
129
- } }, this.uploading ? (h("span", { class: "six-file-upload__drop-zone__spinner-container" }, h("six-spinner", null), " Uploading...")) : (h("div", null, h("span", null, this.renderLabel()), h("input", { class: "six-file-upload__input", type: "file", name: "resume", disabled: this.disabled, accept: this.accept, multiple: this.multiple, onChange: this.onChange, ref: (el) => (this.fileInput = el) }))))), h("div", { key: '25185ad2032778268e923c6b618129bb25e317df', "aria-hidden": this.invalid ? 'false' : 'true' }, h("slot", { key: '48a849e787fb9a3607990204d6cc2a8c3a31dc70', name: "error-text" }, errorMessages.map((text) => (h("six-error", null, h("div", { class: "six-file-upload__error-text" }, text))))))));
134
+ } }, this.uploading ? (h("span", { class: "six-file-upload__drop-zone__spinner-container" }, h("six-spinner", null), " Uploading...")) : (h("div", null, h("span", null, this.renderLabel()), h("input", { class: "six-file-upload__input", type: "file", name: "resume", disabled: this.disabled, accept: this.accept, multiple: this.multiple, onChange: this.onChange, ref: (el) => (this.fileInput = el) }))))), h("div", { key: 'f5aa7f521d1ef6b2af5c23b697fa1014c87e1827', "aria-hidden": this.invalid ? 'false' : 'true' }, h("slot", { key: 'ab2f2bf8bf27b3c67304b61c491e5ab73e76398f', name: "error-text" }, errorMessages.map((text) => (h("six-error", null, h("div", { class: "six-file-upload__error-text" }, text))))))));
130
135
  }
131
136
  static get is() { return "six-file-upload"; }
132
137
  static get encapsulation() { return "scoped"; }
@@ -1 +1 @@
1
- {"version":3,"file":"six-file-upload.js","sourceRoot":"","sources":["../../../src/components/six-file-upload/six-file-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAA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C,OAAO,CAAC,CAAC,CAAC,MAAM;gBAC/C,6DAAM,IAAI,EAAC,YAAY,IACpB,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B;oBACE,WAAK,KAAK,EAAC,6BAA6B,IAAE,IAAI,CAAO,CAC3C,CACb,CAAC,CACG,CACH,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\nexport interface SixFileUploadSuccessPayload {\n files: FileList;\n}\n\nexport interface SixFileUploadFailurePayload {\n reason: string;\n}\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-file-upload',\n styleUrl: 'six-file-upload.scss',\n scoped: true,\n shadow: false,\n})\nexport class SixFileUpload {\n @Element() readonly host!: HTMLSixFileUploadElement;\n\n private fileInput?: HTMLInputElement;\n\n @State() isOver = false;\n @State() hasError = false;\n\n /** Set to true if file control should be small. */\n @Prop() readonly compact: boolean = false;\n\n /** Label of the drop area. */\n @Prop() readonly label?: string;\n\n /** Set when button is disabled. */\n @Prop() readonly disabled = false;\n\n /** Accepted MIME-Types. */\n @Prop() readonly accept?: string;\n\n /** More than one file allowed. */\n @Prop() readonly multiple = false;\n\n /** Allowed max file size in bytes. */\n @Prop() readonly maxFileSize?: number;\n\n /** Set to true to draw the control in a loading state. */\n @Prop({ reflect: true }) uploading = false;\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Triggers when a file is added. */\n @Event({ eventName: 'six-file-upload-success' }) success!: EventEmitter<SixFileUploadSuccessPayload>;\n\n /** Triggers when an uploaded file doesn't match MIME type or max file size. */\n @Event({ eventName: 'six-file-upload-failure' }) failure!: EventEmitter<SixFileUploadFailurePayload>;\n\n @Listen('dragenter', { capture: false })\n dragenterHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragover', { capture: false })\n dragoverHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragleave', { capture: false })\n dragleaveHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n @Listen('drop', { capture: false })\n dropHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n private handleSlotChange = () => {\n let validType = false;\n\n if (\n this.errorText != null &&\n ((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||\n (typeof this.errorText == 'object' && this.errorText.length > 0))\n ) {\n validType = true;\n }\n\n this.hasError = validType || hasSlot(this.host, 'error-text');\n };\n\n private handleFiles = (files: FileList) => {\n if (this.disabled || files.length === 0 || this.uploading) {\n return;\n }\n\n if (!this.multiple && files.length > 1) {\n return this.failure.emit({ reason: 'Only one file is allowed.' });\n }\n\n for (const file of files) {\n if (file == null) {\n return;\n }\n\n let acceptedTypesList: string[] = [];\n if (this.accept != null) {\n acceptedTypesList = this.accept.replace(/\\s/g, '').split(',');\n }\n\n if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {\n const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';\n return this.failure.emit({ reason });\n }\n\n if (this.maxFileSize != null && file.size > this.maxFileSize) {\n const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';\n return this.failure.emit({ reason });\n }\n }\n\n this.success.emit({ files } as SixFileUploadSuccessPayload);\n };\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.addEventListener(eventName, this.preventDefaults, false);\n document.body.addEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.removeEventListener(eventName, this.preventDefaults, false);\n document.body.removeEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n private preventDefaults(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private onChange = () => {\n if (this.fileInput?.files != null) {\n const files = this.fileInput.files;\n this.handleFiles(files);\n this.fileInput.value = '';\n }\n };\n\n private renderLabel() {\n return (\n this.label ??\n (this.compact ? (\n 'Upload'\n ) : (\n <span>\n Drop files to upload, or <span class=\"six-file-upload__label--highlighted\">browse</span>\n </span>\n ))\n );\n }\n\n render() {\n const Container = this.compact ? 'six-button' : 'six-card';\n\n const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n return (\n <div\n class={{\n 'six-file-upload': true,\n 'six-file-upload--disabled': this.disabled || this.uploading,\n }}\n >\n <Container\n disabled={this.disabled || this.uploading}\n aria-invalid={this.invalid ? 'true' : 'false'}\n class={{\n 'six-file-upload__container--compact': this.compact,\n 'six-file-upload__container--full': !this.compact,\n }}\n >\n {this.compact && !this.uploading && <six-icon slot=\"prefix\">arrow_circle_up</six-icon>}\n <div\n class={{\n 'six-file-upload__drop-zone': true,\n 'six-file-upload__drop-zone--hover': this.isOver,\n 'six-file-upload__drop-zone--compact': this.compact,\n }}\n >\n {this.uploading ? (\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner /> Uploading...\n </span>\n ) : (\n <div>\n <span>{this.renderLabel()}</span>\n <input\n class=\"six-file-upload__input\"\n type=\"file\"\n name=\"resume\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.onChange}\n ref={(el) => (this.fileInput = el)}\n />\n </div>\n )}\n </div>\n </Container>\n <div aria-hidden={this.invalid ? 'false' : 'true'}>\n <slot name=\"error-text\">\n {errorMessages.map((text) => (\n <six-error>\n <div class=\"six-file-upload__error-text\">{text}</div>\n </six-error>\n ))}\n </slot>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-file-upload.js","sourceRoot":"","sources":["../../../src/components/six-file-upload/six-file-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAgB3C;;;;;GAKG;AAOH,MAAM,OAAO,aAAa;IAN1B;QAWW,WAAM,GAAG,KAAK,CAAC;QACf,aAAQ,GAAG,KAAK,CAAC;QAE1B,mDAAmD;QAClC,YAAO,GAAY,KAAK,CAAC;QAK1C,mCAAmC;QAClB,aAAQ,GAAG,KAAK,CAAC;QAKlC,kCAAkC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAKlC,0DAA0D;QACjC,cAAS,GAAG,KAAK,CAAC;QAE3C,6DAA6D;QACrD,cAAS,GAAsB,EAAE,CAAC;QAE1C,wHAAwH;QAC/F,YAAO,GAAG,KAAK,CAAC;QAoCjC,qBAAgB,GAAG,GAAG,EAAE;YAC9B,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,IACE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACtB,CAAC,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,QAAQ,IAAI,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\nexport interface SixFileUploadSuccessPayload {\n files: FileList;\n}\n\nexport interface SixFileUploadFailurePayload {\n reason: string;\n code:\n | 'ONLY_ONE_FILE_ALLOWED'\n | 'ONE_OR_MORE_FILES_HAVE_INVALID_MIME_TYPE'\n | 'INVALID_MIME_TYPE'\n | 'ONE_OR_MULTIPLE_FILES_TOO_BIG'\n | 'FILE_TOO_BIG';\n}\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-file-upload',\n styleUrl: 'six-file-upload.scss',\n scoped: true,\n shadow: false,\n})\nexport class SixFileUpload {\n @Element() readonly host!: HTMLSixFileUploadElement;\n\n private fileInput?: HTMLInputElement;\n\n @State() isOver = false;\n @State() hasError = false;\n\n /** Set to true if file control should be small. */\n @Prop() readonly compact: boolean = false;\n\n /** Label of the drop area. */\n @Prop() readonly label?: string;\n\n /** Set when button is disabled. */\n @Prop() readonly disabled = false;\n\n /** Accepted MIME-Types. */\n @Prop() readonly accept?: string;\n\n /** More than one file allowed. */\n @Prop() readonly multiple = false;\n\n /** Allowed max file size in bytes. */\n @Prop() readonly maxFileSize?: number;\n\n /** Set to true to draw the control in a loading state. */\n @Prop({ reflect: true }) uploading = false;\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Triggers when a file is added. */\n @Event({ eventName: 'six-file-upload-success' }) success!: EventEmitter<SixFileUploadSuccessPayload>;\n\n /** Triggers when an uploaded file doesn't match MIME type or max file size. */\n @Event({ eventName: 'six-file-upload-failure' }) failure!: EventEmitter<SixFileUploadFailurePayload>;\n\n @Listen('dragenter', { capture: false })\n dragenterHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragover', { capture: false })\n dragoverHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragleave', { capture: false })\n dragleaveHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n @Listen('drop', { capture: false })\n dropHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n private handleSlotChange = () => {\n let validType = false;\n\n if (\n this.errorText != null &&\n ((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||\n (typeof this.errorText == 'object' && this.errorText.length > 0))\n ) {\n validType = true;\n }\n\n this.hasError = validType || hasSlot(this.host, 'error-text');\n };\n\n private handleFiles = (files: FileList) => {\n if (this.disabled || files.length === 0 || this.uploading) {\n return;\n }\n\n if (!this.multiple && files.length > 1) {\n return this.failure.emit({\n reason: 'Only one file is allowed.',\n code: 'ONLY_ONE_FILE_ALLOWED',\n });\n }\n\n for (const file of files) {\n if (file == null) {\n return;\n }\n\n let acceptedTypesList: string[] = [];\n if (this.accept != null) {\n acceptedTypesList = this.accept.replace(/\\s/g, '').split(',');\n }\n\n if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {\n const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';\n const code = files.length > 1 ? 'ONE_OR_MORE_FILES_HAVE_INVALID_MIME_TYPE' : 'INVALID_MIME_TYPE';\n return this.failure.emit({ reason, code });\n }\n\n if (this.maxFileSize != null && file.size > this.maxFileSize) {\n const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';\n const code = files.length > 1 ? 'ONE_OR_MULTIPLE_FILES_TOO_BIG' : 'FILE_TOO_BIG';\n return this.failure.emit({ reason, code });\n }\n }\n\n this.success.emit({ files } as SixFileUploadSuccessPayload);\n };\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.addEventListener(eventName, this.preventDefaults, false);\n document.body.addEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.removeEventListener(eventName, this.preventDefaults, false);\n document.body.removeEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n private preventDefaults(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private onChange = () => {\n if (this.fileInput?.files != null) {\n const files = this.fileInput.files;\n this.handleFiles(files);\n this.fileInput.value = '';\n }\n };\n\n private renderLabel() {\n return (\n this.label ??\n (this.compact ? (\n 'Upload'\n ) : (\n <span>\n Drop files to upload, or <span class=\"six-file-upload__label--highlighted\">browse</span>\n </span>\n ))\n );\n }\n\n render() {\n const Container = this.compact ? 'six-button' : 'six-card';\n\n const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n return (\n <div\n class={{\n 'six-file-upload': true,\n 'six-file-upload--disabled': this.disabled || this.uploading,\n }}\n >\n <Container\n disabled={this.disabled || this.uploading}\n aria-invalid={this.invalid ? 'true' : 'false'}\n class={{\n 'six-file-upload__container--compact': this.compact,\n 'six-file-upload__container--full': !this.compact,\n }}\n >\n {this.compact && !this.uploading && <six-icon slot=\"prefix\">arrow_circle_up</six-icon>}\n <div\n class={{\n 'six-file-upload__drop-zone': true,\n 'six-file-upload__drop-zone--hover': this.isOver,\n 'six-file-upload__drop-zone--compact': this.compact,\n }}\n >\n {this.uploading ? (\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner /> Uploading...\n </span>\n ) : (\n <div>\n <span>{this.renderLabel()}</span>\n <input\n class=\"six-file-upload__input\"\n type=\"file\"\n name=\"resume\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.onChange}\n ref={(el) => (this.fileInput = el)}\n />\n </div>\n )}\n </div>\n </Container>\n <div aria-hidden={this.invalid ? 'false' : 'true'}>\n <slot name=\"error-text\">\n {errorMessages.map((text) => (\n <six-error>\n <div class=\"six-file-upload__error-text\">{text}</div>\n </six-error>\n ))}\n </slot>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -7,7 +7,7 @@ import { h } from "@stencil/core";
7
7
  */
8
8
  export class SixFooter {
9
9
  render() {
10
- return (h("footer", { key: 'fe39b58edfd331a6b6ae1d551286fd45e3783f5d', class: "six-footer" }, h("slot", { key: '7c93a54de4e4160adabc4790b368401b790d6fcc' })));
10
+ return (h("footer", { key: '21f693d3b5de440dba60926318d0627ca1c260b1', class: "six-footer" }, h("slot", { key: 'ecd570f552abf35060d5b449c4ce900b23b2abb6' })));
11
11
  }
12
12
  static get is() { return "six-footer"; }
13
13
  static get encapsulation() { return "shadow"; }