@mhmo91/schmancy 0.7.5 → 0.7.7
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/ai/details.md +309 -44
- package/ai/directives.md +214 -7
- package/ai/typewriter.md +151 -33
- package/dist/ai/details.md +309 -44
- package/dist/ai/directives.md +214 -7
- package/dist/ai/typewriter.md +151 -33
- package/dist/{animated-text-DnFenRS1.cjs → animated-text-Be290e6l.cjs} +2 -2
- package/dist/{animated-text-DnFenRS1.cjs.map → animated-text-Be290e6l.cjs.map} +1 -1
- package/dist/{animated-text-YBgWXuVJ.js → animated-text-DuLrWJ6O.js} +3 -3
- package/dist/{animated-text-YBgWXuVJ.js.map → animated-text-DuLrWJ6O.js.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/{area.component-C_nUxyiY.js → area.component-BzjJiNTJ.js} +47 -39
- package/dist/area.component-BzjJiNTJ.js.map +1 -0
- package/dist/{area.component-BojFAcRk.cjs → area.component-FL_IUylM.cjs} +4 -4
- package/dist/area.component-FL_IUylM.cjs.map +1 -0
- package/dist/area.js +1 -1
- package/dist/{autocomplete-B8oOdRsV.cjs → autocomplete-CHmGhBNt.cjs} +2 -2
- package/dist/{autocomplete-B8oOdRsV.cjs.map → autocomplete-CHmGhBNt.cjs.map} +1 -1
- package/dist/{autocomplete-B-X_D8MC.js → autocomplete-FLkd9ju8.js} +5 -5
- package/dist/{autocomplete-B-X_D8MC.js.map → autocomplete-FLkd9ju8.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-DBdyON6Y.cjs → avatar-B_uJN9WV.cjs} +2 -2
- package/dist/{avatar-DBdyON6Y.cjs.map → avatar-B_uJN9WV.cjs.map} +1 -1
- package/dist/{avatar-Cro3M4Lw.js → avatar-C8P4lVfa.js} +52 -52
- package/dist/{avatar-Cro3M4Lw.js.map → avatar-C8P4lVfa.js.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/boat-Ma6LW-ny.js +301 -0
- package/dist/boat-Ma6LW-ny.js.map +1 -0
- package/dist/boat-kYOUec8f.cjs +97 -0
- package/dist/boat-kYOUec8f.cjs.map +1 -0
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-DMfwDgYx.cjs → checkbox-DLZkKaon.cjs} +2 -2
- package/dist/{checkbox-DMfwDgYx.cjs.map → checkbox-DLZkKaon.cjs.map} +1 -1
- package/dist/{checkbox-BOmazo-k.js → checkbox-x46L-XTG.js} +2 -2
- package/dist/{checkbox-BOmazo-k.js.map → checkbox-x46L-XTG.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +2 -2
- package/dist/code-highlight.cjs +1 -1
- package/dist/code-highlight.js +1 -1
- package/dist/{code-preview-CbZzYTk2.cjs → code-preview-BsQq77nu.cjs} +2 -2
- package/dist/{code-preview-CbZzYTk2.cjs.map → code-preview-BsQq77nu.cjs.map} +1 -1
- package/dist/{code-preview-DgyY3Jlw.js → code-preview-C3DLglSl.js} +2 -2
- package/dist/{code-preview-DgyY3Jlw.js.map → code-preview-C3DLglSl.js.map} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-BV0479CW.js → date-range-Cm0TCfwu.js} +3 -3
- package/dist/{date-range-BV0479CW.js.map → date-range-Cm0TCfwu.js.map} +1 -1
- package/dist/{date-range-47SnbVM6.cjs → date-range-Cy97kOP_.cjs} +2 -2
- package/dist/{date-range-47SnbVM6.cjs.map → date-range-Cy97kOP_.cjs.map} +1 -1
- package/dist/{date-range-inline-GfLao0NN.js → date-range-inline-CfDu-lIo.js} +3 -3
- package/dist/{date-range-inline-GfLao0NN.js.map → date-range-inline-CfDu-lIo.js.map} +1 -1
- package/dist/{date-range-inline-HNDLTnYi.cjs → date-range-inline-cGptw0hr.cjs} +2 -2
- package/dist/{date-range-inline-HNDLTnYi.cjs.map → date-range-inline-cGptw0hr.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-B40l99jW.js → delay-BINGOQ7f.js} +2 -2
- package/dist/{delay-B40l99jW.js.map → delay-BINGOQ7f.js.map} +1 -1
- package/dist/{delay-Dr3Fr5YB.cjs → delay-CXFIM6qK.cjs} +2 -2
- package/dist/{delay-Dr3Fr5YB.cjs.map → delay-CXFIM6qK.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/details-CLRikV4s.cjs +64 -0
- package/dist/details-CLRikV4s.cjs.map +1 -0
- package/dist/details-bgq2X_hO.js +115 -0
- package/dist/details-bgq2X_hO.js.map +1 -0
- package/dist/details.cjs +1 -1
- package/dist/details.js +1 -1
- package/dist/{dialog-content-Emd7BLQA.cjs → dialog-content-B59ekS_y.cjs} +2 -2
- package/dist/{dialog-content-Emd7BLQA.cjs.map → dialog-content-B59ekS_y.cjs.map} +1 -1
- package/dist/{dialog-content-B_amCfq7.js → dialog-content-Cu7fqN8Y.js} +3 -3
- package/dist/{dialog-content-B_amCfq7.js.map → dialog-content-Cu7fqN8Y.js.map} +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +10 -6
- package/dist/divider-8tk2mDbL.cjs +58 -0
- package/dist/divider-8tk2mDbL.cjs.map +1 -0
- package/dist/divider-Bu6tzwGl.js +84 -0
- package/dist/divider-Bu6tzwGl.js.map +1 -0
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-BpJq8Q1u.cjs → dropdown-content-DFb07S8x.cjs} +2 -2
- package/dist/{dropdown-content-BpJq8Q1u.cjs.map → dropdown-content-DFb07S8x.cjs.map} +1 -1
- package/dist/{dropdown-content-Bw9jnfCR.js → dropdown-content-fVhnEKdY.js} +3 -3
- package/dist/{dropdown-content-Bw9jnfCR.js.map → dropdown-content-fVhnEKdY.js.map} +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/{email-recipients-Bxvu6zi9.cjs → email-recipients-BG3GxJvc.cjs} +2 -2
- package/dist/{email-recipients-Bxvu6zi9.cjs.map → email-recipients-BG3GxJvc.cjs.map} +1 -1
- package/dist/{email-recipients-DZGMhyg4.js → email-recipients-OG52RGiH.js} +6 -6
- package/dist/{email-recipients-DZGMhyg4.js.map → email-recipients-OG52RGiH.js.map} +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-DUgMxT_9.js → flex-CYQU6Pf8.js} +2 -2
- package/dist/{flex-DUgMxT_9.js.map → flex-CYQU6Pf8.js.map} +1 -1
- package/dist/{flex-DakK9gco.cjs → flex-DytMcHmq.cjs} +2 -2
- package/dist/{flex-DakK9gco.cjs.map → flex-DytMcHmq.cjs.map} +1 -1
- package/dist/{form-CPmMvWvE.cjs → form-cWJBcwc6.cjs} +2 -2
- package/dist/{form-CPmMvWvE.cjs.map → form-cWJBcwc6.cjs.map} +1 -1
- package/dist/{form-yZ1fh3h9.js → form-tpyd1nsT.js} +2 -2
- package/dist/{form-yZ1fh3h9.js.map → form-tpyd1nsT.js.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{formField.mixin-Cmb9YpmX.js → formField.mixin-Mx5CwYUh.js} +2 -2
- package/dist/{formField.mixin-Cmb9YpmX.js.map → formField.mixin-Mx5CwYUh.js.map} +1 -1
- package/dist/{formField.mixin-D51klHq7.cjs → formField.mixin-XlN2pAL0.cjs} +2 -2
- package/dist/{formField.mixin-D51klHq7.cjs.map → formField.mixin-XlN2pAL0.cjs.map} +1 -1
- package/dist/{icon-Dsa_BddL.cjs → icon-C8Q_XMtJ.cjs} +2 -2
- package/dist/{icon-Dsa_BddL.cjs.map → icon-C8Q_XMtJ.cjs.map} +1 -1
- package/dist/{icon-DHT8YsE3.js → icon-Y2qLOFqe.js} +2 -2
- package/dist/{icon-DHT8YsE3.js.map → icon-Y2qLOFqe.js.map} +1 -1
- package/dist/{icon-button-PpRHFLCj.js → icon-button-CJ6AVTv9.js} +19 -19
- package/dist/icon-button-CJ6AVTv9.js.map +1 -0
- package/dist/{icon-button-BRcfLsJL.cjs → icon-button-IdG1NVgA.cjs} +8 -8
- package/dist/icon-button-IdG1NVgA.cjs.map +1 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +196 -192
- package/dist/{input-CYGSlByl.js → input-DDCFZ3cr.js} +4 -4
- package/dist/{input-CYGSlByl.js.map → input-DDCFZ3cr.js.map} +1 -1
- package/dist/input-UyknNHNr.cjs +51 -0
- package/dist/{input-DB269a2X.cjs.map → input-UyknNHNr.cjs.map} +1 -1
- package/dist/{input-chip-CKYO8Lww.cjs → input-chip-Bht9MU9G.cjs} +2 -2
- package/dist/{input-chip-CKYO8Lww.cjs.map → input-chip-Bht9MU9G.cjs.map} +1 -1
- package/dist/{input-chip-CTKPIRVA.js → input-chip-DVE4_1wn.js} +2 -2
- package/dist/{input-chip-CTKPIRVA.js.map → input-chip-DVE4_1wn.js.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/{list-BbzeVuby.js → list-BO1gnjmc.js} +2 -2
- package/dist/{list-BbzeVuby.js.map → list-BO1gnjmc.js.map} +1 -1
- package/dist/{list-BQVTFNkq.cjs → list-Bac329kq.cjs} +2 -2
- package/dist/{list-BQVTFNkq.cjs.map → list-Bac329kq.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-DzCpXwcY.cjs → litElement.mixin-B1WTI3WY.cjs} +2 -2
- package/dist/{litElement.mixin-DzCpXwcY.cjs.map → litElement.mixin-B1WTI3WY.cjs.map} +1 -1
- package/dist/{litElement.mixin-BzbZQbxa.js → litElement.mixin-CVje6z-M.js} +2 -2
- package/dist/{litElement.mixin-BzbZQbxa.js.map → litElement.mixin-CVje6z-M.js.map} +1 -1
- package/dist/mailbox.cjs +1 -1
- package/dist/mailbox.js +1 -1
- package/dist/{map-DuTFI2lm.cjs → map-BlmS6Zfx.cjs} +2 -2
- package/dist/{map-DuTFI2lm.cjs.map → map-BlmS6Zfx.cjs.map} +1 -1
- package/dist/{map-CgwU5Px4.js → map-C1jVMhlF.js} +2 -2
- package/dist/{map-CgwU5Px4.js.map → map-C1jVMhlF.js.map} +1 -1
- package/dist/map.cjs +1 -1
- package/dist/map.js +1 -1
- package/dist/{media-BnktmFRW.js → media-CNMZbEJe.js} +2 -2
- package/dist/{media-BnktmFRW.js.map → media-CNMZbEJe.js.map} +1 -1
- package/dist/{media-gtpSHRFx.cjs → media-CxfrOjie.cjs} +2 -2
- package/dist/{media-gtpSHRFx.cjs.map → media-CxfrOjie.cjs.map} +1 -1
- package/dist/menu-CUKV4pVJ.js +61 -0
- package/dist/menu-CUKV4pVJ.js.map +1 -0
- package/dist/menu-DEa2K7Pk.cjs +26 -0
- package/dist/menu-DEa2K7Pk.cjs.map +1 -0
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins.cjs +1 -1
- package/dist/mixins.js +3 -3
- 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-CUMNSz0h.js → navigation-rail-CYKfvZs9.js} +3 -3
- package/dist/{navigation-rail-CUMNSz0h.js.map → navigation-rail-CYKfvZs9.js.map} +1 -1
- package/dist/{navigation-rail-D8otIR2P.cjs → navigation-rail-DXr4NJnN.cjs} +2 -2
- package/dist/{navigation-rail-D8otIR2P.cjs.map → navigation-rail-DXr4NJnN.cjs.map} +1 -1
- package/dist/navigation-rail.cjs +1 -1
- package/dist/navigation-rail.js +1 -1
- package/dist/{notification-service-E16lPsiT.js → notification-service-CZ56fXew.js} +5 -5
- package/dist/{notification-service-E16lPsiT.js.map → notification-service-CZ56fXew.js.map} +1 -1
- package/dist/{notification-service-CP6kGXVL.cjs → notification-service-DQGs9O0f.cjs} +2 -2
- package/dist/{notification-service-CP6kGXVL.cjs.map → notification-service-DQGs9O0f.cjs.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +2 -2
- package/dist/{notify-D865xIlu.js → notify-KvHZ-8z9.js} +2 -2
- package/dist/{notify-D865xIlu.js.map → notify-KvHZ-8z9.js.map} +1 -1
- package/dist/{notify-Czdp7BbG.cjs → notify-VkDx6hMZ.cjs} +2 -2
- package/dist/{notify-Czdp7BbG.cjs.map → notify-VkDx6hMZ.cjs.map} +1 -1
- package/dist/{option-cJ8fM5qJ.js → option-DnRdbsTb.js} +2 -2
- package/dist/{option-cJ8fM5qJ.js.map → option-DnRdbsTb.js.map} +1 -1
- package/dist/{option-B1r0hb3H.cjs → option-Eh2AXe-Z.cjs} +2 -2
- package/dist/{option-B1r0hb3H.cjs.map → option-Eh2AXe-Z.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-EO3auDS8.cjs → payment-card-form-8a4Nqqhy.cjs} +2 -2
- package/dist/{payment-card-form-EO3auDS8.cjs.map → payment-card-form-8a4Nqqhy.cjs.map} +1 -1
- package/dist/{payment-card-form-RBjpMc2m.js → payment-card-form-EVQEb5OX.js} +3 -3
- package/dist/{payment-card-form-RBjpMc2m.js.map → payment-card-form-EVQEb5OX.js.map} +1 -1
- package/dist/{progress-4v9FzvOT.js → progress-D5kgn2Fg.js} +2 -2
- package/dist/{progress-4v9FzvOT.js.map → progress-D5kgn2Fg.js.map} +1 -1
- package/dist/{progress-DnhvJMz_.cjs → progress-yFxoJDYf.cjs} +2 -2
- package/dist/{progress-DnhvJMz_.cjs.map → progress-yFxoJDYf.cjs.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-button-BVegeFKE.cjs → radio-button-BTdqEOSJ.cjs} +2 -2
- package/dist/{radio-button-BVegeFKE.cjs.map → radio-button-BTdqEOSJ.cjs.map} +1 -1
- package/dist/{radio-button-DDavzgCz.js → radio-button-QCukBJLy.js} +3 -3
- package/dist/{radio-button-DDavzgCz.js.map → radio-button-QCukBJLy.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/ripple-QoNZUUw_.js +148 -0
- package/dist/ripple-QoNZUUw_.js.map +1 -0
- package/dist/ripple-Ujq_REH4.cjs +16 -0
- package/dist/ripple-Ujq_REH4.cjs.map +1 -0
- package/dist/{schmancy-steps-container-s6kZWhcr.cjs → schmancy-steps-container-CtwqkRBU.cjs} +2 -2
- package/dist/{schmancy-steps-container-s6kZWhcr.cjs.map → schmancy-steps-container-CtwqkRBU.cjs.map} +1 -1
- package/dist/{schmancy-steps-container-DN9c-HeX.js → schmancy-steps-container-NZOamraF.js} +2 -2
- package/dist/{schmancy-steps-container-DN9c-HeX.js.map → schmancy-steps-container-NZOamraF.js.map} +1 -1
- package/dist/search-B1s7thB0.cjs +2 -0
- package/dist/search-B1s7thB0.cjs.map +1 -0
- package/dist/search-DxxnLa5u.js +95 -0
- package/dist/search-DxxnLa5u.js.map +1 -0
- package/dist/{select-DVT_kFNR.cjs → select-C-Kv7ey_.cjs} +2 -2
- package/dist/{select-DVT_kFNR.cjs.map → select-C-Kv7ey_.cjs.map} +1 -1
- package/dist/{select--D6l5ru7.js → select-DSTQ-Zau.js} +4 -4
- package/dist/{select--D6l5ru7.js.map → select-DSTQ-Zau.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/selector-hook-Cok22ifx.cjs +2 -0
- package/dist/selector-hook-Cok22ifx.cjs.map +1 -0
- package/dist/selector-hook-l2fe2UO5.js +319 -0
- package/dist/selector-hook-l2fe2UO5.js.map +1 -0
- package/dist/{sheet-CNn_huhz.js → sheet-DY-z5_tm.js} +14 -14
- package/dist/sheet-DY-z5_tm.js.map +1 -0
- package/dist/{sheet-Bza5jVS2.cjs → sheet-IzYy3H8n.cjs} +4 -4
- package/dist/sheet-IzYy3H8n.cjs.map +1 -0
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +2 -2
- package/dist/{sheet.service--zUgftN3.cjs → sheet.service-BNz-ird-.cjs} +2 -2
- package/dist/{sheet.service--zUgftN3.cjs.map → sheet.service-BNz-ird-.cjs.map} +1 -1
- package/dist/{sheet.service-CmNDL4f6.js → sheet.service-DuVcXyOB.js} +2 -2
- package/dist/{sheet.service-CmNDL4f6.js.map → sheet.service-DuVcXyOB.js.map} +1 -1
- package/dist/{slider-DPxBmmFD.js → slider-CFtbSQ9Y.js} +3 -3
- package/dist/{slider-DPxBmmFD.js.map → slider-CFtbSQ9Y.js.map} +1 -1
- package/dist/{slider-Cf0pED-U.cjs → slider-CGE_Qeok.cjs} +2 -2
- package/dist/{slider-Cf0pED-U.cjs.map → slider-CGE_Qeok.cjs.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-BDSDxr_W.cjs → spinner-CSPJs8CL.cjs} +3 -3
- package/dist/spinner-CSPJs8CL.cjs.map +1 -0
- package/dist/{spinner-Dyz6HBFa.js → spinner-DAF-hCvQ.js} +3 -3
- package/dist/spinner-DAF-hCvQ.js.map +1 -0
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +1 -1
- package/dist/{suggestion-chip-CCW8g_3S.js → suggestion-chip-CYu-4xrL.js} +3 -3
- package/dist/{suggestion-chip-CCW8g_3S.js.map → suggestion-chip-CYu-4xrL.js.map} +1 -1
- package/dist/{suggestion-chip-B7COqb4l.cjs → suggestion-chip-Cj8gwZqq.cjs} +2 -2
- package/dist/{suggestion-chip-B7COqb4l.cjs.map → suggestion-chip-Cj8gwZqq.cjs.map} +1 -1
- package/dist/{surface-B4CxtF38.js → surface-DTOK-0E4.js} +34 -10
- package/dist/{surface-B4CxtF38.js.map → surface-DTOK-0E4.js.map} +1 -1
- package/dist/{surface-CkzbeSYN.cjs → surface-VX_THUHv.cjs} +27 -3
- package/dist/{surface-CkzbeSYN.cjs.map → surface-VX_THUHv.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-D-g4ZBys.cjs → table-BV0-o9Wi.cjs} +4 -3
- package/dist/{table-D-g4ZBys.cjs.map → table-BV0-o9Wi.cjs.map} +1 -1
- package/dist/{table-KPNVMJtn.js → table-CkXbXqi9.js} +14 -10
- package/dist/{table-KPNVMJtn.js.map → table-CkXbXqi9.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-compatibility-xUK4vD1M.js → tabs-compatibility-D_BBW655.js} +2 -2
- package/dist/{tabs-compatibility-xUK4vD1M.js.map → tabs-compatibility-D_BBW655.js.map} +1 -1
- package/dist/{tabs-compatibility-sMoQP12I.cjs → tabs-compatibility-DsfD60U_.cjs} +2 -2
- package/dist/{tabs-compatibility-sMoQP12I.cjs.map → tabs-compatibility-DsfD60U_.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-JFXu3GSo.cjs +2 -0
- package/dist/{tailwind.mixin-scDxsqaX.cjs.map → tailwind.mixin-JFXu3GSo.cjs.map} +1 -1
- package/dist/tailwind.mixin-wLaKUxf1.js +67 -0
- package/dist/{tailwind.mixin-xIIxrXd8.js.map → tailwind.mixin-wLaKUxf1.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-BSBYVs99.cjs → textarea-B6LDhRed.cjs} +2 -2
- package/dist/{textarea-BSBYVs99.cjs.map → textarea-B6LDhRed.cjs.map} +1 -1
- package/dist/{textarea-CFrirT5y.js → textarea-TeVnUeIJ.js} +3 -3
- package/dist/{textarea-CFrirT5y.js.map → textarea-TeVnUeIJ.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-D-LTPh88.js → theme-button-BXXqAu2Y.js} +2 -2
- package/dist/{theme-button-D-LTPh88.js.map → theme-button-BXXqAu2Y.js.map} +1 -1
- package/dist/{theme-button-B8Xqrz1M.cjs → theme-button-DxMbO3yP.cjs} +2 -2
- package/dist/{theme-button-B8Xqrz1M.cjs.map → theme-button-DxMbO3yP.cjs.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/{theme-controller-boat-C2F-qRyu.cjs → theme-controller-boat-CCBNOGxF.cjs} +2 -2
- package/dist/{theme-controller-boat-C2F-qRyu.cjs.map → theme-controller-boat-CCBNOGxF.cjs.map} +1 -1
- package/dist/{theme-controller-boat-BOddzVdU.js → theme-controller-boat-CVS77gnH.js} +3 -3
- package/dist/{theme-controller-boat-BOddzVdU.js.map → theme-controller-boat-CVS77gnH.js.map} +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-xHmnktrm.cjs → timezone-D7YOMM8G.cjs} +2 -2
- package/dist/{timezone-xHmnktrm.cjs.map → timezone-D7YOMM8G.cjs.map} +1 -1
- package/dist/{timezone-BvOWa9Nt.js → timezone-RBV74f85.js} +3 -3
- package/dist/{timezone-BvOWa9Nt.js.map → timezone-RBV74f85.js.map} +1 -1
- package/dist/{tooltip-D24v5bvM.cjs → tooltip-BH_RLoZI.cjs} +2 -2
- package/dist/{tooltip-D24v5bvM.cjs.map → tooltip-BH_RLoZI.cjs.map} +1 -1
- package/dist/{tooltip-D3ZZJEAk.js → tooltip-DssL6Qfx.js} +2 -2
- package/dist/{tooltip-D3ZZJEAk.js.map → tooltip-DssL6Qfx.js.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-DC_jbDRu.cjs → tree-7Zz1sJKl.cjs} +2 -2
- package/dist/{tree-DC_jbDRu.cjs.map → tree-7Zz1sJKl.cjs.map} +1 -1
- package/dist/{tree-CfVyhRIH.js → tree-C33t9-0j.js} +2 -2
- package/dist/{tree-CfVyhRIH.js.map → tree-C33t9-0j.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-By-3T0Jm.js → typewriter-Dt1Js2lP.js} +247 -118
- package/dist/typewriter-Dt1Js2lP.js.map +1 -0
- package/dist/typewriter-WbYqfXO7.cjs +124 -0
- package/dist/typewriter-WbYqfXO7.cjs.map +1 -0
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-9lVCjAbj.cjs → typography-Ck-OdI83.cjs} +2 -2
- package/dist/{typography-9lVCjAbj.cjs.map → typography-Ck-OdI83.cjs.map} +1 -1
- package/dist/{typography-B7kvO8iJ.js → typography-DdG9aEAg.js} +2 -2
- package/dist/{typography-B7kvO8iJ.js.map → typography-DdG9aEAg.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/types/src/area/router.types.d.ts +1 -0
- package/types/src/boat/boat.d.ts +0 -1
- package/types/src/button/button.d.ts +8 -0
- package/types/src/details/details.d.ts +12 -11
- package/types/src/directives/drag.d.ts +30 -0
- package/types/src/directives/index.d.ts +1 -0
- package/types/src/divider/divider.d.ts +6 -1
- package/types/src/menu/menu-item.d.ts +0 -1
- package/types/src/store/filter-directive.d.ts +1 -1
- package/types/src/surface/surface.d.ts +2 -1
- package/types/src/types/surface.d.ts +1 -1
- package/types/src/typewriter/typewriter.d.ts +15 -0
- package/types/src/utils/index.d.ts +4 -4
- package/types/src/utils/search.d.ts +39 -1
- package/dist/area.component-BojFAcRk.cjs.map +0 -1
- package/dist/area.component-C_nUxyiY.js.map +0 -1
- package/dist/boat-B7AKN6Ge.js +0 -276
- package/dist/boat-B7AKN6Ge.js.map +0 -1
- package/dist/boat-BhAuteUk.cjs +0 -93
- package/dist/boat-BhAuteUk.cjs.map +0 -1
- package/dist/details-CQPpI_la.js +0 -211
- package/dist/details-CQPpI_la.js.map +0 -1
- package/dist/details-DydvHvfw.cjs +0 -143
- package/dist/details-DydvHvfw.cjs.map +0 -1
- package/dist/divider-BF9xljgI.cjs +0 -2
- package/dist/divider-BF9xljgI.cjs.map +0 -1
- package/dist/divider-BHruVdsE.js +0 -23
- package/dist/divider-BHruVdsE.js.map +0 -1
- package/dist/icon-button-BRcfLsJL.cjs.map +0 -1
- package/dist/icon-button-PpRHFLCj.js.map +0 -1
- package/dist/input-DB269a2X.cjs +0 -51
- package/dist/menu-DA2pO48m.cjs +0 -26
- package/dist/menu-DA2pO48m.cjs.map +0 -1
- package/dist/menu-DwFriXTu.js +0 -63
- package/dist/menu-DwFriXTu.js.map +0 -1
- package/dist/ripple-Cy-nvO8W.js +0 -80
- package/dist/ripple-Cy-nvO8W.js.map +0 -1
- package/dist/ripple-DqQrvaTe.cjs +0 -16
- package/dist/ripple-DqQrvaTe.cjs.map +0 -1
- package/dist/search-BeEqIiuO.js +0 -53
- package/dist/search-BeEqIiuO.js.map +0 -1
- package/dist/search-bfOHCuHZ.cjs +0 -2
- package/dist/search-bfOHCuHZ.cjs.map +0 -1
- package/dist/selector-hook-BG6g_IEN.cjs +0 -2
- package/dist/selector-hook-BG6g_IEN.cjs.map +0 -1
- package/dist/selector-hook-CrwQCPxL.js +0 -313
- package/dist/selector-hook-CrwQCPxL.js.map +0 -1
- package/dist/sheet-Bza5jVS2.cjs.map +0 -1
- package/dist/sheet-CNn_huhz.js.map +0 -1
- package/dist/spinner-BDSDxr_W.cjs.map +0 -1
- package/dist/spinner-Dyz6HBFa.js.map +0 -1
- package/dist/tailwind.mixin-scDxsqaX.cjs +0 -2
- package/dist/tailwind.mixin-xIIxrXd8.js +0 -67
- package/dist/typewriter-By-3T0Jm.js.map +0 -1
- package/dist/typewriter-vit0P1N1.cjs +0 -9
- package/dist/typewriter-vit0P1N1.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-content-Emd7BLQA.cjs","sources":["../src/dialog/dailog.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: var(--schmancy-sys-color-scrim);\n\t\topacity: 0.4;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\twidth: var(--dialog-width);\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on variant\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger') {\n\t\t\treturn 'bg-error-default hover:bg-error-container text-error-on'\n\t\t}\n\n\t\treturn ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\" class=\"p-4\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} >\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n`) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid: string\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, set up auto-update for content changes\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// Ensure dialog stays within viewport when content changes\n\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('[role=\"dialog\"]') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\t// Determine if the dialog is centered\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tconst dialogClasses = {\n\t\t\tabsolute: true,\n\t\t\t'w-[var(--dialog-width)]': true, // Use the specified width\n\t\t\t'max-w-[calc(100vw-2rem)]': true, // Prevent overflow on small screens\n\t\t\t'max-h-[calc(100vh-40px)]': true,\n\t\t\t// Centered positioning\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-[50%]': isCentered, // Slight upward shift\n\t\t\t'overflow-auto':true\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=\"fixed inset-0 bg-scrim/40\" @click=${this.handleClose}></div>\n\n\t\t\t<section class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","apply","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","firstUpdated","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","handleCancel","getConfirmButtonClass","render","hasCustomContent","querySelectorAll","showButtons","trim","html","when","options","createElement","appendChild","width","setProperty","show","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","SchmancyDialog","result","connectedCallback","DialogWhereAreYouRicky","tap","e","detail","uid","announcePresence","DialogHereMorty","handleClose","isCentered","dialogClasses","absolute","classMap","reflect","SchmancyDialogContent"],"mappings":"8kBAeaA,QAAAA,cAAN,cAA4BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,CAAA,CAAA,aAAAC,CAAAC,MAAAA,GAAAC,SAAAA,EAsCNC,KAAAC,MAAAA,OAMAD,KAAAE,SAAAA,OAMAF,KAAAG,QAAAA,OAMAH,KAAAI,YAAc,UAMdJ,KAAAK,WAAa,SAMbL,KAAAM,QAAgC,UAKhCN,KAAQO,SAAW,CAAEC,EAAG,EAAGC,EAAG,CAAA,CAAE,CA4BhC,MAAA,KAAWC,EAAAA,CAEV,IAAIF,EAAWC,EAEf,GAAKC,EAIL,GAAW,YAAaA,EAEvBF,EAAIE,EAAgBC,QACpBF,EAAIC,EAAgBE,gBACV,YAAaF,GAAmBA,EAAgBG,QAAQC,OAElEN,EAAIE,EAAgBG,QAAQ,CAAA,EAAGF,QAC/BF,EAAIC,EAAgBG,QAAQ,GAAGD,YACzB,CAEN,MAAMG,EAAML,EACZF,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OK,EAAAA,mBACT,CAAA,EATWiC,QAAAA,4HAAN,CADNjB,EAAAA,cAAc,yBAAA,CAAA,EACFiB"}
|
|
1
|
+
{"version":3,"file":"dialog-content-B59ekS_y.cjs","sources":["../src/dialog/dailog.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: var(--schmancy-sys-color-scrim);\n\t\topacity: 0.4;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\twidth: var(--dialog-width);\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on variant\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger') {\n\t\t\treturn 'bg-error-default hover:bg-error-container text-error-on'\n\t\t}\n\n\t\treturn ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\" class=\"p-4\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} >\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n`) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid: string\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, set up auto-update for content changes\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// Ensure dialog stays within viewport when content changes\n\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('[role=\"dialog\"]') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\t// Determine if the dialog is centered\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tconst dialogClasses = {\n\t\t\tabsolute: true,\n\t\t\t'w-[var(--dialog-width)]': true, // Use the specified width\n\t\t\t'max-w-[calc(100vw-2rem)]': true, // Prevent overflow on small screens\n\t\t\t'max-h-[calc(100vh-40px)]': true,\n\t\t\t// Centered positioning\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-[50%]': isCentered, // Slight upward shift\n\t\t\t'overflow-auto':true\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=\"fixed inset-0 bg-scrim/40\" @click=${this.handleClose}></div>\n\n\t\t\t<section class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","apply","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","firstUpdated","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","handleCancel","getConfirmButtonClass","render","hasCustomContent","querySelectorAll","showButtons","trim","html","when","options","createElement","appendChild","width","setProperty","show","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","SchmancyDialog","result","connectedCallback","DialogWhereAreYouRicky","tap","e","detail","uid","announcePresence","DialogHereMorty","handleClose","isCentered","dialogClasses","absolute","classMap","reflect","SchmancyDialogContent"],"mappings":"8kBAeaA,QAAAA,cAAN,cAA4BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,CAAA,CAAA,aAAAC,CAAAC,MAAAA,GAAAC,SAAAA,EAsCNC,KAAAC,MAAAA,OAMAD,KAAAE,SAAAA,OAMAF,KAAAG,QAAAA,OAMAH,KAAAI,YAAc,UAMdJ,KAAAK,WAAa,SAMbL,KAAAM,QAAgC,UAKhCN,KAAQO,SAAW,CAAEC,EAAG,EAAGC,EAAG,CAAA,CAAE,CA4BhC,MAAA,KAAWC,EAAAA,CAEV,IAAIF,EAAWC,EAEf,GAAKC,EAIL,GAAW,YAAaA,EAEvBF,EAAIE,EAAgBC,QACpBF,EAAIC,EAAgBE,gBACV,YAAaF,GAAmBA,EAAgBG,QAAQC,OAElEN,EAAIE,EAAgBG,QAAQ,CAAA,EAAGF,QAC/BF,EAAIC,EAAgBG,QAAQ,GAAGD,YACzB,CAEN,MAAMG,EAAML,EACZF,EAAIO,EAAIP,EACRC,EAAIM,EAAIN,CACT,MAfCD,EAAIQ,OAAOC,WAAa,EACxBR,EAAIO,OAAOE,YAAc,EA8B1B,OAbAlB,KAAKO,SAAW,CAAEC,EAAAA,EAAGC,EAAAA,CAAAA,EAGrBT,KAAKmB,iBAAmB,CACvBC,sBAAA,IACQ,IAAIC,QAAQb,EAAGC,EAAG,EAAG,CAAA,CAAA,EAK9BT,KAAKsB,aAAa,SAAU,EAAA,EAGrB,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AAAkG,CACP/H,KAAKwF,KAAAA,EAAK,EACVxF,KAAKyF,cACJ,IAAIC,YAAY,QAAS,CACxBC,QAAAA,GACAC,SAAAA,EAAU,CAAA,CAAA,CAGb,CAEA,QAAAG,CAEC,MAAMjE,EAAgBd,OAAOC,WACvBc,EAAiBf,OAAOE,YACxB8G,EACLhG,KAAKC,IAAIjC,KAAKO,SAASC,EAAIsB,EAAgB,CAAA,EAAK,IAAME,KAAKC,IAAIjC,KAAKO,SAASE,EAAIsB,EAAiB,CAAA,EAAK,GAElGkG,EAAgB,CACrBC,SAAAA,GACA,6BACA,2BAAA,GACA,2BAAA,GAEA,UAAWF,EACX,WAAYA,EACZ,mBAAoBA,EACpB,qBAAsBA,EACtB,gBAAA,EAAgB,EAGjB,OAAO5B,EAAAA;AAAAA,mDAC0CpG,KAAK+H,WAAAA;AAAAA;AAAAA,oBAEpC/H,KAAKmI,SAASF,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAMjC,CAAA,EAlV2CnB,EAAA,CAA1CC,EAAAA,SAAS,CAAEC,KAAMC,OAAQmB,QAAAA,EAAS,CAAA,CAAA,EAhBvBf,uBAgB+BH,UAAA,MAAA,GAhB/BG,QAAAA,eAANP,EAAA,CADNM,EAAAA,cAAc,iBAAA,CAAA,EACFC,8DCHAgB,QAAAA,sBAAN,cAAoC1I,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAOrD,QAAAmG,CACE,OAAOK,EAAAA,mBACT,CAAA,EATWiC,QAAAA,4HAAN,CADNjB,EAAAA,cAAc,yBAAA,CAAA,EACFiB"}
|
|
@@ -4,8 +4,8 @@ import { debounceTime as S } from "rxjs/operators";
|
|
|
4
4
|
import "lit/directives/class-map.js";
|
|
5
5
|
import "lit/directives/style-map.js";
|
|
6
6
|
import { property as h, customElement as g } from "lit/decorators.js";
|
|
7
|
-
import "./tailwind.mixin-
|
|
8
|
-
import { $ as y } from "./litElement.mixin-
|
|
7
|
+
import "./tailwind.mixin-wLaKUxf1.js";
|
|
8
|
+
import { $ as y } from "./litElement.mixin-CVje6z-M.js";
|
|
9
9
|
import { css as f, html as r } from "lit";
|
|
10
10
|
import { when as d } from "lit/directives/when.js";
|
|
11
11
|
import { a as $, b as H } from "./dialog-service-Bege4HF4.js";
|
|
@@ -253,4 +253,4 @@ export {
|
|
|
253
253
|
u as S,
|
|
254
254
|
v as a
|
|
255
255
|
};
|
|
256
|
-
//# sourceMappingURL=dialog-content-
|
|
256
|
+
//# sourceMappingURL=dialog-content-Cu7fqN8Y.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-content-B_amCfq7.js","sources":["../src/dialog/dailog.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: var(--schmancy-sys-color-scrim);\n\t\topacity: 0.4;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\twidth: var(--dialog-width);\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on variant\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger') {\n\t\t\treturn 'bg-error-default hover:bg-error-container text-error-on'\n\t\t}\n\n\t\treturn ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\" class=\"p-4\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} >\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n`) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid: string\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, set up auto-update for content changes\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// Ensure dialog stays within viewport when content changes\n\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('[role=\"dialog\"]') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\t// Determine if the dialog is centered\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tconst dialogClasses = {\n\t\t\tabsolute: true,\n\t\t\t'w-[var(--dialog-width)]': true, // Use the specified width\n\t\t\t'max-w-[calc(100vw-2rem)]': true, // Prevent overflow on small screens\n\t\t\t'max-h-[calc(100vh-40px)]': true,\n\t\t\t// Centered positioning\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-[50%]': isCentered, // Slight upward shift\n\t\t\t'overflow-auto':true\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=\"fixed inset-0 bg-scrim/40\" @click=${this.handleClose}></div>\n\n\t\t\t<section class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","apply","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","firstUpdated","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","handleCancel","getConfirmButtonClass","render","hasCustomContent","querySelectorAll","showButtons","trim","html","when","options","createElement","appendChild","width","setProperty","show","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","SchmancyDialog","result","connectedCallback","DialogWhereAreYouRicky","tap","e","detail","uid","announcePresence","DialogHereMorty","handleClose","isCentered","dialogClasses","absolute","classMap","reflect","SchmancyDialogContent"],"mappings":";;;;;;;;;;;;;;;AAeO,IAAMA,IAAN,cAA4BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,EAAA;AAAA,EAAA,cAAAC;AAAAC,UAAAA,GAAAC,SAAAA,GAsCNC,KAAAC,QAAAA,QAMAD,KAAAE,WAAAA,QAMAF,KAAAG,UAAAA,QAMAH,KAAAI,cAAc,WAMdJ,KAAAK,aAAa,UAMbL,KAAAM,UAAgC,WAKhCN,KAAQO,WAAW,EAAEC,GAAG,GAAGC,GAAG,EAAA;AAAA,EAAE;AAAA,EA4BhC,MAAA,KAAWC,GAAAA;AAEV,QAAIF,GAAWC;AAEf,QAAKC,EAIL,KAAW,aAAaA,EAEvBF,CAAAA,IAAIE,EAAgBC,SACpBF,IAAIC,EAAgBE;AAAAA,aACV,aAAaF,KAAmBA,EAAgBG,QAAQC,OAElEN,CAAAA,IAAIE,EAAgBG,QAAQ,CAAA,EAAGF,SAC/BF,IAAIC,EAAgBG,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;AAAAA;AAAAA,oBAEpC/H,KAAKmI,SAASF,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAMjC;AAAA;AAlV2CnB,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQmB,SAAAA,GAAS,CAAA,CAAA,GAhBvBf,EAgB+BH,WAAA,OAAA,CAAA,GAhB/BG,IAANP,EAAA,CADNM,EAAc,iBAAA,CAAA,GACFC,CAAAA;;ACHN,IAAMgB,IAAN,cAAoC1I,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;EAOrD,SAAAmG;AACE,WAAOK;AAAAA,EACT;;AATWiC;;;GAAN,CADNjB,EAAc,yBAAA,CAAA,GACFiB,CAAAA;"}
|
|
1
|
+
{"version":3,"file":"dialog-content-Cu7fqN8Y.js","sources":["../src/dialog/dailog.ts","../src/dialog/dialog.component.ts","../src/dialog/dialog-content.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { fromEvent } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\n\n/**\n * A confirm dialog web component with custom content support\n *\n * @element confirm-dialog\n * @slot content - Optional slot for custom content\n */\n@customElement('confirm-dialog')\nexport class ConfirmDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n\n\t.overlay {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tbackground: var(--schmancy-sys-color-scrim);\n\t\topacity: 0.4;\n\t}\n\n\t.dialog {\n\t\tposition: absolute;\n\t\twidth: var(--dialog-width);\n\t\tmax-height: calc(100vh - 40px); /* Prevent exceeding viewport height */\n\t\toverflow: auto; /* Allow scrolling for oversized content */\n\t}\n\n\t/* Used when centered for initial positioning */\n\t.dialog.centered {\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -55%); /* Slight upward shift looks better */\n\t}\n`) {\n\t/**\n\t * Dialog title\n\t */\n\t@property({ type: String })\n\ttitle = undefined\n\n\t/**\n\t * Dialog subtitle\n\t */\n\t@property({ type: String })\n\tsubtitle = undefined\n\n\t/**\n\t * Dialog message\n\t */\n\t@property({ type: String })\n\tmessage = undefined\n\n\t/**\n\t * Text for confirm button\n\t */\n\t@property({ type: String, attribute: 'confirm-text' })\n\tconfirmText = 'Confirm'\n\n\t/**\n\t * Text for cancel button\n\t */\n\t@property({ type: String, attribute: 'cancel-text' })\n\tcancelText = 'Cancel'\n\n\t/**\n\t * Dialog variant (affects button colors)\n\t */\n\t@property({ type: String })\n\tvariant: 'default' | 'danger' = 'default'\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Store resize subscription\n\t */\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(confirmed = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(confirmed)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, use CSS-based centering\n\t\t\tdialog.classList.add('centered')\n\n\t\t\t// Always set up auto-update for content changes, even for centered dialogs\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// If dialog has the centered class, ensure it stays visible\n\t\t\t\t\t// even when content changes its dimensions\n\t\t\t\t\tif (dialog.classList.contains('centered')) {\n\t\t\t\t\t\t// Adjust max-height to ensure dialog stays within viewport\n\t\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Remove centered class if it exists\n\t\tdialog.classList.remove('centered')\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('.dialog') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle confirm action\n\t */\n\tprivate handleConfirm() {\n\t\tthis.hide(true)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('confirm', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle cancel action\n\t */\n\tprivate handleCancel() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('cancel', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Get the CSS class for the confirm button based on variant\n\t */\n\tprivate getConfirmButtonClass(): string {\n\t\t// If variant is danger, use error color\n\t\tif (this.variant === 'danger') {\n\t\t\treturn 'bg-error-default hover:bg-error-container text-error-on'\n\t\t}\n\n\t\treturn ''\n\t}\n\n\trender() {\n\t\t// For initial rendering, use transform-based centering from CSS\n\t\t// firstUpdated will handle precise positioning after measuring\n\t\tconst hasCustomContent = this.querySelectorAll('[slot=\"content\"]').length > 0\n\t\t// Only show buttons if both confirmText and cancelText are non-empty strings\n\t\tconst showButtons =\n\t\t\tthis.confirmText && this.confirmText.trim() !== '' && this.cancelText && this.cancelText.trim() !== ''\n\n\t\treturn html`\n\t\t\t<div class=\"overlay\" @click=${this.handleCancel}></div>\n\n\t\t\t<div class=\"dialog\" role=\"alertdialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\" class=\"p-4\">\n\t\t\t\t\t<schmancy-form @submit=${this.handleConfirm} >\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.title && this.title.trim() !== '',\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"title\" token=\"md\" class=\"mb-1\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\t\t\tthis.subtitle && this.subtitle.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t\t\t<schmancy-typography type=\"subtitle\" token=\"xs\" class=\"mb-2\">\n\t\t\t\t\t\t\t\t\t\t\t${this.subtitle}\n\t\t\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t() => html``\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t${hasCustomContent\n\t\t\t\t\t\t\t? html`<div class=\"${showButtons ? 'mb-4' : ''}\"><slot name=\"content\"></slot></div>`\n\t\t\t\t\t\t\t: when(\n\t\t\t\t\t\t\t\t\tthis.message && this.message.trim() !== '',\n\t\t\t\t\t\t\t\t\t() => html`<schmancy-typography type=\"body\" class=\"mb-4\"> ${this.message} </schmancy-typography>`,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tshowButtons,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<div class=\"flex justify-end gap-3\">\n\t\t\t\t\t\t\t\t\t<schmancy-button variant=\"outlined\" @click=${this.handleCancel}> ${this.cancelText} </schmancy-button>\n\t\t\t\t\t\t\t\t\t<schmancy-button type=\"submit\" variant=\"filled\" class=${this.getConfirmButtonClass()}> ${this.confirmText} </schmancy-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</schmancy-form>\n\t\t\t\t</schmancy-surface>\n\t\t\t</div>\n\t\t`\n\t}\n\n\t/**\n\t * Static helper for even simpler API\n\t */\n\tstatic async confirm(options: {\n\t\ttitle?: string\n\t\tsubtitle?: string\n\t\tmessage?: string\n\t\tconfirmText?: string\n\t\tcancelText?: string\n\t\tvariant?: 'default' | 'danger'\n\t\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\t\twidth?: string\n\t}): Promise<boolean> {\n\t\t// Create dialog if it doesn't exist\n\t\tlet dialog = document.querySelector('confirm-dialog') as ConfirmDialog\n\n\t\tif (!dialog) {\n\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\tdocument.body.appendChild(dialog)\n\t\t}\n\n\t\t// Set options\n\t\tif (options.title) dialog.title = options.title\n\t\tif (options.subtitle) dialog.subtitle = options.subtitle\n\t\tif (options.message) dialog.message = options.message\n\t\tif (options.confirmText) dialog.confirmText = options.confirmText\n\t\tif (options.cancelText) dialog.cancelText = options.cancelText\n\t\tif (options.variant) dialog.variant = options.variant\n\t\tif (options.width) dialog.style.setProperty('--dialog-width', options.width)\n\n\t\t// Show dialog and return promise\n\t\treturn dialog.show(options.position)\n\t}\n\n\t/**\n\t * Even simpler shorthand method - just pass message and optionally an event\n\t */\n\tstatic async ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'confirm-dialog': ConfirmDialog\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift, size, Strategy } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { fromEvent, tap } from 'rxjs'\nimport { debounceTime } from 'rxjs/operators'\nimport { DialogHereMorty, DialogWhereAreYouRicky, DialogWhereAreYouRickyEvent } from './dialog-events'\n\n/**\n * A basic dialog web component without title or actions\n *\n * @element schmancy-dialog\n * @slot default - Content slot for dialog body\n */\n@customElement('schmancy-dialog')\nexport class SchmancyDialog extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tz-index: 10000;\n\t\tinset: 0;\n\t\tdisplay: none;\n\t\t--dialog-width: 360px;\n\t}\n\n\t:host([active]) {\n\t\tdisplay: block;\n\t}\n`) {\n\t/**\n\t * Unique identifier for the dialog instance\n\t */\n\t@property({ type: String, reflect: true }) uid: string\n\n\t/**\n\t * Current position of the dialog\n\t */\n\tprivate position = { x: 0, y: 0 }\n\n\t/**\n\t * Current active promise resolver\n\t */\n\tprivate resolvePromise?: (value: boolean) => void\n\n\t/**\n\t * Store cleanup function for position auto-updates\n\t */\n\tprivate cleanupAutoUpdate?: () => void\n\n\t/**\n\t * Virtual element to use as reference for positioning\n\t */\n\tprivate virtualReference?: {\n\t\tgetBoundingClientRect: () => DOMRect\n\t}\n\n\t/**\n\t * Simple API: Show the dialog at a specific position\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tasync show(positionOrEvent?: { x: number; y: number } | MouseEvent | TouchEvent): Promise<boolean> {\n\t\t// Extract position from event or use direct coordinates\n\t\tlet x: number, y: number\n\n\t\tif (!positionOrEvent) {\n\t\t\t// Default to center of viewport if no position provided\n\t\t\tx = window.innerWidth / 2\n\t\t\ty = window.innerHeight / 2\n\t\t} else if ('clientX' in positionOrEvent) {\n\t\t\t// It's a mouse event\n\t\t\tx = positionOrEvent.clientX\n\t\t\ty = positionOrEvent.clientY\n\t\t} else if ('touches' in positionOrEvent && positionOrEvent.touches.length) {\n\t\t\t// It's a touch event\n\t\t\tx = positionOrEvent.touches[0].clientX\n\t\t\ty = positionOrEvent.touches[0].clientY\n\t\t} else {\n\t\t\t// It's a position object with x,y coordinates\n\t\t\tconst pos = positionOrEvent as { x: number; y: number }\n\t\t\tx = pos.x\n\t\t\ty = pos.y\n\t\t}\n\n\t\t// Store initial position\n\t\tthis.position = { x, y }\n\n\t\t// Create virtual reference element at the provided coordinates\n\t\tthis.virtualReference = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t},\n\t\t}\n\n\t\t// Make dialog active\n\t\tthis.setAttribute('active', '')\n\n\t\t// Return a promise that resolves when the user makes a choice\n\t\treturn new Promise<boolean>(resolve => {\n\t\t\tthis.resolvePromise = resolve\n\t\t})\n\t}\n\n\t/**\n\t * Simple API: Hide the dialog\n\t */\n\thide(result = false) {\n\t\tthis.removeAttribute('active')\n\n\t\t// Clean up any auto-update subscription\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\n\t\t// Resolve any pending promise\n\t\tif (this.resolvePromise) {\n\t\t\tthis.resolvePromise(result)\n\t\t\tthis.resolvePromise = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Set up position auto-updating when dialog content changes or window resizes\n\t */\n\tprivate setupPositioning(dialog: HTMLElement) {\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\n\t\t// Check if this is a centered dialog\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tif (isCentered) {\n\t\t\t// For centered dialogs, set up auto-update for content changes\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(\n\t\t\t\tdocument.body, // Use body as reference for centered dialogs\n\t\t\t\tdialog,\n\t\t\t\t() => {\n\t\t\t\t\t// Ensure dialog stays within viewport when content changes\n\t\t\t\t\tconst availableHeight = window.innerHeight - 40\n\t\t\t\t\tif (dialog.offsetHeight > availableHeight) {\n\t\t\t\t\t\tdialog.style.maxHeight = `${availableHeight}px`\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telementResize: true,\n\t\t\t\t\tancestorScroll: true,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Use Floating UI's autoUpdate to continually update position\n\t\tif (this.virtualReference) {\n\t\t\tthis.cleanupAutoUpdate = autoUpdate(this.virtualReference, dialog, () => this.updatePosition(dialog), {\n\t\t\t\tancestorScroll: true,\n\t\t\t\tancestorResize: true,\n\t\t\t\telementResize: true,\n\t\t\t\tanimationFrame: true, // Enable continuous updates for smoother repositioning\n\t\t\t})\n\n\t\t\t// Initial positioning\n\t\t\tthis.updatePosition(dialog)\n\t\t}\n\t}\n\n\t/**\n\t * Update dialog position using Floating UI\n\t */\n\tprivate async updatePosition(dialog: HTMLElement) {\n\t\tif (!this.virtualReference) return\n\n\t\t// Force window bounds recalculation on resize\n\t\tif (this.position.x > 0 && this.position.y > 0) {\n\t\t\t// Update virtual reference to consider current window size\n\t\t\tconst viewportWidth = window.innerWidth\n\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t// Ensure position is constrained to current viewport\n\t\t\tconst x = Math.min(this.position.x, viewportWidth - 20)\n\t\t\tconst y = Math.min(this.position.y, viewportHeight - 20)\n\n\t\t\t// Update virtual reference with current viewport-constrained position\n\t\t\tthis.virtualReference = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn new DOMRect(x, y, 0, 0)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tconst placement: Placement = 'bottom-start'\n\t\tconst strategy: Strategy = 'absolute'\n\t\tconst margin = 20 // Standard margin from edges\n\n\t\tconst { x, y } = await computePosition(this.virtualReference, dialog, {\n\t\t\tplacement,\n\t\t\tstrategy,\n\t\t\tmiddleware: [\n\t\t\t\t// Offset from the reference point\n\t\t\t\toffset(margin),\n\n\t\t\t\t// Flip to opposite side if no space\n\t\t\t\tflip({\n\t\t\t\t\tfallbackPlacements: ['top-start', 'bottom-end', 'top-end'],\n\t\t\t\t\tfallbackStrategy: 'bestFit',\n\t\t\t\t}),\n\n\t\t\t\t// Shift along the preferred axis to stay in view\n\t\t\t\tshift({\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\n\t\t\t\t// Resize dialog if needed\n\t\t\t\tsize({\n\t\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\t\t// If dialog is wider than available space\n\t\t\t\t\t\tif (elements.floating.offsetWidth > availableWidth) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxWidth: `${Math.max(availableWidth - margin * 2, 280)}px`, // Keep at least 280px if possible\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If dialog is taller than available space\n\t\t\t\t\t\tif (elements.floating.offsetHeight > availableHeight) {\n\t\t\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\t\t\tmaxHeight: `${availableHeight - margin * 2}px`,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpadding: margin, // Keep margin from viewport edges\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\n\t\t// Apply the computed position\n\t\tObject.assign(dialog.style, {\n\t\t\tleft: `${Math.round(x)}px`,\n\t\t\ttop: `${Math.round(y)}px`,\n\t\t\ttransform: 'none', // Remove any transform that might interfere\n\t\t})\n\t}\n\n\t// Store resize subscription\n\tprivate resizeSubscription?: { unsubscribe: () => void }\n\n\t/**\n\t * Handle component disconnection from DOM\n\t */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\n\t\t// Clean up subscriptions\n\t\tif (this.resizeSubscription) {\n\t\t\tthis.resizeSubscription.unsubscribe()\n\t\t\tthis.resizeSubscription = undefined\n\t\t}\n\n\t\tif (this.cleanupAutoUpdate) {\n\t\t\tthis.cleanupAutoUpdate()\n\t\t\tthis.cleanupAutoUpdate = undefined\n\t\t}\n\t}\n\n\t/**\n\t * Handle component connection to DOM\n\t */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Listen for \"where are you ricky\" events\n\t\tfromEvent<DialogWhereAreYouRickyEvent>(window, DialogWhereAreYouRicky)\n\t\t\t.pipe(\n\t\t\t\ttap(e => {\n\t\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Announce this dialog's presence to the service\n\t */\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(DialogHereMorty, {\n\t\t\t\tdetail: { dialog: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Handle lifecycle callback when dialog is first rendered\n\t */\n\tfirstUpdated() {\n\t\tconst dialog = this.shadowRoot?.querySelector('[role=\"dialog\"]') as HTMLElement\n\t\tif (!dialog) return\n\n\t\t// Set up positioning with Floating UI\n\t\tthis.setupPositioning(dialog)\n\n\t\t// Set up window resize subscription using RxJS with debounce\n\t\tthis.resizeSubscription = fromEvent(window, 'resize')\n\t\t\t.pipe(debounceTime(50)) // Faster response time\n\t\t\t.subscribe(() => {\n\t\t\t\t// Get current viewport dimensions\n\t\t\t\tconst viewportWidth = window.innerWidth\n\t\t\t\tconst viewportHeight = window.innerHeight\n\n\t\t\t\t// If using CSS centered positioning, ensure it stays centered\n\t\t\t\tconst isCentered =\n\t\t\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\t\t\tif (isCentered) {\n\t\t\t\t\t// Update position to new center\n\t\t\t\t\tthis.position = {\n\t\t\t\t\t\tx: viewportWidth / 2,\n\t\t\t\t\t\ty: viewportHeight / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Always update position on resize\n\t\t\t\tthis.updatePosition(dialog)\n\t\t\t})\n\t}\n\n\t/**\n\t * Handle close action\n\t */\n\tprivate handleClose() {\n\t\tthis.hide(false)\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('close', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\t// Determine if the dialog is centered\n\t\tconst viewportWidth = window.innerWidth\n\t\tconst viewportHeight = window.innerHeight\n\t\tconst isCentered =\n\t\t\tMath.abs(this.position.x - viewportWidth / 2) < 10 && Math.abs(this.position.y - viewportHeight / 2) < 10\n\n\t\tconst dialogClasses = {\n\t\t\tabsolute: true,\n\t\t\t'w-[var(--dialog-width)]': true, // Use the specified width\n\t\t\t'max-w-[calc(100vw-2rem)]': true, // Prevent overflow on small screens\n\t\t\t'max-h-[calc(100vh-40px)]': true,\n\t\t\t// Centered positioning\n\t\t\t'top-1/2': isCentered,\n\t\t\t'left-1/2': isCentered,\n\t\t\t'-translate-x-1/2': isCentered,\n\t\t\t'-translate-y-[50%]': isCentered, // Slight upward shift\n\t\t\t'overflow-auto':true\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=\"fixed inset-0 bg-scrim/40\" @click=${this.handleClose}></div>\n\n\t\t\t<section class=${this.classMap(dialogClasses)} role=\"dialog\" aria-modal=\"true\">\n\t\t\t\t<schmancy-surface rounded=\"all\" elevation=\"3\" type=\"containerHigh\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-surface>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-dialog': SchmancyDialog\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n/**\n * A basic dialog content component that doesn't add any padding or styling\n * Used for rendering raw content in a dialog\n *\n * @element schmancy-dialog-content\n * @slot default - Content slot for dialog content without any styling\n */\n@customElement('schmancy-dialog-content')\nexport class SchmancyDialogContent extends $LitElement(css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n`) {\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-dialog-content': SchmancyDialogContent\n }\n}"],"names":["ConfirmDialog","$LitElement","css","constructor","super","arguments","this","title","subtitle","message","confirmText","cancelText","variant","position","x","y","positionOrEvent","clientX","clientY","touches","length","pos","window","innerWidth","innerHeight","virtualReference","getBoundingClientRect","DOMRect","setAttribute","Promise","resolve","resolvePromise","confirmed","removeAttribute","cleanupAutoUpdate","dialog","viewportWidth","viewportHeight","Math","abs","classList","add","autoUpdate","document","body","contains","availableHeight","offsetHeight","style","maxHeight","elementResize","ancestorScroll","remove","updatePosition","ancestorResize","animationFrame","min","computePosition","placement","strategy","middleware","offset","flip","fallbackPlacements","fallbackStrategy","shift","padding","size","apply","availableWidth","elements","floating","offsetWidth","Object","assign","maxWidth","max","margin","left","round","top","transform","disconnectedCallback","resizeSubscription","unsubscribe","firstUpdated","shadowRoot","querySelector","setupPositioning","fromEvent","pipe","debounceTime","subscribe","handleConfirm","hide","dispatchEvent","CustomEvent","bubbles","composed","handleCancel","getConfirmButtonClass","render","hasCustomContent","querySelectorAll","showButtons","trim","html","when","options","createElement","appendChild","width","setProperty","show","event","confirm","__decorateClass","property","type","String","prototype","attribute","customElement","SchmancyDialog","result","connectedCallback","DialogWhereAreYouRicky","tap","e","detail","uid","announcePresence","DialogHereMorty","handleClose","isCentered","dialogClasses","absolute","classMap","reflect","SchmancyDialogContent"],"mappings":";;;;;;;;;;;;;;;AAeO,IAAMA,IAAN,cAA4BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAxC,EAAA;AAAA,EAAA,cAAAC;AAAAC,UAAAA,GAAAC,SAAAA,GAsCNC,KAAAC,QAAAA,QAMAD,KAAAE,WAAAA,QAMAF,KAAAG,UAAAA,QAMAH,KAAAI,cAAc,WAMdJ,KAAAK,aAAa,UAMbL,KAAAM,UAAgC,WAKhCN,KAAQO,WAAW,EAAEC,GAAG,GAAGC,GAAG,EAAA;AAAA,EAAE;AAAA,EA4BhC,MAAA,KAAWC,GAAAA;AAEV,QAAIF,GAAWC;AAEf,QAAKC,EAIL,KAAW,aAAaA,EAEvBF,CAAAA,IAAIE,EAAgBC,SACpBF,IAAIC,EAAgBE;AAAAA,aACV,aAAaF,KAAmBA,EAAgBG,Q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B,sBAAsBA,GACtB,iBAAA,GAAgB;AAGjB,WAAO5B;AAAAA,mDAC0CpG,KAAK+H,WAAAA;AAAAA;AAAAA,oBAEpC/H,KAAKmI,SAASF,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAMjC;AAAA;AAlV2CnB,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQmB,SAAAA,GAAS,CAAA,CAAA,GAhBvBf,EAgB+BH,WAAA,OAAA,CAAA,GAhB/BG,IAANP,EAAA,CADNM,EAAc,iBAAA,CAAA,GACFC,CAAAA;;ACHN,IAAMgB,IAAN,cAAoC1I,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;EAOrD,SAAAmG;AACE,WAAOK;AAAAA,EACT;;AATWiC;;;GAAN,CADNjB,EAAc,yBAAA,CAAA,GACFiB,CAAAA;"}
|
package/dist/dialog.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-B59ekS_y.cjs"),i=require("./dialog-service-B4nR8Em5.cjs");Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>e.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>e.SchmancyDialogContent}),exports.$dialog=i.$dialog,exports.DialogService=i.DialogService;
|
|
2
2
|
//# sourceMappingURL=dialog.cjs.map
|
package/dist/dialog.js
CHANGED
package/dist/directives.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ripple-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ripple-Ujq_REH4.cjs"),r=require("lit/directives/guard.js");exports.DragDirective=e.DragDirective,exports.DropDirective=e.DropDirective,exports.color=e.color,exports.drag=e.drag,exports.drop=e.drop,exports.fullHeight=e.fullHeight,exports.ripple=e.ripple,Object.defineProperty(exports,"guard",{enumerable:!0,get:()=>r.guard});
|
|
2
2
|
//# sourceMappingURL=directives.cjs.map
|
package/dist/directives.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { guard as
|
|
1
|
+
import { D as e, a as o, c as s, d as i, b as p, f as t, r as D } from "./ripple-QoNZUUw_.js";
|
|
2
|
+
import { guard as d } from "lit/directives/guard.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
e as DragDirective,
|
|
5
|
+
o as DropDirective,
|
|
6
|
+
s as color,
|
|
7
|
+
i as drag,
|
|
8
|
+
p as drop,
|
|
9
|
+
t as fullHeight,
|
|
10
|
+
d as guard,
|
|
11
|
+
D as ripple
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=directives.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";require("rxjs"),require("rxjs/operators"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const e=require("lit/decorators.js");require("./tailwind.mixin-JFXu3GSo.cjs");const m=require("./litElement.mixin-B1WTI3WY.cjs"),u=require("lit");var g=Object.defineProperty,h=Object.getOwnPropertyDescriptor,o=(i,a,s,n)=>{for(var l,r=n>1?void 0:n?h(a,s):a,c=i.length-1;c>=0;c--)(l=i[c])&&(r=(n?l(a,s,r):l(r))||r);return n&&r&&g(a,s,r),r};let t=class extends m.$LitElement(u.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@keyframes grow-horizontal {
|
|
7
|
+
from {
|
|
8
|
+
transform: scaleX(0);
|
|
9
|
+
}
|
|
10
|
+
to {
|
|
11
|
+
transform: scaleX(1);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@keyframes grow-vertical {
|
|
16
|
+
from {
|
|
17
|
+
transform: scaleY(0);
|
|
18
|
+
}
|
|
19
|
+
to {
|
|
20
|
+
transform: scaleY(1);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Horizontal divider grow animations */
|
|
25
|
+
.grow-start:not(.h-full) {
|
|
26
|
+
animation: grow-horizontal 400ms ease-out;
|
|
27
|
+
transform-origin: left;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.grow-end:not(.h-full) {
|
|
31
|
+
animation: grow-horizontal 400ms ease-out;
|
|
32
|
+
transform-origin: right;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.grow-both:not(.h-full) {
|
|
36
|
+
animation: grow-horizontal 400ms ease-out;
|
|
37
|
+
transform-origin: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Vertical divider grow animations */
|
|
41
|
+
.grow-start.h-full {
|
|
42
|
+
animation: grow-vertical 400ms ease-out;
|
|
43
|
+
transform-origin: top;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.grow-end.h-full {
|
|
47
|
+
animation: grow-vertical 400ms ease-out;
|
|
48
|
+
transform-origin: bottom;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.grow-both.h-full {
|
|
52
|
+
animation: grow-vertical 400ms ease-out;
|
|
53
|
+
transform-origin: center;
|
|
54
|
+
}
|
|
55
|
+
`){constructor(){super(...arguments),this.outline="variant",this.vertical=!1,this.grow="start"}set orientation(i){this.vertical=i==="vertical"}get orientation(){return this.vertical?"vertical":"horizontal"}render(){return u.html`<div
|
|
56
|
+
class=${this.classMap({"w-full h-px":!this.vertical,"h-full w-px":this.vertical,"border-outlineVariant":this.outline==="variant","border-outline":this.outline==="default","border-t":!this.vertical,"border-l":this.vertical,[`grow-${this.grow}`]:!0})}
|
|
57
|
+
></div>`}};o([e.property({type:String})],t.prototype,"outline",2),o([e.property({type:Boolean})],t.prototype,"vertical",2),o([e.property({type:String})],t.prototype,"grow",2),o([e.property({reflect:!0,type:String})],t.prototype,"orientation",1),t=o([e.customElement("schmancy-divider")],t);
|
|
58
|
+
//# sourceMappingURL=divider-8tk2mDbL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider-8tk2mDbL.cjs","sources":["../src/divider/divider.ts"],"sourcesContent":["// divider.ts\nimport { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-divider')\nexport default class SchmancyDivider extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t@keyframes grow-horizontal {\n\t\tfrom {\n\t\t\ttransform: scaleX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleX(1);\n\t\t}\n\t}\n\n\t@keyframes grow-vertical {\n\t\tfrom {\n\t\t\ttransform: scaleY(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: scaleY(1);\n\t\t}\n\t}\n\n\t/* Horizontal divider grow animations */\n\t.grow-start:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: left;\n\t}\n\n\t.grow-end:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: right;\n\t}\n\n\t.grow-both:not(.h-full) {\n\t\tanimation: grow-horizontal 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n\n\t/* Vertical divider grow animations */\n\t.grow-start.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: top;\n\t}\n\n\t.grow-end.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: bottom;\n\t}\n\n\t.grow-both.h-full {\n\t\tanimation: grow-vertical 400ms ease-out;\n\t\ttransform-origin: center;\n\t}\n`) {\n\t@property({ type: String }) outline: 'default' | 'variant' = 'variant'\n\t@property({ type: Boolean }) vertical = false\n\t@property({ type: String }) grow: 'start' | 'end' | 'both' = 'start'\n\n\t/**\n\t * @deprecated Use `vertical` property instead. Will be removed in next major version.\n\t */\n\t@property({ reflect: true, type: String })\n\tset orientation(value: 'horizontal' | 'vertical') {\n\t\tthis.vertical = value === 'vertical'\n\t}\n\tget orientation(): 'horizontal' | 'vertical' {\n\t\treturn this.vertical ? 'vertical' : 'horizontal'\n\t}\n\n\tprotected render() {\n\t\treturn html`<div\n\t\t\tclass=${this.classMap({\n\t\t\t\t// Dimensions\n\t\t\t\t'w-full h-px': !this.vertical,\n\t\t\t\t'h-full w-px': this.vertical,\n\t\t\t\t// Border color\n\t\t\t\t'border-outlineVariant': this.outline === 'variant',\n\t\t\t\t'border-outline': this.outline === 'default',\n\t\t\t\t// Border style\n\t\t\t\t'border-t': !this.vertical,\n\t\t\t\t'border-l': this.vertical,\n\t\t\t\t// Grow behavior\n\t\t\t\t[`grow-${this.grow}`]: true,\n\t\t\t})}\n\t\t></div>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-divider': SchmancyDivider\n\t}\n}\n"],"names":["SchmancyDivider","$LitElement","css","constructor","super","arguments","this","outline","vertical","grow","value","render","html","classMap","__decorateClass","property","type","String","prototype","Boolean","reflect","customElement"],"mappings":"udAMA,IAAqBA,EAArB,cAA6CC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAA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