@synergy-design-system/components 1.7.0 → 1.9.0

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 (275) hide show
  1. package/README.md +8 -0
  2. package/dist/chunks/{chunk.23HTU3YE.js → chunk.2EI3TNL7.js} +1 -16
  3. package/dist/chunks/chunk.2EI3TNL7.js.map +7 -0
  4. package/dist/chunks/{chunk.RSONAU45.js → chunk.2RF7KO5I.js} +1 -12
  5. package/dist/chunks/chunk.2RF7KO5I.js.map +7 -0
  6. package/dist/chunks/{chunk.GHMKOVA3.js → chunk.3DE5ARIC.js} +23 -3
  7. package/dist/chunks/chunk.3DE5ARIC.js.map +7 -0
  8. package/dist/chunks/chunk.3O5WTWSN.js +12 -0
  9. package/dist/chunks/chunk.3O5WTWSN.js.map +7 -0
  10. package/dist/chunks/{chunk.MFFJYORB.js → chunk.3STW62TA.js} +1 -12
  11. package/dist/chunks/chunk.3STW62TA.js.map +7 -0
  12. package/dist/chunks/{chunk.EKOK7YPB.js → chunk.4QS5IWYB.js} +1 -16
  13. package/dist/chunks/chunk.4QS5IWYB.js.map +7 -0
  14. package/dist/chunks/{chunk.ULMZHWWW.js → chunk.5BMNRZ7L.js} +2 -2
  15. package/dist/chunks/{chunk.SMSP5C6C.js → chunk.5CB3CVZ7.js} +2 -2
  16. package/dist/chunks/{chunk.GMUVD5B2.js → chunk.5R3OVMH2.js} +25 -10
  17. package/dist/chunks/chunk.5R3OVMH2.js.map +7 -0
  18. package/dist/chunks/{chunk.EI34C7LC.js → chunk.6MS3WNDW.js} +8 -7
  19. package/dist/chunks/chunk.6MS3WNDW.js.map +7 -0
  20. package/dist/chunks/{chunk.4ZURABYO.js → chunk.A7IIJ2LL.js} +1 -7
  21. package/dist/chunks/{chunk.O7USYXBT.js.map → chunk.A7IIJ2LL.js.map} +3 -3
  22. package/dist/chunks/{chunk.PGCXJ2PT.js → chunk.ACTJFDNK.js} +1 -12
  23. package/dist/chunks/chunk.ACTJFDNK.js.map +7 -0
  24. package/dist/chunks/{chunk.MNMITYTH.js → chunk.ADRKUQGR.js} +1 -12
  25. package/dist/chunks/chunk.ADRKUQGR.js.map +7 -0
  26. package/dist/chunks/{chunk.5OPODPPZ.js → chunk.AJU6C4KC.js} +2 -2
  27. package/dist/chunks/{chunk.VZ7S7YYN.js → chunk.AVTU2BGE.js} +2 -2
  28. package/dist/chunks/{chunk.QHFGD6WW.js → chunk.BGHK4NQA.js} +1 -12
  29. package/dist/chunks/chunk.BGHK4NQA.js.map +7 -0
  30. package/dist/chunks/{chunk.LWXCBEHD.js → chunk.BGKFRWWO.js} +5 -5
  31. package/dist/chunks/{chunk.3ZHSSMBL.js → chunk.BJYVLDYR.js} +84 -6
  32. package/dist/chunks/chunk.BJYVLDYR.js.map +7 -0
  33. package/dist/chunks/chunk.BLOH2ZNU.js +636 -0
  34. package/dist/chunks/chunk.BLOH2ZNU.js.map +7 -0
  35. package/dist/chunks/{chunk.USYR7G7Z.js → chunk.BTZX6ZFZ.js} +2 -2
  36. package/dist/chunks/{chunk.W6V7TPGK.js → chunk.CFIQXXMW.js} +1 -12
  37. package/dist/chunks/chunk.CFIQXXMW.js.map +7 -0
  38. package/dist/chunks/{chunk.RA2WSKQT.js → chunk.F4THECWA.js} +2 -2
  39. package/dist/chunks/{chunk.Z4NKFCKY.js → chunk.FSONLJTT.js} +19 -15
  40. package/dist/chunks/chunk.FSONLJTT.js.map +7 -0
  41. package/dist/chunks/{chunk.PMTVLWNZ.js → chunk.FUNZW7ES.js} +2 -2
  42. package/dist/chunks/{chunk.OJREQD2D.js → chunk.GAPQVJGQ.js} +22 -14
  43. package/dist/chunks/chunk.GAPQVJGQ.js.map +7 -0
  44. package/dist/chunks/{chunk.NAX6WP3D.js → chunk.GBOII6N4.js} +11 -7
  45. package/dist/chunks/chunk.GBOII6N4.js.map +7 -0
  46. package/dist/chunks/chunk.GTSRMEPE.js +108 -0
  47. package/dist/chunks/chunk.GTSRMEPE.js.map +7 -0
  48. package/dist/chunks/{chunk.JAKJHV44.js → chunk.HF75YRVS.js} +22 -15
  49. package/dist/chunks/chunk.HF75YRVS.js.map +7 -0
  50. package/dist/chunks/{chunk.7VOPIPHW.js → chunk.IOPUYG6Q.js} +2 -2
  51. package/dist/chunks/{chunk.5THN2K5Q.js → chunk.IR2PZHC7.js} +2 -2
  52. package/dist/chunks/{chunk.SBEIXLRW.js → chunk.K3O2PP7X.js} +6 -5
  53. package/dist/chunks/chunk.K3O2PP7X.js.map +7 -0
  54. package/dist/chunks/{chunk.TUYEX4KP.js → chunk.KDDTDU4B.js} +73 -35
  55. package/dist/chunks/chunk.KDDTDU4B.js.map +7 -0
  56. package/dist/chunks/{chunk.5BOEKFIJ.js → chunk.KNXO2FGQ.js} +86 -48
  57. package/dist/chunks/chunk.KNXO2FGQ.js.map +7 -0
  58. package/dist/chunks/{chunk.HG5QC5EW.js → chunk.KUO3KJOC.js} +2 -2
  59. package/dist/chunks/{chunk.B6AKFQJS.js → chunk.LF2XSSHD.js} +2 -2
  60. package/dist/chunks/{chunk.2FN5DTS6.js → chunk.LJQ7LEPV.js} +1 -12
  61. package/dist/chunks/chunk.LJQ7LEPV.js.map +7 -0
  62. package/dist/chunks/{chunk.KP7SYG4K.js → chunk.LZE7OXKV.js} +2 -2
  63. package/dist/chunks/{chunk.CYN675Z6.js → chunk.MDZ22YWD.js} +12 -8
  64. package/dist/chunks/chunk.MDZ22YWD.js.map +7 -0
  65. package/dist/chunks/{chunk.JN7CLMQZ.js → chunk.MIMALEWP.js} +21 -7
  66. package/dist/chunks/chunk.MIMALEWP.js.map +7 -0
  67. package/dist/chunks/{chunk.XSXBQCWN.js → chunk.O6AXKVFJ.js} +11 -7
  68. package/dist/chunks/chunk.O6AXKVFJ.js.map +7 -0
  69. package/dist/chunks/{chunk.N2I6HVX3.js → chunk.OSBC36KQ.js} +4 -9
  70. package/dist/chunks/chunk.OSBC36KQ.js.map +7 -0
  71. package/dist/chunks/chunk.PHSJD47V.js +162 -0
  72. package/dist/chunks/chunk.PHSJD47V.js.map +7 -0
  73. package/dist/chunks/{chunk.JBYBQ5TQ.js → chunk.PKO6FEOM.js} +1 -12
  74. package/dist/chunks/chunk.PKO6FEOM.js.map +7 -0
  75. package/dist/chunks/{chunk.7KSU2SUD.js → chunk.PRZRH7SN.js} +2 -2
  76. package/dist/chunks/{chunk.4MYR27GF.js → chunk.PWMSNMDF.js} +13 -9
  77. package/dist/chunks/chunk.PWMSNMDF.js.map +7 -0
  78. package/dist/chunks/{chunk.BQG5LF7J.js → chunk.QAUTITK3.js} +2 -2
  79. package/dist/chunks/{chunk.DJOAQ4JU.js → chunk.QNDC5KWA.js} +43 -2
  80. package/dist/chunks/{chunk.6XU6OLZ3.js → chunk.QNQNR3RY.js} +1 -16
  81. package/dist/chunks/chunk.QNQNR3RY.js.map +7 -0
  82. package/dist/chunks/{chunk.Q7X5NOPZ.js → chunk.QY6MKIMK.js} +2 -2
  83. package/dist/chunks/{chunk.VQWUZKDS.js → chunk.RMQZMRVP.js} +2 -2
  84. package/dist/chunks/{chunk.XXF35USM.js → chunk.RMZBSKRR.js} +59 -109
  85. package/dist/chunks/chunk.RMZBSKRR.js.map +7 -0
  86. package/dist/chunks/{chunk.OJ4KOC7R.js → chunk.SJMMPKWP.js} +1 -12
  87. package/dist/chunks/chunk.SJMMPKWP.js.map +7 -0
  88. package/dist/chunks/{chunk.AMTCNRDE.js → chunk.SZCGMXW5.js} +3 -3
  89. package/dist/chunks/chunk.SZCGMXW5.js.map +7 -0
  90. package/dist/chunks/{chunk.JHXCBOUD.js → chunk.TTL762VF.js} +57 -60
  91. package/dist/chunks/chunk.TTL762VF.js.map +7 -0
  92. package/dist/chunks/chunk.UYD2OVFV.js +83 -0
  93. package/dist/chunks/chunk.UYD2OVFV.js.map +7 -0
  94. package/dist/chunks/{chunk.7EGCXNF2.js → chunk.UZFPGR6M.js} +8 -7
  95. package/dist/chunks/chunk.UZFPGR6M.js.map +7 -0
  96. package/dist/chunks/{chunk.SXW2KV3B.js → chunk.VATYXV2O.js} +2 -2
  97. package/dist/chunks/{chunk.AFEABUNX.js → chunk.W5JK7V7K.js} +6 -1
  98. package/dist/chunks/chunk.W5JK7V7K.js.map +7 -0
  99. package/dist/chunks/{chunk.IRT2DA6R.js → chunk.WC5SV4TV.js} +28 -18
  100. package/dist/chunks/chunk.WC5SV4TV.js.map +7 -0
  101. package/dist/chunks/{chunk.HKCTVD3U.js → chunk.XEI5ZP7Y.js} +11 -7
  102. package/dist/chunks/chunk.XEI5ZP7Y.js.map +7 -0
  103. package/dist/chunks/{chunk.4I6M5V6O.js → chunk.XIUSSERX.js} +1 -16
  104. package/dist/chunks/chunk.XIUSSERX.js.map +7 -0
  105. package/dist/chunks/{chunk.6V3HOZNE.js → chunk.Y72MIUNI.js} +2 -2
  106. package/dist/chunks/{chunk.IKKMWFWH.js → chunk.ZIQXX272.js} +2 -2
  107. package/dist/chunks/{chunk.GOVLCQY5.js → chunk.ZT5DUKVA.js} +2 -2
  108. package/dist/components/button/button.component.js +13 -14
  109. package/dist/components/button/button.custom.styles.js +1 -1
  110. package/dist/components/button/button.js +14 -15
  111. package/dist/components/button/button.styles.js +2 -4
  112. package/dist/components/button-group/button-group.component.js +4 -5
  113. package/dist/components/button-group/button-group.js +5 -6
  114. package/dist/components/button-group/button-group.styles.js +2 -3
  115. package/dist/components/checkbox/checkbox.component.d.ts +5 -0
  116. package/dist/components/checkbox/checkbox.component.js +12 -11
  117. package/dist/components/checkbox/checkbox.custom.styles.js +1 -1
  118. package/dist/components/checkbox/checkbox.js +13 -12
  119. package/dist/components/checkbox/checkbox.styles.js +2 -4
  120. package/dist/components/divider/divider.component.js +5 -6
  121. package/dist/components/divider/divider.custom.styles.js +1 -1
  122. package/dist/components/divider/divider.js +6 -7
  123. package/dist/components/divider/divider.styles.js +2 -4
  124. package/dist/components/drawer/drawer.component.d.ts +110 -0
  125. package/dist/components/drawer/drawer.component.js +27 -0
  126. package/dist/components/drawer/drawer.component.js.map +7 -0
  127. package/dist/components/drawer/drawer.custom.styles.d.ts +2 -0
  128. package/dist/components/drawer/drawer.custom.styles.js +8 -0
  129. package/dist/components/drawer/drawer.custom.styles.js.map +7 -0
  130. package/dist/components/drawer/drawer.d.ts +8 -0
  131. package/dist/components/drawer/drawer.js +28 -0
  132. package/dist/components/drawer/drawer.js.map +7 -0
  133. package/dist/components/drawer/drawer.styles.d.ts +2 -0
  134. package/dist/components/drawer/drawer.styles.js +8 -0
  135. package/dist/components/drawer/drawer.styles.js.map +7 -0
  136. package/dist/components/icon/icon.component.js +6 -7
  137. package/dist/components/icon/icon.custom.styles.js +1 -1
  138. package/dist/components/icon/icon.js +7 -8
  139. package/dist/components/icon/icon.styles.js +2 -4
  140. package/dist/components/icon/library.default.js +1 -1
  141. package/dist/components/icon/library.js +1 -1
  142. package/dist/components/icon/library.system.js +1 -1
  143. package/dist/components/icon-button/icon-button.component.js +8 -9
  144. package/dist/components/icon-button/icon-button.custom.styles.js +1 -1
  145. package/dist/components/icon-button/icon-button.js +9 -10
  146. package/dist/components/icon-button/icon-button.styles.js +2 -4
  147. package/dist/components/input/input.component.js +14 -15
  148. package/dist/components/input/input.custom.styles.js +1 -1
  149. package/dist/components/input/input.js +15 -16
  150. package/dist/components/input/input.styles.js +2 -5
  151. package/dist/components/optgroup/optgroup.component.js +6 -7
  152. package/dist/components/optgroup/optgroup.js +7 -8
  153. package/dist/components/optgroup/optgroup.styles.js +1 -1
  154. package/dist/components/option/option.component.js +8 -9
  155. package/dist/components/option/option.custom.styles.js +1 -1
  156. package/dist/components/option/option.js +9 -10
  157. package/dist/components/option/option.styles.js +2 -4
  158. package/dist/components/popup/popup.component.d.ts +9 -0
  159. package/dist/components/popup/popup.component.js +4 -5
  160. package/dist/components/popup/popup.styles.js +2 -3
  161. package/dist/components/radio/radio.component.js +8 -9
  162. package/dist/components/radio/radio.custom.styles.js +1 -1
  163. package/dist/components/radio/radio.js +9 -10
  164. package/dist/components/radio/radio.styles.js +2 -4
  165. package/dist/components/radio-button/radio-button.component.js +6 -8
  166. package/dist/components/radio-button/radio-button.js +7 -9
  167. package/dist/components/radio-button/radio-button.styles.js +3 -5
  168. package/dist/components/radio-group/radio-group.component.d.ts +1 -0
  169. package/dist/components/radio-group/radio-group.component.js +9 -10
  170. package/dist/components/radio-group/radio-group.custom.styles.js +1 -1
  171. package/dist/components/radio-group/radio-group.js +10 -11
  172. package/dist/components/radio-group/radio-group.styles.js +2 -5
  173. package/dist/components/select/select.component.d.ts +1 -0
  174. package/dist/components/select/select.component.js +20 -20
  175. package/dist/components/select/select.custom.styles.js +1 -1
  176. package/dist/components/select/select.js +21 -21
  177. package/dist/components/select/select.styles.js +2 -5
  178. package/dist/components/spinner/spinner.component.js +4 -5
  179. package/dist/components/spinner/spinner.styles.js +2 -3
  180. package/dist/components/switch/switch.component.d.ts +5 -0
  181. package/dist/components/switch/switch.component.js +9 -8
  182. package/dist/components/switch/switch.custom.styles.js +2 -2
  183. package/dist/components/switch/switch.js +10 -9
  184. package/dist/components/switch/switch.styles.js +2 -4
  185. package/dist/components/tag/tag.component.js +10 -11
  186. package/dist/components/tag/tag.custom.styles.js +1 -1
  187. package/dist/components/tag/tag.js +11 -12
  188. package/dist/components/tag/tag.styles.js +2 -4
  189. package/dist/components/textarea/textarea.component.js +8 -9
  190. package/dist/components/textarea/textarea.custom.styles.js +1 -1
  191. package/dist/components/textarea/textarea.js +9 -10
  192. package/dist/components/textarea/textarea.styles.js +2 -5
  193. package/dist/custom-elements.json +877 -351
  194. package/dist/events/events.d.ts +2 -0
  195. package/dist/events/syn-initial-focus.d.ts +6 -0
  196. package/dist/events/syn-request-close.d.ts +8 -0
  197. package/dist/internal/active-elements.d.ts +15 -0
  198. package/dist/internal/longpress.d.ts +2 -2
  199. package/dist/internal/modal.d.ts +24 -0
  200. package/dist/internal/string.d.ts +2 -0
  201. package/dist/internal/tabbable.d.ts +9 -0
  202. package/dist/synergy-autoloader.js +1 -1
  203. package/dist/synergy.d.ts +1 -0
  204. package/dist/synergy.js +88 -81
  205. package/dist/themes/utility.css +29 -0
  206. package/dist/translations/de.js +1 -1
  207. package/dist/translations/en.js +1 -1
  208. package/dist/utilities/animation-registry.js +2 -2
  209. package/dist/utilities/base-path.js +1 -1
  210. package/dist/utilities/form.js +3 -3
  211. package/dist/utilities/icon-library.js +1 -1
  212. package/dist/utilities/localize.js +1 -1
  213. package/dist/vscode.html-custom-data.json +78 -21
  214. package/package.json +4 -5
  215. package/dist/chunks/chunk.23HTU3YE.js.map +0 -7
  216. package/dist/chunks/chunk.2FN5DTS6.js.map +0 -7
  217. package/dist/chunks/chunk.3ZHSSMBL.js.map +0 -7
  218. package/dist/chunks/chunk.4I6M5V6O.js.map +0 -7
  219. package/dist/chunks/chunk.4MYR27GF.js.map +0 -7
  220. package/dist/chunks/chunk.4ZURABYO.js.map +0 -7
  221. package/dist/chunks/chunk.5BOEKFIJ.js.map +0 -7
  222. package/dist/chunks/chunk.6XU6OLZ3.js.map +0 -7
  223. package/dist/chunks/chunk.7EGCXNF2.js.map +0 -7
  224. package/dist/chunks/chunk.AFEABUNX.js.map +0 -7
  225. package/dist/chunks/chunk.AMTCNRDE.js.map +0 -7
  226. package/dist/chunks/chunk.CYN675Z6.js.map +0 -7
  227. package/dist/chunks/chunk.EI34C7LC.js.map +0 -7
  228. package/dist/chunks/chunk.EKOK7YPB.js.map +0 -7
  229. package/dist/chunks/chunk.GHMKOVA3.js.map +0 -7
  230. package/dist/chunks/chunk.GMUVD5B2.js.map +0 -7
  231. package/dist/chunks/chunk.HKCTVD3U.js.map +0 -7
  232. package/dist/chunks/chunk.IRT2DA6R.js.map +0 -7
  233. package/dist/chunks/chunk.JAKJHV44.js.map +0 -7
  234. package/dist/chunks/chunk.JBYBQ5TQ.js.map +0 -7
  235. package/dist/chunks/chunk.JHXCBOUD.js.map +0 -7
  236. package/dist/chunks/chunk.JN7CLMQZ.js.map +0 -7
  237. package/dist/chunks/chunk.MFFJYORB.js.map +0 -7
  238. package/dist/chunks/chunk.MNMITYTH.js.map +0 -7
  239. package/dist/chunks/chunk.N2I6HVX3.js.map +0 -7
  240. package/dist/chunks/chunk.NAX6WP3D.js.map +0 -7
  241. package/dist/chunks/chunk.O7USYXBT.js +0 -23
  242. package/dist/chunks/chunk.OJ4KOC7R.js.map +0 -7
  243. package/dist/chunks/chunk.OJREQD2D.js.map +0 -7
  244. package/dist/chunks/chunk.PGCXJ2PT.js.map +0 -7
  245. package/dist/chunks/chunk.QHFGD6WW.js.map +0 -7
  246. package/dist/chunks/chunk.RSONAU45.js.map +0 -7
  247. package/dist/chunks/chunk.SBEIXLRW.js.map +0 -7
  248. package/dist/chunks/chunk.TUYEX4KP.js.map +0 -7
  249. package/dist/chunks/chunk.W6V7TPGK.js.map +0 -7
  250. package/dist/chunks/chunk.XSXBQCWN.js.map +0 -7
  251. package/dist/chunks/chunk.XXF35USM.js.map +0 -7
  252. package/dist/chunks/chunk.Z4NKFCKY.js.map +0 -7
  253. package/dist/web-types.json +0 -2449
  254. /package/dist/chunks/{chunk.ULMZHWWW.js.map → chunk.5BMNRZ7L.js.map} +0 -0
  255. /package/dist/chunks/{chunk.SMSP5C6C.js.map → chunk.5CB3CVZ7.js.map} +0 -0
  256. /package/dist/chunks/{chunk.5OPODPPZ.js.map → chunk.AJU6C4KC.js.map} +0 -0
  257. /package/dist/chunks/{chunk.VZ7S7YYN.js.map → chunk.AVTU2BGE.js.map} +0 -0
  258. /package/dist/chunks/{chunk.LWXCBEHD.js.map → chunk.BGKFRWWO.js.map} +0 -0
  259. /package/dist/chunks/{chunk.USYR7G7Z.js.map → chunk.BTZX6ZFZ.js.map} +0 -0
  260. /package/dist/chunks/{chunk.RA2WSKQT.js.map → chunk.F4THECWA.js.map} +0 -0
  261. /package/dist/chunks/{chunk.PMTVLWNZ.js.map → chunk.FUNZW7ES.js.map} +0 -0
  262. /package/dist/chunks/{chunk.7VOPIPHW.js.map → chunk.IOPUYG6Q.js.map} +0 -0
  263. /package/dist/chunks/{chunk.5THN2K5Q.js.map → chunk.IR2PZHC7.js.map} +0 -0
  264. /package/dist/chunks/{chunk.HG5QC5EW.js.map → chunk.KUO3KJOC.js.map} +0 -0
  265. /package/dist/chunks/{chunk.B6AKFQJS.js.map → chunk.LF2XSSHD.js.map} +0 -0
  266. /package/dist/chunks/{chunk.KP7SYG4K.js.map → chunk.LZE7OXKV.js.map} +0 -0
  267. /package/dist/chunks/{chunk.7KSU2SUD.js.map → chunk.PRZRH7SN.js.map} +0 -0
  268. /package/dist/chunks/{chunk.BQG5LF7J.js.map → chunk.QAUTITK3.js.map} +0 -0
  269. /package/dist/chunks/{chunk.DJOAQ4JU.js.map → chunk.QNDC5KWA.js.map} +0 -0
  270. /package/dist/chunks/{chunk.Q7X5NOPZ.js.map → chunk.QY6MKIMK.js.map} +0 -0
  271. /package/dist/chunks/{chunk.VQWUZKDS.js.map → chunk.RMQZMRVP.js.map} +0 -0
  272. /package/dist/chunks/{chunk.SXW2KV3B.js.map → chunk.VATYXV2O.js.map} +0 -0
  273. /package/dist/chunks/{chunk.6V3HOZNE.js.map → chunk.Y72MIUNI.js.map} +0 -0
  274. /package/dist/chunks/{chunk.IKKMWFWH.js.map → chunk.ZIQXX272.js.map} +0 -0
  275. /package/dist/chunks/{chunk.GOVLCQY5.js.map → chunk.ZT5DUKVA.js.map} +0 -0
@@ -0,0 +1,636 @@
1
+ import {
2
+ animateTo,
3
+ lockBodyScrolling,
4
+ stopAnimations,
5
+ unlockBodyScrolling,
6
+ waitForEvent
7
+ } from "./chunk.GTSRMEPE.js";
8
+ import {
9
+ getAnimation,
10
+ setDefaultAnimation
11
+ } from "./chunk.QAUTITK3.js";
12
+ import {
13
+ SynIconButton
14
+ } from "./chunk.O6AXKVFJ.js";
15
+ import {
16
+ drawer_custom_styles_default
17
+ } from "./chunk.UYD2OVFV.js";
18
+ import {
19
+ drawer_styles_default
20
+ } from "./chunk.PHSJD47V.js";
21
+ import {
22
+ LocalizeController
23
+ } from "./chunk.LAB4YJYE.js";
24
+ import {
25
+ HasSlotController
26
+ } from "./chunk.XGXFE6IF.js";
27
+ import {
28
+ watch
29
+ } from "./chunk.AVTU2BGE.js";
30
+ import {
31
+ SynergyElement,
32
+ component_styles_default
33
+ } from "./chunk.3DE5ARIC.js";
34
+ import {
35
+ __decorateClass,
36
+ __yieldStar
37
+ } from "./chunk.QNDC5KWA.js";
38
+
39
+ // src/components/drawer/drawer.component.ts
40
+ import { classMap } from "lit/directives/class-map.js";
41
+ import { html } from "lit";
42
+ import { ifDefined } from "lit/directives/if-defined.js";
43
+ import { property, query } from "lit/decorators.js";
44
+
45
+ // src/internal/string.ts
46
+ function uppercaseFirstLetter(string) {
47
+ return string.charAt(0).toUpperCase() + string.slice(1);
48
+ }
49
+
50
+ // src/internal/active-elements.ts
51
+ function* activeElements(activeElement = document.activeElement) {
52
+ if (activeElement === null || activeElement === void 0)
53
+ return;
54
+ yield activeElement;
55
+ if ("shadowRoot" in activeElement && activeElement.shadowRoot && activeElement.shadowRoot.mode !== "closed") {
56
+ yield* __yieldStar(activeElements(activeElement.shadowRoot.activeElement));
57
+ }
58
+ }
59
+ function getDeepestActiveElement() {
60
+ return [...activeElements()].pop();
61
+ }
62
+
63
+ // src/internal/tabbable.ts
64
+ var computedStyleMap = /* @__PURE__ */ new WeakMap();
65
+ function getCachedComputedStyle(el) {
66
+ let computedStyle = computedStyleMap.get(el);
67
+ if (!computedStyle) {
68
+ computedStyle = window.getComputedStyle(el, null);
69
+ computedStyleMap.set(el, computedStyle);
70
+ }
71
+ return computedStyle;
72
+ }
73
+ function isVisible(el) {
74
+ if (typeof el.checkVisibility === "function") {
75
+ return el.checkVisibility({ checkOpacity: false, checkVisibilityCSS: true });
76
+ }
77
+ const computedStyle = getCachedComputedStyle(el);
78
+ return computedStyle.visibility !== "hidden" && computedStyle.display !== "none";
79
+ }
80
+ function isOverflowingAndTabbable(el) {
81
+ const computedStyle = getCachedComputedStyle(el);
82
+ const { overflowY, overflowX } = computedStyle;
83
+ if (overflowY === "scroll" || overflowX === "scroll") {
84
+ return true;
85
+ }
86
+ if (overflowY !== "auto" || overflowX !== "auto") {
87
+ return false;
88
+ }
89
+ const isOverflowingY = el.scrollHeight > el.clientHeight;
90
+ if (isOverflowingY && overflowY === "auto") {
91
+ return true;
92
+ }
93
+ const isOverflowingX = el.scrollWidth > el.clientWidth;
94
+ if (isOverflowingX && overflowX === "auto") {
95
+ return true;
96
+ }
97
+ return false;
98
+ }
99
+ function isTabbable(el) {
100
+ const tag = el.tagName.toLowerCase();
101
+ const tabindex = Number(el.getAttribute("tabindex"));
102
+ const hasTabindex = el.hasAttribute("tabindex");
103
+ if (hasTabindex && (isNaN(tabindex) || tabindex <= -1)) {
104
+ return false;
105
+ }
106
+ if (el.hasAttribute("disabled")) {
107
+ return false;
108
+ }
109
+ if (el.closest("[inert]")) {
110
+ return false;
111
+ }
112
+ if (tag === "input" && el.getAttribute("type") === "radio" && !el.hasAttribute("checked")) {
113
+ return false;
114
+ }
115
+ if (!isVisible(el)) {
116
+ return false;
117
+ }
118
+ if ((tag === "audio" || tag === "video") && el.hasAttribute("controls")) {
119
+ return true;
120
+ }
121
+ if (el.hasAttribute("tabindex")) {
122
+ return true;
123
+ }
124
+ if (el.hasAttribute("contenteditable") && el.getAttribute("contenteditable") !== "false") {
125
+ return true;
126
+ }
127
+ const isNativelyTabbable = [
128
+ "button",
129
+ "input",
130
+ "select",
131
+ "textarea",
132
+ "a",
133
+ "audio",
134
+ "video",
135
+ "summary",
136
+ "iframe"
137
+ ].includes(tag);
138
+ if (isNativelyTabbable) {
139
+ return true;
140
+ }
141
+ return isOverflowingAndTabbable(el);
142
+ }
143
+ function getSlottedChildrenOutsideRootElement(slotElement, root) {
144
+ var _a;
145
+ return ((_a = slotElement.getRootNode({ composed: true })) == null ? void 0 : _a.host) !== root;
146
+ }
147
+ function getTabbableElements(root) {
148
+ const walkedEls = /* @__PURE__ */ new WeakMap();
149
+ const tabbableElements = [];
150
+ function walk(el) {
151
+ if (el instanceof Element) {
152
+ if (el.hasAttribute("inert") || el.closest("[inert]")) {
153
+ return;
154
+ }
155
+ if (walkedEls.has(el)) {
156
+ return;
157
+ }
158
+ walkedEls.set(el, true);
159
+ if (!tabbableElements.includes(el) && isTabbable(el)) {
160
+ tabbableElements.push(el);
161
+ }
162
+ if (el instanceof HTMLSlotElement && getSlottedChildrenOutsideRootElement(el, root)) {
163
+ el.assignedElements({ flatten: true }).forEach((assignedEl) => {
164
+ walk(assignedEl);
165
+ });
166
+ }
167
+ if (el.shadowRoot !== null && el.shadowRoot.mode === "open") {
168
+ walk(el.shadowRoot);
169
+ }
170
+ }
171
+ for (const e of el.children) {
172
+ walk(e);
173
+ }
174
+ }
175
+ walk(root);
176
+ return tabbableElements.sort((a, b) => {
177
+ const aTabindex = Number(a.getAttribute("tabindex")) || 0;
178
+ const bTabindex = Number(b.getAttribute("tabindex")) || 0;
179
+ return bTabindex - aTabindex;
180
+ });
181
+ }
182
+
183
+ // src/internal/modal.ts
184
+ var activeModals = [];
185
+ var Modal = class {
186
+ constructor(element) {
187
+ this.tabDirection = "forward";
188
+ this.handleFocusIn = () => {
189
+ if (!this.isActive())
190
+ return;
191
+ this.checkFocus();
192
+ };
193
+ this.handleKeyDown = (event) => {
194
+ var _a;
195
+ if (event.key !== "Tab" || this.isExternalActivated)
196
+ return;
197
+ if (!this.isActive())
198
+ return;
199
+ const currentActiveElement = getDeepestActiveElement();
200
+ this.previousFocus = currentActiveElement;
201
+ if (this.previousFocus && this.possiblyHasTabbableChildren(this.previousFocus)) {
202
+ return;
203
+ }
204
+ if (event.shiftKey) {
205
+ this.tabDirection = "backward";
206
+ } else {
207
+ this.tabDirection = "forward";
208
+ }
209
+ const tabbableElements = getTabbableElements(this.element);
210
+ let currentFocusIndex = tabbableElements.findIndex((el) => el === currentActiveElement);
211
+ this.previousFocus = this.currentFocus;
212
+ const addition = this.tabDirection === "forward" ? 1 : -1;
213
+ while (true) {
214
+ if (currentFocusIndex + addition >= tabbableElements.length) {
215
+ currentFocusIndex = 0;
216
+ } else if (currentFocusIndex + addition < 0) {
217
+ currentFocusIndex = tabbableElements.length - 1;
218
+ } else {
219
+ currentFocusIndex += addition;
220
+ }
221
+ this.previousFocus = this.currentFocus;
222
+ const nextFocus = (
223
+ /** @type {HTMLElement} */
224
+ tabbableElements[currentFocusIndex]
225
+ );
226
+ if (this.tabDirection === "backward") {
227
+ if (this.previousFocus && this.possiblyHasTabbableChildren(this.previousFocus)) {
228
+ return;
229
+ }
230
+ }
231
+ if (nextFocus && this.possiblyHasTabbableChildren(nextFocus)) {
232
+ return;
233
+ }
234
+ event.preventDefault();
235
+ this.currentFocus = nextFocus;
236
+ (_a = this.currentFocus) == null ? void 0 : _a.focus({ preventScroll: false });
237
+ const allActiveElements = [...activeElements()];
238
+ if (allActiveElements.includes(this.currentFocus) || !allActiveElements.includes(this.previousFocus)) {
239
+ break;
240
+ }
241
+ }
242
+ setTimeout(() => this.checkFocus());
243
+ };
244
+ this.handleKeyUp = () => {
245
+ this.tabDirection = "forward";
246
+ };
247
+ this.element = element;
248
+ this.elementsWithTabbableControls = ["iframe"];
249
+ }
250
+ /** Activates focus trapping. */
251
+ activate() {
252
+ activeModals.push(this.element);
253
+ document.addEventListener("focusin", this.handleFocusIn);
254
+ document.addEventListener("keydown", this.handleKeyDown);
255
+ document.addEventListener("keyup", this.handleKeyUp);
256
+ }
257
+ /** Deactivates focus trapping. */
258
+ deactivate() {
259
+ activeModals = activeModals.filter((modal) => modal !== this.element);
260
+ this.currentFocus = null;
261
+ document.removeEventListener("focusin", this.handleFocusIn);
262
+ document.removeEventListener("keydown", this.handleKeyDown);
263
+ document.removeEventListener("keyup", this.handleKeyUp);
264
+ }
265
+ /** Determines if this modal element is currently active or not. */
266
+ isActive() {
267
+ return activeModals[activeModals.length - 1] === this.element;
268
+ }
269
+ /** Activates external modal behavior and temporarily disables focus trapping. */
270
+ activateExternal() {
271
+ this.isExternalActivated = true;
272
+ }
273
+ /** Deactivates external modal behavior and re-enables focus trapping. */
274
+ deactivateExternal() {
275
+ this.isExternalActivated = false;
276
+ }
277
+ checkFocus() {
278
+ if (this.isActive() && !this.isExternalActivated) {
279
+ const tabbableElements = getTabbableElements(this.element);
280
+ if (!this.element.matches(":focus-within")) {
281
+ const start = tabbableElements[0];
282
+ const end = tabbableElements[tabbableElements.length - 1];
283
+ const target = this.tabDirection === "forward" ? start : end;
284
+ if (typeof (target == null ? void 0 : target.focus) === "function") {
285
+ this.currentFocus = target;
286
+ target.focus({ preventScroll: false });
287
+ }
288
+ }
289
+ }
290
+ }
291
+ possiblyHasTabbableChildren(element) {
292
+ return this.elementsWithTabbableControls.includes(element.tagName.toLowerCase()) || element.hasAttribute("controls");
293
+ }
294
+ };
295
+
296
+ // src/components/drawer/drawer.component.ts
297
+ var SynDrawer = class extends SynergyElement {
298
+ constructor() {
299
+ super(...arguments);
300
+ this.hasSlotController = new HasSlotController(this, "footer");
301
+ this.localize = new LocalizeController(this);
302
+ this.modal = new Modal(this);
303
+ this.open = false;
304
+ this.label = "";
305
+ this.placement = "end";
306
+ this.contained = false;
307
+ this.noHeader = false;
308
+ this.handleDocumentKeyDown = (event) => {
309
+ if (this.contained) {
310
+ return;
311
+ }
312
+ if (event.key === "Escape" && this.modal.isActive() && this.open) {
313
+ event.stopImmediatePropagation();
314
+ this.requestClose("keyboard");
315
+ }
316
+ };
317
+ }
318
+ firstUpdated() {
319
+ this.drawer.hidden = !this.open;
320
+ if (this.open) {
321
+ this.addOpenListeners();
322
+ if (!this.contained) {
323
+ this.modal.activate();
324
+ lockBodyScrolling(this);
325
+ }
326
+ }
327
+ }
328
+ disconnectedCallback() {
329
+ var _a;
330
+ super.disconnectedCallback();
331
+ unlockBodyScrolling(this);
332
+ (_a = this.closeWatcher) == null ? void 0 : _a.destroy();
333
+ }
334
+ requestClose(source) {
335
+ const slRequestClose = this.emit("syn-request-close", {
336
+ cancelable: true,
337
+ detail: { source }
338
+ });
339
+ if (slRequestClose.defaultPrevented) {
340
+ const animation = getAnimation(this, "drawer.denyClose", { dir: this.localize.dir() });
341
+ animateTo(this.panel, animation.keyframes, animation.options);
342
+ return;
343
+ }
344
+ this.hide();
345
+ }
346
+ addOpenListeners() {
347
+ var _a;
348
+ if ("CloseWatcher" in window) {
349
+ (_a = this.closeWatcher) == null ? void 0 : _a.destroy();
350
+ if (!this.contained) {
351
+ this.closeWatcher = new CloseWatcher();
352
+ this.closeWatcher.onclose = () => this.requestClose("keyboard");
353
+ }
354
+ } else {
355
+ document.addEventListener("keydown", this.handleDocumentKeyDown);
356
+ }
357
+ }
358
+ removeOpenListeners() {
359
+ var _a;
360
+ document.removeEventListener("keydown", this.handleDocumentKeyDown);
361
+ (_a = this.closeWatcher) == null ? void 0 : _a.destroy();
362
+ }
363
+ async handleOpenChange() {
364
+ if (this.open) {
365
+ this.emit("syn-show");
366
+ this.addOpenListeners();
367
+ this.originalTrigger = document.activeElement;
368
+ if (!this.contained) {
369
+ this.modal.activate();
370
+ lockBodyScrolling(this);
371
+ }
372
+ const autoFocusTarget = this.querySelector("[autofocus]");
373
+ if (autoFocusTarget) {
374
+ autoFocusTarget.removeAttribute("autofocus");
375
+ }
376
+ await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);
377
+ this.drawer.hidden = false;
378
+ requestAnimationFrame(() => {
379
+ const slInitialFocus = this.emit("syn-initial-focus", { cancelable: true });
380
+ if (!slInitialFocus.defaultPrevented) {
381
+ if (autoFocusTarget) {
382
+ autoFocusTarget.focus({ preventScroll: true });
383
+ } else {
384
+ this.panel.focus({ preventScroll: true });
385
+ }
386
+ }
387
+ if (autoFocusTarget) {
388
+ autoFocusTarget.setAttribute("autofocus", "");
389
+ }
390
+ });
391
+ const panelAnimation = getAnimation(this, `drawer.show${uppercaseFirstLetter(this.placement)}`, {
392
+ dir: this.localize.dir()
393
+ });
394
+ const overlayAnimation = getAnimation(this, "drawer.overlay.show", { dir: this.localize.dir() });
395
+ await Promise.all([
396
+ animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),
397
+ animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)
398
+ ]);
399
+ this.emit("syn-after-show");
400
+ } else {
401
+ this.emit("syn-hide");
402
+ this.removeOpenListeners();
403
+ if (!this.contained) {
404
+ this.modal.deactivate();
405
+ unlockBodyScrolling(this);
406
+ }
407
+ await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);
408
+ const panelAnimation = getAnimation(this, `drawer.hide${uppercaseFirstLetter(this.placement)}`, {
409
+ dir: this.localize.dir()
410
+ });
411
+ const overlayAnimation = getAnimation(this, "drawer.overlay.hide", { dir: this.localize.dir() });
412
+ await Promise.all([
413
+ animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {
414
+ this.overlay.hidden = true;
415
+ }),
416
+ animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {
417
+ this.panel.hidden = true;
418
+ })
419
+ ]);
420
+ this.drawer.hidden = true;
421
+ this.overlay.hidden = false;
422
+ this.panel.hidden = false;
423
+ const trigger = this.originalTrigger;
424
+ if (typeof (trigger == null ? void 0 : trigger.focus) === "function") {
425
+ setTimeout(() => trigger.focus());
426
+ }
427
+ this.emit("syn-after-hide");
428
+ }
429
+ }
430
+ handleNoModalChange() {
431
+ if (this.open && !this.contained) {
432
+ this.modal.activate();
433
+ lockBodyScrolling(this);
434
+ }
435
+ if (this.open && this.contained) {
436
+ this.modal.deactivate();
437
+ unlockBodyScrolling(this);
438
+ }
439
+ }
440
+ /** Shows the drawer. */
441
+ async show() {
442
+ if (this.open) {
443
+ return void 0;
444
+ }
445
+ this.open = true;
446
+ return waitForEvent(this, "syn-after-show");
447
+ }
448
+ /** Hides the drawer */
449
+ async hide() {
450
+ if (!this.open) {
451
+ return void 0;
452
+ }
453
+ this.open = false;
454
+ return waitForEvent(this, "syn-after-hide");
455
+ }
456
+ render() {
457
+ return html`
458
+ <div
459
+ part="base"
460
+ class=${classMap({
461
+ drawer: true,
462
+ "drawer--open": this.open,
463
+ "drawer--top": this.placement === "top",
464
+ "drawer--end": this.placement === "end",
465
+ "drawer--bottom": this.placement === "bottom",
466
+ "drawer--start": this.placement === "start",
467
+ "drawer--contained": this.contained,
468
+ "drawer--fixed": !this.contained,
469
+ "drawer--rtl": this.localize.dir() === "rtl",
470
+ "drawer--has-footer": this.hasSlotController.test("footer")
471
+ })}
472
+ >
473
+ <div part="overlay" class="drawer__overlay" @click=${() => this.requestClose("overlay")} tabindex="-1"></div>
474
+
475
+ <div
476
+ part="panel"
477
+ class="drawer__panel"
478
+ role="dialog"
479
+ aria-modal="true"
480
+ aria-hidden=${this.open ? "false" : "true"}
481
+ aria-label=${ifDefined(this.noHeader ? this.label : void 0)}
482
+ aria-labelledby=${ifDefined(!this.noHeader ? "title" : void 0)}
483
+ tabindex="0"
484
+ >
485
+ ${!this.noHeader ? html`
486
+ <header part="header" class="drawer__header">
487
+ <h2 part="title" class="drawer__title" id="title">
488
+ <!-- If there's no label, use an invisible character to prevent the header from collapsing -->
489
+ <slot name="label"> ${this.label.length > 0 ? this.label : String.fromCharCode(65279)} </slot>
490
+ </h2>
491
+ <div part="header-actions" class="drawer__header-actions">
492
+ <slot name="header-actions"></slot>
493
+ <syn-icon-button
494
+ part="close-button"
495
+ exportparts="base:close-button__base"
496
+ class="drawer__close"
497
+ name="x-lg"
498
+ label=${this.localize.term("close")}
499
+ library="system"
500
+ @click=${() => this.requestClose("close-button")}
501
+ ></syn-icon-button>
502
+ </div>
503
+ </header>
504
+ ` : ""}
505
+
506
+ <slot part="body" class="drawer__body"></slot>
507
+
508
+ <footer part="footer" class="drawer__footer">
509
+ <slot name="footer"></slot>
510
+ </footer>
511
+ </div>
512
+ </div>
513
+ `;
514
+ }
515
+ };
516
+ SynDrawer.styles = [component_styles_default, drawer_styles_default, drawer_custom_styles_default];
517
+ SynDrawer.dependencies = { "syn-icon-button": SynIconButton };
518
+ __decorateClass([
519
+ query(".drawer")
520
+ ], SynDrawer.prototype, "drawer", 2);
521
+ __decorateClass([
522
+ query(".drawer__panel")
523
+ ], SynDrawer.prototype, "panel", 2);
524
+ __decorateClass([
525
+ query(".drawer__overlay")
526
+ ], SynDrawer.prototype, "overlay", 2);
527
+ __decorateClass([
528
+ property({ type: Boolean, reflect: true })
529
+ ], SynDrawer.prototype, "open", 2);
530
+ __decorateClass([
531
+ property({ reflect: true })
532
+ ], SynDrawer.prototype, "label", 2);
533
+ __decorateClass([
534
+ property({ reflect: true })
535
+ ], SynDrawer.prototype, "placement", 2);
536
+ __decorateClass([
537
+ property({ type: Boolean, reflect: true })
538
+ ], SynDrawer.prototype, "contained", 2);
539
+ __decorateClass([
540
+ property({ attribute: "no-header", type: Boolean, reflect: true })
541
+ ], SynDrawer.prototype, "noHeader", 2);
542
+ __decorateClass([
543
+ watch("open", { waitUntilFirstUpdate: true })
544
+ ], SynDrawer.prototype, "handleOpenChange", 1);
545
+ __decorateClass([
546
+ watch("contained", { waitUntilFirstUpdate: true })
547
+ ], SynDrawer.prototype, "handleNoModalChange", 1);
548
+ setDefaultAnimation("drawer.showTop", {
549
+ keyframes: [
550
+ { opacity: 0, translate: "0 -100%" },
551
+ { opacity: 1, translate: "0 0" }
552
+ ],
553
+ options: { duration: 250, easing: "ease" }
554
+ });
555
+ setDefaultAnimation("drawer.hideTop", {
556
+ keyframes: [
557
+ { opacity: 1, translate: "0 0" },
558
+ { opacity: 0, translate: "0 -100%" }
559
+ ],
560
+ options: { duration: 250, easing: "ease" }
561
+ });
562
+ setDefaultAnimation("drawer.showEnd", {
563
+ keyframes: [
564
+ { opacity: 0, translate: "100%" },
565
+ { opacity: 1, translate: "0" }
566
+ ],
567
+ rtlKeyframes: [
568
+ { opacity: 0, translate: "-100%" },
569
+ { opacity: 1, translate: "0" }
570
+ ],
571
+ options: { duration: 250, easing: "ease" }
572
+ });
573
+ setDefaultAnimation("drawer.hideEnd", {
574
+ keyframes: [
575
+ { opacity: 1, translate: "0" },
576
+ { opacity: 0, translate: "100%" }
577
+ ],
578
+ rtlKeyframes: [
579
+ { opacity: 1, translate: "0" },
580
+ { opacity: 0, translate: "-100%" }
581
+ ],
582
+ options: { duration: 250, easing: "ease" }
583
+ });
584
+ setDefaultAnimation("drawer.showBottom", {
585
+ keyframes: [
586
+ { opacity: 0, translate: "0 100%" },
587
+ { opacity: 1, translate: "0 0" }
588
+ ],
589
+ options: { duration: 250, easing: "ease" }
590
+ });
591
+ setDefaultAnimation("drawer.hideBottom", {
592
+ keyframes: [
593
+ { opacity: 1, translate: "0 0" },
594
+ { opacity: 0, translate: "0 100%" }
595
+ ],
596
+ options: { duration: 250, easing: "ease" }
597
+ });
598
+ setDefaultAnimation("drawer.showStart", {
599
+ keyframes: [
600
+ { opacity: 0, translate: "-100%" },
601
+ { opacity: 1, translate: "0" }
602
+ ],
603
+ rtlKeyframes: [
604
+ { opacity: 0, translate: "100%" },
605
+ { opacity: 1, translate: "0" }
606
+ ],
607
+ options: { duration: 250, easing: "ease" }
608
+ });
609
+ setDefaultAnimation("drawer.hideStart", {
610
+ keyframes: [
611
+ { opacity: 1, translate: "0" },
612
+ { opacity: 0, translate: "-100%" }
613
+ ],
614
+ rtlKeyframes: [
615
+ { opacity: 1, translate: "0" },
616
+ { opacity: 0, translate: "100%" }
617
+ ],
618
+ options: { duration: 250, easing: "ease" }
619
+ });
620
+ setDefaultAnimation("drawer.denyClose", {
621
+ keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],
622
+ options: { duration: 250 }
623
+ });
624
+ setDefaultAnimation("drawer.overlay.show", {
625
+ keyframes: [{ opacity: 0 }, { opacity: 1 }],
626
+ options: { duration: 250 }
627
+ });
628
+ setDefaultAnimation("drawer.overlay.hide", {
629
+ keyframes: [{ opacity: 1 }, { opacity: 0 }],
630
+ options: { duration: 250 }
631
+ });
632
+
633
+ export {
634
+ SynDrawer
635
+ };
636
+ //# sourceMappingURL=chunk.BLOH2ZNU.js.map