@mhmo91/schmancy 0.2.138 → 0.2.140

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 (250) hide show
  1. package/dist/{animated-text-oP33sAjH.js → animated-text-CWRnkzJa.js} +3 -3
  2. package/dist/{animated-text-oP33sAjH.js.map → animated-text-CWRnkzJa.js.map} +1 -1
  3. package/dist/{animated-text-D0SqsDaA.cjs → animated-text-UjA34w-f.cjs} +2 -2
  4. package/dist/{animated-text-D0SqsDaA.cjs.map → animated-text-UjA34w-f.cjs.map} +1 -1
  5. package/dist/animated-text.cjs +1 -1
  6. package/dist/animated-text.js +1 -1
  7. package/dist/area.cjs +1 -1
  8. package/dist/{area.component-D2RLRPgA.cjs → area.component-BEDtgjNb.cjs} +2 -2
  9. package/dist/{area.component-D2RLRPgA.cjs.map → area.component-BEDtgjNb.cjs.map} +1 -1
  10. package/dist/{area.component-DDhify6o.js → area.component-BzuHoeHG.js} +3 -3
  11. package/dist/{area.component-DDhify6o.js.map → area.component-BzuHoeHG.js.map} +1 -1
  12. package/dist/area.js +1 -1
  13. package/dist/{autocomplete-BVyneE3j.js → autocomplete-B3W-MX_R.js} +3 -3
  14. package/dist/{autocomplete-BVyneE3j.js.map → autocomplete-B3W-MX_R.js.map} +1 -1
  15. package/dist/{autocomplete-DbfgOkUk.cjs → autocomplete-CtqM8VN6.cjs} +2 -2
  16. package/dist/{autocomplete-DbfgOkUk.cjs.map → autocomplete-CtqM8VN6.cjs.map} +1 -1
  17. package/dist/autocomplete.cjs +1 -1
  18. package/dist/autocomplete.js +1 -1
  19. package/dist/busy.cjs +1 -1
  20. package/dist/busy.js +1 -1
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.js +1 -1
  23. package/dist/card.cjs +1 -1
  24. package/dist/card.js +1 -1
  25. package/dist/{checkbox-DSzfea1r.cjs → checkbox-CGAbsupz.cjs} +2 -2
  26. package/dist/{checkbox-DSzfea1r.cjs.map → checkbox-CGAbsupz.cjs.map} +1 -1
  27. package/dist/{checkbox-BBANIXdK.js → checkbox-gDmmaU-i.js} +2 -2
  28. package/dist/{checkbox-BBANIXdK.js.map → checkbox-gDmmaU-i.js.map} +1 -1
  29. package/dist/checkbox.cjs +1 -1
  30. package/dist/checkbox.js +1 -1
  31. package/dist/{chips-Cw7qF2oR.js → chips-DtYGQiRe.js} +12 -12
  32. package/dist/{chips-Cw7qF2oR.js.map → chips-DtYGQiRe.js.map} +1 -1
  33. package/dist/{chips-erUKTp9r.cjs → chips-FOChglMy.cjs} +2 -2
  34. package/dist/{chips-erUKTp9r.cjs.map → chips-FOChglMy.cjs.map} +1 -1
  35. package/dist/chips.cjs +1 -1
  36. package/dist/chips.js +1 -1
  37. package/dist/components.cjs +1 -1
  38. package/dist/components.js +1 -1
  39. package/dist/content-drawer.cjs +1 -1
  40. package/dist/content-drawer.js +1 -1
  41. package/dist/{date-range-BBTV6wcR.cjs → date-range-CCBukS6w.cjs} +2 -2
  42. package/dist/{date-range-BBTV6wcR.cjs.map → date-range-CCBukS6w.cjs.map} +1 -1
  43. package/dist/{date-range-DsJA0Tby.js → date-range-CKocQ00P.js} +3 -3
  44. package/dist/{date-range-DsJA0Tby.js.map → date-range-CKocQ00P.js.map} +1 -1
  45. package/dist/date-range.cjs +1 -1
  46. package/dist/date-range.js +1 -1
  47. package/dist/{delay-D2W1wBaB.js → delay-Byk3BNTS.js} +11 -11
  48. package/dist/{delay-D2W1wBaB.js.map → delay-Byk3BNTS.js.map} +1 -1
  49. package/dist/{delay-_2vm_twm.cjs → delay-DoQ_jIcq.cjs} +2 -2
  50. package/dist/{delay-_2vm_twm.cjs.map → delay-DoQ_jIcq.cjs.map} +1 -1
  51. package/dist/delay.cjs +1 -1
  52. package/dist/delay.js +1 -1
  53. package/dist/{divider-DFboqan9.js → divider-DW1XYPUt.js} +3 -3
  54. package/dist/{divider-DFboqan9.js.map → divider-DW1XYPUt.js.map} +1 -1
  55. package/dist/{divider-CLrTj8jz.cjs → divider-Wh-OY6OR.cjs} +2 -2
  56. package/dist/{divider-CLrTj8jz.cjs.map → divider-Wh-OY6OR.cjs.map} +1 -1
  57. package/dist/divider.cjs +1 -1
  58. package/dist/divider.js +1 -1
  59. package/dist/extra.cjs +1 -1
  60. package/dist/extra.js +1 -1
  61. package/dist/{flex-DvakvCWk.js → flex-BCcCTIEB.js} +2 -2
  62. package/dist/{flex-DvakvCWk.js.map → flex-BCcCTIEB.js.map} +1 -1
  63. package/dist/{flex-jY739kAK.cjs → flex-BaRE9ffF.cjs} +2 -2
  64. package/dist/{flex-jY739kAK.cjs.map → flex-BaRE9ffF.cjs.map} +1 -1
  65. package/dist/{form-C7aF0F06.cjs → form-B0CyaQwH.cjs} +2 -2
  66. package/dist/{form-C7aF0F06.cjs.map → form-B0CyaQwH.cjs.map} +1 -1
  67. package/dist/{form-DgK7oech.js → form-DvQXRrGJ.js} +2 -2
  68. package/dist/{form-DgK7oech.js.map → form-DvQXRrGJ.js.map} +1 -1
  69. package/dist/form.cjs +1 -1
  70. package/dist/form.js +1 -1
  71. package/dist/{icon-BHDhk65-.cjs → icon-BqQnZfcC.cjs} +2 -2
  72. package/dist/{icon-BHDhk65-.cjs.map → icon-BqQnZfcC.cjs.map} +1 -1
  73. package/dist/{icon-Dv-rTUbw.js → icon-CoTwcGO7.js} +3 -3
  74. package/dist/{icon-Dv-rTUbw.js.map → icon-CoTwcGO7.js.map} +1 -1
  75. package/dist/{icon-button-cBFEFoDk.cjs → icon-button-B3LSOKYP.cjs} +2 -2
  76. package/dist/{icon-button-cBFEFoDk.cjs.map → icon-button-B3LSOKYP.cjs.map} +1 -1
  77. package/dist/{icon-button-DJuFBH08.js → icon-button-BMkOl7zP.js} +3 -3
  78. package/dist/{icon-button-DJuFBH08.js.map → icon-button-BMkOl7zP.js.map} +1 -1
  79. package/dist/icons.cjs +1 -1
  80. package/dist/icons.js +1 -1
  81. package/dist/index.cjs +1 -1
  82. package/dist/index.js +115 -112
  83. package/dist/index.js.map +1 -1
  84. package/dist/{input-BctOnBLa.cjs → input-A8mZ7r9Z.cjs} +2 -2
  85. package/dist/{input-BctOnBLa.cjs.map → input-A8mZ7r9Z.cjs.map} +1 -1
  86. package/dist/{input-Q7WmqTmn.js → input-FLgsuB5g.js} +2 -2
  87. package/dist/{input-Q7WmqTmn.js.map → input-FLgsuB5g.js.map} +1 -1
  88. package/dist/input.cjs +1 -1
  89. package/dist/input.js +1 -1
  90. package/dist/layout.cjs +1 -1
  91. package/dist/layout.js +1 -1
  92. package/dist/{list-m4SpVYJN.cjs → list-4_krEg2r.cjs} +2 -2
  93. package/dist/{list-m4SpVYJN.cjs.map → list-4_krEg2r.cjs.map} +1 -1
  94. package/dist/{list-DUKf0HS0.js → list-DxHWsB3z.js} +2 -2
  95. package/dist/{list-DUKf0HS0.js.map → list-DxHWsB3z.js.map} +1 -1
  96. package/dist/list.cjs +1 -1
  97. package/dist/list.js +1 -1
  98. package/dist/{litElement.mixin-B4J8Xi70.cjs → litElement.mixin-CssoQifr.cjs} +2 -2
  99. package/dist/{litElement.mixin-B4J8Xi70.cjs.map → litElement.mixin-CssoQifr.cjs.map} +1 -1
  100. package/dist/{litElement.mixin-DGX2NmqZ.js → litElement.mixin-fACDhe7J.js} +2 -2
  101. package/dist/{litElement.mixin-DGX2NmqZ.js.map → litElement.mixin-fACDhe7J.js.map} +1 -1
  102. package/dist/{menu-DH6tJeig.cjs → menu-fEUIZGXJ.cjs} +2 -2
  103. package/dist/{menu-DH6tJeig.cjs.map → menu-fEUIZGXJ.cjs.map} +1 -1
  104. package/dist/{menu-BSGW7y0_.js → menu-rWt1jKex.js} +3 -3
  105. package/dist/{menu-BSGW7y0_.js.map → menu-rWt1jKex.js.map} +1 -1
  106. package/dist/menu.cjs +1 -1
  107. package/dist/menu.js +1 -1
  108. package/dist/nav-drawer.cjs +1 -1
  109. package/dist/nav-drawer.js +1 -1
  110. package/dist/notification-container-DKLh7Vt2.js +447 -0
  111. package/dist/notification-container-DKLh7Vt2.js.map +1 -0
  112. package/dist/notification-container-DdUjZ0bi.cjs +124 -0
  113. package/dist/notification-container-DdUjZ0bi.cjs.map +1 -0
  114. package/dist/notification-service-DWeUoHi2.js +29 -0
  115. package/dist/notification-service-DWeUoHi2.js.map +1 -0
  116. package/dist/notification-service-DXXrRCmK.cjs +2 -0
  117. package/dist/notification-service-DXXrRCmK.cjs.map +1 -0
  118. package/dist/notification.cjs +1 -1
  119. package/dist/notification.js +7 -4
  120. package/dist/notification.js.map +1 -1
  121. package/dist/{option-Cc0W9pNP.cjs → option-CpmK20dy.cjs} +2 -2
  122. package/dist/{option-Cc0W9pNP.cjs.map → option-CpmK20dy.cjs.map} +1 -1
  123. package/dist/{option-eZZ_p5cP.js → option-ztBnKZ_w.js} +2 -2
  124. package/dist/{option-eZZ_p5cP.js.map → option-ztBnKZ_w.js.map} +1 -1
  125. package/dist/option.cjs +1 -1
  126. package/dist/option.js +1 -1
  127. package/dist/{payment-card-form-iglDilGI.js → payment-card-form-CUgTRvBS.js} +3 -3
  128. package/dist/{payment-card-form-iglDilGI.js.map → payment-card-form-CUgTRvBS.js.map} +1 -1
  129. package/dist/{payment-card-form-CKQC3bI-.cjs → payment-card-form-DmHX_20B.cjs} +2 -2
  130. package/dist/{payment-card-form-CKQC3bI-.cjs.map → payment-card-form-DmHX_20B.cjs.map} +1 -1
  131. package/dist/{radio-group-B6BZtXyc.js → radio-group-BZMhEi5P.js} +2 -2
  132. package/dist/{radio-group-B6BZtXyc.js.map → radio-group-BZMhEi5P.js.map} +1 -1
  133. package/dist/{radio-group-CoXLtacg.cjs → radio-group-DOpJu0Pc.cjs} +2 -2
  134. package/dist/{radio-group-CoXLtacg.cjs.map → radio-group-DOpJu0Pc.cjs.map} +1 -1
  135. package/dist/radio-group.cjs +1 -1
  136. package/dist/radio-group.js +1 -1
  137. package/dist/rxjs-utils.js +4 -4
  138. package/dist/{schmancy-steps-container-BnO47GK2.cjs → schmancy-steps-container-B5UOYQG8.cjs} +2 -2
  139. package/dist/{schmancy-steps-container-BnO47GK2.cjs.map → schmancy-steps-container-B5UOYQG8.cjs.map} +1 -1
  140. package/dist/{schmancy-steps-container-CsK44ND3.js → schmancy-steps-container-srToeIjV.js} +2 -2
  141. package/dist/{schmancy-steps-container-CsK44ND3.js.map → schmancy-steps-container-srToeIjV.js.map} +1 -1
  142. package/dist/select-0NLmJErW.cjs +56 -0
  143. package/dist/select-0NLmJErW.cjs.map +1 -0
  144. package/dist/{select-CDv89ewi.js → select-Dx6IF984.js} +40 -34
  145. package/dist/select-Dx6IF984.js.map +1 -0
  146. package/dist/select.cjs +1 -1
  147. package/dist/select.js +1 -1
  148. package/dist/{sheet-BFX5gOOm.js → sheet-Bl64wfBe.js} +3 -3
  149. package/dist/{sheet-BFX5gOOm.js.map → sheet-Bl64wfBe.js.map} +1 -1
  150. package/dist/{sheet-DmaSoYNy.cjs → sheet-BwsspKto.cjs} +2 -2
  151. package/dist/{sheet-DmaSoYNy.cjs.map → sheet-BwsspKto.cjs.map} +1 -1
  152. package/dist/sheet.cjs +1 -1
  153. package/dist/sheet.js +1 -1
  154. package/dist/{slider-DPQZVffn.cjs → slider-9zdabbA2.cjs} +2 -2
  155. package/dist/{slider-DPQZVffn.cjs.map → slider-9zdabbA2.cjs.map} +1 -1
  156. package/dist/{slider-CM2iMbMY.js → slider-nyTR0hyw.js} +3 -3
  157. package/dist/{slider-CM2iMbMY.js.map → slider-nyTR0hyw.js.map} +1 -1
  158. package/dist/slider.cjs +1 -1
  159. package/dist/slider.js +1 -1
  160. package/dist/{spinner-BkfiWig4.js → spinner-37Y-o4jr.js} +3 -3
  161. package/dist/{spinner-BkfiWig4.js.map → spinner-37Y-o4jr.js.map} +1 -1
  162. package/dist/{spinner-CLm6O2gx.cjs → spinner-D46_Vbxf.cjs} +2 -2
  163. package/dist/{spinner-CLm6O2gx.cjs.map → spinner-D46_Vbxf.cjs.map} +1 -1
  164. package/dist/steps.cjs +1 -1
  165. package/dist/steps.js +1 -1
  166. package/dist/{surface-w8Wh7tEo.cjs → surface-DFXFQBBC.cjs} +2 -2
  167. package/dist/{surface-w8Wh7tEo.cjs.map → surface-DFXFQBBC.cjs.map} +1 -1
  168. package/dist/{surface-BfIX4TcM.js → surface-RtVWZEdq.js} +2 -2
  169. package/dist/{surface-BfIX4TcM.js.map → surface-RtVWZEdq.js.map} +1 -1
  170. package/dist/surface.cjs +1 -1
  171. package/dist/surface.js +1 -1
  172. package/dist/{table-C0Tc-yGX.cjs → table-BG1_ofOE.cjs} +2 -2
  173. package/dist/{table-C0Tc-yGX.cjs.map → table-BG1_ofOE.cjs.map} +1 -1
  174. package/dist/{table-BwrBAFS2.js → table-CGdNPIeN.js} +2 -2
  175. package/dist/{table-BwrBAFS2.js.map → table-CGdNPIeN.js.map} +1 -1
  176. package/dist/table.cjs +1 -1
  177. package/dist/table.js +1 -1
  178. package/dist/{tabs-group-BicSZoFJ.cjs → tabs-group-BVsNqqN1.cjs} +2 -2
  179. package/dist/{tabs-group-BicSZoFJ.cjs.map → tabs-group-BVsNqqN1.cjs.map} +1 -1
  180. package/dist/{tabs-group-DVKv56Ep.js → tabs-group-CvHe90C_.js} +2 -2
  181. package/dist/{tabs-group-DVKv56Ep.js.map → tabs-group-CvHe90C_.js.map} +1 -1
  182. package/dist/tabs.cjs +1 -1
  183. package/dist/tabs.js +1 -1
  184. package/dist/tailwind.mixin-1drvGQKC.cjs +2 -0
  185. package/dist/{tailwind.mixin-DF6X4aiQ.cjs.map → tailwind.mixin-1drvGQKC.cjs.map} +1 -1
  186. package/dist/tailwind.mixin-C7U3gr3P.js +43 -0
  187. package/dist/{tailwind.mixin-CEnl98A5.js.map → tailwind.mixin-C7U3gr3P.js.map} +1 -1
  188. package/dist/teleport.cjs +1 -1
  189. package/dist/{teleport.component-BnMKrFAT.cjs → teleport.component-C6QSf6Kd.cjs} +2 -2
  190. package/dist/{teleport.component-BnMKrFAT.cjs.map → teleport.component-C6QSf6Kd.cjs.map} +1 -1
  191. package/dist/{teleport.component-CnZbiOsF.js → teleport.component-CqG_93Gb.js} +62 -62
  192. package/dist/{teleport.component-CnZbiOsF.js.map → teleport.component-CqG_93Gb.js.map} +1 -1
  193. package/dist/teleport.js +1 -1
  194. package/dist/{textarea-BfDZqwDh.cjs → textarea-D1nov2H8.cjs} +2 -2
  195. package/dist/{textarea-BfDZqwDh.cjs.map → textarea-D1nov2H8.cjs.map} +1 -1
  196. package/dist/{textarea-DB4V05Xv.js → textarea-Ddi7wWLs.js} +2 -2
  197. package/dist/{textarea-DB4V05Xv.js.map → textarea-Ddi7wWLs.js.map} +1 -1
  198. package/dist/textarea.cjs +1 -1
  199. package/dist/textarea.js +1 -1
  200. package/dist/{theme-button-D786Wnk8.js → theme-button-84n-IAL1.js} +2 -2
  201. package/dist/{theme-button-D786Wnk8.js.map → theme-button-84n-IAL1.js.map} +1 -1
  202. package/dist/{theme-button-BNgKvwAk.cjs → theme-button-C-g9a2ZF.cjs} +2 -2
  203. package/dist/{theme-button-BNgKvwAk.cjs.map → theme-button-C-g9a2ZF.cjs.map} +1 -1
  204. package/dist/theme-button.cjs +1 -1
  205. package/dist/theme-button.js +1 -1
  206. package/dist/theme.cjs +1 -1
  207. package/dist/{theme.component-pHUSXVfI.cjs → theme.component-C61DdKLT.cjs} +2 -2
  208. package/dist/{theme.component-pHUSXVfI.cjs.map → theme.component-C61DdKLT.cjs.map} +1 -1
  209. package/dist/{theme.component-CJz1jZNQ.js → theme.component-Dk0d_7Og.js} +47 -47
  210. package/dist/{theme.component-CJz1jZNQ.js.map → theme.component-Dk0d_7Og.js.map} +1 -1
  211. package/dist/theme.js +1 -1
  212. package/dist/{timezone-CGkrXQMo.js → timezone-95O0-5pe.js} +3 -3
  213. package/dist/{timezone-CGkrXQMo.js.map → timezone-95O0-5pe.js.map} +1 -1
  214. package/dist/{timezone-DfzkKed1.cjs → timezone-Bh92BXoh.cjs} +2 -2
  215. package/dist/{timezone-DfzkKed1.cjs.map → timezone-Bh92BXoh.cjs.map} +1 -1
  216. package/dist/{tree-a36dSIP8.cjs → tree-CsKV00BK.cjs} +2 -2
  217. package/dist/{tree-a36dSIP8.cjs.map → tree-CsKV00BK.cjs.map} +1 -1
  218. package/dist/{tree-CiXz8641.js → tree-_dvGG1Dk.js} +2 -2
  219. package/dist/{tree-CiXz8641.js.map → tree-_dvGG1Dk.js.map} +1 -1
  220. package/dist/tree.cjs +1 -1
  221. package/dist/tree.js +1 -1
  222. package/dist/{typewriter-l9E7wjBu.cjs → typewriter-BTKJ8mPR.cjs} +2 -2
  223. package/dist/{typewriter-l9E7wjBu.cjs.map → typewriter-BTKJ8mPR.cjs.map} +1 -1
  224. package/dist/{typewriter-BIQrBhpI.js → typewriter-D1rGUZyO.js} +4 -4
  225. package/dist/{typewriter-BIQrBhpI.js.map → typewriter-D1rGUZyO.js.map} +1 -1
  226. package/dist/typewriter.cjs +1 -1
  227. package/dist/typewriter.js +1 -1
  228. package/dist/{typography-iXM106DT.cjs → typography-BJzp77zk.cjs} +2 -2
  229. package/dist/{typography-iXM106DT.cjs.map → typography-BJzp77zk.cjs.map} +1 -1
  230. package/dist/{typography-BPKd0oVY.js → typography-C3AU6NFt.js} +2 -2
  231. package/dist/{typography-BPKd0oVY.js.map → typography-C3AU6NFt.js.map} +1 -1
  232. package/dist/typography.cjs +1 -1
  233. package/dist/typography.js +1 -1
  234. package/package.json +1 -1
  235. package/types/src/notification/index.d.ts +6 -3
  236. package/types/src/notification/notification-audio-generator.d.ts +45 -0
  237. package/types/src/notification/notification-audio.d.ts +70 -0
  238. package/types/src/notification/notification-container.d.ts +44 -0
  239. package/types/src/notification/notification-service.d.ts +60 -0
  240. package/types/src/notification/notification.d.ts +33 -4
  241. package/types/src/select/select.d.ts +1 -0
  242. package/dist/outlet-BCvmlbVW.cjs +0 -61
  243. package/dist/outlet-BCvmlbVW.cjs.map +0 -1
  244. package/dist/outlet-CjW99bc0.js +0 -128
  245. package/dist/outlet-CjW99bc0.js.map +0 -1
  246. package/dist/select-CDv89ewi.js.map +0 -1
  247. package/dist/select-IisjLR3Q.cjs +0 -54
  248. package/dist/select-IisjLR3Q.cjs.map +0 -1
  249. package/dist/tailwind.mixin-CEnl98A5.js +0 -43
  250. package/dist/tailwind.mixin-DF6X4aiQ.cjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"menu-DH6tJeig.cjs","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","html","customElement","SchmancyMenu","TailwindElement","offset","flip","shift","padding","size","apply","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","getMiddleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":"qUAMA,IAAqBA,EAArB,cAA8CC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,CAAA,CAAA,mBACCC,CAAAA,MAAMC,kBACIC,EAAAA,EAAAA,UAAAC,KAAM,OAAA,EACdC,KAAKC,EAAAA,UAAUF,KAAKG,aACpBC,CAAAA,EAAAA,UAAeC,IACfA,EAAEC,gBAAAA,EACGN,KAAAO,cACJ,IAAIC,YAAY,2BAA4B,CAC3CC,WACAC,SAAAA,EAEF,CAAA,CAAA,CAAA,CAAA,CACA,CAEO,QACF,CAAA,OAAAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAA,CApBYjB,EAAAA,wGAArB,CADCkB,EAAAA,cAAc,oBAAA,CAAA,EACMlB,mMCCrB,IAAqBmB,EAAr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KAAKsD,SAAAA,CAAS,CAIhBlD,CAAAA,EAAAA,UAAAA,CAAU,CAGb,QACQ,CAAA,OAAAO,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAA,CAzHRgD,EAAAA,EAAA,CADCC,EAAAA,sBAAsB,CAAEC,QAAS,GAAMC,KAAM,QAAA,CAAA,CAAA,EAd1BjD,EAepBkD,UAAA,gBAAA,CAAA,EAEgBJ,EAAA,CAAfK,EAAAA,MAAM,OAjBanD,CAAAA,EAAAA,EAiBJkD,UAAA,cAAA,CAjBIlD,EAAAA,EAArB8C,EAAA,CADC/C,EAAAA,cAAc,eACMC,CAAAA,EAAAA,CAAAA"}
1
+ {"version":3,"file":"menu-fEUIZGXJ.cjs","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","html","customElement","SchmancyMenu","TailwindElement","offset","flip","shift","padding","size","apply","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","getMiddleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":"qUAMA,IAAqBA,EAArB,cAA8CC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,CAAA,CAAA,mBACCC,CAAAA,MAAMC,kBACIC,EAAAA,EAAAA,UAAAC,KAAM,OAAA,EACdC,KAAKC,EAAAA,UAAUF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EAAAA,UAAUF,KAAKG,aAAAA,CAAAA,EAEfC,UAAU,IAAA,CACVJ,KAAKsD,SAAAA,CAAS,GAGNvD,YAAAwD,SAAU,OAAA,EAClBtD,KACAuD,EAAAA,OAAQnD,GAAAA,CAAcL,KAAKyD,SAASpD,EAAEqD,MAAAA,CAAAA,EACtCxD,EAAAA,UAAUF,KAAKG,aAAAA,EACfiD,EAAAA,IAAI,IACmC,CAAlCpD,KAAK4B,YAAYY,QAAQC,OAAS,QACrCzC,KAAKsD,SAAAA,CAAS,CAIhBlD,CAAAA,EAAAA,UAAAA,CAAU,CAGb,QACQ,CAAA,OAAAO,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAA,CAzHRgD,EAAAA,EAAA,CADCC,EAAAA,sBAAsB,CAAEC,QAAS,GAAMC,KAAM,QAAA,CAAA,CAAA,EAd1BjD,EAepBkD,UAAA,gBAAA,CAAA,EAEgBJ,EAAA,CAAfK,EAAAA,MAAM,OAjBanD,CAAAA,EAAAA,EAiBJkD,UAAA,cAAA,CAjBIlD,EAAAA,EAArB8C,EAAA,CADC/C,EAAAA,cAAc,eACMC,CAAAA,EAAAA,CAAAA"}
@@ -1,8 +1,8 @@
1
1
  import { fromEvent as l, takeUntil as r, tap as c, filter as f } from "rxjs";
2
2
  import "lit/directives/class-map.js";
3
3
  import "lit/directives/style-map.js";
4
- import { $ as g } from "./litElement.mixin-DGX2NmqZ.js";
5
- import { T as E } from "./tailwind.mixin-CEnl98A5.js";
4
+ import { $ as g } from "./litElement.mixin-fACDhe7J.js";
5
+ import { T as E } from "./tailwind.mixin-C7U3gr3P.js";
6
6
  import { css as d, html as b } from "lit";
7
7
  import { customElement as y, queryAssignedElements as w, query as v } from "lit/decorators.js";
8
8
  import { offset as x, flip as k, shift as M, size as P, computePosition as p, autoUpdate as O } from "@floating-ui/dom";
@@ -96,4 +96,4 @@ let m = class extends E(d`
96
96
  }
97
97
  };
98
98
  u([w({ flatten: !0, slot: "button" })], m.prototype, "buttonElement", 2), u([v("#menu")], m.prototype, "menuElement", 2), m = u([y("schmancy-menu")], m);
99
- //# sourceMappingURL=menu-BSGW7y0_.js.map
99
+ //# sourceMappingURL=menu-rWt1jKex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-BSGW7y0_.js","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","render","html","customElement","SchmancyMenu","TailwindElement","getMiddleware","offset","flip","shift","padding","size","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","firstUpdated","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":";;;;;;;;;AAMA,IAAqBA,IAArB,cAA8CC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,EAAA;AAAA,EAAA,oBACCC;AAAAA,UAAMC,kBACIC,GAAAA,EAAAC,MAAM,OAAA,EACdC,KAAKC,EAAUF,KAAKG,aAAAA,CAAAA,EACpBC,UAAeC,OAAAA;AACfA,QAAEC,gBAAAA,GACGN,KAAAO,cACJ,IAAIC,YAAY,4BAA4B,EAC3CC,SAAS,IACTC,UAAU,GAAA,CAAA,CAAA;AAAA,IAEZ,CACA;AAAA,EAAA;AAAA,EAEO,SAAAC;AACF,WAAAC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAA;AApBYlB;AAAAA;;;GAArB,CADCm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,MACmC;AAAA,MAAlCrD,KAAK6B,YAAYW,QAAQC,SAAS,UACrCzC,KAAKuD,SAAAA;AAAAA,IAAS,CAIhBnD,CAAAA,EAAAA,UAAAA;AAAAA,EAAU;AAAA,EAGb,SACQ;AAAA,WAAAQ;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAA;AAzHRgD;AAAAA,EAAA,CADCC,EAAsB,EAAEC,SAAAA,IAAeC,MAAM,SAAA,CAAA,CAAA,GAd1BjD,EAepBkD,WAAA,iBAAA,CAAA,GAEgBJ,EAAA,CAAfK,EAAM,OAjBanD,CAAAA,GAAAA,EAiBJkD,WAAA,eAAA,IAjBIlD,IAArB8C,EAAA,CADC/C,EAAc,eACMC,CAAAA,GAAAA,CAAAA;"}
1
+ {"version":3,"file":"menu-rWt1jKex.js","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","render","html","customElement","SchmancyMenu","TailwindElement","getMiddleware","offset","flip","shift","padding","size","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","firstUpdated","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":";;;;;;;;;AAMA,IAAqBA,IAArB,cAA8CC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,EAAA;AAAA,EAAA,oBACCC;AAAAA,UAAMC,kBACIC,GAA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AAA,GAGNvD,EAAAC,MAAM,0BAAA,EACdC,KACAoD,EAAIhD,OAAKA,EAAEC,gBACXJ,CAAAA,GAAAA,EAAUF,KAAKG,aAAAA,CAAAA,EAEfC,UAAU,MAAA;AACVJ,WAAKuD,SAAAA;AAAAA,IAAS,IAGNxD,EAAAyD,UAAU,OAClBvD,EAAAA,KACAwD,EAAQpD,OAAAA,CAAcL,KAAK0D,SAASrD,EAAEsD,MAAAA,CAAAA,GACtCzD,EAAUF,KAAKG,aACfkD,GAAAA,EAAI,MACmC;AAAA,MAAlCrD,KAAK6B,YAAYW,QAAQC,SAAS,UACrCzC,KAAKuD,SAAAA;AAAAA,IAAS,CAIhBnD,CAAAA,EAAAA,UAAAA;AAAAA,EAAU;AAAA,EAGb,SACQ;AAAA,WAAAQ;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAA;AAzHRgD;AAAAA,EAAA,CADCC,EAAsB,EAAEC,SAAAA,IAAeC,MAAM,SAAA,CAAA,CAAA,GAd1BjD,EAepBkD,WAAA,iBAAA,CAAA,GAEgBJ,EAAA,CAAfK,EAAM,OAjBanD,CAAAA,GAAAA,EAiBJkD,WAAA,eAAA,IAjBIlD,IAArB8C,EAAA,CADC/C,EAAc,eACMC,CAAAA,GAAAA,CAAAA;"}
package/dist/menu.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";require("./menu-DH6tJeig.cjs");
1
+ "use strict";require("./menu-fEUIZGXJ.cjs");
2
2
  //# sourceMappingURL=menu.cjs.map
package/dist/menu.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./menu-BSGW7y0_.js";
1
+ import "./menu-rWt1jKex.js";
2
2
  //# sourceMappingURL=menu.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BnMKrFAT.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-C6QSf6Kd.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
2
2
  //# sourceMappingURL=nav-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-CnZbiOsF.js";
1
+ import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-CqG_93Gb.js";
2
2
  export {
3
3
  c as $drawer,
4
4
  e as SchmancyDrawerAppbar,
@@ -0,0 +1,447 @@
1
+ import { fromEvent as A, takeUntil as _ } from "rxjs";
2
+ import { classMap as x } from "lit/directives/class-map.js";
3
+ import { styleMap as S } from "lit/directives/style-map.js";
4
+ import { $ as T } from "./litElement.mixin-fACDhe7J.js";
5
+ import "./tailwind.mixin-C7U3gr3P.js";
6
+ import { c as w } from "./ripple-BumgqsDT.js";
7
+ import { S as h } from "./theme.interface-C5Kj6WjD.js";
8
+ import { html as d } from "lit";
9
+ import { property as p, state as f, customElement as b } from "lit/decorators.js";
10
+ import { repeat as C } from "lit/directives/repeat.js";
11
+ var V = Object.defineProperty, k = Object.getOwnPropertyDescriptor, u = (a, t, e, i) => {
12
+ for (var o, n = i > 1 ? void 0 : i ? k(t, e) : t, s = a.length - 1; s >= 0; s--) (o = a[s]) && (n = (i ? o(t, e, n) : o(n)) || n);
13
+ return i && n && V(t, e, n), n;
14
+ };
15
+ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child{margin-bottom:0}.notification{width:100%;max-width:400px;border-radius:8px;box-shadow:var(--schmancy-sys-elevation-2);overflow:hidden;transform:translate(0);opacity:1;transition:transform .3s ease-out,opacity .3s ease-out;background-color:var(--schmancy-sys-color-surface-container);color:var(--schmancy-sys-color-surface-on)}.notification.info{border-left:4px solid var(--schmancy-sys-color-primary-default)}.notification.success{border-left:4px solid var(--schmancy-sys-color-success-default)}.notification.warning{border-left:4px solid var(--schmancy-sys-color-tertiary-default)}.notification.error{border-left:4px solid var(--schmancy-sys-color-error-default)}.notification.closing{transform:translate(120%);opacity:0}.notification .notification-content{display:flex;padding:16px;align-items:flex-start;position:relative}.notification .icon-container{flex-shrink:0;margin-right:12px;display:flex;align-items:center;justify-content:center}.notification .content{flex:1;min-width:0;display:flex;flex-direction:column}.notification .title{font-weight:600;font-size:16px;margin-bottom:4px;word-break:break-word}.notification .message{font-size:14px;word-break:break-word}.notification .close-button{background:transparent;border:none;cursor:pointer;color:var(--schmancy-sys-color-surface-onVariant);padding:4px;margin-left:8px;border-radius:4px;display:flex;align-items:center;justify-content:center}.notification .close-button:hover{background-color:#0000000d}.notification .close-button:focus{outline:none;box-shadow:0 0 0 2px var(--schmancy-sys-color-primary-default)}.notification .progress-bar-container{height:4px;width:100%;background-color:#0000001a;overflow:hidden}.notification .progress-bar{height:100%;width:100%;transition:width .1s linear}") {
16
+ constructor() {
17
+ super(...arguments), this.title = "", this.message = "", this.type = "info", this.closable = !0, this.duration = 5e3, this.id = `notification-${Date.now()}-${Math.floor(1e4 * Math.random())}`, this.playSound = !0, this._visible = !0, this._progress = 100, this._hovered = !1, this._closing = !1;
18
+ }
19
+ connectedCallback() {
20
+ super.connectedCallback(), this.duration > 0 && this._startAutoCloseTimer(), this.playSound && this._playSound();
21
+ }
22
+ disconnectedCallback() {
23
+ this._clearTimers(), super.disconnectedCallback();
24
+ }
25
+ updated(a) {
26
+ super.updated(a), a.has("duration") && this.duration > 0 && (this._clearTimers(), this._startAutoCloseTimer());
27
+ }
28
+ _startAutoCloseTimer() {
29
+ if (this.duration <= 0) return;
30
+ const a = Date.now() + this.duration;
31
+ this._autoCloseTimer = window.setTimeout(() => {
32
+ this.close();
33
+ }, this.duration), this._progressTimer = window.setInterval(() => {
34
+ if (this._hovered) return;
35
+ const t = Date.now(), e = Math.max(0, a - t);
36
+ this._progress = e / this.duration * 100, e <= 0 && this._clearTimers();
37
+ }, 16);
38
+ }
39
+ _clearTimers() {
40
+ this._autoCloseTimer && (clearTimeout(this._autoCloseTimer), this._autoCloseTimer = void 0), this._progressTimer && (clearInterval(this._progressTimer), this._progressTimer = void 0);
41
+ }
42
+ _pauseTimers() {
43
+ this._clearTimers();
44
+ }
45
+ _resumeTimers() {
46
+ if (this.duration > 0) {
47
+ const a = this._progress / 100 * this.duration;
48
+ if (a > 0) {
49
+ this._autoCloseTimer = window.setTimeout(() => {
50
+ this.close();
51
+ }, a);
52
+ const t = Date.now() + a;
53
+ this._progressTimer = window.setInterval(() => {
54
+ if (this._hovered) return;
55
+ const e = Date.now(), i = Math.max(0, t - e);
56
+ this._progress = i / a * 100, i <= 0 && this._clearTimers();
57
+ }, 16);
58
+ }
59
+ }
60
+ }
61
+ _playSound() {
62
+ this.dispatchEvent(new CustomEvent("playsound", { detail: { type: this.type }, bubbles: !0, composed: !0 }));
63
+ }
64
+ _handleMouseEnter() {
65
+ this._hovered = !0, this._pauseTimers();
66
+ }
67
+ _handleMouseLeave() {
68
+ this._hovered = !1, this._resumeTimers();
69
+ }
70
+ close() {
71
+ this._closing || (this._closing = !0, this._clearTimers(), this._visible = !1, setTimeout(() => {
72
+ this.dispatchEvent(new CustomEvent("close", { detail: { id: this.id }, bubbles: !0, composed: !0 }));
73
+ }, 300));
74
+ }
75
+ render() {
76
+ if (!this._visible && this._closing) return d``;
77
+ const a = this._getTypeStyles();
78
+ return d`
79
+ <div
80
+ class=${x({ notification: !0, closing: this._closing, [this.type]: !0 })}
81
+ role="alert"
82
+ style=${S({ transform: this._closing ? "translateX(120%)" : "translateX(0)", opacity: this._closing ? "0" : "1" })}
83
+ @mouseenter=${this._handleMouseEnter}
84
+ @mouseleave=${this._handleMouseLeave}
85
+ >
86
+ <div class="notification-content">
87
+ <div class="icon-container" ${w({ color: a.iconColor })}>${a.icon}</div>
88
+
89
+ <div class="content">
90
+ ${this.title ? d` <div class="title">${this.title}</div> ` : ""}
91
+
92
+ <div class="message">${this.message}</div>
93
+ </div>
94
+
95
+ ${this.closable ? d`
96
+ <button class="close-button" aria-label="Close notification" @click=${this.close}>
97
+ <svg
98
+ width="16"
99
+ height="16"
100
+ viewBox="0 0 24 24"
101
+ fill="none"
102
+ stroke="currentColor"
103
+ stroke-width="2"
104
+ stroke-linecap="round"
105
+ stroke-linejoin="round"
106
+ >
107
+ <line x1="18" y1="6" x2="6" y2="18"></line>
108
+ <line x1="6" y1="6" x2="18" y2="18"></line>
109
+ </svg>
110
+ </button>
111
+ ` : ""}
112
+ </div>
113
+
114
+ ${this.duration > 0 ? d`
115
+ <div class="progress-bar-container">
116
+ <div
117
+ class="progress-bar"
118
+ style="width: ${this._progress}%"
119
+ ${w({ bgColor: a.progressColor })}
120
+ ></div>
121
+ </div>
122
+ ` : ""}
123
+ </div>
124
+ `;
125
+ }
126
+ _getTypeStyles() {
127
+ switch (this.type) {
128
+ case "success":
129
+ return { icon: d`
130
+ <svg
131
+ width="20"
132
+ height="20"
133
+ viewBox="0 0 24 24"
134
+ fill="none"
135
+ stroke="currentColor"
136
+ stroke-width="2"
137
+ stroke-linecap="round"
138
+ stroke-linejoin="round"
139
+ >
140
+ <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
141
+ <polyline points="22 4 12 14.01 9 11.01"></polyline>
142
+ </svg>
143
+ `, iconColor: h.sys.color.success.default, progressColor: h.sys.color.success.default };
144
+ case "warning":
145
+ return { icon: d`
146
+ <svg
147
+ width="20"
148
+ height="20"
149
+ viewBox="0 0 24 24"
150
+ fill="none"
151
+ stroke="currentColor"
152
+ stroke-width="2"
153
+ stroke-linecap="round"
154
+ stroke-linejoin="round"
155
+ >
156
+ <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
157
+ <line x1="12" y1="9" x2="12" y2="13"></line>
158
+ <line x1="12" y1="17" x2="12.01" y2="17"></line>
159
+ </svg>
160
+ `, iconColor: h.sys.color.tertiary.default, progressColor: h.sys.color.tertiary.default };
161
+ case "error":
162
+ return { icon: d`
163
+ <svg
164
+ width="20"
165
+ height="20"
166
+ viewBox="0 0 24 24"
167
+ fill="none"
168
+ stroke="currentColor"
169
+ stroke-width="2"
170
+ stroke-linecap="round"
171
+ stroke-linejoin="round"
172
+ >
173
+ <circle cx="12" cy="12" r="10"></circle>
174
+ <line x1="15" y1="9" x2="9" y2="15"></line>
175
+ <line x1="9" y1="9" x2="15" y2="15"></line>
176
+ </svg>
177
+ `, iconColor: h.sys.color.error.default, progressColor: h.sys.color.error.default };
178
+ default:
179
+ return { icon: d`
180
+ <svg
181
+ width="20"
182
+ height="20"
183
+ viewBox="0 0 24 24"
184
+ fill="none"
185
+ stroke="currentColor"
186
+ stroke-width="2"
187
+ stroke-linecap="round"
188
+ stroke-linejoin="round"
189
+ >
190
+ <circle cx="12" cy="12" r="10"></circle>
191
+ <line x1="12" y1="16" x2="12" y2="12"></line>
192
+ <line x1="12" y1="8" x2="12.01" y2="8"></line>
193
+ </svg>
194
+ `, iconColor: h.sys.color.primary.default, progressColor: h.sys.color.primary.default };
195
+ }
196
+ }
197
+ };
198
+ u([p({ type: String })], c.prototype, "title", 2), u([p({ type: String })], c.prototype, "message", 2), u([p({ type: String })], c.prototype, "type", 2), u([p({ type: Boolean })], c.prototype, "closable", 2), u([p({ type: Number })], c.prototype, "duration", 2), u([p({ type: String })], c.prototype, "id", 2), u([p({ type: Boolean })], c.prototype, "playSound", 2), u([f()], c.prototype, "_visible", 2), u([f()], c.prototype, "_progress", 2), u([f()], c.prototype, "_hovered", 2), u([f()], c.prototype, "_closing", 2), u([f()], c.prototype, "_autoCloseTimer", 2), u([f()], c.prototype, "_progressTimer", 2), c = u([b("sch-notification")], c);
199
+ class $ {
200
+ constructor() {
201
+ this.audioContext = null;
202
+ }
203
+ getAudioContext() {
204
+ if (!this.audioContext) {
205
+ const t = window.AudioContext || window.webkitAudioContext;
206
+ this.audioContext = new t();
207
+ }
208
+ return this.audioContext;
209
+ }
210
+ playInfoSound(t = 0.2) {
211
+ const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(), s = e.createBiquadFilter();
212
+ o.type = "sine", o.frequency.setValueAtTime(392, i), o.frequency.exponentialRampToValueAtTime(523.25, i + 0.25), s.type = "lowpass", s.frequency.value = 1500, n.gain.setValueAtTime(1e-4, i), n.gain.exponentialRampToValueAtTime(t, i + 0.15), n.gain.exponentialRampToValueAtTime(1e-4, i + 0.4), o.connect(s).connect(n).connect(e.destination), o.start(i), o.stop(i + 0.45);
213
+ }
214
+ playSuccessSound(t = 0.2) {
215
+ const e = this.getAudioContext(), i = e.currentTime, o = (n, s, r) => {
216
+ const l = e.createOscillator(), y = e.createGain(), v = e.createBiquadFilter();
217
+ l.type = "sine", l.frequency.setValueAtTime(n, i), v.type = "lowpass", v.frequency.value = 4 * n, y.gain.setValueAtTime(1e-4, i), y.gain.exponentialRampToValueAtTime(t, i + 0.1), y.gain.exponentialRampToValueAtTime(1e-4, i + r), l.connect(v).connect(y).connect(e.destination), l.start(i + s), l.stop(i + r);
218
+ };
219
+ o(659.25, 0, 0.6), o(523.25, 0.05, 0.55);
220
+ }
221
+ playWarningSound(t = 0.25) {
222
+ const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createOscillator(), s = e.createGain(), r = e.createBiquadFilter();
223
+ o.type = "sine", n.type = "sine", o.frequency.setValueAtTime(349.23, i), n.frequency.setValueAtTime(440, i), r.type = "lowpass", r.frequency.value = 1e3, s.gain.setValueAtTime(1e-4, i), s.gain.exponentialRampToValueAtTime(t, i + 0.08), s.gain.exponentialRampToValueAtTime(1e-4, i + 0.5), o.connect(r), n.connect(r), r.connect(s).connect(e.destination), o.start(i), n.start(i), o.stop(i + 0.55), n.stop(i + 0.55);
224
+ }
225
+ playErrorSound(t = 0.25) {
226
+ const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(), s = e.createBiquadFilter();
227
+ o.type = "triangle", o.frequency.setValueAtTime(220, i), o.frequency.exponentialRampToValueAtTime(1760, i + 0.3), s.type = "lowpass", s.frequency.value = 800, s.Q.value = 0.5, n.gain.setValueAtTime(1e-4, i), n.gain.exponentialRampToValueAtTime(0.8 * t, i + 0.1), n.gain.exponentialRampToValueAtTime(1e-4, i + 0.7), o.connect(s).connect(n).connect(e.destination), o.start(i), o.stop(i + 0.75);
228
+ }
229
+ async generateAudioFiles(t = 0.25) {
230
+ const i = {};
231
+ return i.info = await this.generateAudioFile(async (o) => {
232
+ const n = o.createOscillator();
233
+ n.type = "sine", n.frequency.setValueAtTime(320, 0), n.frequency.exponentialRampToValueAtTime(520, 0.3);
234
+ const s = o.createGain();
235
+ s.gain.setValueAtTime(0, 0), s.gain.linearRampToValueAtTime(t, 0.1), s.gain.linearRampToValueAtTime(0, 0.5), n.connect(s), s.connect(o.destination), n.start(), n.stop(0.5);
236
+ }, 44100, 1), i.success = await this.generateAudioFile(async (o) => {
237
+ const n = o.createOscillator();
238
+ n.type = "sine", n.frequency.setValueAtTime(660, 0);
239
+ const s = o.createOscillator();
240
+ s.type = "sine", s.frequency.setValueAtTime(440, 0);
241
+ const r = o.createGain();
242
+ r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0, 0.5);
243
+ const l = o.createGain();
244
+ l.gain.setValueAtTime(0, 0), l.gain.linearRampToValueAtTime(0.6 * t, 0.15), l.gain.linearRampToValueAtTime(0, 0.7), n.connect(r), r.connect(o.destination), s.connect(l), l.connect(o.destination), n.start(), s.start(0.15), n.stop(0.5), s.stop(0.7);
245
+ }, 44100, 1), i.warning = await this.generateAudioFile(async (o) => {
246
+ const n = o.createOscillator();
247
+ n.type = "sine", n.frequency.setValueAtTime(293.66, 0);
248
+ const s = o.createOscillator();
249
+ s.type = "sine", s.frequency.setValueAtTime(349.23, 0);
250
+ const r = o.createGain();
251
+ r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0.6 * t, 0.2), r.gain.linearRampToValueAtTime(0.8 * t, 0.3), r.gain.linearRampToValueAtTime(0, 0.6), n.connect(r), s.connect(r), r.connect(o.destination), n.start(), s.start(), n.stop(0.6), s.stop(0.6);
252
+ }, 44100, 1), i.error = await this.generateAudioFile(async (o) => {
253
+ const n = o.createOscillator();
254
+ n.type = "sine", n.frequency.setValueAtTime(196, 0);
255
+ const s = o.createGain();
256
+ s.gain.setValueAtTime(0, 0), s.gain.linearRampToValueAtTime(t, 0.1), s.gain.linearRampToValueAtTime(0.4 * t, 0.2), s.gain.linearRampToValueAtTime(0.6 * t, 0.3), s.gain.linearRampToValueAtTime(0, 0.7);
257
+ const r = o.createBiquadFilter();
258
+ r.type = "lowpass", r.frequency.value = 600, r.Q.value = 0.7, n.connect(r), r.connect(s), s.connect(o.destination), n.start(), n.stop(0.7);
259
+ }, 44100, 1), i;
260
+ }
261
+ async generateAudioFile(t, e = 44100, i = 1) {
262
+ const o = new OfflineAudioContext(2, e * i, e);
263
+ await t(o);
264
+ const n = await o.startRendering(), s = this.audioBufferToWav(n);
265
+ return URL.createObjectURL(s);
266
+ }
267
+ audioBufferToWav(t) {
268
+ const e = t.numberOfChannels, i = t.sampleRate, o = 2 * e, n = this.getAudioSamples(t, 16), s = 2 * n.length, r = new ArrayBuffer(44 + s), l = new DataView(r);
269
+ return this.writeString(l, 0, "RIFF"), l.setUint32(4, 36 + s, !0), this.writeString(l, 8, "WAVE"), this.writeString(l, 12, "fmt "), l.setUint32(16, 16, !0), l.setUint16(20, 1, !0), l.setUint16(22, e, !0), l.setUint32(24, i, !0), l.setUint32(28, i * o, !0), l.setUint16(32, o, !0), l.setUint16(34, 16, !0), this.writeString(l, 36, "data"), l.setUint32(40, s, !0), this.writeInt16Samples(l, 44, n), new Blob([r], { type: "audio/wav" });
270
+ }
271
+ getAudioSamples(t, e) {
272
+ const i = t.numberOfChannels, o = t.length, n = [], s = e === 16 ? 32768 : 128;
273
+ for (let r = 0; r < o; r++) for (let l = 0; l < i; l++) {
274
+ const y = t.getChannelData(l)[r], v = Math.max(-1, Math.min(1, y));
275
+ n.push(v * s);
276
+ }
277
+ return n;
278
+ }
279
+ writeInt16Samples(t, e, i) {
280
+ for (let o = 0; o < i.length; o++) t.setInt16(e + 2 * o, i[o], !0);
281
+ }
282
+ writeString(t, e, i) {
283
+ for (let o = 0; o < i.length; o++) t.setUint8(e + o, i.charCodeAt(o));
284
+ }
285
+ }
286
+ class R {
287
+ constructor() {
288
+ this.audioContext = null, this.soundBuffers = /* @__PURE__ */ new Map(), this.volume = 0.5, this.muted = !1, this.soundGenerator = new $(), this.soundUrls = { info: "/assets/sounds/notification-info.mp3", success: "/assets/sounds/notification-success.mp3", warning: "/assets/sounds/notification-warning.mp3", error: "/assets/sounds/notification-error.mp3" }, this.initializeAudioFiles();
289
+ }
290
+ async initializeAudioFiles() {
291
+ try {
292
+ await this.preloadSounds();
293
+ } catch {
294
+ try {
295
+ const e = await this.soundGenerator.generateAudioFiles(this.volume);
296
+ this.soundUrls = e;
297
+ } catch {
298
+ }
299
+ }
300
+ }
301
+ getAudioContext() {
302
+ if (!this.audioContext) {
303
+ const t = window.AudioContext || window.webkitAudioContext;
304
+ this.audioContext = new t();
305
+ }
306
+ return this.audioContext;
307
+ }
308
+ async preloadSounds() {
309
+ const t = ["info", "success", "warning", "error"];
310
+ for (const e of t) try {
311
+ const i = await this.loadSound(e);
312
+ this.soundBuffers.set(e, i);
313
+ } catch {
314
+ }
315
+ }
316
+ async loadSound(t) {
317
+ const e = this.soundUrls[t], i = await fetch(e);
318
+ if (!i.ok) throw new Error(`Failed to load sound from ${e}: ${i.statusText}`);
319
+ const o = await i.arrayBuffer();
320
+ return await this.getAudioContext().decodeAudioData(o);
321
+ }
322
+ async playSound(t) {
323
+ if (!this.muted) try {
324
+ const e = this.getAudioContext();
325
+ if (e.state === "suspended" && await e.resume(), this.soundUrls[t].startsWith("blob:")) return void this.playFallbackSound(t);
326
+ if (!this.soundBuffers.has(t)) try {
327
+ const s = await this.loadSound(t);
328
+ this.soundBuffers.set(t, s);
329
+ } catch {
330
+ return void this.playDirectGeneratedSound(t);
331
+ }
332
+ const i = this.soundBuffers.get(t);
333
+ if (!i) throw new Error(`Sound buffer for ${t} not available`);
334
+ const o = e.createBufferSource();
335
+ o.buffer = i;
336
+ const n = e.createGain();
337
+ n.gain.value = this.volume, o.connect(n), n.connect(e.destination), o.start(0);
338
+ } catch {
339
+ this.playDirectGeneratedSound(t);
340
+ }
341
+ }
342
+ playDirectGeneratedSound(t) {
343
+ if (!this.muted) try {
344
+ switch (t) {
345
+ case "info":
346
+ this.soundGenerator.playInfoSound(this.volume);
347
+ break;
348
+ case "success":
349
+ this.soundGenerator.playSuccessSound(this.volume);
350
+ break;
351
+ case "warning":
352
+ this.soundGenerator.playWarningSound(this.volume);
353
+ break;
354
+ case "error":
355
+ this.soundGenerator.playErrorSound(this.volume);
356
+ }
357
+ } catch {
358
+ }
359
+ }
360
+ playFallbackSound(t) {
361
+ if (!this.muted) try {
362
+ const e = new Audio(this.soundUrls[t]);
363
+ e.volume = this.volume, e.addEventListener("ended", () => {
364
+ e.remove();
365
+ }), e.play().catch((i) => {
366
+ this.playDirectGeneratedSound(t);
367
+ });
368
+ } catch {
369
+ this.playDirectGeneratedSound(t);
370
+ }
371
+ }
372
+ setVolume(t) {
373
+ this.volume = Math.max(0, Math.min(1, t));
374
+ }
375
+ getVolume() {
376
+ return this.volume;
377
+ }
378
+ mute() {
379
+ this.muted = !0;
380
+ }
381
+ unmute() {
382
+ this.muted = !1;
383
+ }
384
+ isMuted() {
385
+ return this.muted;
386
+ }
387
+ setSoundUrl(t, e) {
388
+ this.soundUrls[t] = e, this.soundBuffers.delete(t);
389
+ }
390
+ getSoundUrl(t) {
391
+ return this.soundUrls[t];
392
+ }
393
+ }
394
+ var B = Object.defineProperty, q = Object.getOwnPropertyDescriptor, g = (a, t, e, i) => {
395
+ for (var o, n = i > 1 ? void 0 : i ? q(t, e) : t, s = a.length - 1; s >= 0; s--) (o = a[s]) && (n = (i ? o(t, e, n) : o(n)) || n);
396
+ return i && n && B(t, e, n), n;
397
+ };
398
+ let m = class extends T(":host{display:block}.notification-container{position:fixed;z-index:9999;padding:12px;pointer-events:none;width:100%;max-width:424px}.notification-container sch-notification{pointer-events:auto}.notification-container.top-right{top:0;right:0;display:flex;flex-direction:column-reverse}.notification-container.top-left{top:0;left:0;display:flex;flex-direction:column-reverse}.notification-container.bottom-right{bottom:0;right:0;display:flex;flex-direction:column}.notification-container.bottom-left{bottom:0;left:0;display:flex;flex-direction:column}.notification-container.top-center{top:0;left:50%;transform:translate(-50%);display:flex;flex-direction:column-reverse}.notification-container.bottom-center{bottom:0;left:50%;transform:translate(-50%);display:flex;flex-direction:column}") {
399
+ constructor() {
400
+ super(...arguments), this.position = "top-right", this.maxVisibleNotifications = 5, this.playSound = !1, this.audioVolume = 0.5, this._notifications = [], this._audioService = new R();
401
+ }
402
+ connectedCallback() {
403
+ super.connectedCallback(), this._audioService.setVolume(this.audioVolume), A(window, "schmancy-notification").pipe(_(this.disconnecting)).subscribe((a) => {
404
+ this.addNotification(a.detail);
405
+ }), this.addEventListener("playsound", (a) => {
406
+ this.playSound && this._audioService.playSound(a.detail.type);
407
+ });
408
+ }
409
+ addNotification(a) {
410
+ const t = a.id || `notification-${Date.now()}-${Math.floor(1e4 * Math.random())}`, e = { id: t, title: a.title || "", message: a.message, type: a.type || "info", duration: a.duration !== void 0 ? a.duration : 5e3, closable: a.closable === void 0 || a.closable, playSound: a.playSound !== void 0 ? a.playSound : this.playSound };
411
+ return this.position.startsWith("top") ? this._notifications = [...this._notifications, e] : this._notifications = [e, ...this._notifications], this._notifications.length > this.maxVisibleNotifications && (this._notifications = this._notifications.slice(-this.maxVisibleNotifications)), e.playSound && this._audioService.playSound(e.type), t;
412
+ }
413
+ removeNotification(a) {
414
+ this._notifications = this._notifications.filter((t) => t.id !== a);
415
+ }
416
+ _handleClose(a) {
417
+ const t = a.detail.id;
418
+ this.removeNotification(t);
419
+ }
420
+ render() {
421
+ return d`
422
+ <div
423
+ class=${x({ "notification-container": !0, [this.position]: !0 })}
424
+ >
425
+ ${C(this._notifications, (a) => a.id, (a) => d`
426
+ <sch-notification
427
+ .id=${a.id}
428
+ .title=${a.title}
429
+ .message=${a.message}
430
+ .type=${a.type}
431
+ .duration=${a.duration}
432
+ ?closable=${a.closable}
433
+ ?playSound=${!1} /* We already played the sound on add */
434
+ @close=${this._handleClose}
435
+ ></sch-notification>
436
+ `)}
437
+ </div>
438
+ `;
439
+ }
440
+ };
441
+ g([p({ type: String })], m.prototype, "position", 2), g([p({ type: Number })], m.prototype, "maxVisibleNotifications", 2), g([p({ type: Boolean })], m.prototype, "playSound", 2), g([p({ type: Number })], m.prototype, "audioVolume", 2), g([f()], m.prototype, "_notifications", 2), m = g([b("sch-notification-container")], m);
442
+ export {
443
+ R as N,
444
+ c as S,
445
+ m as a
446
+ };
447
+ //# sourceMappingURL=notification-container-DKLh7Vt2.js.map