@mhmo91/schmancy 0.10.35 → 0.10.36
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.
- package/custom-elements.json +1155 -1083
- package/dist/SchmancyElement-BBzRWB1w.cjs +2 -0
- package/dist/SchmancyElement-BBzRWB1w.cjs.map +1 -0
- package/dist/SchmancyElement-C3CpdNsi.js +284 -0
- package/dist/SchmancyElement-C3CpdNsi.js.map +1 -0
- package/dist/agent/schmancy.agent.js +3387 -3228
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/schmancy.manifest.json +333 -255
- package/dist/{area-DviXdbDx.js → area-BA96mwFY.js} +2 -2
- package/dist/{area-DviXdbDx.js.map → area-BA96mwFY.js.map} +1 -1
- package/dist/{area-CTSTgjlx.cjs → area-DtyQDdOF.cjs} +1 -1
- package/dist/{area-CTSTgjlx.cjs.map → area-DtyQDdOF.cjs.map} +1 -1
- package/dist/area.cjs +1 -1
- package/dist/area.js +1 -1
- package/dist/{audio-Q9oB_cQR.cjs → audio-B_jT9Xr7.cjs} +1 -1
- package/dist/{audio-Q9oB_cQR.cjs.map → audio-B_jT9Xr7.cjs.map} +1 -1
- package/dist/{audio-DFYoaw0M.js → audio-D52h1jAT.js} +1 -1
- package/dist/{audio-DFYoaw0M.js.map → audio-D52h1jAT.js.map} +1 -1
- package/dist/audio.cjs +1 -1
- package/dist/audio.js +2 -2
- package/dist/{autocomplete-DmLXJr7C.cjs → autocomplete-Bts5Jwwr.cjs} +1 -1
- package/dist/{autocomplete-DmLXJr7C.cjs.map → autocomplete-Bts5Jwwr.cjs.map} +1 -1
- package/dist/{autocomplete-BDvuma6D.js → autocomplete-CI4QJXAN.js} +3 -3
- package/dist/{autocomplete-BDvuma6D.js.map → autocomplete-CI4QJXAN.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +3 -3
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/boat-I4B1UNMc.cjs +34 -0
- package/dist/boat-I4B1UNMc.cjs.map +1 -0
- package/dist/{boat-lr7MPZ7H.js → boat-_N1x5U_3.js} +67 -83
- package/dist/boat-_N1x5U_3.js.map +1 -0
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +2 -2
- package/dist/{busy-CgzZbGfx.cjs → busy-BIUonyPk.cjs} +1 -1
- package/dist/{busy-CgzZbGfx.cjs.map → busy-BIUonyPk.cjs.map} +1 -1
- package/dist/{busy-DgQ4ux5N.js → busy-CCB3qKnh.js} +2 -2
- package/dist/{busy-DgQ4ux5N.js.map → busy-CCB3qKnh.js.map} +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/{button-qbN1muQ0.js → button-C89bPnHt.js} +2 -2
- package/dist/{button-qbN1muQ0.js.map → button-C89bPnHt.js.map} +1 -1
- package/dist/{button-DFvR1iXX.cjs → button-CkwQH-g3.cjs} +1 -1
- package/dist/{button-DFvR1iXX.cjs.map → button-CkwQH-g3.cjs.map} +1 -1
- package/dist/button.cjs +4 -4
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +16 -22
- package/dist/button.js.map +1 -1
- package/dist/{card-D_GlwZ5q.cjs → card-BO93_oxQ.cjs} +1 -1
- package/dist/{card-D_GlwZ5q.cjs.map → card-BO93_oxQ.cjs.map} +1 -1
- package/dist/{card-DAbr-7Vy.js → card-CFsCgJKZ.js} +2 -2
- package/dist/{card-DAbr-7Vy.js.map → card-CFsCgJKZ.js.map} +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-BNORaxMF.js → checkbox-Bh7q0djq.js} +2 -2
- package/dist/{checkbox-BNORaxMF.js.map → checkbox-Bh7q0djq.js.map} +1 -1
- package/dist/{checkbox-BUY_uc_r.cjs → checkbox-CFUBUFtW.cjs} +1 -1
- package/dist/{checkbox-BUY_uc_r.cjs.map → checkbox-CFUBUFtW.cjs.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-Dg6Lk6BT.js → chips-6YaoRmeG.js} +145 -122
- package/dist/chips-6YaoRmeG.js.map +1 -0
- package/dist/{chips-CXZ4dJCK.cjs → chips-BfzpsyV1.cjs} +44 -33
- package/dist/chips-BfzpsyV1.cjs.map +1 -0
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +2 -2
- package/dist/connectivity.cjs +1 -1
- package/dist/connectivity.js +3 -3
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-BU6WX7d5.js → date-range-CEo_Kjqw.js} +129 -137
- package/dist/date-range-CEo_Kjqw.js.map +1 -0
- package/dist/{date-range-C-_be3_E.cjs → date-range-N-A249O9.cjs} +25 -19
- package/dist/date-range-N-A249O9.cjs.map +1 -0
- package/dist/{date-range-inline-7o7xtVIu.js → date-range-inline-BwialV9j.js} +2 -2
- package/dist/{date-range-inline-7o7xtVIu.js.map → date-range-inline-BwialV9j.js.map} +1 -1
- package/dist/{date-range-inline-DJtUmHKF.cjs → date-range-inline-DFopysWF.cjs} +1 -1
- package/dist/{date-range-inline-DJtUmHKF.cjs.map → date-range-inline-DFopysWF.cjs.map} +1 -1
- package/dist/date-range-inline.cjs +1 -1
- package/dist/date-range-inline.js +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +2 -2
- package/dist/{details-Bs0MyyvF.cjs → details-BLRPV8sY.cjs} +1 -1
- package/dist/{details-Bs0MyyvF.cjs.map → details-BLRPV8sY.cjs.map} +1 -1
- package/dist/{details-EfbDPVEo.js → details-GtpfI2hA.js} +2 -2
- package/dist/{details-EfbDPVEo.js.map → details-GtpfI2hA.js.map} +1 -1
- package/dist/details.cjs +1 -1
- package/dist/details.js +1 -1
- package/dist/{directives-zi1Mm2er.js → directives-C2dXgpCY.js} +13 -6
- package/dist/directives-C2dXgpCY.js.map +1 -0
- package/dist/{directives-fLwDj6b0.cjs → directives-CvYGSW_a.cjs} +2 -2
- package/dist/directives-CvYGSW_a.cjs.map +1 -0
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +2 -2
- package/dist/{divider-CEPfrIwe.js → divider-D0pGX2VB.js} +2 -2
- package/dist/{divider-CEPfrIwe.js.map → divider-D0pGX2VB.js.map} +1 -1
- package/dist/{divider-CdIsWZrM.cjs → divider-rNsWCvMi.cjs} +1 -1
- package/dist/{divider-CdIsWZrM.cjs.map → divider-rNsWCvMi.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +2 -2
- package/dist/{expand-g1vqqUp1.js → expand-FcKAzJta.js} +3 -3
- package/dist/{expand-g1vqqUp1.js.map → expand-FcKAzJta.js.map} +1 -1
- package/dist/{expand--at1k3qo.cjs → expand-tffQHGbZ.cjs} +1 -1
- package/dist/{expand--at1k3qo.cjs.map → expand-tffQHGbZ.cjs.map} +1 -1
- package/dist/expand.cjs +1 -1
- package/dist/expand.js +1 -1
- package/dist/fab.cjs +77 -0
- package/dist/fab.cjs.map +1 -0
- package/dist/fab.js +151 -0
- package/dist/fab.js.map +1 -0
- package/dist/{float-P9HukAm-.cjs → float-CDjgxWyy.cjs} +1 -1
- package/dist/{float-P9HukAm-.cjs.map → float-CDjgxWyy.cjs.map} +1 -1
- package/dist/{float-DxVzgI9o.js → float-CQ1WEp3M.js} +2 -2
- package/dist/{float-DxVzgI9o.js.map → float-CQ1WEp3M.js.map} +1 -1
- package/dist/float.cjs +1 -1
- package/dist/float.js +1 -1
- package/dist/{form-CqLaozHp.js → form-H24puioV.js} +3 -3
- package/dist/{form-CqLaozHp.js.map → form-H24puioV.js.map} +1 -1
- package/dist/{form-ByYhXe1p.cjs → form-VYhbbir3.cjs} +1 -1
- package/dist/{form-ByYhXe1p.cjs.map → form-VYhbbir3.cjs.map} +1 -1
- package/dist/form.cjs +6 -6
- package/dist/form.cjs.map +1 -1
- package/dist/form.js +25 -23
- package/dist/form.js.map +1 -1
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/{icons-DYtiRU5V.cjs → icons-B_a1HStW.cjs} +1 -1
- package/dist/{icons-DYtiRU5V.cjs.map → icons-B_a1HStW.cjs.map} +1 -1
- package/dist/{icons-CkphcMp6.js → icons-DBxfN91B.js} +2 -2
- package/dist/{icons-CkphcMp6.js.map → icons-DBxfN91B.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/{iframe-CjqJksl8.js → iframe-BDVElN8z.js} +2 -2
- package/dist/{iframe-CjqJksl8.js.map → iframe-BDVElN8z.js.map} +1 -1
- package/dist/{iframe-C3trkP8q.cjs → iframe-CG-z9qev.cjs} +1 -1
- package/dist/{iframe-C3trkP8q.cjs.map → iframe-CG-z9qev.cjs.map} +1 -1
- package/dist/iframe.cjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +57 -56
- package/dist/{input-DuavpwNL.cjs → input-B14Nn6xD.cjs} +1 -1
- package/dist/{input-DuavpwNL.cjs.map → input-B14Nn6xD.cjs.map} +1 -1
- package/dist/{input-CG51zDVh.js → input-Bt_o4sYo.js} +2 -2
- package/dist/{input-CG51zDVh.js.map → input-Bt_o4sYo.js.map} +1 -1
- package/dist/{input-chip-C6Lq1927.js → input-chip-DEqO0DXc.js} +2 -2
- package/dist/input-chip-DEqO0DXc.js.map +1 -0
- package/dist/{input-chip-57tgNXKT.cjs → input-chip-ugYu9Fn9.cjs} +1 -1
- package/dist/input-chip-ugYu9Fn9.cjs.map +1 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.js +3 -3
- package/dist/kbd.cjs +1 -1
- package/dist/kbd.js +2 -2
- package/dist/{layout-D4IOwx7p.js → layout-BJ_43VrH.js} +1 -1
- package/dist/{layout-D4IOwx7p.js.map → layout-BJ_43VrH.js.map} +1 -1
- package/dist/{layout-6ipbiWTl.cjs → layout-DF9ZaQ-b.cjs} +1 -1
- package/dist/{layout-6ipbiWTl.cjs.map → layout-DF9ZaQ-b.cjs.map} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +2 -2
- package/dist/{lightbox-H8pVWGMX.cjs → lightbox-B47Zoqv-.cjs} +1 -1
- package/dist/{lightbox-H8pVWGMX.cjs.map → lightbox-B47Zoqv-.cjs.map} +1 -1
- package/dist/{lightbox-CsyO2XSr.js → lightbox-ZmuoBBFT.js} +2 -2
- package/dist/{lightbox-CsyO2XSr.js.map → lightbox-ZmuoBBFT.js.map} +1 -1
- package/dist/lightbox.cjs +1 -1
- package/dist/lightbox.js +1 -1
- package/dist/{list-BAwH0pQW.js → list-C47xzld_.js} +2 -2
- package/dist/{list-BAwH0pQW.js.map → list-C47xzld_.js.map} +1 -1
- package/dist/{list-Bs9m8kw7.cjs → list-CaSWrlG2.cjs} +1 -1
- package/dist/{list-Bs9m8kw7.cjs.map → list-CaSWrlG2.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{menu-tQVARVaC.js → menu-8RObM6Ie.js} +3 -3
- package/dist/{menu-tQVARVaC.js.map → menu-8RObM6Ie.js.map} +1 -1
- package/dist/{menu-BMcGzj1h.cjs → menu-Jpsy85SX.cjs} +1 -1
- package/dist/{menu-BMcGzj1h.cjs.map → menu-Jpsy85SX.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/{mixins-CGXSzZc7.cjs → mixins-DPdzC9ZH.cjs} +1 -1
- package/dist/{mixins-CGXSzZc7.cjs.map → mixins-DPdzC9ZH.cjs.map} +1 -1
- package/dist/{mixins-Bp0wIHg2.js → mixins-DTzfFVyv.js} +1 -1
- package/dist/{mixins-Bp0wIHg2.js.map → mixins-DTzfFVyv.js.map} +1 -1
- package/dist/mixins.cjs +1 -1
- package/dist/mixins.js +2 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-rail.cjs +1 -1
- package/dist/navigation-rail.js +2 -2
- package/dist/{notification-D1tX2nx5.js → notification-Ccktcj9H.js} +4 -4
- package/dist/{notification-D1tX2nx5.js.map → notification-Ccktcj9H.js.map} +1 -1
- package/dist/{notification-Bz00zdpV.cjs → notification-DSkB-sn0.cjs} +1 -1
- package/dist/{notification-Bz00zdpV.cjs.map → notification-DSkB-sn0.cjs.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-BnybLEDO.cjs → option-0aNiVB3Q.cjs} +1 -1
- package/dist/{option-BnybLEDO.cjs.map → option-0aNiVB3Q.cjs.map} +1 -1
- package/dist/{option-BpGV8Apj.js → option-CkMxwBqU.js} +2 -2
- package/dist/{option-BpGV8Apj.js.map → option-CkMxwBqU.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{overlay-UQR2Dy3u.cjs → overlay-BS-ta-zq.cjs} +5 -5
- package/dist/overlay-BS-ta-zq.cjs.map +1 -0
- package/dist/{overlay-BpNhd74N.js → overlay-H3Wt_dgQ.js} +108 -108
- package/dist/overlay-H3Wt_dgQ.js.map +1 -0
- package/dist/overlay.cjs +1 -1
- package/dist/{overlay.confirm-body-CVDtVk5X.cjs → overlay.confirm-body-CR9xaqOE.cjs} +1 -1
- package/dist/{overlay.confirm-body-CVDtVk5X.cjs.map → overlay.confirm-body-CR9xaqOE.cjs.map} +1 -1
- package/dist/{overlay.confirm-body-BHcXu5Wk.js → overlay.confirm-body-Dxn_wNm3.js} +6 -6
- package/dist/{overlay.confirm-body-BHcXu5Wk.js.map → overlay.confirm-body-Dxn_wNm3.js.map} +1 -1
- package/dist/overlay.js +3 -3
- package/dist/{overlay.service-DTE6NwIM.js → overlay.service-C46kOtUi.js} +2 -2
- package/dist/{overlay.service-DTE6NwIM.js.map → overlay.service-C46kOtUi.js.map} +1 -1
- package/dist/{overlay.service-C8RsQzgM.cjs → overlay.service-DEj3rfRr.cjs} +1 -1
- package/dist/{overlay.service-C8RsQzgM.cjs.map → overlay.service-DEj3rfRr.cjs.map} +1 -1
- package/dist/{progress-CAKsxp29.js → progress-BK7gSq8j.js} +2 -2
- package/dist/{progress-CAKsxp29.js.map → progress-BK7gSq8j.js.map} +1 -1
- package/dist/{progress-gbIALDRs.cjs → progress-zs18GR6C.cjs} +1 -1
- package/dist/{progress-gbIALDRs.cjs.map → progress-zs18GR6C.cjs.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-group-otyvZvUk.js → radio-group-1HCpzRUB.js} +2 -2
- package/dist/{radio-group-otyvZvUk.js.map → radio-group-1HCpzRUB.js.map} +1 -1
- package/dist/{radio-group-CfJ5DtI4.cjs → radio-group-DbYlyPc-.cjs} +1 -1
- package/dist/{radio-group-CfJ5DtI4.cjs.map → radio-group-DbYlyPc-.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/range.cjs +1 -1
- package/dist/range.js +2 -2
- package/dist/{select-81jniVTs.cjs → select-B-SSmUDe.cjs} +1 -1
- package/dist/{select-81jniVTs.cjs.map → select-B-SSmUDe.cjs.map} +1 -1
- package/dist/{select-9vXx1fhr.js → select-CEyhNtZ2.js} +3 -3
- package/dist/{select-9vXx1fhr.js.map → select-CEyhNtZ2.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +2 -2
- package/dist/skills/INDEX.md +1 -1
- package/dist/skills/SKILL.md +6 -7
- package/dist/skills/boat.md +21 -15
- package/dist/skills/fab.md +75 -0
- package/dist/skills/schmancy/INDEX.md +1 -1
- package/dist/skills/schmancy/SKILL.md +6 -7
- package/dist/skills/schmancy/boat.md +21 -15
- package/dist/skills/schmancy/fab.md +75 -0
- package/dist/skills/schmancy/theme.md +1 -1
- package/dist/skills/theme.md +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +2 -2
- package/dist/{sound.service-D3ZSq1Kj.js → sound.service-DO4SmUUT.js} +1 -1
- package/dist/{sound.service-D3ZSq1Kj.js.map → sound.service-DO4SmUUT.js.map} +1 -1
- package/dist/{sound.service-CmIw63aM.cjs → sound.service-G_8GV_6L.cjs} +1 -1
- package/dist/{sound.service-CmIw63aM.cjs.map → sound.service-G_8GV_6L.cjs.map} +1 -1
- package/dist/{splash-screen-BOjrmGLk.js → splash-screen-B1mM4_xz.js} +2 -2
- package/dist/{splash-screen-BOjrmGLk.js.map → splash-screen-B1mM4_xz.js.map} +1 -1
- package/dist/{splash-screen-C5KAWXvA.cjs → splash-screen-cbz4bxjB.cjs} +1 -1
- package/dist/{splash-screen-C5KAWXvA.cjs.map → splash-screen-cbz4bxjB.cjs.map} +1 -1
- package/dist/splash-screen.cjs +1 -1
- package/dist/splash-screen.js +1 -1
- package/dist/{src-qzUpLbje.cjs → src-czeiuT1m.cjs} +1 -1
- package/dist/{src-qzUpLbje.cjs.map → src-czeiuT1m.cjs.map} +1 -1
- package/dist/{src-C5g3p1J5.js → src-tncsWsTY.js} +36 -35
- package/dist/{src-C5g3p1J5.js.map → src-tncsWsTY.js.map} +1 -1
- package/dist/{state-Cex3rmx2.cjs → state-Cx0aoL5e.cjs} +1 -1
- package/dist/{state-Cex3rmx2.cjs.map → state-Cx0aoL5e.cjs.map} +1 -1
- package/dist/{state-CWBRTSvE.js → state-DJDp3N7J.js} +1 -1
- package/dist/{state-CWBRTSvE.js.map → state-DJDp3N7J.js.map} +1 -1
- package/dist/state.cjs +1 -1
- package/dist/state.js +2 -2
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +2 -2
- package/dist/{surface-PfiejLuw.cjs → surface-C3cxTcJD.cjs} +1 -1
- package/dist/{surface-PfiejLuw.cjs.map → surface-C3cxTcJD.cjs.map} +1 -1
- package/dist/{surface-9S5scTsD.js → surface-CYBl8_a3.js} +2 -2
- package/dist/{surface-9S5scTsD.js.map → surface-CYBl8_a3.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +2 -2
- package/dist/table.cjs +1 -1
- package/dist/table.js +2 -2
- package/dist/{tabs-BBOjAmgG.js → tabs-DHy93Q3N.js} +2 -2
- package/dist/{tabs-BBOjAmgG.js.map → tabs-DHy93Q3N.js.map} +1 -1
- package/dist/{tabs-uYvb1P06.cjs → tabs-ORQ_Zd43.cjs} +1 -1
- package/dist/{tabs-uYvb1P06.cjs.map → tabs-ORQ_Zd43.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-YPHX4g7Y.cjs → textarea-CEUaDURR.cjs} +1 -1
- package/dist/{textarea-YPHX4g7Y.cjs.map → textarea-CEUaDURR.cjs.map} +1 -1
- package/dist/{textarea-QzSj8Dkl.js → textarea-DHIMt-ly.js} +2 -2
- package/dist/{textarea-QzSj8Dkl.js.map → textarea-DHIMt-ly.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/theme-CJpjkqHr.cjs +181 -0
- package/dist/{theme-iKUaS9JB.cjs.map → theme-CJpjkqHr.cjs.map} +1 -1
- package/dist/{theme-C2Mp-VGt.js → theme-CgI9PRco.js} +6 -5
- package/dist/{theme-C2Mp-VGt.js.map → theme-CgI9PRco.js.map} +1 -1
- package/dist/{theme-button-CJmhxfMe.cjs → theme-button--FuBkuVr.cjs} +1 -1
- package/dist/{theme-button-CJmhxfMe.cjs.map → theme-button--FuBkuVr.cjs.map} +1 -1
- package/dist/{theme-button-DGWAXhzd.js → theme-button-D-FXb3oO.js} +2 -2
- package/dist/{theme-button-DGWAXhzd.js.map → theme-button-D-FXb3oO.js.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +3 -3
- package/dist/{theme.service-hc4N-1Oz.js → theme.service-BfTK1Wtl.js} +1 -1
- package/dist/{theme.service-hc4N-1Oz.js.map → theme.service-BfTK1Wtl.js.map} +1 -1
- package/dist/{theme.service-p61RsJBF.cjs → theme.service-Dg7LO0Qz.cjs} +1 -1
- package/dist/{theme.service-p61RsJBF.cjs.map → theme.service-Dg7LO0Qz.cjs.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +2 -2
- package/dist/{typography-DwV0sqht.js → typography-BEGLfHwz.js} +2 -2
- package/dist/{typography-DwV0sqht.js.map → typography-BEGLfHwz.js.map} +1 -1
- package/dist/{typography-Bdt8RlX2.cjs → typography-CxA3sx9B.cjs} +1 -1
- package/dist/{typography-Bdt8RlX2.cjs.map → typography-CxA3sx9B.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/dist/visually-hidden.cjs +1 -1
- package/dist/visually-hidden.js +2 -2
- package/dist/{window-n4jN60B_.js → window-B_n4P9az.js} +3 -3
- package/dist/{window-n4jN60B_.js.map → window-B_n4P9az.js.map} +1 -1
- package/dist/{window-D2WfvNng.cjs → window-Vl1u1-EG.cjs} +1 -1
- package/dist/{window-D2WfvNng.cjs.map → window-Vl1u1-EG.cjs.map} +1 -1
- package/dist/window.cjs +1 -1
- package/dist/window.js +1 -1
- package/package.json +1 -1
- package/skills/schmancy/INDEX.md +1 -1
- package/skills/schmancy/SKILL.md +6 -7
- package/skills/schmancy/boat.md +21 -15
- package/skills/schmancy/fab.md +75 -0
- package/skills/schmancy/theme.md +1 -1
- package/src/CLAUDE.md +22 -16
- package/src/boat/boat.test.ts +130 -0
- package/src/boat/boat.ts +144 -121
- package/src/button/icon-button.ts +18 -30
- package/src/chips/assist-chip.ts +2 -263
- package/src/chips/chips.ts +2 -259
- package/src/chips/filter-chip.ts +2 -255
- package/src/chips/index.ts +2 -5
- package/src/chips/input-chip.ts +2 -413
- package/src/chips/suggestion-chip.ts +2 -266
- package/src/directives/fill.ts +28 -5
- package/src/fab/fab.test.ts +101 -0
- package/src/fab/fab.ts +226 -0
- package/src/fab/index.ts +1 -0
- package/src/form/fields/chips/assist-chip.ts +263 -0
- package/src/form/fields/chips/chips.ts +234 -0
- package/src/form/fields/chips/filter-chip.ts +255 -0
- package/src/form/fields/chips/index.ts +5 -0
- package/src/form/fields/chips/input-chip.ts +413 -0
- package/src/form/fields/chips/suggestion-chip.ts +266 -0
- package/src/form/fields/date-range/date-range.test.ts +44 -0
- package/src/form/fields/date-range/date-range.ts +103 -97
- package/src/form/fields/index.ts +1 -0
- package/src/index.ts +2 -1
- package/src/overlay/overlay.animations.ts +2 -3
- package/src/overlay/overlay.component.ts +8 -4
- package/src/overlay/overlay.types.ts +14 -2
- package/src/theme/theme.component.ts +1 -0
- package/src/theme/theme.style.css +3 -0
- package/types/src/boat/boat.d.ts +27 -9
- package/types/src/boat/boat.test.d.ts +2 -0
- package/types/src/button/icon-button.d.ts +3 -2
- package/types/src/chips/assist-chip.d.ts +1 -47
- package/types/src/chips/chips.d.ts +1 -43
- package/types/src/chips/filter-chip.d.ts +1 -67
- package/types/src/chips/index.d.ts +1 -5
- package/types/src/chips/input-chip.d.ts +1 -82
- package/types/src/chips/suggestion-chip.d.ts +1 -52
- package/types/src/fab/fab.d.ts +80 -0
- package/types/src/fab/fab.test.d.ts +2 -0
- package/types/src/fab/index.d.ts +1 -0
- package/types/src/form/fields/chips/assist-chip.d.ts +47 -0
- package/types/src/form/fields/chips/chips.d.ts +35 -0
- package/types/src/form/fields/chips/filter-chip.d.ts +67 -0
- package/types/src/form/fields/chips/index.d.ts +5 -0
- package/types/src/form/fields/chips/input-chip.d.ts +82 -0
- package/types/src/form/fields/chips/suggestion-chip.d.ts +52 -0
- package/types/src/form/fields/date-range/date-range.d.ts +5 -10
- package/types/src/form/fields/index.d.ts +1 -0
- package/types/src/index.d.ts +2 -1
- package/types/src/overlay/overlay.component.d.ts +1 -0
- package/types/src/overlay/overlay.types.d.ts +12 -2
- package/types/src/theme/theme.component.d.ts +1 -0
- package/dist/SchmancyElement-CA0Wqt8m.js +0 -284
- package/dist/SchmancyElement-CA0Wqt8m.js.map +0 -1
- package/dist/SchmancyElement-CYIif26I.cjs +0 -2
- package/dist/SchmancyElement-CYIif26I.cjs.map +0 -1
- package/dist/boat-Vqjgo10B.cjs +0 -33
- package/dist/boat-Vqjgo10B.cjs.map +0 -1
- package/dist/boat-lr7MPZ7H.js.map +0 -1
- package/dist/chips-CXZ4dJCK.cjs.map +0 -1
- package/dist/chips-Dg6Lk6BT.js.map +0 -1
- package/dist/date-range-BU6WX7d5.js.map +0 -1
- package/dist/date-range-C-_be3_E.cjs.map +0 -1
- package/dist/directives-fLwDj6b0.cjs.map +0 -1
- package/dist/directives-zi1Mm2er.js.map +0 -1
- package/dist/input-chip-57tgNXKT.cjs.map +0 -1
- package/dist/input-chip-C6Lq1927.js.map +0 -1
- package/dist/overlay-BpNhd74N.js.map +0 -1
- package/dist/overlay-UQR2Dy3u.cjs.map +0 -1
- package/dist/theme-iKUaS9JB.cjs +0 -181
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-D1tX2nx5.js","names":[],"sources":["../src/notification/notification.scss?inline","../src/notification/notification.ts","../src/notification/notification-service.ts","../src/notification/notify.ts"],"sourcesContent":[":host {\n\tdisplay: block;\n}\n\n.notification {\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: stretch;\n\tmax-width: 360px;\n\toverflow: hidden;\n\n\t/* Asymmetric radius: 4px left, 14px right */\n\tborder-radius: 4px 14px 14px 4px;\n\toutline: 1px solid color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 50%, transparent);\n\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-container) 100%, transparent),\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-containerHigh) 100%, transparent)\n\t);\n\n\tcolor: var(--schmancy-sys-color-surface-on);\n\n\t/* Type-colored luminous glow — tightened */\n\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\tbox-shadow:\n\t\t0 6px 28px -10px color-mix(in srgb, var(--notification-glow-color) 22%, transparent),\n\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\n\ttransition:\n\t\tbox-shadow 300ms ease,\n\t\ttransform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\n\t&.info {\n\t\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-primary-default);\n\t}\n\t&.success {\n\t\t--notification-glow-color: var(--schmancy-sys-color-success-default);\n\t\t--notification-accent: var(--schmancy-sys-color-success-default);\n\t}\n\t&.warning {\n\t\t--notification-glow-color: var(--schmancy-sys-color-tertiary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-tertiary-default);\n\t}\n\t&.error {\n\t\t--notification-glow-color: var(--schmancy-sys-color-error-default);\n\t\t--notification-accent: var(--schmancy-sys-color-error-default);\n\t}\n\n\t&.hovered {\n\t\tbox-shadow:\n\t\t\t0 10px 36px -8px color-mix(in srgb, var(--notification-glow-color) 34%, transparent),\n\t\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\t\ttransform: translateY(-2px);\n\n\t\t.accent-rail {\n\t\t\twidth: 4px;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\ttransition: box-shadow 200ms ease;\n\n\t\t&.hovered {\n\t\t\ttransform: none;\n\t\t}\n\t}\n}\n\n/* Vertical accent rail — left edge */\n.accent-rail {\n\tflex-shrink: 0;\n\twidth: 3px;\n\tbackground: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tborder-radius: 4px 0 0 4px;\n\ttransition: width 200ms ease;\n\talign-self: stretch;\n}\n\n/* Card body */\n.content {\n\tflex: 1;\n\tmin-width: 0;\n\tpadding: 14px 36px 14px 18px;\n}\n\n/* Monospace uppercase type tag */\n.type-tag {\n\tdisplay: block;\n\tfont-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;\n\tfont-size: 10px;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\topacity: 0.7;\n\tcolor: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tmargin-bottom: 4px;\n\tline-height: 1;\n}\n\n/* Serif display title */\n.title {\n\tfont-family: ui-serif, Georgia, Cambria, 'Times New Roman', serif;\n\tfont-weight: 500;\n\tfont-size: 15px;\n\tline-height: 1.3;\n\tmargin-bottom: 3px;\n\tcolor: var(--schmancy-sys-color-surface-on);\n}\n\n/* Body message */\n.message {\n\tfont-family: ui-sans-serif, system-ui, -apple-system, sans-serif;\n\tfont-size: 13px;\n\tline-height: 1.45;\n\topacity: 0.72;\n}\n\n/* Close button — 28×28 hit target, × glyph */\n.close {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 6px;\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tfont-size: 18px;\n\tfont-weight: 400;\n\tcolor: var(--schmancy-sys-color-surface-onVariant);\n\tcursor: pointer;\n\tpadding: 0;\n\tline-height: 1;\n\topacity: 0.4;\n\tborder-radius: 50%;\n\ttransition: opacity 200ms ease;\n\n\t&:hover {\n\t\topacity: 0.85;\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\topacity: 1;\n\t\tbox-shadow: 0 0 0 2px var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\t}\n}\n\n/* Progress hairline — top edge */\n.progress {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: auto;\n\tleft: 0;\n\tright: 0;\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { html, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { BehaviorSubject, timer, interval, NEVER } from 'rxjs'\nimport { switchMap, takeUntil, map, tap, distinctUntilChanged } from 'rxjs/operators'\nimport '../progress/progress'\nimport style from './notification.scss?inline'\n\nexport type NotificationType = 'info' | 'success' | 'warning' | 'error'\n\n/**\n * @fires close - When notification is closed\n */\n@customElement('sch-notification')\nexport default class SchmancyNotification extends SchmancyElement {\n\tstatic styles = [unsafeCSS(style)]\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) message = ''\n\t@property({ type: String }) type: NotificationType = 'info'\n\t@property({ type: Boolean }) closable = true\n\t@property({ type: Number }) duration = 5000\n\t@property({ type: String }) id = `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\t@property({ type: Boolean }) playSound = true\n\t@property({ type: Boolean }) showProgress = false\n\t// startPosition retained for API compatibility — not used in entrance animation\n\t@property({ type: Object }) startPosition: { x: number; y: number } = { x: 0, y: 0 }\n\n\t@state() private _visible = true\n\t@state() private _progress = 100\n\t@state() private _hovered = false\n\t@state() private _closing = false\n\n\tprivate paused$ = new BehaviorSubject<boolean>(false)\n\tprivate startTime = 0\n\tprivate pausedAt = 0\n\tprivate elapsedBeforePause = 0\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\tthis.style.position = 'fixed'\n\t\tthis.style.top = '16px'\n\t\tthis.style.right = '16px'\n\t\tthis.style.zIndex = '10001'\n\t\tthis.style.opacity = '0'\n\n\t\tthis.updateComplete.then(() => {\n\t\t\tthis.animateIn()\n\t\t\treturn\n\t\t})\n\n\t\tif (this.duration > 0) {\n\t\t\tthis.setupAutoClose()\n\t\t\tthis.setupProgressUpdates()\n\t\t}\n\n\t\tif (this.playSound) {\n\t\t\tthis._playSound()\n\t\t}\n\t}\n\n\tprivate async animateIn() {\n\t\tconst reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\t\tawait this.animate(\n\t\t\treduced\n\t\t\t\t? [{ opacity: 0 }, { opacity: 1 }]\n\t\t\t\t: [\n\t\t\t\t\t\t{ transform: 'translateX(40px) scale(0.96)', opacity: 0 },\n\t\t\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t\t],\n\t\t\t{\n\t\t\t\tduration: reduced ? 200 : 360,\n\t\t\t\teasing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\t}\n\n\tprivate setupAutoClose() {\n\t\tif (this.duration <= 0) return\n\n\t\tthis.startTime = Date.now()\n\t\tthis.elapsedBeforePause = 0\n\n\t\tthis.paused$\n\t\t\t.pipe(\n\t\t\t\tswitchMap(paused => {\n\t\t\t\t\tif (paused) {\n\t\t\t\t\t\tthis.pausedAt = Date.now()\n\t\t\t\t\t\tthis.elapsedBeforePause += this.pausedAt - this.startTime\n\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.startTime = Date.now()\n\t\t\t\t\t\tconst remaining = this.duration - this.elapsedBeforePause\n\t\t\t\t\t\tif (remaining <= 0) {\n\t\t\t\t\t\t\tthis.close()\n\t\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn timer(remaining)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => this.close())\n\t}\n\n\tprivate setupProgressUpdates() {\n\t\tif (this.duration <= 0) return\n\n\t\tinterval(16)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(() =>\n\t\t\t\t\tthis.paused$.pipe(\n\t\t\t\t\t\tmap(paused => {\n\t\t\t\t\t\t\tif (paused) return this._progress\n\t\t\t\t\t\t\tconst elapsed = this.elapsedBeforePause + (Date.now() - this.startTime)\n\t\t\t\t\t\t\tconst remaining = Math.max(0, this.duration - elapsed)\n\t\t\t\t\t\t\treturn (remaining / this.duration) * 100\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(progress => {\n\t\t\t\t\tthis._progress = progress\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tprivate _playSound() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('playsound', {\n\t\t\t\tdetail: { type: this.type },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _handleMouseEnter() {\n\t\tthis._hovered = true\n\t\tthis.paused$.next(true)\n\t}\n\n\tprivate _handleMouseLeave() {\n\t\tthis._hovered = false\n\t\tthis.paused$.next(false)\n\t}\n\n\tpublic async close() {\n\t\tif (this._closing) return\n\t\tthis._closing = true\n\t\tthis._visible = false\n\n\t\tawait this.animate(\n\t\t\t[\n\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t{ transform: 'translateX(20px) scale(0.98)', opacity: 0 },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 180,\n\t\t\t\teasing: 'cubic-bezier(0.4, 0, 1, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tdetail: { id: this.id },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _getTypeLabel(): string {\n\t\tswitch (this.type) {\n\t\t\tcase 'success':\n\t\t\t\treturn 'SUCCESS'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'WARNING'\n\t\t\tcase 'error':\n\t\t\t\treturn 'ERROR'\n\t\t\tdefault:\n\t\t\t\treturn 'INFO'\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._visible && this._closing) return html``\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=\"notification ${this.type} ${this._closing ? 'closing' : ''} ${this._hovered ? 'hovered' : ''}\"\n\t\t\t\trole=\"alert\"\n\t\t\t\t@mouseenter=${this._handleMouseEnter}\n\t\t\t\t@mouseleave=${this._handleMouseLeave}\n\t\t\t>\n\t\t\t\t${this.showProgress || this.duration > 0\n\t\t\t\t\t? html`<schmancy-progress\n\t\t\t\t\t\t\tclass=\"progress\"\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t.value=${this._progress}\n\t\t\t\t\t\t\t?indeterminate=${this.showProgress && this.duration === 0}\n\t\t\t\t\t\t></schmancy-progress>`\n\t\t\t\t\t: ''}\n\t\t\t\t<div class=\"accent-rail\"></div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<span class=\"type-tag\">${this._getTypeLabel()}</span>\n\t\t\t\t\t${this.title ? html`<div class=\"title\">${this.title}</div>` : ''}\n\t\t\t\t\t<div class=\"message\">${this.message}</div>\n\t\t\t\t</div>\n\t\t\t\t${this.closable\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<button class=\"close\" aria-label=\"Close notification\" @click=${this.close}>×</button>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sch-notification': SchmancyNotification\n\t}\n}\n","import { fromEvent } from 'rxjs'\nimport { $sounds, type Feeling } from '../audio'\nimport SchmancyNotification, { NotificationType } from './notification'\n\nexport interface NotificationOptions {\n\tid?: string\n\ttitle?: string\n\tmessage: string\n\ttype?: NotificationType\n\tduration?: number\n\tclosable?: boolean\n\tplaySound?: boolean\n\tshowProgress?: boolean\n}\n\nconst typeToFeeling: Record<NotificationType, Feeling> = {\n\tinfo: 'curious',\n\tsuccess: 'content',\n\twarning: 'anxious',\n\terror: 'disappointed',\n}\n\nconst typeDurations: Record<NotificationType, number> = {\n\tsuccess: 1500,\n\tinfo: 2000,\n\twarning: 2500,\n\terror: 2500,\n}\n\n$sounds.setVolume(0.1)\n\n// Track last mouse position via RxJS\nlet lastClickPosition = { x: window.innerWidth - 100, y: 50 }\nif (typeof window !== 'undefined') {\n\tfromEvent<MouseEvent>(window, 'mousedown', { capture: true, passive: true } as AddEventListenerOptions).subscribe(\n\t\te => {\n\t\t\tlastClickPosition = { x: e.clientX, y: e.clientY }\n\t\t},\n\t)\n}\n\nlet currentNotification: SchmancyNotification | null = null\nconst notificationStack: string[] = []\n\nfunction show(options: NotificationOptions): string {\n\tconst id = options.id ?? `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\tnotificationStack.push(id)\n\n\tif (currentNotification) {\n\t\tcurrentNotification.remove()\n\t\tcurrentNotification = null\n\t}\n\n\tconst notification = document.createElement('sch-notification') as SchmancyNotification\n\tnotification.id = id\n\tnotification.title = options.title ?? ''\n\tnotification.message = options.message\n\tnotification.type = options.type ?? 'info'\n\tnotification.duration = options.duration ?? 1000\n\tnotification.closable = options.closable !== false\n\tnotification.playSound = false\n\tnotification.showProgress = options.showProgress ?? false\n\tnotification.startPosition = { ...lastClickPosition }\n\n\tif (options.playSound !== false) {\n\t\t$sounds.play(typeToFeeling[notification.type])\n\t}\n\n\tfromEvent(notification, 'close').subscribe(() => {\n\t\tconst index = notificationStack.indexOf(id)\n\t\tif (index > -1) notificationStack.splice(index, 1)\n\t\tnotification.remove()\n\t\tif (currentNotification === notification) currentNotification = null\n\t})\n\n\tdocument.body.appendChild(notification)\n\tcurrentNotification = notification\n\treturn id\n}\n\n/**\n * Global notification (toast) utility. Fire-and-forget API for success,\n * error, info, and warning toasts, plus a low-level `show` for custom\n * notifications.\n *\n * @service\n * @summary Toast notifications — success, error, info, warning.\n * @method show(options: NotificationOptions) - Low-level; show any NotificationOptions.\n * @method success(message, options?) - Green success toast.\n * @method error(message, options?) - Red error toast.\n * @method info(message, options?) - Blue informational toast.\n * @method warning(message, options?) - Amber warning toast.\n */\nexport const $notify = {\n\tshow,\n\n\tinfo: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'info',\n\t\t\tduration: message ? (options.duration ?? typeDurations.info) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tsuccess: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'success',\n\t\t\tduration: message ? (options.duration ?? typeDurations.success) : 1,\n\t\t\t...options,\n\t\t}),\n\n\twarning: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'warning',\n\t\t\tduration: message ? (options.duration ?? typeDurations.warning) : 1,\n\t\t\t...options,\n\t\t}),\n\n\terror: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'error',\n\t\t\tduration: message ? (options.duration ?? typeDurations.error) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tcustomDuration: (\n\t\tmessage: string,\n\t\tduration: number,\n\t\toptions: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {},\n\t): string => show({ message, duration, ...options }),\n\n\tpersistent: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {}): string =>\n\t\tshow({ message, duration: 0, ...options }),\n\n\tdismiss: (id?: string): void => {\n\t\tconst targetId = id ? (notificationStack.splice(notificationStack.indexOf(id), 1)[0]) : notificationStack.pop()\n\t\tif (targetId && currentNotification?.id === targetId) currentNotification.close()\n\t},\n\n\tupdate: (id: string, options: Partial<NotificationOptions>): void => {\n\t\tif (currentNotification?.id !== id) return\n\t\tif (options.title !== undefined) currentNotification.title = options.title\n\t\tif (options.message !== undefined) currentNotification.message = options.message\n\t\tif (options.type !== undefined) currentNotification.type = options.type\n\t},\n}\n\n","import { Observable, tap, finalize, catchError } from 'rxjs'\r\nimport { $notify, NotificationOptions } from './notification-service'\r\n\r\nexport interface NotifyOptions {\r\n\t/**\r\n\t * Message to show while the operation is in progress\r\n\t */\r\n\tloadingMessage?: string\r\n\t/**\r\n\t * Message to show when the operation completes successfully\r\n\t */\r\n\tsuccessMessage?: string\r\n\t/**\r\n\t * Message to show when the operation fails (can be a function to format error)\r\n\t */\r\n\terrorMessage?: string | ((error: any) => string)\r\n\t/**\r\n\t * Type of notification for loading state\r\n\t */\r\n\tloadingType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for success state\r\n\t */\r\n\tsuccessType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for error state\r\n\t */\r\n\terrorType?: NotificationOptions['type']\r\n\t/**\r\n\t * Whether to auto-dismiss the loading notification on complete/error\r\n\t */\r\n\tautoDismissLoading?: boolean\r\n\t/**\r\n\t * Duration for success notification (ms). Use 0 for persistent\r\n\t */\r\n\tsuccessDuration?: number\r\n\t/**\r\n\t * Duration for error notification (ms). Use 0 for persistent\r\n\t */\r\n\terrorDuration?: number\r\n}\r\n\r\n/**\r\n * Wraps an Observable with notification lifecycle management.\r\n * Shows a loading notification with progress indicator, then auto-dismisses and shows success/error notification.\r\n * \r\n * @example\r\n * ```typescript\r\n * // Basic usage with progress indicator\r\n * someApiCall().pipe(\r\n * notify({\r\n * loadingMessage: 'Loading data...',\r\n * successMessage: 'Data loaded successfully!',\r\n * errorMessage: 'Failed to load data'\r\n * })\r\n * ).subscribe()\r\n * \r\n * // With custom durations\r\n * saveData().pipe(\r\n * notify({\r\n * loadingMessage: 'Saving...',\r\n * successMessage: 'Saved!',\r\n * successDuration: 5000, // Success stays for 5 seconds\r\n * errorMessage: (err) => `Save failed: ${err.message}`,\r\n * errorDuration: 0 // Error is persistent until dismissed\r\n * })\r\n * ).subscribe()\r\n * \r\n * // Full configuration example\r\n * uploadFile().pipe(\r\n * notify({\r\n * loadingMessage: 'Uploading file...',\r\n * loadingType: 'info',\r\n * successMessage: 'Upload complete!',\r\n * successType: 'success',\r\n * successDuration: 3000,\r\n * errorMessage: (err) => `Upload failed: ${err.message}`,\r\n * errorType: 'error',\r\n * errorDuration: 10000,\r\n * autoDismissLoading: true\r\n * })\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notify<T>(options: NotifyOptions) {\r\n\treturn (source: Observable<T>): Observable<T> => {\r\n\t\tlet loadingNotificationId: string | undefined\r\n\r\n\t\t// Show loading notification if message provided\r\n\t\tif (options.loadingMessage) {\r\n\t\t\tloadingNotificationId = $notify.show({\r\n\t\t\t\tmessage: options.loadingMessage,\r\n\t\t\t\ttype: options.loadingType || 'info',\r\n\t\t\t\tduration: 0, // Persistent until dismissed\r\n\t\t\t\tshowProgress: true, // Show indeterminate progress by default\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn source.pipe(\r\n\t\t\ttap((value) => {\r\n\t\t\t\t// Check if the emitted value contains progress information\r\n\t\t\t\t// Common patterns: { progress: number }, { loaded: number, total: number }, etc.\r\n\t\t\t\tif (loadingNotificationId && typeof value === 'object' && value !== null) {\r\n\t\t\t\t\tlet progress: number | undefined\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Check for different progress patterns\r\n\t\t\t\t\tif ('progress' in value && typeof (value as any).progress === 'number') {\r\n\t\t\t\t\t\tprogress = (value as any).progress\r\n\t\t\t\t\t} else if ('loaded' in value && 'total' in value) {\r\n\t\t\t\t\t\tconst loaded = (value as any).loaded\r\n\t\t\t\t\t\tconst total = (value as any).total\r\n\t\t\t\t\t\tif (typeof loaded === 'number' && typeof total === 'number' && total > 0) {\r\n\t\t\t\t\t\t\tprogress = (loaded / total) * 100\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update notification with progress if available\r\n\t\t\t\t\tif (progress !== undefined) {\r\n\t\t\t\t\t\t// We need to update the progress of the notification\r\n\t\t\t\t\t\t// For now, we'll update the message to show progress percentage\r\n\t\t\t\t\t\t$notify.update?.(loadingNotificationId, {\r\n\t\t\t\t\t\t\tmessage: `${options.loadingMessage} (${Math.round(progress)}%)`,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Check if this is the final success emission (not a progress update)\r\n\t\t\t\t// Typically file uploads emit progress events then a final result\r\n\t\t\t\tconst isProgressUpdate = typeof value === 'object' && value !== null && \r\n\t\t\t\t\t('progress' in value || ('loaded' in value && 'total' in value))\r\n\t\t\t\t\r\n\t\t\t\tif (!isProgressUpdate) {\r\n\t\t\t\t\t// On successful final emission, dismiss loading and show success\r\n\t\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (options.successMessage) {\r\n\t\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\t\tmessage: options.successMessage,\r\n\t\t\t\t\t\t\ttype: options.successType || 'success',\r\n\t\t\t\t\t\t\tduration: options.successDuration ?? 2000,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}),\r\n\t\t\tcatchError((error) => {\r\n\t\t\t\t// On error, dismiss loading and show error\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options.errorMessage) {\r\n\t\t\t\t\tconst message = typeof options.errorMessage === 'function' \r\n\t\t\t\t\t\t? options.errorMessage(error)\r\n\t\t\t\t\t\t: options.errorMessage\r\n\t\t\t\t\t\r\n\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\tmessage,\r\n\t\t\t\t\t\ttype: options.errorType || 'error',\r\n\t\t\t\t\t\tduration: options.errorDuration ?? 3000,\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Re-throw the error to maintain the error flow\r\n\t\t\t\tthrow error\r\n\t\t\t}),\r\n\t\t\tfinalize(() => {\r\n\t\t\t\t// Clean up any remaining loading notification\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n}\r\n\r\n/**\r\n * Simplified version for API calls that just need loading and auto-dismiss.\r\n * Perfect for fire-and-forget operations where you want to show progress.\r\n * \r\n * @example\r\n * ```typescript\r\n * downloadData().pipe(\r\n * notifyProgress('Downloading...')\r\n * ).subscribe()\r\n * \r\n * // With custom messages\r\n * saveDocument().pipe(\r\n * notifyProgress('Saving document...', 'Document saved!', 'Save failed')\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notifyProgress<T>(\r\n\tloadingMessage: string,\r\n\tsuccessMessage?: string,\r\n\terrorMessage?: string\r\n) {\r\n\treturn notify<T>({\r\n\t\tloadingMessage,\r\n\t\tsuccessMessage: successMessage || undefined,\r\n\t\terrorMessage: errorMessage || undefined,\r\n\t\tautoDismissLoading: true,\r\n\t})\r\n}"],"mappings":";;;;;;;;ICce,IAAA,cAAmC,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,CAAA,GAAA,KAAA,QAGb,IAAA,KAAA,UACE,IAAA,KAAA,OACe,QAAA,KAAA,WAAA,CACb,GAAA,KAAA,WACD,KAAA,KAAA,KACN,gBAAgB,KAAK,IAAA,EAAA,GAAS,KAAK,MAAsB,MAAhB,KAAK,OAAA,CAAA,KAAA,KAAA,YAAA,CACtC,GAAA,KAAA,eAAA,CACG,GAAA,KAAA,gBAE0B;GAAE,GAAG;GAAG,GAAG;EAAA,GAA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AAmB;GAAA,CAAA;EAAA,CAAA,GAKzC,GAAY,MAAA;GAOX,IALI,KAAA,CAAwD,MAA/B,EAAQ,uBACpC,EAAQ,QAAQ,CAAA,GAChB,IAAA,KAAwB,IAGrB,EAAQ,cAAc;IACzB,IAAM,IAA0C,OAAzB,EAAQ,gBAAiB,aAC7C,EAAQ,aAAa,CAAA,IACrB,EAAQ;IAEX,EAAQ,KAAK;KACZ,SAAA;KACA,MAAM,EAAQ,aAAa;KAC3B,UAAU,EAAQ,iBAAiB;IAAA,CAAA;GAErC;GAGA,MAAM;EAAA,CAAA,GAEP,QAAA;GAEK,KAAA,CAAwD,MAA/B,EAAQ,sBACpC,EAAQ,QAAQ,CAAA;EAAA,CAAA,CAAA;CAAA;AAKrB;AAkBA,SAAgB,EACf,GACA,GACA,GAAA;CAEA,OAAO,EAAU;EAChB,gBAAA;EACA,gBAAgB,KAAA,KAAkB;EAClC,cAAc,KAAA,KAAgB;EAC9B,oBAAA,CAAoB;CAAA,CAAA;AAEtB;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"notification-Ccktcj9H.js","names":[],"sources":["../src/notification/notification.scss?inline","../src/notification/notification.ts","../src/notification/notification-service.ts","../src/notification/notify.ts"],"sourcesContent":[":host {\n\tdisplay: block;\n}\n\n.notification {\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: stretch;\n\tmax-width: 360px;\n\toverflow: hidden;\n\n\t/* Asymmetric radius: 4px left, 14px right */\n\tborder-radius: 4px 14px 14px 4px;\n\toutline: 1px solid color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 50%, transparent);\n\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-container) 100%, transparent),\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-containerHigh) 100%, transparent)\n\t);\n\n\tcolor: var(--schmancy-sys-color-surface-on);\n\n\t/* Type-colored luminous glow — tightened */\n\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\tbox-shadow:\n\t\t0 6px 28px -10px color-mix(in srgb, var(--notification-glow-color) 22%, transparent),\n\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\n\ttransition:\n\t\tbox-shadow 300ms ease,\n\t\ttransform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\n\t&.info {\n\t\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-primary-default);\n\t}\n\t&.success {\n\t\t--notification-glow-color: var(--schmancy-sys-color-success-default);\n\t\t--notification-accent: var(--schmancy-sys-color-success-default);\n\t}\n\t&.warning {\n\t\t--notification-glow-color: var(--schmancy-sys-color-tertiary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-tertiary-default);\n\t}\n\t&.error {\n\t\t--notification-glow-color: var(--schmancy-sys-color-error-default);\n\t\t--notification-accent: var(--schmancy-sys-color-error-default);\n\t}\n\n\t&.hovered {\n\t\tbox-shadow:\n\t\t\t0 10px 36px -8px color-mix(in srgb, var(--notification-glow-color) 34%, transparent),\n\t\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\t\ttransform: translateY(-2px);\n\n\t\t.accent-rail {\n\t\t\twidth: 4px;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\ttransition: box-shadow 200ms ease;\n\n\t\t&.hovered {\n\t\t\ttransform: none;\n\t\t}\n\t}\n}\n\n/* Vertical accent rail — left edge */\n.accent-rail {\n\tflex-shrink: 0;\n\twidth: 3px;\n\tbackground: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tborder-radius: 4px 0 0 4px;\n\ttransition: width 200ms ease;\n\talign-self: stretch;\n}\n\n/* Card body */\n.content {\n\tflex: 1;\n\tmin-width: 0;\n\tpadding: 14px 36px 14px 18px;\n}\n\n/* Monospace uppercase type tag */\n.type-tag {\n\tdisplay: block;\n\tfont-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;\n\tfont-size: 10px;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\topacity: 0.7;\n\tcolor: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tmargin-bottom: 4px;\n\tline-height: 1;\n}\n\n/* Serif display title */\n.title {\n\tfont-family: ui-serif, Georgia, Cambria, 'Times New Roman', serif;\n\tfont-weight: 500;\n\tfont-size: 15px;\n\tline-height: 1.3;\n\tmargin-bottom: 3px;\n\tcolor: var(--schmancy-sys-color-surface-on);\n}\n\n/* Body message */\n.message {\n\tfont-family: ui-sans-serif, system-ui, -apple-system, sans-serif;\n\tfont-size: 13px;\n\tline-height: 1.45;\n\topacity: 0.72;\n}\n\n/* Close button — 28×28 hit target, × glyph */\n.close {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 6px;\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tfont-size: 18px;\n\tfont-weight: 400;\n\tcolor: var(--schmancy-sys-color-surface-onVariant);\n\tcursor: pointer;\n\tpadding: 0;\n\tline-height: 1;\n\topacity: 0.4;\n\tborder-radius: 50%;\n\ttransition: opacity 200ms ease;\n\n\t&:hover {\n\t\topacity: 0.85;\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\topacity: 1;\n\t\tbox-shadow: 0 0 0 2px var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\t}\n}\n\n/* Progress hairline — top edge */\n.progress {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: auto;\n\tleft: 0;\n\tright: 0;\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { html, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { BehaviorSubject, timer, interval, NEVER } from 'rxjs'\nimport { switchMap, takeUntil, map, tap, distinctUntilChanged } from 'rxjs/operators'\nimport '../progress/progress'\nimport style from './notification.scss?inline'\n\nexport type NotificationType = 'info' | 'success' | 'warning' | 'error'\n\n/**\n * @fires close - When notification is closed\n */\n@customElement('sch-notification')\nexport default class SchmancyNotification extends SchmancyElement {\n\tstatic styles = [unsafeCSS(style)]\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) message = ''\n\t@property({ type: String }) type: NotificationType = 'info'\n\t@property({ type: Boolean }) closable = true\n\t@property({ type: Number }) duration = 5000\n\t@property({ type: String }) id = `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\t@property({ type: Boolean }) playSound = true\n\t@property({ type: Boolean }) showProgress = false\n\t// startPosition retained for API compatibility — not used in entrance animation\n\t@property({ type: Object }) startPosition: { x: number; y: number } = { x: 0, y: 0 }\n\n\t@state() private _visible = true\n\t@state() private _progress = 100\n\t@state() private _hovered = false\n\t@state() private _closing = false\n\n\tprivate paused$ = new BehaviorSubject<boolean>(false)\n\tprivate startTime = 0\n\tprivate pausedAt = 0\n\tprivate elapsedBeforePause = 0\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\tthis.style.position = 'fixed'\n\t\tthis.style.top = '16px'\n\t\tthis.style.right = '16px'\n\t\tthis.style.zIndex = '10001'\n\t\tthis.style.opacity = '0'\n\n\t\tthis.updateComplete.then(() => {\n\t\t\tthis.animateIn()\n\t\t\treturn\n\t\t})\n\n\t\tif (this.duration > 0) {\n\t\t\tthis.setupAutoClose()\n\t\t\tthis.setupProgressUpdates()\n\t\t}\n\n\t\tif (this.playSound) {\n\t\t\tthis._playSound()\n\t\t}\n\t}\n\n\tprivate async animateIn() {\n\t\tconst reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\t\tawait this.animate(\n\t\t\treduced\n\t\t\t\t? [{ opacity: 0 }, { opacity: 1 }]\n\t\t\t\t: [\n\t\t\t\t\t\t{ transform: 'translateX(40px) scale(0.96)', opacity: 0 },\n\t\t\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t\t],\n\t\t\t{\n\t\t\t\tduration: reduced ? 200 : 360,\n\t\t\t\teasing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\t}\n\n\tprivate setupAutoClose() {\n\t\tif (this.duration <= 0) return\n\n\t\tthis.startTime = Date.now()\n\t\tthis.elapsedBeforePause = 0\n\n\t\tthis.paused$\n\t\t\t.pipe(\n\t\t\t\tswitchMap(paused => {\n\t\t\t\t\tif (paused) {\n\t\t\t\t\t\tthis.pausedAt = Date.now()\n\t\t\t\t\t\tthis.elapsedBeforePause += this.pausedAt - this.startTime\n\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.startTime = Date.now()\n\t\t\t\t\t\tconst remaining = this.duration - this.elapsedBeforePause\n\t\t\t\t\t\tif (remaining <= 0) {\n\t\t\t\t\t\t\tthis.close()\n\t\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn timer(remaining)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => this.close())\n\t}\n\n\tprivate setupProgressUpdates() {\n\t\tif (this.duration <= 0) return\n\n\t\tinterval(16)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(() =>\n\t\t\t\t\tthis.paused$.pipe(\n\t\t\t\t\t\tmap(paused => {\n\t\t\t\t\t\t\tif (paused) return this._progress\n\t\t\t\t\t\t\tconst elapsed = this.elapsedBeforePause + (Date.now() - this.startTime)\n\t\t\t\t\t\t\tconst remaining = Math.max(0, this.duration - elapsed)\n\t\t\t\t\t\t\treturn (remaining / this.duration) * 100\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(progress => {\n\t\t\t\t\tthis._progress = progress\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tprivate _playSound() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('playsound', {\n\t\t\t\tdetail: { type: this.type },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _handleMouseEnter() {\n\t\tthis._hovered = true\n\t\tthis.paused$.next(true)\n\t}\n\n\tprivate _handleMouseLeave() {\n\t\tthis._hovered = false\n\t\tthis.paused$.next(false)\n\t}\n\n\tpublic async close() {\n\t\tif (this._closing) return\n\t\tthis._closing = true\n\t\tthis._visible = false\n\n\t\tawait this.animate(\n\t\t\t[\n\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t{ transform: 'translateX(20px) scale(0.98)', opacity: 0 },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 180,\n\t\t\t\teasing: 'cubic-bezier(0.4, 0, 1, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tdetail: { id: this.id },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _getTypeLabel(): string {\n\t\tswitch (this.type) {\n\t\t\tcase 'success':\n\t\t\t\treturn 'SUCCESS'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'WARNING'\n\t\t\tcase 'error':\n\t\t\t\treturn 'ERROR'\n\t\t\tdefault:\n\t\t\t\treturn 'INFO'\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._visible && this._closing) return html``\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=\"notification ${this.type} ${this._closing ? 'closing' : ''} ${this._hovered ? 'hovered' : ''}\"\n\t\t\t\trole=\"alert\"\n\t\t\t\t@mouseenter=${this._handleMouseEnter}\n\t\t\t\t@mouseleave=${this._handleMouseLeave}\n\t\t\t>\n\t\t\t\t${this.showProgress || this.duration > 0\n\t\t\t\t\t? html`<schmancy-progress\n\t\t\t\t\t\t\tclass=\"progress\"\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t.value=${this._progress}\n\t\t\t\t\t\t\t?indeterminate=${this.showProgress && this.duration === 0}\n\t\t\t\t\t\t></schmancy-progress>`\n\t\t\t\t\t: ''}\n\t\t\t\t<div class=\"accent-rail\"></div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<span class=\"type-tag\">${this._getTypeLabel()}</span>\n\t\t\t\t\t${this.title ? html`<div class=\"title\">${this.title}</div>` : ''}\n\t\t\t\t\t<div class=\"message\">${this.message}</div>\n\t\t\t\t</div>\n\t\t\t\t${this.closable\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<button class=\"close\" aria-label=\"Close notification\" @click=${this.close}>×</button>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sch-notification': SchmancyNotification\n\t}\n}\n","import { fromEvent } from 'rxjs'\nimport { $sounds, type Feeling } from '../audio'\nimport SchmancyNotification, { NotificationType } from './notification'\n\nexport interface NotificationOptions {\n\tid?: string\n\ttitle?: string\n\tmessage: string\n\ttype?: NotificationType\n\tduration?: number\n\tclosable?: boolean\n\tplaySound?: boolean\n\tshowProgress?: boolean\n}\n\nconst typeToFeeling: Record<NotificationType, Feeling> = {\n\tinfo: 'curious',\n\tsuccess: 'content',\n\twarning: 'anxious',\n\terror: 'disappointed',\n}\n\nconst typeDurations: Record<NotificationType, number> = {\n\tsuccess: 1500,\n\tinfo: 2000,\n\twarning: 2500,\n\terror: 2500,\n}\n\n$sounds.setVolume(0.1)\n\n// Track last mouse position via RxJS\nlet lastClickPosition = { x: window.innerWidth - 100, y: 50 }\nif (typeof window !== 'undefined') {\n\tfromEvent<MouseEvent>(window, 'mousedown', { capture: true, passive: true } as AddEventListenerOptions).subscribe(\n\t\te => {\n\t\t\tlastClickPosition = { x: e.clientX, y: e.clientY }\n\t\t},\n\t)\n}\n\nlet currentNotification: SchmancyNotification | null = null\nconst notificationStack: string[] = []\n\nfunction show(options: NotificationOptions): string {\n\tconst id = options.id ?? `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\tnotificationStack.push(id)\n\n\tif (currentNotification) {\n\t\tcurrentNotification.remove()\n\t\tcurrentNotification = null\n\t}\n\n\tconst notification = document.createElement('sch-notification') as SchmancyNotification\n\tnotification.id = id\n\tnotification.title = options.title ?? ''\n\tnotification.message = options.message\n\tnotification.type = options.type ?? 'info'\n\tnotification.duration = options.duration ?? 1000\n\tnotification.closable = options.closable !== false\n\tnotification.playSound = false\n\tnotification.showProgress = options.showProgress ?? false\n\tnotification.startPosition = { ...lastClickPosition }\n\n\tif (options.playSound !== false) {\n\t\t$sounds.play(typeToFeeling[notification.type])\n\t}\n\n\tfromEvent(notification, 'close').subscribe(() => {\n\t\tconst index = notificationStack.indexOf(id)\n\t\tif (index > -1) notificationStack.splice(index, 1)\n\t\tnotification.remove()\n\t\tif (currentNotification === notification) currentNotification = null\n\t})\n\n\tdocument.body.appendChild(notification)\n\tcurrentNotification = notification\n\treturn id\n}\n\n/**\n * Global notification (toast) utility. Fire-and-forget API for success,\n * error, info, and warning toasts, plus a low-level `show` for custom\n * notifications.\n *\n * @service\n * @summary Toast notifications — success, error, info, warning.\n * @method show(options: NotificationOptions) - Low-level; show any NotificationOptions.\n * @method success(message, options?) - Green success toast.\n * @method error(message, options?) - Red error toast.\n * @method info(message, options?) - Blue informational toast.\n * @method warning(message, options?) - Amber warning toast.\n */\nexport const $notify = {\n\tshow,\n\n\tinfo: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'info',\n\t\t\tduration: message ? (options.duration ?? typeDurations.info) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tsuccess: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'success',\n\t\t\tduration: message ? (options.duration ?? typeDurations.success) : 1,\n\t\t\t...options,\n\t\t}),\n\n\twarning: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'warning',\n\t\t\tduration: message ? (options.duration ?? typeDurations.warning) : 1,\n\t\t\t...options,\n\t\t}),\n\n\terror: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'error',\n\t\t\tduration: message ? (options.duration ?? typeDurations.error) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tcustomDuration: (\n\t\tmessage: string,\n\t\tduration: number,\n\t\toptions: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {},\n\t): string => show({ message, duration, ...options }),\n\n\tpersistent: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {}): string =>\n\t\tshow({ message, duration: 0, ...options }),\n\n\tdismiss: (id?: string): void => {\n\t\tconst targetId = id ? (notificationStack.splice(notificationStack.indexOf(id), 1)[0]) : notificationStack.pop()\n\t\tif (targetId && currentNotification?.id === targetId) currentNotification.close()\n\t},\n\n\tupdate: (id: string, options: Partial<NotificationOptions>): void => {\n\t\tif (currentNotification?.id !== id) return\n\t\tif (options.title !== undefined) currentNotification.title = options.title\n\t\tif (options.message !== undefined) currentNotification.message = options.message\n\t\tif (options.type !== undefined) currentNotification.type = options.type\n\t},\n}\n\n","import { Observable, tap, finalize, catchError } from 'rxjs'\r\nimport { $notify, NotificationOptions } from './notification-service'\r\n\r\nexport interface NotifyOptions {\r\n\t/**\r\n\t * Message to show while the operation is in progress\r\n\t */\r\n\tloadingMessage?: string\r\n\t/**\r\n\t * Message to show when the operation completes successfully\r\n\t */\r\n\tsuccessMessage?: string\r\n\t/**\r\n\t * Message to show when the operation fails (can be a function to format error)\r\n\t */\r\n\terrorMessage?: string | ((error: any) => string)\r\n\t/**\r\n\t * Type of notification for loading state\r\n\t */\r\n\tloadingType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for success state\r\n\t */\r\n\tsuccessType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for error state\r\n\t */\r\n\terrorType?: NotificationOptions['type']\r\n\t/**\r\n\t * Whether to auto-dismiss the loading notification on complete/error\r\n\t */\r\n\tautoDismissLoading?: boolean\r\n\t/**\r\n\t * Duration for success notification (ms). Use 0 for persistent\r\n\t */\r\n\tsuccessDuration?: number\r\n\t/**\r\n\t * Duration for error notification (ms). Use 0 for persistent\r\n\t */\r\n\terrorDuration?: number\r\n}\r\n\r\n/**\r\n * Wraps an Observable with notification lifecycle management.\r\n * Shows a loading notification with progress indicator, then auto-dismisses and shows success/error notification.\r\n * \r\n * @example\r\n * ```typescript\r\n * // Basic usage with progress indicator\r\n * someApiCall().pipe(\r\n * notify({\r\n * loadingMessage: 'Loading data...',\r\n * successMessage: 'Data loaded successfully!',\r\n * errorMessage: 'Failed to load data'\r\n * })\r\n * ).subscribe()\r\n * \r\n * // With custom durations\r\n * saveData().pipe(\r\n * notify({\r\n * loadingMessage: 'Saving...',\r\n * successMessage: 'Saved!',\r\n * successDuration: 5000, // Success stays for 5 seconds\r\n * errorMessage: (err) => `Save failed: ${err.message}`,\r\n * errorDuration: 0 // Error is persistent until dismissed\r\n * })\r\n * ).subscribe()\r\n * \r\n * // Full configuration example\r\n * uploadFile().pipe(\r\n * notify({\r\n * loadingMessage: 'Uploading file...',\r\n * loadingType: 'info',\r\n * successMessage: 'Upload complete!',\r\n * successType: 'success',\r\n * successDuration: 3000,\r\n * errorMessage: (err) => `Upload failed: ${err.message}`,\r\n * errorType: 'error',\r\n * errorDuration: 10000,\r\n * autoDismissLoading: true\r\n * })\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notify<T>(options: NotifyOptions) {\r\n\treturn (source: Observable<T>): Observable<T> => {\r\n\t\tlet loadingNotificationId: string | undefined\r\n\r\n\t\t// Show loading notification if message provided\r\n\t\tif (options.loadingMessage) {\r\n\t\t\tloadingNotificationId = $notify.show({\r\n\t\t\t\tmessage: options.loadingMessage,\r\n\t\t\t\ttype: options.loadingType || 'info',\r\n\t\t\t\tduration: 0, // Persistent until dismissed\r\n\t\t\t\tshowProgress: true, // Show indeterminate progress by default\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn source.pipe(\r\n\t\t\ttap((value) => {\r\n\t\t\t\t// Check if the emitted value contains progress information\r\n\t\t\t\t// Common patterns: { progress: number }, { loaded: number, total: number }, etc.\r\n\t\t\t\tif (loadingNotificationId && typeof value === 'object' && value !== null) {\r\n\t\t\t\t\tlet progress: number | undefined\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Check for different progress patterns\r\n\t\t\t\t\tif ('progress' in value && typeof (value as any).progress === 'number') {\r\n\t\t\t\t\t\tprogress = (value as any).progress\r\n\t\t\t\t\t} else if ('loaded' in value && 'total' in value) {\r\n\t\t\t\t\t\tconst loaded = (value as any).loaded\r\n\t\t\t\t\t\tconst total = (value as any).total\r\n\t\t\t\t\t\tif (typeof loaded === 'number' && typeof total === 'number' && total > 0) {\r\n\t\t\t\t\t\t\tprogress = (loaded / total) * 100\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update notification with progress if available\r\n\t\t\t\t\tif (progress !== undefined) {\r\n\t\t\t\t\t\t// We need to update the progress of the notification\r\n\t\t\t\t\t\t// For now, we'll update the message to show progress percentage\r\n\t\t\t\t\t\t$notify.update?.(loadingNotificationId, {\r\n\t\t\t\t\t\t\tmessage: `${options.loadingMessage} (${Math.round(progress)}%)`,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Check if this is the final success emission (not a progress update)\r\n\t\t\t\t// Typically file uploads emit progress events then a final result\r\n\t\t\t\tconst isProgressUpdate = typeof value === 'object' && value !== null && \r\n\t\t\t\t\t('progress' in value || ('loaded' in value && 'total' in value))\r\n\t\t\t\t\r\n\t\t\t\tif (!isProgressUpdate) {\r\n\t\t\t\t\t// On successful final emission, dismiss loading and show success\r\n\t\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (options.successMessage) {\r\n\t\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\t\tmessage: options.successMessage,\r\n\t\t\t\t\t\t\ttype: options.successType || 'success',\r\n\t\t\t\t\t\t\tduration: options.successDuration ?? 2000,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}),\r\n\t\t\tcatchError((error) => {\r\n\t\t\t\t// On error, dismiss loading and show error\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options.errorMessage) {\r\n\t\t\t\t\tconst message = typeof options.errorMessage === 'function' \r\n\t\t\t\t\t\t? options.errorMessage(error)\r\n\t\t\t\t\t\t: options.errorMessage\r\n\t\t\t\t\t\r\n\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\tmessage,\r\n\t\t\t\t\t\ttype: options.errorType || 'error',\r\n\t\t\t\t\t\tduration: options.errorDuration ?? 3000,\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Re-throw the error to maintain the error flow\r\n\t\t\t\tthrow error\r\n\t\t\t}),\r\n\t\t\tfinalize(() => {\r\n\t\t\t\t// Clean up any remaining loading notification\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n}\r\n\r\n/**\r\n * Simplified version for API calls that just need loading and auto-dismiss.\r\n * Perfect for fire-and-forget operations where you want to show progress.\r\n * \r\n * @example\r\n * ```typescript\r\n * downloadData().pipe(\r\n * notifyProgress('Downloading...')\r\n * ).subscribe()\r\n * \r\n * // With custom messages\r\n * saveDocument().pipe(\r\n * notifyProgress('Saving document...', 'Document saved!', 'Save failed')\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notifyProgress<T>(\r\n\tloadingMessage: string,\r\n\tsuccessMessage?: string,\r\n\terrorMessage?: string\r\n) {\r\n\treturn notify<T>({\r\n\t\tloadingMessage,\r\n\t\tsuccessMessage: successMessage || undefined,\r\n\t\terrorMessage: errorMessage || undefined,\r\n\t\tautoDismissLoading: true,\r\n\t})\r\n}"],"mappings":";;;;;;;;ICce,IAAA,cAAmC,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,CAAA,GAAA,KAAA,QAGb,IAAA,KAAA,UACE,IAAA,KAAA,OACe,QAAA,KAAA,WAAA,CACb,GAAA,KAAA,WACD,KAAA,KAAA,KACN,gBAAgB,KAAK,IAAA,EAAA,GAAS,KAAK,MAAsB,MAAhB,KAAK,OAAA,CAAA,KAAA,KAAA,YAAA,CACtC,GAAA,KAAA,eAAA,CACG,GAAA,KAAA,gBAE0B;GAAE,GAAG;GAAG,GAAG;EAAA,GAAA,KAAA,WAAA,CAErD,GAAA,KAAA,YACC,KAAA,KAAA,WAAA,CACD,GAAA,KAAA,WAAA,CACA,GAAA,KAAA,UAEV,IAAI,EAAA,CAAyB,CAAA,GAAA,KAAA,YAC3B,GAAA,KAAA,WACD,GAAA,KAAA,qBACU;CAAA;CAAA;EAAA,KAAA,SArBb,CAAC,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,CAAA,IACrB,EAAQ;IAEX,EAAQ,KAAK;KACZ,SAAA;KACA,MAAM,EAAQ,aAAa;KAC3B,UAAU,EAAQ,iBAAiB;IAAA,CAAA;GAErC;GAGA,MAAM;EAAA,CAAA,GAEP,QAAA;GAEK,KAAA,CAAwD,MAA/B,EAAQ,sBACpC,EAAQ,QAAQ,CAAA;EAAA,CAAA,CAAA;CAAA;AAKrB;AAkBA,SAAgB,EACf,GACA,GACA,GAAA;CAEA,OAAO,EAAU;EAChB,gBAAA;EACA,gBAAgB,KAAA,KAAkB;EAClC,cAAc,KAAA,KAAgB;EAC9B,oBAAA,CAAoB;CAAA,CAAA;AAEtB;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-
|
|
1
|
+
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-BBzRWB1w.cjs`);require(`./mixins-DPdzC9ZH.cjs`);const t=require(`./audio-B_jT9Xr7.cjs`);require(`./progress-zs18GR6C.cjs`);let n=require(`rxjs`),r=require(`rxjs/operators`),i=require(`lit/decorators.js`),a=require(`lit`);var o=class extends e.t{constructor(...e){super(...e),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.showProgress=!1,this.startPosition={x:0,y:0},this._visible=!0,this._progress=100,this._hovered=!1,this._closing=!1,this.paused$=new n.BehaviorSubject(!1),this.startTime=0,this.pausedAt=0,this.elapsedBeforePause=0}static{this.styles=[(0,a.unsafeCSS)(`:host{display:block}.notification{outline:1px solid color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 50%, transparent);background:linear-gradient(180deg, color-mix(in srgb, var(--schmancy-sys-color-surface-container) 100%, transparent), color-mix(in srgb, var(--schmancy-sys-color-surface-containerHigh) 100%, transparent));max-width:360px;color:var(--schmancy-sys-color-surface-on);--notification-glow-color:var(--schmancy-sys-color-primary-default);box-shadow:0 6px 28px -10px color-mix(in srgb, var(--notification-glow-color) 22%, transparent), 0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);border-radius:4px 14px 14px 4px;align-items:stretch;transition:box-shadow .3s,transform .3s cubic-bezier(.34,1.56,.64,1);display:flex;position:relative;overflow:hidden}.notification.info{--notification-glow-color:var(--schmancy-sys-color-primary-default);--notification-accent:var(--schmancy-sys-color-primary-default)}.notification.success{--notification-glow-color:var(--schmancy-sys-color-success-default);--notification-accent:var(--schmancy-sys-color-success-default)}.notification.warning{--notification-glow-color:var(--schmancy-sys-color-tertiary-default);--notification-accent:var(--schmancy-sys-color-tertiary-default)}.notification.error{--notification-glow-color:var(--schmancy-sys-color-error-default);--notification-accent:var(--schmancy-sys-color-error-default)}.notification.hovered{box-shadow:0 10px 36px -8px color-mix(in srgb, var(--notification-glow-color) 34%, transparent), 0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);transform:translateY(-2px)}.notification.hovered .accent-rail{width:4px}@media (prefers-reduced-motion:reduce){.notification{transition:box-shadow .2s}.notification.hovered{transform:none}}.accent-rail{background:var(--notification-accent,var(--schmancy-sys-color-primary-default));border-radius:4px 0 0 4px;flex-shrink:0;align-self:stretch;width:3px;transition:width .2s}.content{flex:1;min-width:0;padding:14px 36px 14px 18px}.type-tag{letter-spacing:.14em;text-transform:uppercase;opacity:.7;color:var(--notification-accent,var(--schmancy-sys-color-primary-default));margin-bottom:4px;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,Consolas,monospace;font-size:10px;line-height:1;display:block}.title{color:var(--schmancy-sys-color-surface-on);margin-bottom:3px;font-family:ui-serif,Georgia,Cambria,Times New Roman,serif;font-size:15px;font-weight:500;line-height:1.3}.message{opacity:.72;font-family:ui-sans-serif,system-ui,-apple-system,sans-serif;font-size:13px;line-height:1.45}.close{width:28px;height:28px;color:var(--schmancy-sys-color-surface-onVariant);cursor:pointer;opacity:.4;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;font-size:18px;font-weight:400;line-height:1;transition:opacity .2s;display:flex;position:absolute;top:6px;right:6px}.close:hover{opacity:.85}.close:focus-visible{opacity:1;box-shadow:0 0 0 2px var(--notification-accent,var(--schmancy-sys-color-primary-default));outline:none}.progress{position:absolute;inset:0 0 auto}`)]}connectedCallback(){super.connectedCallback(),this.style.position=`fixed`,this.style.top=`16px`,this.style.right=`16px`,this.style.zIndex=`10001`,this.style.opacity=`0`,this.updateComplete.then(()=>{this.animateIn()}),this.duration>0&&(this.setupAutoClose(),this.setupProgressUpdates()),this.playSound&&this._playSound()}async animateIn(){let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;await this.animate(e?[{opacity:0},{opacity:1}]:[{transform:`translateX(40px) scale(0.96)`,opacity:0},{transform:`translateX(0) scale(1)`,opacity:1}],{duration:e?200:360,easing:`cubic-bezier(0.22, 1, 0.36, 1)`,fill:`forwards`}).finished}setupAutoClose(){this.duration<=0||(this.startTime=Date.now(),this.elapsedBeforePause=0,this.paused$.pipe((0,r.switchMap)(e=>{if(e)return this.pausedAt=Date.now(),this.elapsedBeforePause+=this.pausedAt-this.startTime,n.NEVER;{this.startTime=Date.now();let e=this.duration-this.elapsedBeforePause;return e<=0?(this.close(),n.NEVER):(0,n.timer)(e)}}),(0,r.takeUntil)(this.disconnecting)).subscribe(()=>this.close()))}setupProgressUpdates(){this.duration<=0||(0,n.interval)(16).pipe((0,r.switchMap)(()=>this.paused$.pipe((0,r.map)(e=>{if(e)return this._progress;let t=this.elapsedBeforePause+(Date.now()-this.startTime);return Math.max(0,this.duration-t)/this.duration*100}))),(0,r.distinctUntilChanged)(),(0,r.tap)(e=>{this._progress=e}),(0,r.takeUntil)(this.disconnecting)).subscribe()}_playSound(){this.dispatchEvent(new CustomEvent(`playsound`,{detail:{type:this.type},bubbles:!0,composed:!0}))}_handleMouseEnter(){this._hovered=!0,this.paused$.next(!0)}_handleMouseLeave(){this._hovered=!1,this.paused$.next(!1)}async close(){this._closing||(this._closing=!0,this._visible=!1,await this.animate([{transform:`translateX(0) scale(1)`,opacity:1},{transform:`translateX(20px) scale(0.98)`,opacity:0}],{duration:180,easing:`cubic-bezier(0.4, 0, 1, 1)`,fill:`forwards`}).finished,this.dispatchEvent(new CustomEvent(`close`,{detail:{id:this.id},bubbles:!0,composed:!0})))}_getTypeLabel(){switch(this.type){case`success`:return`SUCCESS`;case`warning`:return`WARNING`;case`error`:return`ERROR`;default:return`INFO`}}render(){return!this._visible&&this._closing?a.html``:a.html`
|
|
2
2
|
<div
|
|
3
3
|
class="notification ${this.type} ${this._closing?`closing`:``} ${this._hovered?`hovered`:``}"
|
|
4
4
|
role="alert"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-Bz00zdpV.cjs","names":[],"sources":["../src/notification/notification.scss?inline","../src/notification/notification.ts","../src/notification/notification-service.ts","../src/notification/notify.ts"],"sourcesContent":[":host {\n\tdisplay: block;\n}\n\n.notification {\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: stretch;\n\tmax-width: 360px;\n\toverflow: hidden;\n\n\t/* Asymmetric radius: 4px left, 14px right */\n\tborder-radius: 4px 14px 14px 4px;\n\toutline: 1px solid color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 50%, transparent);\n\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-container) 100%, transparent),\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-containerHigh) 100%, transparent)\n\t);\n\n\tcolor: var(--schmancy-sys-color-surface-on);\n\n\t/* Type-colored luminous glow — tightened */\n\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\tbox-shadow:\n\t\t0 6px 28px -10px color-mix(in srgb, var(--notification-glow-color) 22%, transparent),\n\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\n\ttransition:\n\t\tbox-shadow 300ms ease,\n\t\ttransform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\n\t&.info {\n\t\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-primary-default);\n\t}\n\t&.success {\n\t\t--notification-glow-color: var(--schmancy-sys-color-success-default);\n\t\t--notification-accent: var(--schmancy-sys-color-success-default);\n\t}\n\t&.warning {\n\t\t--notification-glow-color: var(--schmancy-sys-color-tertiary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-tertiary-default);\n\t}\n\t&.error {\n\t\t--notification-glow-color: var(--schmancy-sys-color-error-default);\n\t\t--notification-accent: var(--schmancy-sys-color-error-default);\n\t}\n\n\t&.hovered {\n\t\tbox-shadow:\n\t\t\t0 10px 36px -8px color-mix(in srgb, var(--notification-glow-color) 34%, transparent),\n\t\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\t\ttransform: translateY(-2px);\n\n\t\t.accent-rail {\n\t\t\twidth: 4px;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\ttransition: box-shadow 200ms ease;\n\n\t\t&.hovered {\n\t\t\ttransform: none;\n\t\t}\n\t}\n}\n\n/* Vertical accent rail — left edge */\n.accent-rail {\n\tflex-shrink: 0;\n\twidth: 3px;\n\tbackground: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tborder-radius: 4px 0 0 4px;\n\ttransition: width 200ms ease;\n\talign-self: stretch;\n}\n\n/* Card body */\n.content {\n\tflex: 1;\n\tmin-width: 0;\n\tpadding: 14px 36px 14px 18px;\n}\n\n/* Monospace uppercase type tag */\n.type-tag {\n\tdisplay: block;\n\tfont-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;\n\tfont-size: 10px;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\topacity: 0.7;\n\tcolor: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tmargin-bottom: 4px;\n\tline-height: 1;\n}\n\n/* Serif display title */\n.title {\n\tfont-family: ui-serif, Georgia, Cambria, 'Times New Roman', serif;\n\tfont-weight: 500;\n\tfont-size: 15px;\n\tline-height: 1.3;\n\tmargin-bottom: 3px;\n\tcolor: var(--schmancy-sys-color-surface-on);\n}\n\n/* Body message */\n.message {\n\tfont-family: ui-sans-serif, system-ui, -apple-system, sans-serif;\n\tfont-size: 13px;\n\tline-height: 1.45;\n\topacity: 0.72;\n}\n\n/* Close button — 28×28 hit target, × glyph */\n.close {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 6px;\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tfont-size: 18px;\n\tfont-weight: 400;\n\tcolor: var(--schmancy-sys-color-surface-onVariant);\n\tcursor: pointer;\n\tpadding: 0;\n\tline-height: 1;\n\topacity: 0.4;\n\tborder-radius: 50%;\n\ttransition: opacity 200ms ease;\n\n\t&:hover {\n\t\topacity: 0.85;\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\topacity: 1;\n\t\tbox-shadow: 0 0 0 2px var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\t}\n}\n\n/* Progress hairline — top edge */\n.progress {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: auto;\n\tleft: 0;\n\tright: 0;\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { html, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { BehaviorSubject, timer, interval, NEVER } from 'rxjs'\nimport { switchMap, takeUntil, map, tap, distinctUntilChanged } from 'rxjs/operators'\nimport '../progress/progress'\nimport style from './notification.scss?inline'\n\nexport type NotificationType = 'info' | 'success' | 'warning' | 'error'\n\n/**\n * @fires close - When notification is closed\n */\n@customElement('sch-notification')\nexport default class SchmancyNotification extends SchmancyElement {\n\tstatic styles = [unsafeCSS(style)]\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) message = ''\n\t@property({ type: String }) type: NotificationType = 'info'\n\t@property({ type: Boolean }) closable = true\n\t@property({ type: Number }) duration = 5000\n\t@property({ type: String }) id = `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\t@property({ type: Boolean }) playSound = true\n\t@property({ type: Boolean }) showProgress = false\n\t// startPosition retained for API compatibility — not used in entrance animation\n\t@property({ type: Object }) startPosition: { x: number; y: number } = { x: 0, y: 0 }\n\n\t@state() private _visible = true\n\t@state() private _progress = 100\n\t@state() private _hovered = false\n\t@state() private _closing = false\n\n\tprivate paused$ = new BehaviorSubject<boolean>(false)\n\tprivate startTime = 0\n\tprivate pausedAt = 0\n\tprivate elapsedBeforePause = 0\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\tthis.style.position = 'fixed'\n\t\tthis.style.top = '16px'\n\t\tthis.style.right = '16px'\n\t\tthis.style.zIndex = '10001'\n\t\tthis.style.opacity = '0'\n\n\t\tthis.updateComplete.then(() => {\n\t\t\tthis.animateIn()\n\t\t\treturn\n\t\t})\n\n\t\tif (this.duration > 0) {\n\t\t\tthis.setupAutoClose()\n\t\t\tthis.setupProgressUpdates()\n\t\t}\n\n\t\tif (this.playSound) {\n\t\t\tthis._playSound()\n\t\t}\n\t}\n\n\tprivate async animateIn() {\n\t\tconst reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\t\tawait this.animate(\n\t\t\treduced\n\t\t\t\t? [{ opacity: 0 }, { opacity: 1 }]\n\t\t\t\t: [\n\t\t\t\t\t\t{ transform: 'translateX(40px) scale(0.96)', opacity: 0 },\n\t\t\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t\t],\n\t\t\t{\n\t\t\t\tduration: reduced ? 200 : 360,\n\t\t\t\teasing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\t}\n\n\tprivate setupAutoClose() {\n\t\tif (this.duration <= 0) return\n\n\t\tthis.startTime = Date.now()\n\t\tthis.elapsedBeforePause = 0\n\n\t\tthis.paused$\n\t\t\t.pipe(\n\t\t\t\tswitchMap(paused => {\n\t\t\t\t\tif (paused) {\n\t\t\t\t\t\tthis.pausedAt = Date.now()\n\t\t\t\t\t\tthis.elapsedBeforePause += this.pausedAt - this.startTime\n\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.startTime = Date.now()\n\t\t\t\t\t\tconst remaining = this.duration - this.elapsedBeforePause\n\t\t\t\t\t\tif (remaining <= 0) {\n\t\t\t\t\t\t\tthis.close()\n\t\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn timer(remaining)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => this.close())\n\t}\n\n\tprivate setupProgressUpdates() {\n\t\tif (this.duration <= 0) return\n\n\t\tinterval(16)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(() =>\n\t\t\t\t\tthis.paused$.pipe(\n\t\t\t\t\t\tmap(paused => {\n\t\t\t\t\t\t\tif (paused) return this._progress\n\t\t\t\t\t\t\tconst elapsed = this.elapsedBeforePause + (Date.now() - this.startTime)\n\t\t\t\t\t\t\tconst remaining = Math.max(0, this.duration - elapsed)\n\t\t\t\t\t\t\treturn (remaining / this.duration) * 100\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(progress => {\n\t\t\t\t\tthis._progress = progress\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tprivate _playSound() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('playsound', {\n\t\t\t\tdetail: { type: this.type },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _handleMouseEnter() {\n\t\tthis._hovered = true\n\t\tthis.paused$.next(true)\n\t}\n\n\tprivate _handleMouseLeave() {\n\t\tthis._hovered = false\n\t\tthis.paused$.next(false)\n\t}\n\n\tpublic async close() {\n\t\tif (this._closing) return\n\t\tthis._closing = true\n\t\tthis._visible = false\n\n\t\tawait this.animate(\n\t\t\t[\n\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t{ transform: 'translateX(20px) scale(0.98)', opacity: 0 },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 180,\n\t\t\t\teasing: 'cubic-bezier(0.4, 0, 1, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tdetail: { id: this.id },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _getTypeLabel(): string {\n\t\tswitch (this.type) {\n\t\t\tcase 'success':\n\t\t\t\treturn 'SUCCESS'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'WARNING'\n\t\t\tcase 'error':\n\t\t\t\treturn 'ERROR'\n\t\t\tdefault:\n\t\t\t\treturn 'INFO'\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._visible && this._closing) return html``\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=\"notification ${this.type} ${this._closing ? 'closing' : ''} ${this._hovered ? 'hovered' : ''}\"\n\t\t\t\trole=\"alert\"\n\t\t\t\t@mouseenter=${this._handleMouseEnter}\n\t\t\t\t@mouseleave=${this._handleMouseLeave}\n\t\t\t>\n\t\t\t\t${this.showProgress || this.duration > 0\n\t\t\t\t\t? html`<schmancy-progress\n\t\t\t\t\t\t\tclass=\"progress\"\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t.value=${this._progress}\n\t\t\t\t\t\t\t?indeterminate=${this.showProgress && this.duration === 0}\n\t\t\t\t\t\t></schmancy-progress>`\n\t\t\t\t\t: ''}\n\t\t\t\t<div class=\"accent-rail\"></div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<span class=\"type-tag\">${this._getTypeLabel()}</span>\n\t\t\t\t\t${this.title ? html`<div class=\"title\">${this.title}</div>` : ''}\n\t\t\t\t\t<div class=\"message\">${this.message}</div>\n\t\t\t\t</div>\n\t\t\t\t${this.closable\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<button class=\"close\" aria-label=\"Close notification\" @click=${this.close}>×</button>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sch-notification': SchmancyNotification\n\t}\n}\n","import { fromEvent } from 'rxjs'\nimport { $sounds, type Feeling } from '../audio'\nimport SchmancyNotification, { NotificationType } from './notification'\n\nexport interface NotificationOptions {\n\tid?: string\n\ttitle?: string\n\tmessage: string\n\ttype?: NotificationType\n\tduration?: number\n\tclosable?: boolean\n\tplaySound?: boolean\n\tshowProgress?: boolean\n}\n\nconst typeToFeeling: Record<NotificationType, Feeling> = {\n\tinfo: 'curious',\n\tsuccess: 'content',\n\twarning: 'anxious',\n\terror: 'disappointed',\n}\n\nconst typeDurations: Record<NotificationType, number> = {\n\tsuccess: 1500,\n\tinfo: 2000,\n\twarning: 2500,\n\terror: 2500,\n}\n\n$sounds.setVolume(0.1)\n\n// Track last mouse position via RxJS\nlet lastClickPosition = { x: window.innerWidth - 100, y: 50 }\nif (typeof window !== 'undefined') {\n\tfromEvent<MouseEvent>(window, 'mousedown', { capture: true, passive: true } as AddEventListenerOptions).subscribe(\n\t\te => {\n\t\t\tlastClickPosition = { x: e.clientX, y: e.clientY }\n\t\t},\n\t)\n}\n\nlet currentNotification: SchmancyNotification | null = null\nconst notificationStack: string[] = []\n\nfunction show(options: NotificationOptions): string {\n\tconst id = options.id ?? `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\tnotificationStack.push(id)\n\n\tif (currentNotification) {\n\t\tcurrentNotification.remove()\n\t\tcurrentNotification = null\n\t}\n\n\tconst notification = document.createElement('sch-notification') as SchmancyNotification\n\tnotification.id = id\n\tnotification.title = options.title ?? ''\n\tnotification.message = options.message\n\tnotification.type = options.type ?? 'info'\n\tnotification.duration = options.duration ?? 1000\n\tnotification.closable = options.closable !== false\n\tnotification.playSound = false\n\tnotification.showProgress = options.showProgress ?? false\n\tnotification.startPosition = { ...lastClickPosition }\n\n\tif (options.playSound !== false) {\n\t\t$sounds.play(typeToFeeling[notification.type])\n\t}\n\n\tfromEvent(notification, 'close').subscribe(() => {\n\t\tconst index = notificationStack.indexOf(id)\n\t\tif (index > -1) notificationStack.splice(index, 1)\n\t\tnotification.remove()\n\t\tif (currentNotification === notification) currentNotification = null\n\t})\n\n\tdocument.body.appendChild(notification)\n\tcurrentNotification = notification\n\treturn id\n}\n\n/**\n * Global notification (toast) utility. Fire-and-forget API for success,\n * error, info, and warning toasts, plus a low-level `show` for custom\n * notifications.\n *\n * @service\n * @summary Toast notifications — success, error, info, warning.\n * @method show(options: NotificationOptions) - Low-level; show any NotificationOptions.\n * @method success(message, options?) - Green success toast.\n * @method error(message, options?) - Red error toast.\n * @method info(message, options?) - Blue informational toast.\n * @method warning(message, options?) - Amber warning toast.\n */\nexport const $notify = {\n\tshow,\n\n\tinfo: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'info',\n\t\t\tduration: message ? (options.duration ?? typeDurations.info) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tsuccess: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'success',\n\t\t\tduration: message ? (options.duration ?? typeDurations.success) : 1,\n\t\t\t...options,\n\t\t}),\n\n\twarning: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'warning',\n\t\t\tduration: message ? (options.duration ?? typeDurations.warning) : 1,\n\t\t\t...options,\n\t\t}),\n\n\terror: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'error',\n\t\t\tduration: message ? (options.duration ?? typeDurations.error) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tcustomDuration: (\n\t\tmessage: string,\n\t\tduration: number,\n\t\toptions: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {},\n\t): string => show({ message, duration, ...options }),\n\n\tpersistent: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {}): string =>\n\t\tshow({ message, duration: 0, ...options }),\n\n\tdismiss: (id?: string): void => {\n\t\tconst targetId = id ? (notificationStack.splice(notificationStack.indexOf(id), 1)[0]) : notificationStack.pop()\n\t\tif (targetId && currentNotification?.id === targetId) currentNotification.close()\n\t},\n\n\tupdate: (id: string, options: Partial<NotificationOptions>): void => {\n\t\tif (currentNotification?.id !== id) return\n\t\tif (options.title !== undefined) currentNotification.title = options.title\n\t\tif (options.message !== undefined) currentNotification.message = options.message\n\t\tif (options.type !== undefined) currentNotification.type = options.type\n\t},\n}\n\n","import { Observable, tap, finalize, catchError } from 'rxjs'\r\nimport { $notify, NotificationOptions } from './notification-service'\r\n\r\nexport interface NotifyOptions {\r\n\t/**\r\n\t * Message to show while the operation is in progress\r\n\t */\r\n\tloadingMessage?: string\r\n\t/**\r\n\t * Message to show when the operation completes successfully\r\n\t */\r\n\tsuccessMessage?: string\r\n\t/**\r\n\t * Message to show when the operation fails (can be a function to format error)\r\n\t */\r\n\terrorMessage?: string | ((error: any) => string)\r\n\t/**\r\n\t * Type of notification for loading state\r\n\t */\r\n\tloadingType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for success state\r\n\t */\r\n\tsuccessType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for error state\r\n\t */\r\n\terrorType?: NotificationOptions['type']\r\n\t/**\r\n\t * Whether to auto-dismiss the loading notification on complete/error\r\n\t */\r\n\tautoDismissLoading?: boolean\r\n\t/**\r\n\t * Duration for success notification (ms). Use 0 for persistent\r\n\t */\r\n\tsuccessDuration?: number\r\n\t/**\r\n\t * Duration for error notification (ms). Use 0 for persistent\r\n\t */\r\n\terrorDuration?: number\r\n}\r\n\r\n/**\r\n * Wraps an Observable with notification lifecycle management.\r\n * Shows a loading notification with progress indicator, then auto-dismisses and shows success/error notification.\r\n * \r\n * @example\r\n * ```typescript\r\n * // Basic usage with progress indicator\r\n * someApiCall().pipe(\r\n * notify({\r\n * loadingMessage: 'Loading data...',\r\n * successMessage: 'Data loaded successfully!',\r\n * errorMessage: 'Failed to load data'\r\n * })\r\n * ).subscribe()\r\n * \r\n * // With custom durations\r\n * saveData().pipe(\r\n * notify({\r\n * loadingMessage: 'Saving...',\r\n * successMessage: 'Saved!',\r\n * successDuration: 5000, // Success stays for 5 seconds\r\n * errorMessage: (err) => `Save failed: ${err.message}`,\r\n * errorDuration: 0 // Error is persistent until dismissed\r\n * })\r\n * ).subscribe()\r\n * \r\n * // Full configuration example\r\n * uploadFile().pipe(\r\n * notify({\r\n * loadingMessage: 'Uploading file...',\r\n * loadingType: 'info',\r\n * successMessage: 'Upload complete!',\r\n * successType: 'success',\r\n * successDuration: 3000,\r\n * errorMessage: (err) => `Upload failed: ${err.message}`,\r\n * errorType: 'error',\r\n * errorDuration: 10000,\r\n * autoDismissLoading: true\r\n * })\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notify<T>(options: NotifyOptions) {\r\n\treturn (source: Observable<T>): Observable<T> => {\r\n\t\tlet loadingNotificationId: string | undefined\r\n\r\n\t\t// Show loading notification if message provided\r\n\t\tif (options.loadingMessage) {\r\n\t\t\tloadingNotificationId = $notify.show({\r\n\t\t\t\tmessage: options.loadingMessage,\r\n\t\t\t\ttype: options.loadingType || 'info',\r\n\t\t\t\tduration: 0, // Persistent until dismissed\r\n\t\t\t\tshowProgress: true, // Show indeterminate progress by default\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn source.pipe(\r\n\t\t\ttap((value) => {\r\n\t\t\t\t// Check if the emitted value contains progress information\r\n\t\t\t\t// Common patterns: { progress: number }, { loaded: number, total: number }, etc.\r\n\t\t\t\tif (loadingNotificationId && typeof value === 'object' && value !== null) {\r\n\t\t\t\t\tlet progress: number | undefined\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Check for different progress patterns\r\n\t\t\t\t\tif ('progress' in value && typeof (value as any).progress === 'number') {\r\n\t\t\t\t\t\tprogress = (value as any).progress\r\n\t\t\t\t\t} else if ('loaded' in value && 'total' in value) {\r\n\t\t\t\t\t\tconst loaded = (value as any).loaded\r\n\t\t\t\t\t\tconst total = (value as any).total\r\n\t\t\t\t\t\tif (typeof loaded === 'number' && typeof total === 'number' && total > 0) {\r\n\t\t\t\t\t\t\tprogress = (loaded / total) * 100\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update notification with progress if available\r\n\t\t\t\t\tif (progress !== undefined) {\r\n\t\t\t\t\t\t// We need to update the progress of the notification\r\n\t\t\t\t\t\t// For now, we'll update the message to show progress percentage\r\n\t\t\t\t\t\t$notify.update?.(loadingNotificationId, {\r\n\t\t\t\t\t\t\tmessage: `${options.loadingMessage} (${Math.round(progress)}%)`,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Check if this is the final success emission (not a progress update)\r\n\t\t\t\t// Typically file uploads emit progress events then a final result\r\n\t\t\t\tconst isProgressUpdate = typeof value === 'object' && value !== null && \r\n\t\t\t\t\t('progress' in value || ('loaded' in value && 'total' in value))\r\n\t\t\t\t\r\n\t\t\t\tif (!isProgressUpdate) {\r\n\t\t\t\t\t// On successful final emission, dismiss loading and show success\r\n\t\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (options.successMessage) {\r\n\t\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\t\tmessage: options.successMessage,\r\n\t\t\t\t\t\t\ttype: options.successType || 'success',\r\n\t\t\t\t\t\t\tduration: options.successDuration ?? 2000,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}),\r\n\t\t\tcatchError((error) => {\r\n\t\t\t\t// On error, dismiss loading and show error\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options.errorMessage) {\r\n\t\t\t\t\tconst message = typeof options.errorMessage === 'function' \r\n\t\t\t\t\t\t? options.errorMessage(error)\r\n\t\t\t\t\t\t: options.errorMessage\r\n\t\t\t\t\t\r\n\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\tmessage,\r\n\t\t\t\t\t\ttype: options.errorType || 'error',\r\n\t\t\t\t\t\tduration: options.errorDuration ?? 3000,\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Re-throw the error to maintain the error flow\r\n\t\t\t\tthrow error\r\n\t\t\t}),\r\n\t\t\tfinalize(() => {\r\n\t\t\t\t// Clean up any remaining loading notification\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n}\r\n\r\n/**\r\n * Simplified version for API calls that just need loading and auto-dismiss.\r\n * Perfect for fire-and-forget operations where you want to show progress.\r\n * \r\n * @example\r\n * ```typescript\r\n * downloadData().pipe(\r\n * notifyProgress('Downloading...')\r\n * ).subscribe()\r\n * \r\n * // With custom messages\r\n * saveDocument().pipe(\r\n * notifyProgress('Saving document...', 'Document saved!', 'Save failed')\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notifyProgress<T>(\r\n\tloadingMessage: string,\r\n\tsuccessMessage?: string,\r\n\terrorMessage?: string\r\n) {\r\n\treturn notify<T>({\r\n\t\tloadingMessage,\r\n\t\tsuccessMessage: successMessage || undefined,\r\n\t\terrorMessage: errorMessage || undefined,\r\n\t\tautoDismissLoading: true,\r\n\t})\r\n}"],"mappings":"oSCce,EAAA,cAAmC,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,MAGb,GAAA,KAAA,QACE,GAAA,KAAA,KACe,OAAA,KAAA,SAAA,CACb,EAAA,KAAA,SACD,IAAA,KAAA,GACN,gBAAgB,KAAK,IAAA,EAAA,GAAS,KAAK,MAAsB,IAAhB,KAAK,OAAA,CAAA,IAAA,KAAA,UAAA,CACtC,EAAA,KAAA,aAAA,CACG,EAAA,KAAA,cAE0B,CAAE,EAAG,EAAG,EAAG,CAAA,EAAA,KAAA,SAAA,CAErD,EAAA,KAAA,UACC,IAAA,KAAA,SAAA,CACD,EAAA,KAAA,SAAA,CACA,EAAA,KAAA,QAEV,IAAI,EAAA,gBAAA,CAAyB,CAAA,EAAA,KAAA,UAC3B,EAAA,KAAA,SACD,EAAA,KAAA,mBACU,CAAA,CAAA,OAAA,KAAA,OArBb,EAAA,EAAA,EAAA,WAAA,qlGAAA,CAAA,CAAA,CAuBhB,mBAAA,CACC,MAAM,kBAAA,EAEN,KAAK,MAAM,SAAW,QACtB,KAAK,MAAM,IAAM,OACjB,KAAK,MAAM,MAAQ,OACnB,KAAK,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CACZ,QAAS,EAAQ,eACjB,KAAM,EAAQ,aAAe,UAC7B,SAAU,EAAQ,iBAAmB,GAAA,CAAA,EAAA,CAAA,GAIxC,EAAA,EAAA,YACW,GAAA,CAOX,GALI,GAAA,CAAwD,IAA/B,EAAQ,qBACpC,EAAQ,QAAQ,CAAA,EAChB,EAAA,IAAwB,IAGrB,EAAQ,aAAc,CACzB,IAAM,EAA0C,OAAzB,EAAQ,cAAiB,WAC7C,EAAQ,aAAa,CAAA,EACrB,EAAQ,aAEX,EAAQ,KAAK,CACZ,QAAA,EACA,KAAM,EAAQ,WAAa,QAC3B,SAAU,EAAQ,eAAiB,GAAA,CAAA,CAErC,CAGA,MAAM,CAAA,CAAA,GACN,EAAA,EAAA,cAAA,CAGI,GAAA,CAAwD,IAA/B,EAAQ,oBACpC,EAAQ,QAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAKrB,CAkBA,SAAgB,EACf,EACA,EACA,EAAA,CAEA,OAAO,EAAU,CAChB,eAAA,EACA,eAAgB,GAAA,IAAkB,GAClC,aAAc,GAAA,IAAgB,GAC9B,mBAAA,CAAoB,CAAA,CAAA,CAEtB,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"notification-DSkB-sn0.cjs","names":[],"sources":["../src/notification/notification.scss?inline","../src/notification/notification.ts","../src/notification/notification-service.ts","../src/notification/notify.ts"],"sourcesContent":[":host {\n\tdisplay: block;\n}\n\n.notification {\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: stretch;\n\tmax-width: 360px;\n\toverflow: hidden;\n\n\t/* Asymmetric radius: 4px left, 14px right */\n\tborder-radius: 4px 14px 14px 4px;\n\toutline: 1px solid color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 50%, transparent);\n\n\tbackground: linear-gradient(\n\t\t180deg,\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-container) 100%, transparent),\n\t\tcolor-mix(in srgb, var(--schmancy-sys-color-surface-containerHigh) 100%, transparent)\n\t);\n\n\tcolor: var(--schmancy-sys-color-surface-on);\n\n\t/* Type-colored luminous glow — tightened */\n\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\tbox-shadow:\n\t\t0 6px 28px -10px color-mix(in srgb, var(--notification-glow-color) 22%, transparent),\n\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\n\ttransition:\n\t\tbox-shadow 300ms ease,\n\t\ttransform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\n\t&.info {\n\t\t--notification-glow-color: var(--schmancy-sys-color-primary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-primary-default);\n\t}\n\t&.success {\n\t\t--notification-glow-color: var(--schmancy-sys-color-success-default);\n\t\t--notification-accent: var(--schmancy-sys-color-success-default);\n\t}\n\t&.warning {\n\t\t--notification-glow-color: var(--schmancy-sys-color-tertiary-default);\n\t\t--notification-accent: var(--schmancy-sys-color-tertiary-default);\n\t}\n\t&.error {\n\t\t--notification-glow-color: var(--schmancy-sys-color-error-default);\n\t\t--notification-accent: var(--schmancy-sys-color-error-default);\n\t}\n\n\t&.hovered {\n\t\tbox-shadow:\n\t\t\t0 10px 36px -8px color-mix(in srgb, var(--notification-glow-color) 34%, transparent),\n\t\t\t0 1px 0 0 color-mix(in srgb, var(--schmancy-sys-color-outline-variant) 30%, transparent);\n\t\ttransform: translateY(-2px);\n\n\t\t.accent-rail {\n\t\t\twidth: 4px;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\ttransition: box-shadow 200ms ease;\n\n\t\t&.hovered {\n\t\t\ttransform: none;\n\t\t}\n\t}\n}\n\n/* Vertical accent rail — left edge */\n.accent-rail {\n\tflex-shrink: 0;\n\twidth: 3px;\n\tbackground: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tborder-radius: 4px 0 0 4px;\n\ttransition: width 200ms ease;\n\talign-self: stretch;\n}\n\n/* Card body */\n.content {\n\tflex: 1;\n\tmin-width: 0;\n\tpadding: 14px 36px 14px 18px;\n}\n\n/* Monospace uppercase type tag */\n.type-tag {\n\tdisplay: block;\n\tfont-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;\n\tfont-size: 10px;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\topacity: 0.7;\n\tcolor: var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\tmargin-bottom: 4px;\n\tline-height: 1;\n}\n\n/* Serif display title */\n.title {\n\tfont-family: ui-serif, Georgia, Cambria, 'Times New Roman', serif;\n\tfont-weight: 500;\n\tfont-size: 15px;\n\tline-height: 1.3;\n\tmargin-bottom: 3px;\n\tcolor: var(--schmancy-sys-color-surface-on);\n}\n\n/* Body message */\n.message {\n\tfont-family: ui-sans-serif, system-ui, -apple-system, sans-serif;\n\tfont-size: 13px;\n\tline-height: 1.45;\n\topacity: 0.72;\n}\n\n/* Close button — 28×28 hit target, × glyph */\n.close {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 6px;\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tfont-size: 18px;\n\tfont-weight: 400;\n\tcolor: var(--schmancy-sys-color-surface-onVariant);\n\tcursor: pointer;\n\tpadding: 0;\n\tline-height: 1;\n\topacity: 0.4;\n\tborder-radius: 50%;\n\ttransition: opacity 200ms ease;\n\n\t&:hover {\n\t\topacity: 0.85;\n\t}\n\n\t&:focus-visible {\n\t\toutline: none;\n\t\topacity: 1;\n\t\tbox-shadow: 0 0 0 2px var(--notification-accent, var(--schmancy-sys-color-primary-default));\n\t}\n}\n\n/* Progress hairline — top edge */\n.progress {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: auto;\n\tleft: 0;\n\tright: 0;\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { html, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { BehaviorSubject, timer, interval, NEVER } from 'rxjs'\nimport { switchMap, takeUntil, map, tap, distinctUntilChanged } from 'rxjs/operators'\nimport '../progress/progress'\nimport style from './notification.scss?inline'\n\nexport type NotificationType = 'info' | 'success' | 'warning' | 'error'\n\n/**\n * @fires close - When notification is closed\n */\n@customElement('sch-notification')\nexport default class SchmancyNotification extends SchmancyElement {\n\tstatic styles = [unsafeCSS(style)]\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) message = ''\n\t@property({ type: String }) type: NotificationType = 'info'\n\t@property({ type: Boolean }) closable = true\n\t@property({ type: Number }) duration = 5000\n\t@property({ type: String }) id = `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\t@property({ type: Boolean }) playSound = true\n\t@property({ type: Boolean }) showProgress = false\n\t// startPosition retained for API compatibility — not used in entrance animation\n\t@property({ type: Object }) startPosition: { x: number; y: number } = { x: 0, y: 0 }\n\n\t@state() private _visible = true\n\t@state() private _progress = 100\n\t@state() private _hovered = false\n\t@state() private _closing = false\n\n\tprivate paused$ = new BehaviorSubject<boolean>(false)\n\tprivate startTime = 0\n\tprivate pausedAt = 0\n\tprivate elapsedBeforePause = 0\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\tthis.style.position = 'fixed'\n\t\tthis.style.top = '16px'\n\t\tthis.style.right = '16px'\n\t\tthis.style.zIndex = '10001'\n\t\tthis.style.opacity = '0'\n\n\t\tthis.updateComplete.then(() => {\n\t\t\tthis.animateIn()\n\t\t\treturn\n\t\t})\n\n\t\tif (this.duration > 0) {\n\t\t\tthis.setupAutoClose()\n\t\t\tthis.setupProgressUpdates()\n\t\t}\n\n\t\tif (this.playSound) {\n\t\t\tthis._playSound()\n\t\t}\n\t}\n\n\tprivate async animateIn() {\n\t\tconst reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\t\tawait this.animate(\n\t\t\treduced\n\t\t\t\t? [{ opacity: 0 }, { opacity: 1 }]\n\t\t\t\t: [\n\t\t\t\t\t\t{ transform: 'translateX(40px) scale(0.96)', opacity: 0 },\n\t\t\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t\t],\n\t\t\t{\n\t\t\t\tduration: reduced ? 200 : 360,\n\t\t\t\teasing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\t}\n\n\tprivate setupAutoClose() {\n\t\tif (this.duration <= 0) return\n\n\t\tthis.startTime = Date.now()\n\t\tthis.elapsedBeforePause = 0\n\n\t\tthis.paused$\n\t\t\t.pipe(\n\t\t\t\tswitchMap(paused => {\n\t\t\t\t\tif (paused) {\n\t\t\t\t\t\tthis.pausedAt = Date.now()\n\t\t\t\t\t\tthis.elapsedBeforePause += this.pausedAt - this.startTime\n\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.startTime = Date.now()\n\t\t\t\t\t\tconst remaining = this.duration - this.elapsedBeforePause\n\t\t\t\t\t\tif (remaining <= 0) {\n\t\t\t\t\t\t\tthis.close()\n\t\t\t\t\t\t\treturn NEVER\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn timer(remaining)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => this.close())\n\t}\n\n\tprivate setupProgressUpdates() {\n\t\tif (this.duration <= 0) return\n\n\t\tinterval(16)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(() =>\n\t\t\t\t\tthis.paused$.pipe(\n\t\t\t\t\t\tmap(paused => {\n\t\t\t\t\t\t\tif (paused) return this._progress\n\t\t\t\t\t\t\tconst elapsed = this.elapsedBeforePause + (Date.now() - this.startTime)\n\t\t\t\t\t\t\tconst remaining = Math.max(0, this.duration - elapsed)\n\t\t\t\t\t\t\treturn (remaining / this.duration) * 100\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap(progress => {\n\t\t\t\t\tthis._progress = progress\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tprivate _playSound() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('playsound', {\n\t\t\t\tdetail: { type: this.type },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _handleMouseEnter() {\n\t\tthis._hovered = true\n\t\tthis.paused$.next(true)\n\t}\n\n\tprivate _handleMouseLeave() {\n\t\tthis._hovered = false\n\t\tthis.paused$.next(false)\n\t}\n\n\tpublic async close() {\n\t\tif (this._closing) return\n\t\tthis._closing = true\n\t\tthis._visible = false\n\n\t\tawait this.animate(\n\t\t\t[\n\t\t\t\t{ transform: 'translateX(0) scale(1)', opacity: 1 },\n\t\t\t\t{ transform: 'translateX(20px) scale(0.98)', opacity: 0 },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 180,\n\t\t\t\teasing: 'cubic-bezier(0.4, 0, 1, 1)',\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t).finished\n\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tdetail: { id: this.id },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate _getTypeLabel(): string {\n\t\tswitch (this.type) {\n\t\t\tcase 'success':\n\t\t\t\treturn 'SUCCESS'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'WARNING'\n\t\t\tcase 'error':\n\t\t\t\treturn 'ERROR'\n\t\t\tdefault:\n\t\t\t\treturn 'INFO'\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._visible && this._closing) return html``\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=\"notification ${this.type} ${this._closing ? 'closing' : ''} ${this._hovered ? 'hovered' : ''}\"\n\t\t\t\trole=\"alert\"\n\t\t\t\t@mouseenter=${this._handleMouseEnter}\n\t\t\t\t@mouseleave=${this._handleMouseLeave}\n\t\t\t>\n\t\t\t\t${this.showProgress || this.duration > 0\n\t\t\t\t\t? html`<schmancy-progress\n\t\t\t\t\t\t\tclass=\"progress\"\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t.value=${this._progress}\n\t\t\t\t\t\t\t?indeterminate=${this.showProgress && this.duration === 0}\n\t\t\t\t\t\t></schmancy-progress>`\n\t\t\t\t\t: ''}\n\t\t\t\t<div class=\"accent-rail\"></div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<span class=\"type-tag\">${this._getTypeLabel()}</span>\n\t\t\t\t\t${this.title ? html`<div class=\"title\">${this.title}</div>` : ''}\n\t\t\t\t\t<div class=\"message\">${this.message}</div>\n\t\t\t\t</div>\n\t\t\t\t${this.closable\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<button class=\"close\" aria-label=\"Close notification\" @click=${this.close}>×</button>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sch-notification': SchmancyNotification\n\t}\n}\n","import { fromEvent } from 'rxjs'\nimport { $sounds, type Feeling } from '../audio'\nimport SchmancyNotification, { NotificationType } from './notification'\n\nexport interface NotificationOptions {\n\tid?: string\n\ttitle?: string\n\tmessage: string\n\ttype?: NotificationType\n\tduration?: number\n\tclosable?: boolean\n\tplaySound?: boolean\n\tshowProgress?: boolean\n}\n\nconst typeToFeeling: Record<NotificationType, Feeling> = {\n\tinfo: 'curious',\n\tsuccess: 'content',\n\twarning: 'anxious',\n\terror: 'disappointed',\n}\n\nconst typeDurations: Record<NotificationType, number> = {\n\tsuccess: 1500,\n\tinfo: 2000,\n\twarning: 2500,\n\terror: 2500,\n}\n\n$sounds.setVolume(0.1)\n\n// Track last mouse position via RxJS\nlet lastClickPosition = { x: window.innerWidth - 100, y: 50 }\nif (typeof window !== 'undefined') {\n\tfromEvent<MouseEvent>(window, 'mousedown', { capture: true, passive: true } as AddEventListenerOptions).subscribe(\n\t\te => {\n\t\t\tlastClickPosition = { x: e.clientX, y: e.clientY }\n\t\t},\n\t)\n}\n\nlet currentNotification: SchmancyNotification | null = null\nconst notificationStack: string[] = []\n\nfunction show(options: NotificationOptions): string {\n\tconst id = options.id ?? `notification-${Date.now()}-${Math.floor(Math.random() * 10000)}`\n\tnotificationStack.push(id)\n\n\tif (currentNotification) {\n\t\tcurrentNotification.remove()\n\t\tcurrentNotification = null\n\t}\n\n\tconst notification = document.createElement('sch-notification') as SchmancyNotification\n\tnotification.id = id\n\tnotification.title = options.title ?? ''\n\tnotification.message = options.message\n\tnotification.type = options.type ?? 'info'\n\tnotification.duration = options.duration ?? 1000\n\tnotification.closable = options.closable !== false\n\tnotification.playSound = false\n\tnotification.showProgress = options.showProgress ?? false\n\tnotification.startPosition = { ...lastClickPosition }\n\n\tif (options.playSound !== false) {\n\t\t$sounds.play(typeToFeeling[notification.type])\n\t}\n\n\tfromEvent(notification, 'close').subscribe(() => {\n\t\tconst index = notificationStack.indexOf(id)\n\t\tif (index > -1) notificationStack.splice(index, 1)\n\t\tnotification.remove()\n\t\tif (currentNotification === notification) currentNotification = null\n\t})\n\n\tdocument.body.appendChild(notification)\n\tcurrentNotification = notification\n\treturn id\n}\n\n/**\n * Global notification (toast) utility. Fire-and-forget API for success,\n * error, info, and warning toasts, plus a low-level `show` for custom\n * notifications.\n *\n * @service\n * @summary Toast notifications — success, error, info, warning.\n * @method show(options: NotificationOptions) - Low-level; show any NotificationOptions.\n * @method success(message, options?) - Green success toast.\n * @method error(message, options?) - Red error toast.\n * @method info(message, options?) - Blue informational toast.\n * @method warning(message, options?) - Amber warning toast.\n */\nexport const $notify = {\n\tshow,\n\n\tinfo: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'info',\n\t\t\tduration: message ? (options.duration ?? typeDurations.info) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tsuccess: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'success',\n\t\t\tduration: message ? (options.duration ?? typeDurations.success) : 1,\n\t\t\t...options,\n\t\t}),\n\n\twarning: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'warning',\n\t\t\tduration: message ? (options.duration ?? typeDurations.warning) : 1,\n\t\t\t...options,\n\t\t}),\n\n\terror: (message?: string, options: Partial<Omit<NotificationOptions, 'message' | 'type'>> = {}): string =>\n\t\tshow({\n\t\t\tmessage: message ?? '',\n\t\t\ttype: 'error',\n\t\t\tduration: message ? (options.duration ?? typeDurations.error) : 1,\n\t\t\t...options,\n\t\t}),\n\n\tcustomDuration: (\n\t\tmessage: string,\n\t\tduration: number,\n\t\toptions: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {},\n\t): string => show({ message, duration, ...options }),\n\n\tpersistent: (message: string, options: Partial<Omit<NotificationOptions, 'message' | 'duration'>> = {}): string =>\n\t\tshow({ message, duration: 0, ...options }),\n\n\tdismiss: (id?: string): void => {\n\t\tconst targetId = id ? (notificationStack.splice(notificationStack.indexOf(id), 1)[0]) : notificationStack.pop()\n\t\tif (targetId && currentNotification?.id === targetId) currentNotification.close()\n\t},\n\n\tupdate: (id: string, options: Partial<NotificationOptions>): void => {\n\t\tif (currentNotification?.id !== id) return\n\t\tif (options.title !== undefined) currentNotification.title = options.title\n\t\tif (options.message !== undefined) currentNotification.message = options.message\n\t\tif (options.type !== undefined) currentNotification.type = options.type\n\t},\n}\n\n","import { Observable, tap, finalize, catchError } from 'rxjs'\r\nimport { $notify, NotificationOptions } from './notification-service'\r\n\r\nexport interface NotifyOptions {\r\n\t/**\r\n\t * Message to show while the operation is in progress\r\n\t */\r\n\tloadingMessage?: string\r\n\t/**\r\n\t * Message to show when the operation completes successfully\r\n\t */\r\n\tsuccessMessage?: string\r\n\t/**\r\n\t * Message to show when the operation fails (can be a function to format error)\r\n\t */\r\n\terrorMessage?: string | ((error: any) => string)\r\n\t/**\r\n\t * Type of notification for loading state\r\n\t */\r\n\tloadingType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for success state\r\n\t */\r\n\tsuccessType?: NotificationOptions['type']\r\n\t/**\r\n\t * Type of notification for error state\r\n\t */\r\n\terrorType?: NotificationOptions['type']\r\n\t/**\r\n\t * Whether to auto-dismiss the loading notification on complete/error\r\n\t */\r\n\tautoDismissLoading?: boolean\r\n\t/**\r\n\t * Duration for success notification (ms). Use 0 for persistent\r\n\t */\r\n\tsuccessDuration?: number\r\n\t/**\r\n\t * Duration for error notification (ms). Use 0 for persistent\r\n\t */\r\n\terrorDuration?: number\r\n}\r\n\r\n/**\r\n * Wraps an Observable with notification lifecycle management.\r\n * Shows a loading notification with progress indicator, then auto-dismisses and shows success/error notification.\r\n * \r\n * @example\r\n * ```typescript\r\n * // Basic usage with progress indicator\r\n * someApiCall().pipe(\r\n * notify({\r\n * loadingMessage: 'Loading data...',\r\n * successMessage: 'Data loaded successfully!',\r\n * errorMessage: 'Failed to load data'\r\n * })\r\n * ).subscribe()\r\n * \r\n * // With custom durations\r\n * saveData().pipe(\r\n * notify({\r\n * loadingMessage: 'Saving...',\r\n * successMessage: 'Saved!',\r\n * successDuration: 5000, // Success stays for 5 seconds\r\n * errorMessage: (err) => `Save failed: ${err.message}`,\r\n * errorDuration: 0 // Error is persistent until dismissed\r\n * })\r\n * ).subscribe()\r\n * \r\n * // Full configuration example\r\n * uploadFile().pipe(\r\n * notify({\r\n * loadingMessage: 'Uploading file...',\r\n * loadingType: 'info',\r\n * successMessage: 'Upload complete!',\r\n * successType: 'success',\r\n * successDuration: 3000,\r\n * errorMessage: (err) => `Upload failed: ${err.message}`,\r\n * errorType: 'error',\r\n * errorDuration: 10000,\r\n * autoDismissLoading: true\r\n * })\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notify<T>(options: NotifyOptions) {\r\n\treturn (source: Observable<T>): Observable<T> => {\r\n\t\tlet loadingNotificationId: string | undefined\r\n\r\n\t\t// Show loading notification if message provided\r\n\t\tif (options.loadingMessage) {\r\n\t\t\tloadingNotificationId = $notify.show({\r\n\t\t\t\tmessage: options.loadingMessage,\r\n\t\t\t\ttype: options.loadingType || 'info',\r\n\t\t\t\tduration: 0, // Persistent until dismissed\r\n\t\t\t\tshowProgress: true, // Show indeterminate progress by default\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn source.pipe(\r\n\t\t\ttap((value) => {\r\n\t\t\t\t// Check if the emitted value contains progress information\r\n\t\t\t\t// Common patterns: { progress: number }, { loaded: number, total: number }, etc.\r\n\t\t\t\tif (loadingNotificationId && typeof value === 'object' && value !== null) {\r\n\t\t\t\t\tlet progress: number | undefined\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Check for different progress patterns\r\n\t\t\t\t\tif ('progress' in value && typeof (value as any).progress === 'number') {\r\n\t\t\t\t\t\tprogress = (value as any).progress\r\n\t\t\t\t\t} else if ('loaded' in value && 'total' in value) {\r\n\t\t\t\t\t\tconst loaded = (value as any).loaded\r\n\t\t\t\t\t\tconst total = (value as any).total\r\n\t\t\t\t\t\tif (typeof loaded === 'number' && typeof total === 'number' && total > 0) {\r\n\t\t\t\t\t\t\tprogress = (loaded / total) * 100\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Update notification with progress if available\r\n\t\t\t\t\tif (progress !== undefined) {\r\n\t\t\t\t\t\t// We need to update the progress of the notification\r\n\t\t\t\t\t\t// For now, we'll update the message to show progress percentage\r\n\t\t\t\t\t\t$notify.update?.(loadingNotificationId, {\r\n\t\t\t\t\t\t\tmessage: `${options.loadingMessage} (${Math.round(progress)}%)`,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Check if this is the final success emission (not a progress update)\r\n\t\t\t\t// Typically file uploads emit progress events then a final result\r\n\t\t\t\tconst isProgressUpdate = typeof value === 'object' && value !== null && \r\n\t\t\t\t\t('progress' in value || ('loaded' in value && 'total' in value))\r\n\t\t\t\t\r\n\t\t\t\tif (!isProgressUpdate) {\r\n\t\t\t\t\t// On successful final emission, dismiss loading and show success\r\n\t\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (options.successMessage) {\r\n\t\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\t\tmessage: options.successMessage,\r\n\t\t\t\t\t\t\ttype: options.successType || 'success',\r\n\t\t\t\t\t\t\tduration: options.successDuration ?? 2000,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}),\r\n\t\t\tcatchError((error) => {\r\n\t\t\t\t// On error, dismiss loading and show error\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t\tloadingNotificationId = undefined\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (options.errorMessage) {\r\n\t\t\t\t\tconst message = typeof options.errorMessage === 'function' \r\n\t\t\t\t\t\t? options.errorMessage(error)\r\n\t\t\t\t\t\t: options.errorMessage\r\n\t\t\t\t\t\r\n\t\t\t\t\t$notify.show({\r\n\t\t\t\t\t\tmessage,\r\n\t\t\t\t\t\ttype: options.errorType || 'error',\r\n\t\t\t\t\t\tduration: options.errorDuration ?? 3000,\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Re-throw the error to maintain the error flow\r\n\t\t\t\tthrow error\r\n\t\t\t}),\r\n\t\t\tfinalize(() => {\r\n\t\t\t\t// Clean up any remaining loading notification\r\n\t\t\t\tif (loadingNotificationId && options.autoDismissLoading !== false) {\r\n\t\t\t\t\t$notify.dismiss(loadingNotificationId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n}\r\n\r\n/**\r\n * Simplified version for API calls that just need loading and auto-dismiss.\r\n * Perfect for fire-and-forget operations where you want to show progress.\r\n * \r\n * @example\r\n * ```typescript\r\n * downloadData().pipe(\r\n * notifyProgress('Downloading...')\r\n * ).subscribe()\r\n * \r\n * // With custom messages\r\n * saveDocument().pipe(\r\n * notifyProgress('Saving document...', 'Document saved!', 'Save failed')\r\n * ).subscribe()\r\n * ```\r\n */\r\nexport function notifyProgress<T>(\r\n\tloadingMessage: string,\r\n\tsuccessMessage?: string,\r\n\terrorMessage?: string\r\n) {\r\n\treturn notify<T>({\r\n\t\tloadingMessage,\r\n\t\tsuccessMessage: successMessage || undefined,\r\n\t\terrorMessage: errorMessage || undefined,\r\n\t\tautoDismissLoading: true,\r\n\t})\r\n}"],"mappings":"oSCce,EAAA,cAAmC,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,MAGb,GAAA,KAAA,QACE,GAAA,KAAA,KACe,OAAA,KAAA,SAAA,CACb,EAAA,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AAc,GAAA,IAAgB,GAC9B,mBAAA,CAAoB,CAAA,CAAA,CAEtB,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
package/dist/notification.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./notification-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./notification-DSkB-sn0.cjs`);exports.$notify=e.r,exports.SchmancyNotification=e.i,exports.notify=e.t,exports.notifyProgress=e.n;
|
package/dist/notification.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./notification-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./notification-Ccktcj9H.js";
|
|
2
2
|
export { n as $notify, e as SchmancyNotification, r as notify, t as notifyProgress };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-
|
|
1
|
+
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-BBzRWB1w.cjs`);require(`./mixins-DPdzC9ZH.cjs`);let t=require(`rxjs`),n=require(`lit/decorators.js`),r=require(`lit`);var i=class extends e.t{constructor(...e){super(...e),this.value=``,this.label=``,this.selected=!1,this.disabled=!1,this.group=``,this.icon=``}static{this.styles=[r.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-
|
|
1
|
+
{"version":3,"file":"option-0aNiVB3Q.cjs","names":[],"sources":["../src/option/option.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n/**\n * `schmancy-option` is an option element for schmancy-select and schmancy-autocomplete components.\n *\n * @fires click - When the option is clicked\n */\n@customElement('schmancy-option')\nexport default class SchmancyOption extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: block;\n\t\tcursor: pointer;\n\t\tuser-select: none;\n\t\toutline: none;\n\t}\n\n\t:host(:focus-visible) {\n\t\toutline: 2px solid var(--schmancy-sys-color-primary-default);\n\t\toutline-offset: -2px;\n\t}\n\n\t:host([hidden]) {\n\t\tdisplay: none;\n\t}\n\n\t:host([disabled]) {\n\t\topacity: 0.5;\n\t\tpointer-events: none;\n\t}\n`];\n\t/**\n\t * The value of the option, will be used when selected.\n\t */\n\t@property({ type: String })\n\tvalue: string = ''\n\n\t/**\n\t * The human-readable label for the option.\n\t */\n\t@property({ type: String })\n\tlabel: string = ''\n\n\t/**\n\t * Whether the option is currently selected.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tselected: boolean = false\n\n\t/**\n\t * Whether the option is disabled.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tdisabled: boolean = false\n\n\t/**\n\t * Optional group this option belongs to (for option grouping).\n\t */\n\t@property({ type: String })\n\tgroup: string = ''\n\n\t/**\n\t * Optional icon or image to display before the label.\n\t */\n\t@property({ type: String })\n\ticon: string = ''\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Ensure the option has an ID for accessibility\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-option-${Math.random().toString(36).substring(2, 9)}`\n\t\t}\n\n\t\t// If no label was provided, use the text content or value\n\t\tif (!this.label) {\n\t\t\tthis.label = this.textContent?.trim() || this.value\n\t\t}\n\n\t\t// If value wasn't set but there's text content, use that as the value\n\t\tif (!this.value && this.textContent) {\n\t\t\tthis.value = this.textContent.trim()\n\t\t}\n\n\t\t// Make the option clickable\n\t\tfromEvent<MouseEvent>(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\tif (this.disabled) return\n\t\t\t\t// Dispatch a custom event with this option's value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('option-select', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tdetail: { value: this.value },\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\tfromEvent<KeyboardEvent>(this, 'keydown')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe((e) => {\n\t\t\t\t// Handle space and enter as clicks\n\t\t\t\tif (e.key === ' ' || e.key === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\tif (this.disabled) return\n\t\t\t\t\t// Dispatch a custom event with this option's value\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('option-select', {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: { value: this.value },\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tdisconnectedCallback() {\n\t\t// Event listeners are automatically cleaned up via takeUntil(this.disconnecting)\n\t\tsuper.disconnectedCallback()\n\t}\n\n\n\trender() {\n\t\tconst classes = {\n\t\t\t'py-2': true,\n\t\t\t'px-3': true,\n\t\t\trounded: true,\n\t\t\t'text-sm': true,\n\t\t\t'w-full': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t// Selected state\n\t\t\t'bg-primary-container': this.selected,\n\t\t\t'text-primary-onContainer': this.selected,\n\t\t\t// Hover state (when not selected)\n\t\t\t'hover:bg-surface-high': !this.selected,\n\t\t\t// Focus state\n\t\t\t'focus:outline-none': true,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${this.classMap(classes)} role=\"option\" aria-selected=${this.selected} aria-disabled=${this.disabled}>\n\t\t\t\t${this.icon ? html`<span class=\"icon\">${this.icon}</span>` : ''}\n\t\t\t\t<span class=\"flex-1\">${this.label || this.value}</span>\n\t\t\t\t${this.selected\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<span class=\"check\">\n\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<polyline points=\"20 6 9 17 4 12\"></polyline>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"mappings":"yLAWe,IAAA,EAAA,cAA6B,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,MA2B3B,GAAA,KAAA,MAMA,GAAA,KAAA,SAAA,CAMI,EAAA,KAAA,SAAA,CAMA,EAAA,KAAA,MAMJ,G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
|
2
|
+
import "./mixins-DTzfFVyv.js";
|
|
3
3
|
import { fromEvent as n, takeUntil as r } from "rxjs";
|
|
4
4
|
import { customElement as i, property as a } from "lit/decorators.js";
|
|
5
5
|
import { css as o, html as s } from "lit";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-
|
|
1
|
+
{"version":3,"file":"option-CkMxwBqU.js","names":[],"sources":["../src/option/option.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n/**\n * `schmancy-option` is an option element for schmancy-select and schmancy-autocomplete components.\n *\n * @fires click - When the option is clicked\n */\n@customElement('schmancy-option')\nexport default class SchmancyOption extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: block;\n\t\tcursor: pointer;\n\t\tuser-select: none;\n\t\toutline: none;\n\t}\n\n\t:host(:focus-visible) {\n\t\toutline: 2px solid var(--schmancy-sys-color-primary-default);\n\t\toutline-offset: -2px;\n\t}\n\n\t:host([hidden]) {\n\t\tdisplay: none;\n\t}\n\n\t:host([disabled]) {\n\t\topacity: 0.5;\n\t\tpointer-events: none;\n\t}\n`];\n\t/**\n\t * The value of the option, will be used when selected.\n\t */\n\t@property({ type: String })\n\tvalue: string = ''\n\n\t/**\n\t * The human-readable label for the option.\n\t */\n\t@property({ type: String })\n\tlabel: string = ''\n\n\t/**\n\t * Whether the option is currently selected.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tselected: boolean = false\n\n\t/**\n\t * Whether the option is disabled.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tdisabled: boolean = false\n\n\t/**\n\t * Optional group this option belongs to (for option grouping).\n\t */\n\t@property({ type: String })\n\tgroup: string = ''\n\n\t/**\n\t * Optional icon or image to display before the label.\n\t */\n\t@property({ type: String })\n\ticon: string = ''\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Ensure the option has an ID for accessibility\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-option-${Math.random().toString(36).substring(2, 9)}`\n\t\t}\n\n\t\t// If no label was provided, use the text content or value\n\t\tif (!this.label) {\n\t\t\tthis.label = this.textContent?.trim() || this.value\n\t\t}\n\n\t\t// If value wasn't set but there's text content, use that as the value\n\t\tif (!this.value && this.textContent) {\n\t\t\tthis.value = this.textContent.trim()\n\t\t}\n\n\t\t// Make the option clickable\n\t\tfromEvent<MouseEvent>(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\tif (this.disabled) return\n\t\t\t\t// Dispatch a custom event with this option's value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('option-select', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tdetail: { value: this.value },\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\tfromEvent<KeyboardEvent>(this, 'keydown')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe((e) => {\n\t\t\t\t// Handle space and enter as clicks\n\t\t\t\tif (e.key === ' ' || e.key === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\tif (this.disabled) return\n\t\t\t\t\t// Dispatch a custom event with this option's value\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('option-select', {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\tdetail: { value: this.value },\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tdisconnectedCallback() {\n\t\t// Event listeners are automatically cleaned up via takeUntil(this.disconnecting)\n\t\tsuper.disconnectedCallback()\n\t}\n\n\n\trender() {\n\t\tconst classes = {\n\t\t\t'py-2': true,\n\t\t\t'px-3': true,\n\t\t\trounded: true,\n\t\t\t'text-sm': true,\n\t\t\t'w-full': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t// Selected state\n\t\t\t'bg-primary-container': this.selected,\n\t\t\t'text-primary-onContainer': this.selected,\n\t\t\t// Hover state (when not selected)\n\t\t\t'hover:bg-surface-high': !this.selected,\n\t\t\t// Focus state\n\t\t\t'focus:outline-none': true,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${this.classMap(classes)} role=\"option\" aria-selected=${this.selected} aria-disabled=${this.disabled}>\n\t\t\t\t${this.icon ? html`<span class=\"icon\">${this.icon}</span>` : ''}\n\t\t\t\t<span class=\"flex-1\">${this.label || this.value}</span>\n\t\t\t\t${this.selected\n\t\t\t\t\t? html`\n\t\t\t\t\t\t\t<span class=\"check\">\n\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<polyline points=\"20 6 9 17 4 12\"></polyline>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t`\n\t\t\t\t\t: ''}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"mappings":";;;;;AAWe,IAAA,IAAA,cAA6B,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,CAA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
1
|
-
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-
|
|
1
|
+
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-BBzRWB1w.cjs`);require(`./mixins-DPdzC9ZH.cjs`);const t=require(`./animation-CCOIW4wJ.cjs`),n=require(`./reduced-motion-Ds-HjMzn.cjs`),r=require(`./layout-DF9ZaQ-b.cjs`),i=require(`./overlay.service-DEj3rfRr.cjs`);require(`./overlay.confirm-body-CR9xaqOE.cjs`);let a=require(`rxjs`),o=require(`lit/decorators.js`),s=require(`lit`),c=require(`lit/directives/when.js`),l=require(`@floating-ui/dom`);var u=n.t.value;n.t.subscribe(e=>{u=e});var d=`--schmancy-overlay-origin-x`,f=`--schmancy-overlay-origin-y`,p=`var(${d}, 50%) var(${f}, 50%)`;function m(e){return Number.isNaN(e)||!Number.isFinite(e)?50:Math.max(0,Math.min(100,e))}function h(e){let{surface:t,dragHandle:n,until$:r}=e;return new a.Observable(e=>{let i=n??t,o=new a.Subject,s=!1,c=null,l=0,u=0,d=0;return(0,a.merge)((0,a.fromEvent)(i,`pointerdown`).pipe((0,a.filter)(e=>e.isPrimary&&(e.pointerType!==`mouse`||e.button===0)),(0,a.filter)(e=>{if(n)return!0;let r=t.getBoundingClientRect();return e.clientY-r.top<=40}),(0,a.tap)(e=>{s=!0,c=e.pointerId,l=e.clientY,u=performance.now(),d=0,t.style.transition=`none`,t.style.willChange=`transform`;try{i.setPointerCapture?.(e.pointerId)}catch{}})),(0,a.fromEvent)(i,`pointermove`).pipe((0,a.filter)(()=>s),(0,a.filter)(e=>e.pointerId===c),(0,a.tap)(e=>{d=function(e){if(e>=0)return e;let t=-e;return-Math.max(0,8*(Math.log(t+1)-2))}(e.clientY-l),t.style.transform=`translateY(${d}px)`,e.cancelable&&e.preventDefault()})),(0,a.merge)((0,a.fromEvent)(i,`pointerup`),(0,a.fromEvent)(i,`pointercancel`),(0,a.fromEvent)(i,`lostpointercapture`)).pipe((0,a.filter)(()=>s),(0,a.filter)(e=>e.pointerId===c),(0,a.tap)(()=>{s=!1;let n=c;c=null;try{n!==null&&i.releasePointerCapture?.(n)}catch{}let r=Math.max(1,performance.now()-u),a=d/r,o=t.getBoundingClientRect().height,l=Math.min(80,.25*o),f=d>l||d>20&&a>.4;t.style.willChange=``,f?(t.style.transition=`transform 300ms cubic-bezier(0.16, 1, 0.3, 1)`,t.style.transform=`translateY(100%)`,e.next(`dismiss`),e.complete()):(t.style.transition=`transform 300ms cubic-bezier(0.16, 1, 0.3, 1)`,t.style.transform=`translateY(0)`)}))).pipe((0,a.takeUntil)((0,a.merge)(o,r))).subscribe(),()=>{o.next(),o.complete(),t.style.transition=``,t.style.transform=``,t.style.willChange=``}}).pipe((0,a.take)(1))}function g(e){return e.anchor===void 0?`sheet`:`anchored`}function _(e,t){return{x:e,y:t,width:0,height:0,left:e,right:e,top:t,bottom:t,toJSON:()=>({x:e,y:t,width:0,height:0,left:e,right:e,top:t,bottom:t})}}var v=Object.freeze({popover:typeof HTMLElement<`u`&&`popover`in HTMLElement.prototype&&typeof HTMLElement.prototype.showPopover==`function`,cssAnchor:typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --x`)});function y(e){if(!v.popover)throw Error(`positionPopoverAPI requires Popover API support`);e.setAttribute(`popover`,`manual`);try{e.showPopover()}catch{}return()=>{try{e.hidePopover?.()}catch{}e.removeAttribute(`popover`)}}function b(e,t,n={}){return new a.Observable(r=>{let i=t.el??t.virtual;if(!i)return void r.error(Error(`positionFloatingUI requires an element or virtual anchor`));let a=n.placement??`bottom-start`,o=n.padding??16,s=n.offsetPx??8,c=(0,l.autoUpdate)(i,e,async()=>{try{let{x:t,y:n}=await(0,l.computePosition)(i,e,{strategy:`fixed`,placement:a,middleware:[(0,l.offset)(s),(0,l.flip)({padding:o,fallbackPlacements:x(a)}),(0,l.shift)({padding:o}),(0,l.size)({padding:o,apply({availableWidth:e,availableHeight:t,elements:n}){n.floating.style.maxWidth=`${Math.max(0,e)}px`,n.floating.style.maxHeight=`${Math.max(0,t)}px`}})]});Object.assign(e.style,{position:`fixed`,left:`${Math.round(t)}px`,top:`${Math.round(n)}px`,transform:`none`}),r.next()}catch(e){r.error(e)}},{ancestorScroll:!0,ancestorResize:!0,elementResize:!1!==n.track});return()=>{c()}})}function x(e){switch(e){case`bottom-start`:return[`top-start`,`bottom-end`,`top-end`];case`bottom-end`:return[`top-end`,`bottom-start`,`top-start`];case`top-start`:return[`bottom-start`,`top-end`,`bottom-end`];case`top-end`:return[`bottom-end`,`top-start`,`bottom-start`];case`left-start`:return[`right-start`,`left-end`,`right-end`];case`left-end`:return[`right-end`,`left-start`,`right-start`];case`right-start`:return[`left-start`,`right-end`,`left-end`];case`right-end`:return[`left-end`,`right-start`,`left-start`];case`top`:return[`bottom`,`left`,`right`];case`bottom`:return[`top`,`left`,`right`];case`left`:return[`right`,`top`,`bottom`];case`right`:return[`left`,`top`,`bottom`];default:return[`top-start`,`bottom-end`]}}var S=`overlay-mount`,C=class extends e.t{constructor(...e){super(...e),this.layout=`sheet`,this.dismissable=!0,this.modal=!0,this.tier=`modal`,this._active=!1,this._full=!1,this._closed$=new a.Subject,this._mounted=!1,this._closing=!1,this._lastFocusedElement=null,this._inertedSiblings=[],this._lastReResolveAt=0,this.onBackdropClick=()=>{this.dismissable&&this.close(`backdrop`)}}static{this.styles=[s.css`
|
|
2
2
|
:host {
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
@@ -40,11 +40,11 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-CYIif26I.cjs`
|
|
|
40
40
|
background: transparent;
|
|
41
41
|
overflow: visible;
|
|
42
42
|
}
|
|
43
|
-
`]}get closed$(){return this._closed$.asObservable()}async open(e,t){if(this._mounted)throw Error(`schmancy-overlay: open() called twice on the same element`);this._mounted=!0,this.dismissable=!1!==t.dismissable,this._rawAnchor=t.anchor,this._anchorOriginAnchor=t.anchor,this._resolvedAnchor=function(e){if(!e)return;if(typeof HTMLElement<`u`&&e instanceof HTMLElement)return{el:e};if(typeof e.getBoundingClientRect==`function`)return{virtual:{getBoundingClientRect:()=>e.getBoundingClientRect()}};if(typeof e.width==`number`&&typeof e.height==`number`&&typeof e.left==`number`&&typeof e.top==`number`){let t=e;return{virtual:{getBoundingClientRect:()=>t}}}if(typeof e.clientX==`number`&&typeof e.clientY==`number`){let t=e,n=_(t.clientX,t.clientY);return{virtual:{getBoundingClientRect:()=>n}}}if(e.touches!==void 0&&e.touches.length>0){let t=e.touches[0],n=_(t.clientX,t.clientY);return{virtual:{getBoundingClientRect:()=>n}}}let t=e,n=_(t.x,t.y);return{virtual:{getBoundingClientRect:()=>n}}}(t.anchor),this._active=!0,this.setAttribute(`active`,``),await this.updateComplete;let n=this.renderRoot.querySelector(`#${S}`);if(!n)throw Error(`schmancy-overlay: mount point missing`);var r;if(await w(e,n,t.props),this.layout=t.as??g({anchor:t.anchor}),this.modal=this.layout===`sheet`,this.tier=this.modal?`modal`:this._resolvedAnchor?(r=this._resolvedAnchor,v.popover&&v.cssAnchor&&r.el?`css-anchor`:v.popover?`popover-fui`:`fui-only`):`modal`,await this.updateComplete,this.tier===`css-anchor`&&this._resolvedAnchor?.el&&this.shadowRoot){this._positionerTeardown=function(e,t,n,r={id:``}){if(!t.el)throw Error(`positionCSSAnchor requires an element anchor`);let i=t.el,a=`--ov-${r.id||Math.random().toString(36).slice(2,10)}`,o=r.placement??`bottom-start`,s=i.style.getPropertyValue(`anchor-name`);i.style.setProperty(`anchor-name`,a);let c=new CSSStyleSheet;return c.replaceSync(`\n\t\t${e.localName}[data-overlay-ref="${r.id}"] {\n\t\t\tposition-anchor: ${a};\n\t\t\t${function(e){switch(e){case`top`:case`top-start`:return`bottom: anchor(top); left: anchor(start);`;case`top-end`:return`bottom: anchor(top); right: anchor(end);`;case`bottom`:case`bottom-start`:return`top: anchor(bottom); left: anchor(start);`;case`bottom-end`:return`top: anchor(bottom); right: anchor(end);`;case`left`:case`left-start`:return`right: anchor(left); top: anchor(start);`;case`left-end`:return`right: anchor(left); bottom: anchor(end);`;case`right`:case`right-start`:return`left: anchor(right); top: anchor(start);`;case`right-end`:return`left: anchor(right); bottom: anchor(end);`}}(o)}\n\t\t\tmargin: 8px;\n\t\t\tposition-try-fallbacks:\n\t\t\t\tflip-block,\n\t\t\t\tflip-inline,\n\t\t\t\tflip-block flip-inline;\n\t\t}\n\t`),e.dataset.overlayRef=r.id,n.adoptedStyleSheets=[...n.adoptedStyleSheets,c],()=>{s?i.style.setProperty(`anchor-name`,s):i.style.removeProperty(`anchor-name`),n.adoptedStyleSheets=n.adoptedStyleSheets.filter(e=>e!==c),delete e.dataset.overlayRef}}(this._surface,this._resolvedAnchor,this.shadowRoot,{id:`ov-${Math.random().toString(36).slice(2,10)}`,placement:t.preferredPlacement??`bottom-start`});let e=y(this._surface),n=this._positionerTeardown;this._positionerTeardown=()=>{e(),n?.()}}else if(this.tier===`popover-fui`&&this._resolvedAnchor){let e=y(this._surface),n=b(this._surface,this._resolvedAnchor,{placement:t.preferredPlacement??`bottom-start`,offsetPx:8,track:!1!==t.track}).pipe((0,a.takeUntil)(this.disconnecting)).subscribe();this._positionerTeardown=()=>{e(),n.unsubscribe()}}else if(this.tier===`fui-only`&&this._resolvedAnchor){let e=b(this._surface,this._resolvedAnchor,{placement:t.preferredPlacement??`bottom-start`,offsetPx:8,track:!1!==t.track}).pipe((0,a.takeUntil)(this.disconnecting)).subscribe();this._positionerTeardown=()=>e.unsubscribe()}else if(this.tier===`modal`&&this._shell)try{this._positionerTeardown=y(this._shell)}catch{}this.setAnchorOriginVars(),this.wireFocusTrap(),this.wireCloseTriggers(t.signal),this.wireResizeObserver(n),await this.playAnimations(`in`)}async close(e,t){if(!this._closing&&this._mounted){this._closing=!0;try{await this.playAnimations(`out`)}catch{}if(this.releaseFocusTrap(),this._positionerTeardown){try{this._positionerTeardown()}catch{}this._positionerTeardown=void 0}this._active=!1,this.removeAttribute(`active`),this._closed$.next({reason:e,result:t}),this._closed$.complete()}}render(){if(!this._active)return s.html``;let e=this.layout===`sheet
|
|
43
|
+
`]}get closed$(){return this._closed$.asObservable()}async open(e,t){if(this._mounted)throw Error(`schmancy-overlay: open() called twice on the same element`);this._mounted=!0,this.dismissable=!1!==t.dismissable,this._full=t.full??!1,this._rawAnchor=t.anchor,this._anchorOriginAnchor=t.anchor,this._resolvedAnchor=function(e){if(!e)return;if(typeof HTMLElement<`u`&&e instanceof HTMLElement)return{el:e};if(typeof e.getBoundingClientRect==`function`)return{virtual:{getBoundingClientRect:()=>e.getBoundingClientRect()}};if(typeof e.width==`number`&&typeof e.height==`number`&&typeof e.left==`number`&&typeof e.top==`number`){let t=e;return{virtual:{getBoundingClientRect:()=>t}}}if(typeof e.clientX==`number`&&typeof e.clientY==`number`){let t=e,n=_(t.clientX,t.clientY);return{virtual:{getBoundingClientRect:()=>n}}}if(e.touches!==void 0&&e.touches.length>0){let t=e.touches[0],n=_(t.clientX,t.clientY);return{virtual:{getBoundingClientRect:()=>n}}}let t=e,n=_(t.x,t.y);return{virtual:{getBoundingClientRect:()=>n}}}(t.anchor),this._active=!0,this.setAttribute(`active`,``),await this.updateComplete;let n=this.renderRoot.querySelector(`#${S}`);if(!n)throw Error(`schmancy-overlay: mount point missing`);var r;if(await w(e,n,t.props),this.layout=t.as??g({anchor:t.anchor}),this.modal=this.layout===`sheet`,this.tier=this.modal?`modal`:this._resolvedAnchor?(r=this._resolvedAnchor,v.popover&&v.cssAnchor&&r.el?`css-anchor`:v.popover?`popover-fui`:`fui-only`):`modal`,await this.updateComplete,this.tier===`css-anchor`&&this._resolvedAnchor?.el&&this.shadowRoot){this._positionerTeardown=function(e,t,n,r={id:``}){if(!t.el)throw Error(`positionCSSAnchor requires an element anchor`);let i=t.el,a=`--ov-${r.id||Math.random().toString(36).slice(2,10)}`,o=r.placement??`bottom-start`,s=i.style.getPropertyValue(`anchor-name`);i.style.setProperty(`anchor-name`,a);let c=new CSSStyleSheet;return c.replaceSync(`\n\t\t${e.localName}[data-overlay-ref="${r.id}"] {\n\t\t\tposition-anchor: ${a};\n\t\t\t${function(e){switch(e){case`top`:case`top-start`:return`bottom: anchor(top); left: anchor(start);`;case`top-end`:return`bottom: anchor(top); right: anchor(end);`;case`bottom`:case`bottom-start`:return`top: anchor(bottom); left: anchor(start);`;case`bottom-end`:return`top: anchor(bottom); right: anchor(end);`;case`left`:case`left-start`:return`right: anchor(left); top: anchor(start);`;case`left-end`:return`right: anchor(left); bottom: anchor(end);`;case`right`:case`right-start`:return`left: anchor(right); top: anchor(start);`;case`right-end`:return`left: anchor(right); bottom: anchor(end);`}}(o)}\n\t\t\tmargin: 8px;\n\t\t\tposition-try-fallbacks:\n\t\t\t\tflip-block,\n\t\t\t\tflip-inline,\n\t\t\t\tflip-block flip-inline;\n\t\t}\n\t`),e.dataset.overlayRef=r.id,n.adoptedStyleSheets=[...n.adoptedStyleSheets,c],()=>{s?i.style.setProperty(`anchor-name`,s):i.style.removeProperty(`anchor-name`),n.adoptedStyleSheets=n.adoptedStyleSheets.filter(e=>e!==c),delete e.dataset.overlayRef}}(this._surface,this._resolvedAnchor,this.shadowRoot,{id:`ov-${Math.random().toString(36).slice(2,10)}`,placement:t.preferredPlacement??`bottom-start`});let e=y(this._surface),n=this._positionerTeardown;this._positionerTeardown=()=>{e(),n?.()}}else if(this.tier===`popover-fui`&&this._resolvedAnchor){let e=y(this._surface),n=b(this._surface,this._resolvedAnchor,{placement:t.preferredPlacement??`bottom-start`,offsetPx:8,track:!1!==t.track}).pipe((0,a.takeUntil)(this.disconnecting)).subscribe();this._positionerTeardown=()=>{e(),n.unsubscribe()}}else if(this.tier===`fui-only`&&this._resolvedAnchor){let e=b(this._surface,this._resolvedAnchor,{placement:t.preferredPlacement??`bottom-start`,offsetPx:8,track:!1!==t.track}).pipe((0,a.takeUntil)(this.disconnecting)).subscribe();this._positionerTeardown=()=>e.unsubscribe()}else if(this.tier===`modal`&&this._shell)try{this._positionerTeardown=y(this._shell)}catch{}this.setAnchorOriginVars(),this.wireFocusTrap(),this.wireCloseTriggers(t.signal),this.wireResizeObserver(n),await this.playAnimations(`in`)}async close(e,t){if(!this._closing&&this._mounted){this._closing=!0;try{await this.playAnimations(`out`)}catch{}if(this.releaseFocusTrap(),this._positionerTeardown){try{this._positionerTeardown()}catch{}this._positionerTeardown=void 0}this._active=!1,this.removeAttribute(`active`),this._closed$.next({reason:e,result:t}),this._closed$.complete()}}render(){if(!this._active)return s.html``;let e=this.layout===`sheet`?this._full?`left-0 right-0 bottom-0 w-full h-[90dvh] rounded-t-[28px] shadow-overlay flex flex-col overflow-hidden`:`left-0 right-0 bottom-0 w-full max-h-[90dvh] rounded-t-[28px] shadow-overlay overflow-auto`:`max-w-[min(480px,calc(100vw-2rem))] max-h-[90dvh] rounded-3xl shadow-overlay-anchored overflow-auto`;return s.html`
|
|
44
44
|
<div class="shell fixed inset-0 pointer-events-none" part="shell">
|
|
45
45
|
${(0,c.when)(this.modal,()=>s.html`<div class="backdrop fixed inset-0 pointer-events-auto" part="backdrop" @click=${this.onBackdropClick}></div>`)}
|
|
46
46
|
<section
|
|
47
|
-
class="${`surface fixed pointer-events-auto
|
|
47
|
+
class="${`surface fixed pointer-events-auto bg-surface-container/85 text-surface-on backdrop-blur-md border border-surface-on/8`} ${e}"
|
|
48
48
|
part="surface"
|
|
49
49
|
data-layout=${this.layout}
|
|
50
50
|
data-tier=${this.tier}
|
|
@@ -52,7 +52,7 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-CYIif26I.cjs`
|
|
|
52
52
|
aria-modal=${this.modal?`true`:`false`}
|
|
53
53
|
tabindex="-1"
|
|
54
54
|
>
|
|
55
|
-
<div id=${S}></div>
|
|
55
|
+
<div id=${S} class=${this.layout===`sheet`&&this._full?`flex-1 min-h-0 overflow-hidden`:``}></div>
|
|
56
56
|
</section>
|
|
57
57
|
</div>
|
|
58
|
-
`}setAnchorOriginVars(){let e=this._surface;if(!e)return;let t=e.getBoundingClientRect(),n=this.layout!==`sheet`||this._anchorOriginAnchor?function(e,t){if(!e)return{[d]:`50%`,[f]:`50%`};let{x:n,y:r}=function(e){if(typeof e.getBoundingClientRect==`function`){let t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}if(typeof e.width==`number`&&typeof e.height==`number`&&typeof e.left==`number`&&typeof e.top==`number`){let t=e;return{x:t.left+t.width/2,y:t.top+t.height/2}}if(typeof e.clientX==`number`&&typeof e.clientY==`number`){let t=e;return{x:t.clientX,y:t.clientY}}if(e.touches!==void 0&&e.touches.length>0){let t=e.touches[0];return{x:t.clientX,y:t.clientY}}let t=e;return{x:t.x,y:t.y}}(e);if(!t.width||!t.height)return{[d]:`50%`,[f]:`50%`};let i=m((n-t.left)/t.width*100),a=m((r-t.top)/t.height*100);return{[d]:`${i}%`,[f]:`${a}%`}}(this._anchorOriginAnchor,t):{"--schmancy-overlay-origin-x":`50%`,"--schmancy-overlay-origin-y":`100%`};for(let[t,r]of Object.entries(n))e.style.setProperty(t,r)}wireFocusTrap(){if(!this.modal)return;this._lastFocusedElement=document.activeElement??null;let e=this.parentElement;if(e){this._inertedSiblings=[];for(let t of Array.from(e.children))t!==this&&t instanceof HTMLElement&&!t.inert&&(t.inert=!0,this._inertedSiblings.push(t))}queueMicrotask(()=>{(this._surface?.querySelector(`[autofocus]`)??this._surface)?.focus()})}releaseFocusTrap(){for(let e of this._inertedSiblings)e.inert=!1;this._inertedSiblings=[];try{this._lastFocusedElement?.focus?.()}catch{}this._lastFocusedElement=null}wireCloseTriggers(e){let t=this.disconnecting;if(e?.aborted)return void queueMicrotask(()=>{this.close(`abort`)});let n=(0,a.fromEvent)(this,`close`).pipe((0,a.filter)(e=>e instanceof CustomEvent),(0,a.tap)(e=>e.stopPropagation()),(0,a.map)(e=>({reason:`structured`,result:e.detail}))),r=(0,a.fromEvent)(this,`submit`).pipe((0,a.filter)(e=>{let t=e.target;return!!t&&t.method===`dialog`}),(0,a.tap)(e=>e.preventDefault()),(0,a.map)(e=>({reason:`native-submit`,result:e.submitter?.value??``}))),o=(0,a.fromEvent)(document,`keydown`).pipe((0,a.filter)(e=>e.key===`Escape`),(0,a.tap)(e=>e.preventDefault()),(0,a.filter)(()=>this.dismissable),(0,a.map)(()=>({reason:`escape`})),(0,a.take)(1)),s=this.tier===`modal`?null:(0,a.fromEvent)(document,`pointerdown`,{capture:!0}).pipe((0,a.filter)(e=>{if(!this.dismissable)return!1;let t=e.composedPath();if(this._surface&&t.includes(this._surface)||this._resolvedAnchor?.el&&t.includes(this._resolvedAnchor.el))return!1;let n=i.s(),r=n.findIndex(e=>e.element===this);if(r!==-1)for(let e=r+1;e<n.length;e++){if(t.includes(n[e].element))return!1;let r=n[e].element.shadowRoot?.querySelector(`.surface`);if(r&&t.includes(r))return!1}return!0}),(0,a.map)(()=>({reason:`backdrop`})),(0,a.take)(1)),c=this.layout===`sheet`&&this.dismissable?h({surface:this._surface,until$:(0,a.merge)(t,this._closed$)}).pipe((0,a.take)(1),(0,a.map)(()=>({reason:`swipe`}))):null,l=e?(0,a.fromEvent)(e,`abort`).pipe((0,a.take)(1),(0,a.map)(()=>({reason:`abort`}))):null;(0,a.merge)(n,r,o,s??a.EMPTY,c??a.EMPTY,l??a.EMPTY).pipe((0,a.takeUntil)(t)).subscribe(({reason:e,result:t})=>{this.close(e,t)})}wireResizeObserver(e){r.t(e).pipe((0,a.map)(e=>{let t=e[0];if(!t)return null;let n=t.contentRect;return{w:n.width,h:n.height}}),(0,a.filter)(e=>e!==null),(0,a.distinctUntilChanged)((e,t)=>e.w===t.w&&e.h===t.h),(0,a.debounceTime)(80),(0,a.takeUntil)((0,a.merge)(this.disconnecting,this._closed$))).subscribe(e=>this.maybeReResolve(e))}async maybeReResolve(e){if(this._closing)return;let n=g({anchor:this._rawAnchor});if(n===this.layout||performance.now()-this._lastReResolveAt<600||(r=this.layout,i=n,r!==`anchored`||i!==`sheet`))return;var r,i;let a=this._surface,o=a.getBoundingClientRect();this.layout=n,await this.updateComplete;let s=function(e,n){return u?{keyframes:[{transform:`none`},{transform:`none`}],options:{duration:1,easing:`linear`,fill:`forwards`}}:{keyframes:[{transform:`translate(${e.left-n.left}px, ${e.top-n.top}px) scale(${n.width>0?e.width/n.width:1}, ${n.height>0?e.height/n.height:1})`,transformOrigin:`top left`},{transform:`none`,transformOrigin:`top left`}],options:{duration:t.d.duration,easing:t._(t.d),fill:`forwards`}}}(o,a.getBoundingClientRect());try{await a.animate(s.keyframes,s.options).finished}catch{}this._lastReResolveAt=performance.now()}async playAnimations(e){let n=this._surface;if(!n)return;let r=function(e,n){if(u)return n===`in`?{keyframes:[{opacity:0,transform:`none`},{opacity:1,transform:`none`}],options:{duration:1,easing:`linear`,fill:`forwards`}}:{keyframes:[{opacity:1,transform:`none`},{opacity:0,transform:`none`}],options:{duration:1,easing:`linear`,fill:`forwards`}};switch(e){case`sheet`:return n===`in`?{keyframes:[{opacity:0,transform:`translateY(100%)`},{opacity:1,transform:`translateY(0)`}],options:{duration:t.
|
|
58
|
+
`}setAnchorOriginVars(){let e=this._surface;if(!e)return;let t=e.getBoundingClientRect(),n=this.layout!==`sheet`||this._anchorOriginAnchor?function(e,t){if(!e)return{[d]:`50%`,[f]:`50%`};let{x:n,y:r}=function(e){if(typeof e.getBoundingClientRect==`function`){let t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}if(typeof e.width==`number`&&typeof e.height==`number`&&typeof e.left==`number`&&typeof e.top==`number`){let t=e;return{x:t.left+t.width/2,y:t.top+t.height/2}}if(typeof e.clientX==`number`&&typeof e.clientY==`number`){let t=e;return{x:t.clientX,y:t.clientY}}if(e.touches!==void 0&&e.touches.length>0){let t=e.touches[0];return{x:t.clientX,y:t.clientY}}let t=e;return{x:t.x,y:t.y}}(e);if(!t.width||!t.height)return{[d]:`50%`,[f]:`50%`};let i=m((n-t.left)/t.width*100),a=m((r-t.top)/t.height*100);return{[d]:`${i}%`,[f]:`${a}%`}}(this._anchorOriginAnchor,t):{"--schmancy-overlay-origin-x":`50%`,"--schmancy-overlay-origin-y":`100%`};for(let[t,r]of Object.entries(n))e.style.setProperty(t,r)}wireFocusTrap(){if(!this.modal)return;this._lastFocusedElement=document.activeElement??null;let e=this.parentElement;if(e){this._inertedSiblings=[];for(let t of Array.from(e.children))t!==this&&t instanceof HTMLElement&&!t.inert&&(t.inert=!0,this._inertedSiblings.push(t))}queueMicrotask(()=>{(this._surface?.querySelector(`[autofocus]`)??this._surface)?.focus()})}releaseFocusTrap(){for(let e of this._inertedSiblings)e.inert=!1;this._inertedSiblings=[];try{this._lastFocusedElement?.focus?.()}catch{}this._lastFocusedElement=null}wireCloseTriggers(e){let t=this.disconnecting;if(e?.aborted)return void queueMicrotask(()=>{this.close(`abort`)});let n=(0,a.fromEvent)(this,`close`).pipe((0,a.filter)(e=>e instanceof CustomEvent),(0,a.tap)(e=>e.stopPropagation()),(0,a.map)(e=>({reason:`structured`,result:e.detail}))),r=(0,a.fromEvent)(this,`submit`).pipe((0,a.filter)(e=>{let t=e.target;return!!t&&t.method===`dialog`}),(0,a.tap)(e=>e.preventDefault()),(0,a.map)(e=>({reason:`native-submit`,result:e.submitter?.value??``}))),o=(0,a.fromEvent)(document,`keydown`).pipe((0,a.filter)(e=>e.key===`Escape`),(0,a.tap)(e=>e.preventDefault()),(0,a.filter)(()=>this.dismissable),(0,a.map)(()=>({reason:`escape`})),(0,a.take)(1)),s=this.tier===`modal`?null:(0,a.fromEvent)(document,`pointerdown`,{capture:!0}).pipe((0,a.filter)(e=>{if(!this.dismissable)return!1;let t=e.composedPath();if(this._surface&&t.includes(this._surface)||this._resolvedAnchor?.el&&t.includes(this._resolvedAnchor.el))return!1;let n=i.s(),r=n.findIndex(e=>e.element===this);if(r!==-1)for(let e=r+1;e<n.length;e++){if(t.includes(n[e].element))return!1;let r=n[e].element.shadowRoot?.querySelector(`.surface`);if(r&&t.includes(r))return!1}return!0}),(0,a.map)(()=>({reason:`backdrop`})),(0,a.take)(1)),c=this.layout===`sheet`&&this.dismissable?h({surface:this._surface,until$:(0,a.merge)(t,this._closed$)}).pipe((0,a.take)(1),(0,a.map)(()=>({reason:`swipe`}))):null,l=e?(0,a.fromEvent)(e,`abort`).pipe((0,a.take)(1),(0,a.map)(()=>({reason:`abort`}))):null;(0,a.merge)(n,r,o,s??a.EMPTY,c??a.EMPTY,l??a.EMPTY).pipe((0,a.takeUntil)(t)).subscribe(({reason:e,result:t})=>{this.close(e,t)})}wireResizeObserver(e){r.t(e).pipe((0,a.map)(e=>{let t=e[0];if(!t)return null;let n=t.contentRect;return{w:n.width,h:n.height}}),(0,a.filter)(e=>e!==null),(0,a.distinctUntilChanged)((e,t)=>e.w===t.w&&e.h===t.h),(0,a.debounceTime)(80),(0,a.takeUntil)((0,a.merge)(this.disconnecting,this._closed$))).subscribe(e=>this.maybeReResolve(e))}async maybeReResolve(e){if(this._closing)return;let n=g({anchor:this._rawAnchor});if(n===this.layout||performance.now()-this._lastReResolveAt<600||(r=this.layout,i=n,r!==`anchored`||i!==`sheet`))return;var r,i;let a=this._surface,o=a.getBoundingClientRect();this.layout=n,await this.updateComplete;let s=function(e,n){return u?{keyframes:[{transform:`none`},{transform:`none`}],options:{duration:1,easing:`linear`,fill:`forwards`}}:{keyframes:[{transform:`translate(${e.left-n.left}px, ${e.top-n.top}px) scale(${n.width>0?e.width/n.width:1}, ${n.height>0?e.height/n.height:1})`,transformOrigin:`top left`},{transform:`none`,transformOrigin:`top left`}],options:{duration:t.d.duration,easing:t._(t.d),fill:`forwards`}}}(o,a.getBoundingClientRect());try{await a.animate(s.keyframes,s.options).finished}catch{}this._lastReResolveAt=performance.now()}async playAnimations(e){let n=this._surface;if(!n)return;let r=function(e,n){if(u)return n===`in`?{keyframes:[{opacity:0,transform:`none`},{opacity:1,transform:`none`}],options:{duration:1,easing:`linear`,fill:`forwards`}}:{keyframes:[{opacity:1,transform:`none`},{opacity:0,transform:`none`}],options:{duration:1,easing:`linear`,fill:`forwards`}};switch(e){case`sheet`:return n===`in`?{keyframes:[{opacity:0,transform:`translateY(100%)`},{opacity:1,transform:`translateY(0)`}],options:{duration:t.f.duration,easing:t._(t.f),fill:`forwards`}}:{keyframes:[{opacity:1,transform:`translateY(0)`},{opacity:0,transform:`translateY(100%)`}],options:{duration:150,easing:t._(t.d),fill:`forwards`}};case`anchored`:return n===`in`?{keyframes:[{opacity:0,transform:`scale(0.85)`,transformOrigin:p},{opacity:1,transform:`scale(1)`,transformOrigin:p}],options:{duration:t.f.duration,easing:t._(t.f),fill:`forwards`}}:{keyframes:[{opacity:1,transform:`scale(1)`,transformOrigin:p},{opacity:0,transform:`scale(0.92)`,transformOrigin:p}],options:{duration:150,easing:t._(t.d),fill:`forwards`}}}}(this.layout,e),i=[n.animate(r.keyframes,r.options).finished.catch(()=>{})],a=this._backdrop;this.modal&&a&&i.push(a.animate(e===`in`?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],{duration:r.options.duration,easing:e===`in`?`ease-out`:`ease-in`,fill:`forwards`}).finished.catch(()=>{})),await Promise.all(i)}};async function w(e,t,n){if(typeof(r=e)==`function`&&!r.prototype)return w(e(),t,n);var r;if(function(e){return typeof e==`object`&&!!e&&`_$litType$`in e}(e))return(0,s.render)(e,t),t;if(e instanceof HTMLElement)return n&&Object.assign(e,n),t.appendChild(e),e;if(function(e){return typeof e==`function`&&(`preload`in e||`_promise`in e)}(e))return w((await e()).default,t,n);if(typeof e==`function`){let r=new e;return n&&Object.assign(r,n),t.appendChild(r),r}if(typeof e==`string`){let r=document.createElement(e);return n&&Object.assign(r,n),t.appendChild(r),r}throw Error(`schmancy-overlay: unsupported content type`)}e.u([(0,o.property)({type:String,reflect:!0})],C.prototype,`layout`,void 0),e.u([(0,o.property)({type:Boolean,reflect:!0})],C.prototype,`dismissable`,void 0),e.u([(0,o.property)({type:Boolean,reflect:!0})],C.prototype,`modal`,void 0),e.u([(0,o.property)({type:String,reflect:!0})],C.prototype,`tier`,void 0),e.u([(0,o.state)()],C.prototype,`_active`,void 0),e.u([(0,o.state)()],C.prototype,`_full`,void 0),e.u([(0,o.query)(`.backdrop`)],C.prototype,`_backdrop`,void 0),e.u([(0,o.query)(`.surface`)],C.prototype,`_surface`,void 0),e.u([(0,o.query)(`.shell`)],C.prototype,`_shell`,void 0),C=e.u([(0,o.customElement)(`schmancy-overlay`)],C),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return C}});
|