@mhmo91/schmancy 0.2.118 → 0.2.120
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/dist/{animated-text-C2EvhDmf.cjs → animated-text-BH6DM-pF.cjs} +2 -2
- package/dist/{animated-text-C2EvhDmf.cjs.map → animated-text-BH6DM-pF.cjs.map} +1 -1
- package/dist/{animated-text-6DhYKKzt.js → animated-text-C92_eFNP.js} +3 -3
- package/dist/{animated-text-6DhYKKzt.js.map → animated-text-C92_eFNP.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-X-1ZwgJL.cjs → area.component-BDkmpYX3.cjs} +2 -2
- package/dist/{area.component-X-1ZwgJL.cjs.map → area.component-BDkmpYX3.cjs.map} +1 -1
- package/dist/{area.component-DAry93pl.js → area.component-Bh_XioGp.js} +10 -10
- package/dist/{area.component-DAry93pl.js.map → area.component-Bh_XioGp.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/autocomplete-DMSMomJC.cjs +57 -0
- package/dist/{autocomplete-BIJ9G0y1.cjs.map → autocomplete-DMSMomJC.cjs.map} +1 -1
- package/dist/{autocomplete-C_QyhPJw.js → autocomplete-IOFBU8oc.js} +4 -5
- package/dist/{autocomplete-C_QyhPJw.js.map → autocomplete-IOFBU8oc.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.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-BkGLOzBe.cjs → checkbox-Bw98L4cT.cjs} +2 -2
- package/dist/{checkbox-BkGLOzBe.cjs.map → checkbox-Bw98L4cT.cjs.map} +1 -1
- package/dist/{checkbox-CTRhgYJB.js → checkbox-CglGRaSJ.js} +2 -2
- package/dist/{checkbox-CTRhgYJB.js.map → checkbox-CglGRaSJ.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-B4X5PxUQ.cjs → chips-BepHO_mm.cjs} +2 -2
- package/dist/{chips-B4X5PxUQ.cjs.map → chips-BepHO_mm.cjs.map} +1 -1
- package/dist/{chips-DjX_Zznh.js → chips-C_7K0qF3.js} +3 -3
- package/dist/{chips-DjX_Zznh.js.map → chips-C_7K0qF3.js.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +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/context-object-CVqtbNDv.js +303 -0
- package/dist/context-object-CVqtbNDv.js.map +1 -0
- package/dist/context-object-CgZ6F8E9.cjs +2 -0
- package/dist/context-object-CgZ6F8E9.cjs.map +1 -0
- package/dist/{date-range-CRJ7wYwK.js → date-range-BBY-tMEk.js} +3 -3
- package/dist/{date-range-CRJ7wYwK.js.map → date-range-BBY-tMEk.js.map} +1 -1
- package/dist/{date-range-CCsKoZUV.cjs → date-range-DC3sAepm.cjs} +2 -2
- package/dist/{date-range-CCsKoZUV.cjs.map → date-range-DC3sAepm.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-BkSIN-In.js → delay-DcwT5pHi.js} +2 -2
- package/dist/{delay-BkSIN-In.js.map → delay-DcwT5pHi.js.map} +1 -1
- package/dist/{delay-ttYmIqo7.cjs → delay-UhlOkp1Q.cjs} +2 -2
- package/dist/{delay-ttYmIqo7.cjs.map → delay-UhlOkp1Q.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +4 -5
- package/dist/directives.js.map +1 -1
- package/dist/{divider-C3zQQjqq.js → divider-B-bxtxQ9.js} +3 -3
- package/dist/{divider-C3zQQjqq.js.map → divider-B-bxtxQ9.js.map} +1 -1
- package/dist/{divider-2AVp1yWB.cjs → divider-yLBrmrYU.cjs} +2 -2
- package/dist/{divider-2AVp1yWB.cjs.map → divider-yLBrmrYU.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-CfGGWirm.cjs → flex-CG8OOL02.cjs} +2 -2
- package/dist/{flex-CfGGWirm.cjs.map → flex-CG8OOL02.cjs.map} +1 -1
- package/dist/{flex-CfRUWQWK.js → flex-CofCUs7b.js} +4 -4
- package/dist/{flex-CfRUWQWK.js.map → flex-CofCUs7b.js.map} +1 -1
- package/dist/form-BqHD2BmW.cjs +14 -0
- package/dist/form-BqHD2BmW.cjs.map +1 -0
- package/dist/form-CbH5yVTc.js +161 -0
- package/dist/form-CbH5yVTc.js.map +1 -0
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-BLvikygg.js → icon-2u-dF77v.js} +3 -3
- package/dist/{icon-BLvikygg.js.map → icon-2u-dF77v.js.map} +1 -1
- package/dist/{icon-BfUZ5ZBV.cjs → icon-CqImPgUG.cjs} +2 -2
- package/dist/{icon-BfUZ5ZBV.cjs.map → icon-CqImPgUG.cjs.map} +1 -1
- package/dist/{icon-button-BefimCfp.cjs → icon-button-CZjaNotL.cjs} +2 -2
- package/dist/{icon-button-BefimCfp.cjs.map → icon-button-CZjaNotL.cjs.map} +1 -1
- package/dist/{icon-button-OidywZ1U.js → icon-button-xKDMAiJd.js} +3 -3
- package/dist/{icon-button-OidywZ1U.js.map → icon-button-xKDMAiJd.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +128 -105
- package/dist/index.js.map +1 -1
- package/dist/input-BDXWcxNw.cjs +111 -0
- package/dist/input-BDXWcxNw.cjs.map +1 -0
- package/dist/input-fP8EqcLF.js +390 -0
- package/dist/input-fP8EqcLF.js.map +1 -0
- 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-C78nnFIZ.cjs → list-C8pDC7As.cjs} +2 -2
- package/dist/{list-C78nnFIZ.cjs.map → list-C8pDC7As.cjs.map} +1 -1
- package/dist/{list-CQV0ecrY.js → list-O7kfL-NW.js} +2 -2
- package/dist/{list-CQV0ecrY.js.map → list-O7kfL-NW.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-DGx3SrGX.cjs → litElement.mixin-Ct-snNwC.cjs} +2 -2
- package/dist/{litElement.mixin-DGx3SrGX.cjs.map → litElement.mixin-Ct-snNwC.cjs.map} +1 -1
- package/dist/{litElement.mixin-B1ZP2iG4.js → litElement.mixin-CtugwVVz.js} +2 -2
- package/dist/{litElement.mixin-B1ZP2iG4.js.map → litElement.mixin-CtugwVVz.js.map} +1 -1
- package/dist/{menu-15yMmtd2.js → menu-DoVBeCHb.js} +3 -3
- package/dist/{menu-15yMmtd2.js.map → menu-DoVBeCHb.js.map} +1 -1
- package/dist/{menu-DqLKbEXx.cjs → menu-bkGcaSru.cjs} +2 -2
- package/dist/{menu-DqLKbEXx.cjs.map → menu-bkGcaSru.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-DleJMgj-.js → option-D_RxI1cV.js} +2 -2
- package/dist/{option-DleJMgj-.js.map → option-D_RxI1cV.js.map} +1 -1
- package/dist/{option-BaOmCXP8.cjs → option-DrizkeI1.cjs} +2 -2
- package/dist/{option-BaOmCXP8.cjs.map → option-DrizkeI1.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{outlet-mNvq9oaA.cjs → outlet-BIwnmuNu.cjs} +2 -2
- package/dist/{outlet-mNvq9oaA.cjs.map → outlet-BIwnmuNu.cjs.map} +1 -1
- package/dist/{outlet-I1IE2wTK.js → outlet-U_CoKIxQ.js} +2 -2
- package/dist/{outlet-I1IE2wTK.js.map → outlet-U_CoKIxQ.js.map} +1 -1
- package/dist/{payment-card-form-Cm_-ul4G.cjs → payment-card-form-BPtQt3Xd.cjs} +2 -2
- package/dist/{payment-card-form-Cm_-ul4G.cjs.map → payment-card-form-BPtQt3Xd.cjs.map} +1 -1
- package/dist/{payment-card-form-DHmtfa_H.js → payment-card-form-CSboFL3Z.js} +3 -3
- package/dist/{payment-card-form-DHmtfa_H.js.map → payment-card-form-CSboFL3Z.js.map} +1 -1
- package/dist/{radio-group-CSKgiPxL.js → radio-group-BNyzzO-F.js} +2 -2
- package/dist/{radio-group-CSKgiPxL.js.map → radio-group-BNyzzO-F.js.map} +1 -1
- package/dist/{radio-group-RChAvIUM.cjs → radio-group-DiRAAiCy.cjs} +2 -2
- package/dist/{radio-group-RChAvIUM.cjs.map → radio-group-DiRAAiCy.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/ripple-BumgqsDT.js +78 -0
- package/dist/ripple-BumgqsDT.js.map +1 -0
- package/dist/ripple-C2BHbhcS.cjs +16 -0
- package/dist/ripple-C2BHbhcS.cjs.map +1 -0
- package/dist/rxjs-utils.js +4 -4
- package/dist/schmancy-steps-container-3Odvvi2u.cjs +64 -0
- package/dist/schmancy-steps-container-3Odvvi2u.cjs.map +1 -0
- package/dist/schmancy-steps-container-Ke5dskhS.js +147 -0
- package/dist/schmancy-steps-container-Ke5dskhS.js.map +1 -0
- package/dist/select-BYI_HL-h.js +234 -0
- package/dist/select-BYI_HL-h.js.map +1 -0
- package/dist/select-DiFknGpF.cjs +57 -0
- package/dist/select-DiFknGpF.cjs.map +1 -0
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/selector-hook-B5oIBdcJ.cjs +2 -0
- package/dist/selector-hook-B5oIBdcJ.cjs.map +1 -0
- package/dist/selector-hook-BdsJkaE2.js +185 -0
- package/dist/selector-hook-BdsJkaE2.js.map +1 -0
- package/dist/{sheet-DcDDkPRG.js → sheet-9d1u9s1_.js} +12 -12
- package/dist/{sheet-DcDDkPRG.js.map → sheet-9d1u9s1_.js.map} +1 -1
- package/dist/{sheet-OQg2AgBP.cjs → sheet-BKvr585i.cjs} +2 -2
- package/dist/{sheet-OQg2AgBP.cjs.map → sheet-BKvr585i.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-njrfDqrk.js → slider-DAawYwTF.js} +3 -3
- package/dist/{slider-njrfDqrk.js.map → slider-DAawYwTF.js.map} +1 -1
- package/dist/{slider-rumGp8Bz.cjs → slider-bPjwDSDc.cjs} +2 -2
- package/dist/{slider-rumGp8Bz.cjs.map → slider-bPjwDSDc.cjs.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-DVEN9TFJ.cjs → spinner-BgkHeWML.cjs} +4 -4
- package/dist/{spinner-DVEN9TFJ.cjs.map → spinner-BgkHeWML.cjs.map} +1 -1
- package/dist/{spinner-C3JUT7Lx.js → spinner-CTrfi93b.js} +11 -12
- package/dist/{spinner-C3JUT7Lx.js.map → spinner-CTrfi93b.js.map} +1 -1
- package/dist/steps.cjs +2 -0
- package/dist/steps.cjs.map +1 -0
- package/dist/steps.js +8 -0
- package/dist/steps.js.map +1 -0
- package/dist/store.cjs +2 -0
- package/dist/store.cjs.map +1 -0
- package/dist/store.js +22 -0
- package/dist/store.js.map +1 -0
- package/dist/{surface-BpQasVOW.js → surface-CjUAkHMv.js} +2 -2
- package/dist/{surface-BpQasVOW.js.map → surface-CjUAkHMv.js.map} +1 -1
- package/dist/{surface-CZayNjQ8.cjs → surface-QtNAwY0v.cjs} +2 -2
- package/dist/{surface-CZayNjQ8.cjs.map → surface-QtNAwY0v.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/table-CUgn9BYP.cjs +80 -0
- package/dist/table-CUgn9BYP.cjs.map +1 -0
- package/dist/table-k-u5jZrL.js +129 -0
- package/dist/table-k-u5jZrL.js.map +1 -0
- package/dist/table.cjs +1 -1
- package/dist/table.js +5 -1
- package/dist/{tabs-group-BWmuXV1M.cjs → tabs-group-B4ZCjn7j.cjs} +2 -2
- package/dist/{tabs-group-BWmuXV1M.cjs.map → tabs-group-B4ZCjn7j.cjs.map} +1 -1
- package/dist/{tabs-group-Dsupy-TK.js → tabs-group-BhHCB2nJ.js} +2 -2
- package/dist/{tabs-group-Dsupy-TK.js.map → tabs-group-BhHCB2nJ.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-Bn3Brhz1.js +43 -0
- package/dist/{tailwind.mixin-C2MUeArS.js.map → tailwind.mixin-Bn3Brhz1.js.map} +1 -1
- package/dist/tailwind.mixin-DqqGTjD_.cjs +2 -0
- package/dist/{tailwind.mixin-UzdLTEsN.cjs.map → tailwind.mixin-DqqGTjD_.cjs.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-Cf9BZUyf.js → teleport.component-CCf1dH9g.js} +59 -59
- package/dist/{teleport.component-Cf9BZUyf.js.map → teleport.component-CCf1dH9g.js.map} +1 -1
- package/dist/{teleport.component-DElxiimP.cjs → teleport.component-n3DU71bR.cjs} +19 -19
- package/dist/{teleport.component-DElxiimP.cjs.map → teleport.component-n3DU71bR.cjs.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/textarea-8T5kXo2A.cjs +42 -0
- package/dist/{textarea-DtP4CN8S.cjs.map → textarea-8T5kXo2A.cjs.map} +1 -1
- package/dist/{textarea-DZhAzd2-.js → textarea-CqkmSvJg.js} +8 -9
- package/dist/{textarea-DZhAzd2-.js.map → textarea-CqkmSvJg.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-XUBpRyVd.cjs → theme-button-CZFLICY-.cjs} +2 -2
- package/dist/{theme-button-XUBpRyVd.cjs.map → theme-button-CZFLICY-.cjs.map} +1 -1
- package/dist/{theme-button-B7v53G35.js → theme-button-CyebufWg.js} +2 -2
- package/dist/{theme-button-B7v53G35.js.map → theme-button-CyebufWg.js.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.component-Df85q2pE.cjs → theme.component-DTaJ-jCs.cjs} +2 -2
- package/dist/{theme.component-Df85q2pE.cjs.map → theme.component-DTaJ-jCs.cjs.map} +1 -1
- package/dist/{theme.component-4tKB3U5D.js → theme.component-HyW-lfw_.js} +2 -2
- package/dist/{theme.component-4tKB3U5D.js.map → theme.component-HyW-lfw_.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-FYjFkh4S.cjs → timezone-CgtDcgym.cjs} +2 -2
- package/dist/{timezone-FYjFkh4S.cjs.map → timezone-CgtDcgym.cjs.map} +1 -1
- package/dist/{timezone-C9zQrHBV.js → timezone-Cn0_OvVY.js} +3 -3
- package/dist/{timezone-C9zQrHBV.js.map → timezone-Cn0_OvVY.js.map} +1 -1
- package/dist/{tree-BEsQyzsP.js → tree-B0bZOfLC.js} +2 -2
- package/dist/{tree-BEsQyzsP.js.map → tree-B0bZOfLC.js.map} +1 -1
- package/dist/{tree-k_BipeY0.cjs → tree-Bg8L88Pd.cjs} +2 -2
- package/dist/{tree-k_BipeY0.cjs.map → tree-Bg8L88Pd.cjs.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-B3B8JBRl.cjs → typewriter-C-U4rB_m.cjs} +2 -2
- package/dist/{typewriter-B3B8JBRl.cjs.map → typewriter-C-U4rB_m.cjs.map} +1 -1
- package/dist/{typewriter-CjgsbmTc.js → typewriter-DB08jO4e.js} +11 -11
- package/dist/{typewriter-CjgsbmTc.js.map → typewriter-DB08jO4e.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-BzTRpIGt.js → typography-CdFf2sTC.js} +2 -2
- package/dist/{typography-BzTRpIGt.js.map → typography-CdFf2sTC.js.map} +1 -1
- package/dist/{typography-Cs7PQACq.cjs → typography-DvI9Wos_.cjs} +2 -2
- package/dist/{typography-Cs7PQACq.cjs.map → typography-DvI9Wos_.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/form/form-v2.d.ts +72 -0
- package/types/src/form/index.d.ts +1 -0
- package/types/src/index.d.ts +2 -1
- package/types/src/input/index.d.ts +1 -0
- package/types/src/input/input-v2.d.ts +250 -0
- package/types/src/select/select.d.ts +10 -1
- package/types/src/steps/index.d.ts +3 -0
- package/types/src/steps/schmancy-step.d.ts +52 -0
- package/types/src/steps/schmancy-steps-container.d.ts +17 -0
- package/types/src/steps/steps.context.d.ts +12 -0
- package/types/src/store/action-creator.d.ts +8 -0
- package/types/src/store/clear.d.ts +1 -0
- package/types/src/store/context-collection.d.ts +74 -0
- package/types/src/store/context-create.d.ts +8 -0
- package/types/src/store/context-object.d.ts +69 -0
- package/types/src/store/filter-directive.d.ts +32 -0
- package/types/src/store/index.d.ts +8 -0
- package/types/src/store/selector-hook.d.ts +15 -0
- package/types/src/store/selectors.d.ts +50 -0
- package/types/src/store/storage-manager.d.ts +56 -0
- package/types/src/store/types.d.ts +84 -0
- package/types/src/table/index.d.ts +1 -0
- package/types/src/table/row.d.ts +19 -0
- package/types/src/table/table.d.ts +26 -4
- package/dist/autocomplete-BIJ9G0y1.cjs +0 -57
- package/dist/color-D8r6dpWm.cjs +0 -2
- package/dist/color-D8r6dpWm.cjs.map +0 -1
- package/dist/color-DrgmL7QT.js +0 -19
- package/dist/color-DrgmL7QT.js.map +0 -1
- package/dist/form-BTg8x5QO.js +0 -73
- package/dist/form-BTg8x5QO.js.map +0 -1
- package/dist/form-DPRTjp4Q.cjs +0 -8
- package/dist/form-DPRTjp4Q.cjs.map +0 -1
- package/dist/input-BNIa-xYu.js +0 -136
- package/dist/input-BNIa-xYu.js.map +0 -1
- package/dist/input-CqYkuOF4.cjs +0 -51
- package/dist/input-CqYkuOF4.cjs.map +0 -1
- package/dist/input-Dq3dT_7p.cjs +0 -98
- package/dist/input-Dq3dT_7p.cjs.map +0 -1
- package/dist/input-igN7Vis2.js +0 -205
- package/dist/input-igN7Vis2.js.map +0 -1
- package/dist/ripple-3indJ14o.js +0 -64
- package/dist/ripple-3indJ14o.js.map +0 -1
- package/dist/ripple-B_wT0zgD.cjs +0 -16
- package/dist/ripple-B_wT0zgD.cjs.map +0 -1
- package/dist/select-CHXdCR-t.js +0 -206
- package/dist/select-CHXdCR-t.js.map +0 -1
- package/dist/select-Gbo-xjwq.cjs +0 -56
- package/dist/select-Gbo-xjwq.cjs.map +0 -1
- package/dist/table-BzJFv5qf.cjs +0 -6
- package/dist/table-BzJFv5qf.cjs.map +0 -1
- package/dist/table-CWRqwAtQ.js +0 -21
- package/dist/table-CWRqwAtQ.js.map +0 -1
- package/dist/tailwind.mixin-C2MUeArS.js +0 -43
- package/dist/tailwind.mixin-UzdLTEsN.cjs +0 -2
- package/dist/textarea-DtP4CN8S.cjs +0 -42
- package/dist/v2.cjs +0 -2
- package/dist/v2.cjs.map +0 -1
- package/dist/v2.js +0 -5
- package/dist/v2.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-DiRAAiCy.cjs","sources":["../src/radio-group/radio-group.ts"],"sourcesContent":["import { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { Subject } from 'rxjs'\nimport style from './radio-group.scss?inline'\nimport { TailwindElement } from '@mixins/index'\nimport { when } from 'lit/directives/when.js'\n\nexport type SchmancyRadioGroupOption = {\n\tlabel: string\n\tvalue: string\n}\nexport type SchmancyRadioGroupChangeEvent = CustomEvent<{\n\tvalue: string\n}>\n@customElement('schmancy-radio-group')\nexport class RadioGroup extends TailwindElement(style) {\n\t@property({ type: String }) label = ''\n\t@property({ type: String }) name = ''\n\t@property({ type: String }) selected = ''\n\t@property({ type: Array }) options: SchmancyRadioGroupOption[] = []\n\t@property({ type: Boolean }) required: boolean = false\n\tprivate selection$ = new Subject<SchmancyRadioGroupOption>()\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.selection$.subscribe(value => {\n\t\t\tthis.selected = value.value\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('change', {\n\t\t\t\t\tdetail: value,\n\t\t\t\t\tbubbles: true,\n\t\t\t\t}),\n\t\t\t)\n\t\t})\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.selection$?.unsubscribe()\n\t}\n\tprivate handleSelection(value: SchmancyRadioGroupOption) {\n\t\tthis.selection$.next(value)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"grid gap-4\">\n\t\t\t\t${when(this.label, () => html` <label class=\"text-base font-semibold text-gray-900\">${this.label}</label> `)}\n\t\t\t\t${this.options?.map(\n\t\t\t\t\toption => html`\n\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t.required=${this.required}\n\t\t\t\t\t\t\t\tid=${option.value}\n\t\t\t\t\t\t\t\tclass=\"h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600\"\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tname=${this.name}\n\t\t\t\t\t\t\t\t.value=${option.value}\n\t\t\t\t\t\t\t\t.checked=${option.value === this.selected}\n\t\t\t\t\t\t\t\t@change=${() => this.handleSelection(option)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<label for=${option.value} class=\"ml-3 block text-sm font-medium leading-6 text-gray-900\"\n\t\t\t\t\t\t\t\t>${option.value}</label\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-radio-group': RadioGroup\n\t}\n}\n"],"names":["RadioGroup","TailwindElement","super","arguments","this","label","name","selected","options","required","selection$","Subject","connectedCallback","subscribe","value","dispatchEvent","CustomEvent","detail","bubbles","disconnectedCallback","unsubscribe","next","html","when","map","option","handleSelection","__decorateClass","property","type","String","prototype","Array","Boolean","customElement"],"mappings":"wbAeaA,QAAAA,WAAN,cAAyBC,6DAAzB,aAAAC,CAAAA,MAAAA,GAAAC,SAC8BC,EAAAA,KAAAC,MAAA,GACDD,KAAAE,KAAA,GACIF,KAAAG,SAAA,GACZH,KAAAI,QAAsC,CAChBJ,EAAAA,KAAAK,SAAA,GACzCL,KAAAM,WAAa,IAAIC,SAAkC,CAE3D,mBAAAC,CACCV,MAAMU,kBAAAA,EACDR,KAAAM,WAAWG,UAAmBC,GAClCV,CAAAA,KAAKG,SAAWO,EAAMA,MACjBV,KAAAW,cACJ,IAAIC,YAAY,SAAU,CACzBC,OAAQH,EACRI,QAAAA,EAEF,CAAA,CAAA,CAAA,CAAA,CACA,CAGF,sBAAAC,OACCjB,MAAMiB,qBAAAA,GACNf,EAAAA,KAAKM,aAALN,MAAAA,EAAiBgB,aAAY,CAEtB,gBAAgBN,EAClBV,CAAAA,KAAAM,WAAWW,KAAKP,EAAK,CAG3B,QACQ,OAAA,OAAAQ,EAAAA;AAAAA;AAAAA,MAEHC,EAAAA,KAAKnB,KAAKC,MAAO,IAAMiB,EAAAA,6DAA6DlB,KAAKC,KAAAA,WAAAA,CAAAA;AAAAA,OACzFD,EAAAA,KAAKI,UAALJ,YAAAA,EAAcoB,IACLC,GAAAH,EAAAA;AAAAA;AAAAA;AAAAA,oBAGKlB,KAAKK,QAAAA;AAAAA,aACZgB,EAAOX,KAAAA;AAAAA;AAAAA;AAAAA,eAGLV,KAAKE,IAAAA;AAAAA,iBACHmB,EAAOX,KAAAA;AAAAA,mBACLW,EAAOX,QAAUV,KAAKG,QAAAA;AAAAA,kBACvB,IAAMH,KAAKsB,gBAAgBD,CAAAA,CAAAA;AAAAA;AAAAA,oBAEzBA,EAAOX,KAAAA;AAAAA,WAChBW,EAAOX,KAAAA;AAAAA;AAAAA;AAAAA;;GAIb,CAAA,EAlDwBa,EAAA,CAA3BC,WAAS,CAAEC,KAAMC,MADN9B,CAAAA,CAAAA,EAAAA,mBACgB+B,UAAA,QAAA,CAAA,EACAJ,EAAA,CAA3BC,WAAS,CAAEC,KAAMC,MAAAA,CAAAA,CAAAA,EAFN9B,mBAEgB+B,UAAA,OAAA,CAAA,EACAJ,EAAA,CAA3BC,WAAS,CAAEC,KAAMC,UAHN9B,mBAGgB+B,UAAA,WAAA,CACDJ,EAAAA,EAAA,CAA1BC,WAAS,CAAEC,KAAMG,KAJNhC,CAAAA,CAAAA,EAAAA,mBAIe+B,UAAA,UAAA,CAAA,EACEJ,EAAA,CAA5BC,WAAS,CAAEC,KAAMI,OAAAA,CAAAA,CAAAA,EALNjC,mBAKiB+B,UAAA,WAAA,CAAA,EALjB/B,QAANA,WAAA2B,EAAA,CADNO,EAAAA,cAAc,yBACFlC"}
|
package/dist/radio-group.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./radio-group-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./radio-group-DiRAAiCy.cjs");Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>e.RadioGroup});
|
|
2
2
|
//# sourceMappingURL=radio-group.cjs.map
|
package/dist/radio-group.js
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { nothing as d } from "lit";
|
|
2
|
+
import { directive as s, Directive as h, PartType as r } from "lit/directive.js";
|
|
3
|
+
import { Subject as a, fromEvent as m, debounceTime as f, startWith as g, takeUntil as u } from "rxjs";
|
|
4
|
+
import { AsyncDirective as p } from "lit/async-directive.js";
|
|
5
|
+
const x = s(class extends h {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
super(e), this.config = {};
|
|
8
|
+
}
|
|
9
|
+
update(e, [t]) {
|
|
10
|
+
if (e.type !== r.ELEMENT) throw new Error("The `classMap` directive must be used in the `class` attribute");
|
|
11
|
+
const n = e.element;
|
|
12
|
+
this.config = t, this.config.bgColor && (n.style.backgroundColor = this.config.bgColor), this.config.color && (n.style.color = this.config.color);
|
|
13
|
+
}
|
|
14
|
+
render(e) {
|
|
15
|
+
return this.config = e, d;
|
|
16
|
+
}
|
|
17
|
+
}), i = new a();
|
|
18
|
+
m(window, "resize").pipe(f(10), g(window)).subscribe({ next: () => {
|
|
19
|
+
i.next(window);
|
|
20
|
+
} });
|
|
21
|
+
const v = s(class extends p {
|
|
22
|
+
constructor(e) {
|
|
23
|
+
super(e), this.disconnecting = new a(), i.pipe(u(this.disconnecting)).subscribe(() => {
|
|
24
|
+
this.element.style.setProperty("height", `${window.innerHeight}px`), setTimeout(() => {
|
|
25
|
+
this.element.style.setProperty("height", `${window.innerHeight}px`);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
}
|
|
31
|
+
update(e) {
|
|
32
|
+
if (e.type !== r.ELEMENT) throw new Error("The `ripple` directive can only be used on elements");
|
|
33
|
+
this.element = e.element, i.next(window);
|
|
34
|
+
}
|
|
35
|
+
disconnected() {
|
|
36
|
+
this.disconnecting.next(!0);
|
|
37
|
+
}
|
|
38
|
+
reconnected() {
|
|
39
|
+
}
|
|
40
|
+
}), T = s(class extends p {
|
|
41
|
+
render() {
|
|
42
|
+
}
|
|
43
|
+
addRippleEffect(e) {
|
|
44
|
+
const t = e.target, n = document.createElement("span"), o = Math.max(t.clientWidth, t.clientHeight), c = o / 2;
|
|
45
|
+
n.style.width = n.style.height = `${o}px`, n.style.left = e.clientX - t.getBoundingClientRect().left - c + "px", n.style.top = e.clientY - t.getBoundingClientRect().top - c + "px", n.classList.add("ripple");
|
|
46
|
+
const l = t.getElementsByClassName("ripple")[0];
|
|
47
|
+
l && l.remove(), t.appendChild(n);
|
|
48
|
+
}
|
|
49
|
+
update(e) {
|
|
50
|
+
if (e.type !== r.ELEMENT) throw new Error("The `ripple` directive can only be used on elements");
|
|
51
|
+
this.element = e.element;
|
|
52
|
+
const t = document.createElement("style");
|
|
53
|
+
t.append(`.ripple {
|
|
54
|
+
position: absolute;
|
|
55
|
+
border-radius: 50%;
|
|
56
|
+
background: var(--schmancy-sys-color-surface-high);
|
|
57
|
+
transform: scale(0);
|
|
58
|
+
animation: ripple 600ms linear;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@keyframes ripple {
|
|
62
|
+
to {
|
|
63
|
+
transform: scale(4);
|
|
64
|
+
opacity: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`), this.element.append(t), this.element.addEventListener("click", this.addRippleEffect);
|
|
68
|
+
}
|
|
69
|
+
disconnected() {
|
|
70
|
+
this.element && this.element.removeEventListener("click", this.addRippleEffect);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
x as c,
|
|
75
|
+
v as f,
|
|
76
|
+
T as r
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=ripple-BumgqsDT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripple-BumgqsDT.js","sources":["../src/directives/color.ts","../src/directives/height.ts","../src/directives/ripple.ts"],"sourcesContent":["// color.ts\nimport { Part, nothing } from 'lit'\nimport { Directive, PartInfo, PartType, directive } from 'lit/directive.js'\n\nexport type ColorConfig = {\n\tbgColor?: string\n\tcolor?: string\n}\n\nclass ColorDirective extends Directive {\n\tprivate config: ColorConfig\n\n\tconstructor(partInfo: PartInfo) {\n\t\tsuper(partInfo)\n\t\tthis.config = {}\n\t}\n\n\tupdate(part: Part, [config]: [ColorConfig]) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The `classMap` directive must be used in the `class` attribute')\n\t\t}\n\t\tconst element = part.element as HTMLElement\n\t\tthis.config = config\n\t\tif (this.config.bgColor) {\n\t\t\telement.style.backgroundColor = this.config.bgColor\n\t\t}\n\n\t\tif (this.config.color) {\n\t\t\telement.style.color = this.config.color\n\t\t}\n\t}\n\n\trender(config: ColorConfig): unknown {\n\t\tthis.config = config\n\t\treturn nothing\n\t}\n}\n\nconst color = directive(ColorDirective)\n\nexport { color }\n","import { Subject, debounceTime, fromEvent, startWith, takeUntil } from 'rxjs'\n\nconst $SchmancyResize = new Subject<Window>()\nfromEvent<Event>(window, 'resize')\n\t.pipe(\n\t\tdebounceTime(10), // Adjust the debounce time as needed\n\t\tstartWith(window),\n\t)\n\t.subscribe({\n\t\tnext: () => {\n\t\t\t$SchmancyResize.next(window)\n\t\t},\n\t})\n\nimport { directive, PartInfo, PartType } from 'lit/directive.js'\nimport { AsyncDirective } from 'lit/async-directive.js'\nimport { LitElement } from 'lit'\n\nclass FullHeight extends AsyncDirective {\n\telement: HTMLElement & LitElement\n\tdisconnecting = new Subject<boolean>()\n\trender() {\n\t\treturn\n\t}\n\n\tconstructor(_partInfo: PartInfo) {\n\t\tsuper(_partInfo)\n\t\t$SchmancyResize.pipe(takeUntil(this.disconnecting)).subscribe(() => {\n\t\t\tthis.element.style.setProperty('height', `${window.innerHeight}px`)\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.element.style.setProperty('height', `${window.innerHeight}px`)\n\t\t\t})\n\t\t})\n\t}\n\n\tupdate(part) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The `ripple` directive can only be used on elements')\n\t\t}\n\t\tthis.element = part.element\n\t\t$SchmancyResize.next(window)\n\t}\n\n\tdisconnected() {\n\t\tthis.disconnecting.next(true)\n\t}\n\n\treconnected() {}\n}\n\nexport const fullHeight = directive(FullHeight)\n","import { directive, PartType } from 'lit/directive.js'\nimport { AsyncDirective } from 'lit/async-directive.js'\n\nconst rippleStyle = `.ripple {\n position: absolute;\n border-radius: 50%;\n background: var(--schmancy-sys-color-surface-high);\n transform: scale(0);\n animation: ripple 600ms linear;\n}\n\n@keyframes ripple {\n to {\n transform: scale(4);\n opacity: 0;\n }\n}\n`\nclass RippleDirective extends AsyncDirective {\n\telement: HTMLElement\n\trender() {\n\t\treturn\n\t}\n\n\taddRippleEffect(event) {\n\t\tconst element = event.target\n\t\tconst circle = document.createElement('span')\n\t\tconst diameter = Math.max(element.clientWidth, element.clientHeight)\n\t\tconst radius = diameter / 2\n\t\tcircle.style.width = circle.style.height = `${diameter}px`\n\t\tcircle.style.left = `${event.clientX - element.getBoundingClientRect().left - radius}px`\n\t\tcircle.style.top = `${event.clientY - element.getBoundingClientRect().top - radius}px`\n\t\tcircle.classList.add('ripple')\n\n\t\tconst ripple = element.getElementsByClassName('ripple')[0]\n\t\tif (ripple) {\n\t\t\tripple.remove()\n\t\t}\n\n\t\telement.appendChild(circle)\n\t}\n\n\tupdate(part) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The `ripple` directive can only be used on elements')\n\t\t}\n\n\t\tthis.element = part.element\n\t\tconst style = document.createElement('style')\n\t\tstyle.append(rippleStyle)\n\t\tthis.element.append(style)\n\t\tthis.element.addEventListener('click', this.addRippleEffect)\n\t}\n\n\tdisconnected() {\n\t\tif (this.element) {\n\t\t\tthis.element.removeEventListener('click', this.addRippleEffect)\n\t\t}\n\t}\n}\n\nexport const ripple = directive(RippleDirective)\n"],"names":["color","directive","Directive","partInfo","super","this","config","part","type","PartType","ELEMENT","Error","element","bgColor","style","backgroundColor","nothing","$SchmancyResize","Subject","fromEvent","window","pipe","debounceTime","startWith","subscribe","next","fullHeight","AsyncDirective","_partInfo","disconnecting","takeUntil","setProperty","innerHeight","setTimeout","reconnected","ripple","render","event","target","circle","document","createElement","diameter","Math","max","clientWidth","clientHeight","radius","width","height","left","clientX","getBoundingClientRect","top","clientY","classList","add","getElementsByClassName","remove","appendChild","append","addEventListener","addRippleEffect","removeEventListener"],"mappings":";;;;AAsCM,MAAAA,IAAQC,EA7Bd,cAA6BC,EAAAA;AAAAA,EAG5B,YAAYC,GACXC;AAAAA,UAAMD,IACNE,KAAKC,SAAS,CAAC;AAAA,EAAA;AAAA,EAGhB,OAAOC,GAAAA,CAAaD;AACf,QAAAC,EAAKC,SAASC,EAASC,QACpB,OAAA,IAAIC,MAAM;AAEjB,UAAMC,IAAUL,EAAKK;AACrBP,SAAKC,SAASA,GACVD,KAAKC,OAAOO,YACPD,EAAAE,MAAMC,kBAAkBV,KAAKC,OAAOO,UAGzCR,KAAKC,OAAON,UACPY,EAAAE,MAAMd,QAAQK,KAAKC,OAAON;AAAAA,EACnC;AAAA,EAGD,OAAOM,GAEC;AAAA,WADPD,KAAKC,SAASA,GACPU;AAAAA,EAAA;AChCHC,CAAAA,GAAAA,IAAkB,IAAIC;AAC5BC,EAAiBC,QAAQ,QAAA,EACvBC,KACAC,EAAa,EACbC,GAAAA,EAAUH,SAEVI,UAAU,EACVC,MAAM,MAAA;AACLR,EAAAA,EAAgBQ,KAAKL,MAAM;AAAA,EAAA,CAAA;AAwCjB,MAAAM,IAAazB,EAhC1B,cAAyB0B,EAAAA;AAAAA,EAOxB,YAAYC,GAAAA;AACXxB,UAAMwB,CAAAA,GANPvB,KAAAwB,gBAAgB,IAAIX,KAOnBD,EAAgBI,KAAKS,EAAUzB,KAAKwB,aAAAA,CAAAA,EAAgBL,UAAU,MAC7DnB;AAAAA,WAAKO,QAAQE,MAAMiB,YAAY,UAAU,GAAGX,OAAOY,kBACnDC,WAAW,MAAA;AACV5B,aAAKO,QAAQE,MAAMiB,YAAY,UAAU,GAAGX,OAAOY,WAAe,IAAA;AAAA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CA+CbvD,GAAAA,KAAAO,QAAQgD,OAAO9C,IACpBT,KAAKO,QAAQiD,iBAAiB,SAASxD,KAAKyD,eAAAA;AAAAA,EAAe;AAAA,EAG5D;AACKzD,SAAKO,WACRP,KAAKO,QAAQmD,oBAAoB,SAAS1D,KAAKyD,eAChD;AAAA,EAAA;AAAA,CAAA;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";const a=require("lit"),i=require("lit/directive.js"),s=require("rxjs"),p=require("lit/async-directive.js");class h extends i.Directive{constructor(e){super(e),this.config={}}update(e,[t]){if(e.type!==i.PartType.ELEMENT)throw new Error("The `classMap` directive must be used in the `class` attribute");const n=e.element;this.config=t,this.config.bgColor&&(n.style.backgroundColor=this.config.bgColor),this.config.color&&(n.style.color=this.config.color)}render(e){return this.config=e,a.nothing}}const u=i.directive(h),r=new s.Subject;s.fromEvent(window,"resize").pipe(s.debounceTime(10),s.startWith(window)).subscribe({next:()=>{r.next(window)}});class m extends p.AsyncDirective{constructor(e){super(e),this.disconnecting=new s.Subject,r.pipe(s.takeUntil(this.disconnecting)).subscribe(()=>{this.element.style.setProperty("height",`${window.innerHeight}px`),setTimeout(()=>{this.element.style.setProperty("height",`${window.innerHeight}px`)})})}render(){}update(e){if(e.type!==i.PartType.ELEMENT)throw new Error("The `ripple` directive can only be used on elements");this.element=e.element,r.next(window)}disconnected(){this.disconnecting.next(!0)}reconnected(){}}const g=i.directive(m);class y extends p.AsyncDirective{render(){}addRippleEffect(e){const t=e.target,n=document.createElement("span"),o=Math.max(t.clientWidth,t.clientHeight),l=o/2;n.style.width=n.style.height=`${o}px`,n.style.left=e.clientX-t.getBoundingClientRect().left-l+"px",n.style.top=e.clientY-t.getBoundingClientRect().top-l+"px",n.classList.add("ripple");const d=t.getElementsByClassName("ripple")[0];d&&d.remove(),t.appendChild(n)}update(e){if(e.type!==i.PartType.ELEMENT)throw new Error("The `ripple` directive can only be used on elements");this.element=e.element;const t=document.createElement("style");t.append(`.ripple {
|
|
2
|
+
position: absolute;
|
|
3
|
+
border-radius: 50%;
|
|
4
|
+
background: var(--schmancy-sys-color-surface-high);
|
|
5
|
+
transform: scale(0);
|
|
6
|
+
animation: ripple 600ms linear;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@keyframes ripple {
|
|
10
|
+
to {
|
|
11
|
+
transform: scale(4);
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`),this.element.append(t),this.element.addEventListener("click",this.addRippleEffect)}disconnected(){this.element&&this.element.removeEventListener("click",this.addRippleEffect)}}const f=i.directive(y);exports.color=u,exports.fullHeight=g,exports.ripple=f;
|
|
16
|
+
//# sourceMappingURL=ripple-C2BHbhcS.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripple-C2BHbhcS.cjs","sources":["../src/directives/color.ts","../src/directives/height.ts","../src/directives/ripple.ts"],"sourcesContent":["// color.ts\nimport { Part, nothing } from 'lit'\nimport { Directive, PartInfo, PartType, directive } from 'lit/directive.js'\n\nexport type ColorConfig = {\n\tbgColor?: string\n\tcolor?: string\n}\n\nclass ColorDirective extends Directive {\n\tprivate config: ColorConfig\n\n\tconstructor(partInfo: PartInfo) {\n\t\tsuper(partInfo)\n\t\tthis.config = {}\n\t}\n\n\tupdate(part: Part, [config]: [ColorConfig]) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The `classMap` directive must be used in the `class` attribute')\n\t\t}\n\t\tconst element = part.element as HTMLElement\n\t\tthis.config = config\n\t\tif (this.config.bgColor) {\n\t\t\telement.style.backgroundColor = this.config.bgColor\n\t\t}\n\n\t\tif (this.config.color) {\n\t\t\telement.style.color = this.config.color\n\t\t}\n\t}\n\n\trender(config: ColorConfig): unknown {\n\t\tthis.config = config\n\t\treturn nothing\n\t}\n}\n\nconst color = directive(ColorDirective)\n\nexport { color }\n","import { Subject, debounceTime, fromEvent, startWith, takeUntil } from 'rxjs'\n\nconst $SchmancyResize = new Subject<Window>()\nfromEvent<Event>(window, 'resize')\n\t.pipe(\n\t\tdebounceTime(10), // Adjust the debounce time as needed\n\t\tstartWith(window),\n\t)\n\t.subscribe({\n\t\tnext: () => {\n\t\t\t$SchmancyResize.next(window)\n\t\t},\n\t})\n\nimport { directive, PartInfo, PartType } from 'lit/directive.js'\nimport { AsyncDirective } from 'lit/async-directive.js'\nimport { LitElement } from 'lit'\n\nclass FullHeight extends AsyncDirective {\n\telement: HTMLElement & LitElement\n\tdisconnecting = new Subject<boolean>()\n\trender() {\n\t\treturn\n\t}\n\n\tconstructor(_partInfo: PartInfo) {\n\t\tsuper(_partInfo)\n\t\t$SchmancyResize.pipe(takeUntil(this.disconnecting)).subscribe(() => {\n\t\t\tthis.element.style.setProperty('height', `${window.innerHeight}px`)\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.element.style.setProperty('height', `${window.innerHeight}px`)\n\t\t\t})\n\t\t})\n\t}\n\n\tupdate(part) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The `ripple` directive can only be used on elements')\n\t\t}\n\t\tthis.element = part.element\n\t\t$SchmancyResize.next(window)\n\t}\n\n\tdisconnected() {\n\t\tthis.disconnecting.next(true)\n\t}\n\n\treconnected() {}\n}\n\nexport const fullHeight = directive(FullHeight)\n","import { directive, PartType } from 'lit/directive.js'\nimport { AsyncDirective } from 'lit/async-directive.js'\n\nconst rippleStyle = `.ripple {\n position: absolute;\n border-radius: 50%;\n background: var(--schmancy-sys-color-surface-high);\n transform: scale(0);\n animation: ripple 600ms linear;\n}\n\n@keyframes ripple {\n to {\n transform: scale(4);\n opacity: 0;\n }\n}\n`\nclass RippleDirective extends AsyncDirective {\n\telement: HTMLElement\n\trender() {\n\t\treturn\n\t}\n\n\taddRippleEffect(event) {\n\t\tconst element = event.target\n\t\tconst circle = document.createElement('span')\n\t\tconst diameter = Math.max(element.clientWidth, element.clientHeight)\n\t\tconst radius = diameter / 2\n\t\tcircle.style.width = circle.style.height = `${diameter}px`\n\t\tcircle.style.left = `${event.clientX - element.getBoundingClientRect().left - radius}px`\n\t\tcircle.style.top = `${event.clientY - element.getBoundingClientRect().top - radius}px`\n\t\tcircle.classList.add('ripple')\n\n\t\tconst ripple = element.getElementsByClassName('ripple')[0]\n\t\tif (ripple) {\n\t\t\tripple.remove()\n\t\t}\n\n\t\telement.appendChild(circle)\n\t}\n\n\tupdate(part) {\n\t\tif (part.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The `ripple` directive can only be used on elements')\n\t\t}\n\n\t\tthis.element = part.element\n\t\tconst style = document.createElement('style')\n\t\tstyle.append(rippleStyle)\n\t\tthis.element.append(style)\n\t\tthis.element.addEventListener('click', this.addRippleEffect)\n\t}\n\n\tdisconnected() {\n\t\tif (this.element) {\n\t\t\tthis.element.removeEventListener('click', this.addRippleEffect)\n\t\t}\n\t}\n}\n\nexport const ripple = directive(RippleDirective)\n"],"names":["ColorDirective","Directive","partInfo","super","this","config","part","type","PartType","ELEMENT","Error","element","bgColor","style","backgroundColor","color","nothing","directive","$SchmancyResize","Subject","fromEvent","window","pipe","debounceTime","startWith","subscribe","next","FullHeight","AsyncDirective","_partInfo","disconnecting","takeUntil","setProperty","innerHeight","setTimeout","render","disconnected","reconnected","fullHeight","RippleDirective","event","target","circle","document","createElement","diameter","Math","max","clientWidth","clientHeight","radius","width","height","left","clientX","getBoundingClientRect","top","clientY","classList","add","ripple","getElementsByClassName","remove","appendChild","append","addEventListener","addRippleEffect","removeEventListener"],"mappings":"wHASA,MAAMA,UAAuBC,EAAAA,SAG5B,CAAA,YAAYC,EAAAA,CACXC,MAAMD,CACNE,EAAAA,KAAKC,OAAS,CAAC,CAAA,CAGhB,OAAOC,EAAAA,CAAaD,IACf,GAAAC,EAAKC,OAASC,EAAAA,SAASC,QACpB,MAAA,IAAIC,MAAM,kEAEjB,MAAMC,EAAUL,EAAKK,QACrBP,KAAKC,OAASA,EACVD,KAAKC,OAAOO,UACPD,EAAA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AQqC,YAAarC,EAAQsC,cACjDC,EAASL,EAAW,EAC1BH,EAAO7B,MAAMsC,MAAQT,EAAO7B,MAAMuC,OAAS,GAAGP,CACvCH,KAAAA,EAAA7B,MAAMwC,KAAUb,EAAMc,QAAU3C,EAAQ4C,sBAAwBF,EAAAA,KAAOH,EAA1D,KACbR,EAAA7B,MAAM2C,IAAShB,EAAMiB,QAAU9C,EAAQ4C,sBAAAA,EAAwBC,IAAMN,EAAzD,KACZR,EAAAgB,UAAUC,IAAI,QAAA,EAErB,MAAMC,EAASjD,EAAQkD,uBAAuB,QAAA,EAAU,GACpDD,GACHA,EAAOE,OAGRnD,EAAAA,EAAQoD,YAAYrB,CAAM,CAAA,CAG3B,OAAOpC,GACF,GAAAA,EAAKC,OAASC,EAAAA,SAASC,QACpB,MAAA,IAAIC,MAAM,uDAGjBN,KAAKO,QAAUL,EAAKK,QACd,MAAAE,EAAQ8B,SAASC,cAAc,OAAA,EACrC/B,EAAMmD,OA9CY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,EA+Cb5D,KAAAO,QAAQqD,OAAOnD,CACpBT,EAAAA,KAAKO,QAAQsD,iBAAiB,QAAS7D,KAAK8D,eAAAA,CAAe,CAG5D,eACK9D,KAAKO,SACRP,KAAKO,QAAQwD,oBAAoB,QAAS/D,KAAK8D,eAChD,CAAA,CAAA,CAIW,MAAAN,EAAS3C,YAAUsB,CAAAA"}
|
package/dist/rxjs-utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Observable as
|
|
1
|
+
import { Observable as n } from "rxjs";
|
|
2
2
|
import "./index-CuY8m6ta.js";
|
|
3
|
-
const a = (e, r = { attributes: !0, childList: !0, subtree: !0 }) => new
|
|
4
|
-
const t = new MutationObserver((
|
|
5
|
-
s.next(
|
|
3
|
+
const a = (e, r = { attributes: !0, childList: !0, subtree: !0 }) => new n((s) => {
|
|
4
|
+
const t = new MutationObserver((o) => {
|
|
5
|
+
s.next(o);
|
|
6
6
|
});
|
|
7
7
|
return t.observe(e, r), () => {
|
|
8
8
|
t.disconnect();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";const m=require("./consume-Bb7_UzYd.cjs"),i=require("lit"),c=require("lit/decorators.js"),u=require("lit/directives/when.js"),S=require("./litElement.mixin-Ct-snNwC.cjs"),d=require("./provide-DSU87U5x.cjs"),b=require("rxjs");class y{constructor(){this._currentStep=new b.BehaviorSubject(1)}get currentStep$(){return this._currentStep.asObservable()}get currentStep(){return this._currentStep.value}setStep(e){this._currentStep.next(e)}}const h=d.n(Symbol("SchmancyStepsContext"));var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,o=(t,e,n,s)=>{for(var p,r=s>1?void 0:s?f(e,n):e,a=t.length-1;a>=0;a--)(p=t[a])&&(r=(s?p(e,n,r):p(r))||r);return s&&r&&g(e,n,r),r};exports.SchmancyStep=class extends S.$LitElement(i.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: grid;
|
|
4
|
+
/* Base display is just grid, flex properties will be applied dynamically */
|
|
5
|
+
}
|
|
6
|
+
`){constructor(){super(...arguments),this.position=1,this.title="",this.description="",this.completed=!1,this.lockBack=!1,this.currentStep=1}connectedCallback(){super.connectedCallback(),this.subscription=this.steps.currentStep$.subscribe(t=>{this.currentStep=t,this.updateFlexProperties()}),this.updateFlexProperties()}disconnectedCallback(){var t;(t=this.subscription)==null||t.unsubscribe(),super.disconnectedCallback()}updateFlexProperties(){const t=this.position===this.currentStep;this.style.flex=t?"1 1 auto":"0 0 auto"}get status(){return this.completed||this.position<this.steps.currentStep?"complete":this.position===this.steps.currentStep?"current":"upcoming"}_onStepClick(t){this.lockBack&&this.position<this.steps.currentStep||this.status!=="upcoming"&&this.steps.setStep(this.position)}render(){const t=this.position===this.currentStep,e=this.status==="complete",n={"bg-tertiary-default":e,"bg-gray-300":!e},s={"relative border-solid z-10 flex size-5 items-center justify-center rounded-full":!0,"bg-tertiary-default group-hover:bg-tertiary-onContainer":e,"border-2 border-tertiary-default bg-white":!e&&t,"border-2 border-gray-300 bg-white group-hover:border-gray-400":this.status==="upcoming"},p={"text-tertiary-default":t,"text-gray-500":!t},r=t||e?"cursor-pointer":"";return i.html`
|
|
7
|
+
<li class="relative">
|
|
8
|
+
<!-- Connector line -->
|
|
9
|
+
<div
|
|
10
|
+
class="absolute top-6 left-2.5 mt-0.5 -ml-px h-full w-0.5 ${this.classMap(n)}"
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
></div>
|
|
13
|
+
|
|
14
|
+
<!-- Step Button/Label -->
|
|
15
|
+
<button type="button" @click=${this._onStepClick} class="relative flex items-center group ${r}">
|
|
16
|
+
<span class="flex items-center h-10">
|
|
17
|
+
<span class=${this.classMap(s)}>
|
|
18
|
+
${e?i.html`
|
|
19
|
+
<svg class="text-white size-3" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
20
|
+
<path
|
|
21
|
+
fill-rule="evenodd"
|
|
22
|
+
d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z"
|
|
23
|
+
clip-rule="evenodd"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
`:i.html`
|
|
27
|
+
<span
|
|
28
|
+
class="size-2.5 rounded-full ${t?"bg-tertiary-default":"bg-transparent group-hover:bg-gray-300"}"
|
|
29
|
+
></span>
|
|
30
|
+
`}
|
|
31
|
+
</span>
|
|
32
|
+
</span>
|
|
33
|
+
|
|
34
|
+
<span class="flex flex-col items-start min-w-0 ml-4">
|
|
35
|
+
<schmancy-typography type="title">
|
|
36
|
+
<span class=${this.classMap(p)}>${this.title}</span>
|
|
37
|
+
</schmancy-typography>
|
|
38
|
+
${u.when(this.description,()=>i.html`
|
|
39
|
+
<schmancy-typography type="label">
|
|
40
|
+
<span class="text-gray-500">${this.description}</span>
|
|
41
|
+
</schmancy-typography>
|
|
42
|
+
`)}
|
|
43
|
+
</span>
|
|
44
|
+
</button>
|
|
45
|
+
|
|
46
|
+
<!-- Render step content if the step is active, regardless of completion -->
|
|
47
|
+
${u.when(t,()=>i.html`
|
|
48
|
+
<div class="pl-2 ml-2 block h-full pb-12">
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</div>
|
|
51
|
+
`)}
|
|
52
|
+
</li>
|
|
53
|
+
`}},o([c.property({type:Number})],exports.SchmancyStep.prototype,"position",2),o([c.property({type:String})],exports.SchmancyStep.prototype,"title",2),o([c.property({type:String})],exports.SchmancyStep.prototype,"description",2),o([c.property({type:Boolean,reflect:!0})],exports.SchmancyStep.prototype,"completed",2),o([c.property({type:Boolean})],exports.SchmancyStep.prototype,"lockBack",2),o([m.c({context:h})],exports.SchmancyStep.prototype,"steps",2),o([c.state()],exports.SchmancyStep.prototype,"currentStep",2),exports.SchmancyStep=o([c.customElement("schmancy-step")],exports.SchmancyStep);var v=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(t,e,n,s)=>{for(var p,r=s>1?void 0:s?x(e,n):e,a=t.length-1;a>=0;a--)(p=t[a])&&(r=(s?p(e,n,r):p(r))||r);return s&&r&&v(e,n,r),r};exports.SchmancyStepsContainer=class extends S.$LitElement(i.css`
|
|
54
|
+
:host {
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
`){constructor(){super(...arguments),this.controller=new y,this.stepsController=this.controller,this._currentStep=1}set currentStep(t){const e=this._currentStep;this._currentStep=t,this.controller.setStep(t),this.requestUpdate("currentStep",e)}get currentStep(){return this._currentStep}connectedCallback(){super.connectedCallback(),this.controller.setStep(this.currentStep)}render(){return i.html`
|
|
58
|
+
<nav class="flex h-full w-full" aria-label="Progress">
|
|
59
|
+
<ol class="flex flex-col flex-1" role="list">
|
|
60
|
+
<slot></slot>
|
|
61
|
+
</ol>
|
|
62
|
+
</nav>
|
|
63
|
+
`}},l([d.e({context:h})],exports.SchmancyStepsContainer.prototype,"stepsController",2),l([c.property({type:Number,reflect:!0})],exports.SchmancyStepsContainer.prototype,"currentStep",1),exports.SchmancyStepsContainer=l([c.customElement("schmancy-steps-container")],exports.SchmancyStepsContainer),exports.StepsController=y,exports.stepsContext=h;
|
|
64
|
+
//# sourceMappingURL=schmancy-steps-container-3Odvvi2u.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schmancy-steps-container-3Odvvi2u.cjs","sources":["../src/steps/steps.context.ts","../src/steps/schmancy-step.ts","../src/steps/schmancy-steps-container.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { BehaviorSubject } from 'rxjs'\n\nexport class StepsController {\n\tprivate _currentStep = new BehaviorSubject(1)\n\n\tget currentStep$() {\n\t\treturn this._currentStep.asObservable()\n\t}\n\n\tget currentStep() {\n\t\treturn this._currentStep.value\n\t}\n\n\tsetStep(step: number) {\n\t\tthis._currentStep.next(step)\n\t}\n}\n\n/**\n * The actual context object. We provide/consume this in the container and steps.\n */\nexport const stepsContext = createContext<StepsController>(Symbol('SchmancyStepsContext'))\n","import { consume } from '@lit/context'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { Subscription } from 'rxjs'\nimport { stepsContext, StepsController } from './steps.context'\nimport { $LitElement } from '@mixins/litElement.mixin'\n\n@customElement('schmancy-step')\nexport class SchmancyStep extends $LitElement(css`\n\t:host {\n\t\tdisplay: grid;\n\t\t/* Base display is just grid, flex properties will be applied dynamically */\n\t}\n`) {\n\t/**\n\t * The step's position (1-based). This is used to compare against\n\t * the container's current step to decide if it's \"complete\",\n\t * \"current\", or \"upcoming\".\n\t */\n\t@property({ type: Number }) position = 1\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) description = ''\n\n\t// NEW: Allow a step to be explicitly marked as complete.\n\t@property({ type: Boolean, reflect: true }) completed = false\n\n\t/**\n\t * NEW: Lock API to disable users from going back.\n\t * When set to true, clicking on a previous (completed) step is ignored.\n\t */\n\t@property({ type: Boolean }) lockBack = false\n\n\t/**\n\t * Consume the shared StepsController from context.\n\t */\n\t@consume({ context: stepsContext })\n\tprivate steps!: StepsController\n\n\t/**\n\t * Local reactive copy of the container's current step number.\n\t */\n\t@state()\n\tprivate currentStep = 1\n\n\t/**\n\t * Keep a reference to our subscription so we can unsubscribe cleanly.\n\t */\n\tprivate subscription?: Subscription\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Subscribe to updates from the container's StepsController.\n\t\tthis.subscription = this.steps.currentStep$.subscribe(step => {\n\t\t\tthis.currentStep = step\n\t\t\t// When the current step changes, update the flex properties\n\t\t\tthis.updateFlexProperties()\n\t\t})\n\t\t// Initial update of flex properties\n\t\tthis.updateFlexProperties()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.subscription?.unsubscribe()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Update the host element's flex properties based on active state\n\t */\n\tprivate updateFlexProperties() {\n\t\tconst isActive = this.position === this.currentStep\n\n\t\tif (isActive) {\n\t\t\t// Apply flex-grow when active\n\t\t\tthis.style.flex = '1 1 auto'\n\t\t} else {\n\t\t\t// Make it shrink when not active\n\t\t\tthis.style.flex = '0 0 auto'\n\t\t}\n\t}\n\n\t/**\n\t * Compute visual status for styling purposes. Note that if a step is explicitly\n\t * marked as completed, it always appears as complete even if it's active.\n\t */\n\tget status(): 'complete' | 'current' | 'upcoming' {\n\t\tif (this.completed || this.position < this.steps.currentStep) return 'complete'\n\t\tif (this.position === this.steps.currentStep) return 'current'\n\t\treturn 'upcoming'\n\t}\n\n\t/**\n\t * Click handler to allow navigation between completed (or active) steps.\n\t * With lockBack enabled, clicking on a previous step is ignored.\n\t */\n\tprivate _onStepClick(_e: Event) {\n\t\t// If lockBack is enabled and the user attempts to go back, do nothing.\n\t\tif (this.lockBack && this.position < this.steps.currentStep) {\n\t\t\treturn\n\t\t}\n\t\tif (this.status !== 'upcoming') {\n\t\t\tthis.steps.setStep(this.position)\n\t\t}\n\t}\n\n\trender() {\n\t\t// Determine if the step is currently active.\n\t\tconst isActive = this.position === this.currentStep\n\n\t\t// Use computed status for visual styling.\n\t\tconst isComplete = this.status === 'complete'\n\t\tconst isUpcoming = this.status === 'upcoming'\n\n\t\t// Tailwind (or similar) classes for styling.\n\t\tconst connectorClasses = {\n\t\t\t'bg-tertiary-default': isComplete,\n\t\t\t'bg-gray-300': !isComplete,\n\t\t}\n\n\t\tconst iconContainerClasses = {\n\t\t\t'relative border-solid z-10 flex size-5 items-center justify-center rounded-full': true,\n\t\t\t'bg-tertiary-default group-hover:bg-tertiary-onContainer': isComplete,\n\t\t\t'border-2 border-tertiary-default bg-white': !isComplete && isActive,\n\t\t\t'border-2 border-gray-300 bg-white group-hover:border-gray-400': isUpcoming,\n\t\t}\n\n\t\tconst textClasses = {\n\t\t\t'text-tertiary-default': isActive,\n\t\t\t'text-gray-500': !isActive,\n\t\t}\n\n\t\t// If the step is clickable (active or complete), add a pointer cursor.\n\t\tconst clickableClass = isActive || isComplete ? 'cursor-pointer' : ''\n\n\t\treturn html`\n\t\t\t<li class=\"relative\">\n\t\t\t\t<!-- Connector line -->\n\t\t\t\t<div\n\t\t\t\t\tclass=\"absolute top-6 left-2.5 mt-0.5 -ml-px h-full w-0.5 ${this.classMap(connectorClasses)}\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<!-- Step Button/Label -->\n\t\t\t\t<button type=\"button\" @click=${this._onStepClick} class=\"relative flex items-center group ${clickableClass}\">\n\t\t\t\t\t<span class=\"flex items-center h-10\">\n\t\t\t\t\t\t<span class=${this.classMap(iconContainerClasses)}>\n\t\t\t\t\t\t\t${isComplete\n\t\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t\t<svg class=\"text-white size-3\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z\"\n\t\t\t\t\t\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"size-2.5 rounded-full ${isActive\n\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-tertiary-default'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'bg-transparent group-hover:bg-gray-300'}\"\n\t\t\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"flex flex-col items-start min-w-0 ml-4\">\n\t\t\t\t\t\t<schmancy-typography type=\"title\">\n\t\t\t\t\t\t\t<span class=${this.classMap(textClasses)}>${this.title}</span>\n\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.description,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"label\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-gray-500\">${this.description}</span>\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\n\t\t\t\t<!-- Render step content if the step is active, regardless of completion -->\n\t\t\t\t${when(\n\t\t\t\t\tisActive,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"pl-2 ml-2 block h-full pb-12\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-step': SchmancyStep\n\t}\n}\n","import { provide } from '@lit/context'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { StepsController, stepsContext } from './steps.context'\n\n@customElement('schmancy-steps-container')\nexport class SchmancyStepsContainer extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprivate controller = new StepsController()\n\n\t@provide({ context: stepsContext })\n\tstepsController = this.controller\n\n\t@property({ type: Number, reflect: true })\n\tset currentStep(value: number) {\n\t\tconst oldValue = this._currentStep\n\t\tthis._currentStep = value\n\t\tthis.controller.setStep(value)\n\t\tthis.requestUpdate('currentStep', oldValue)\n\t}\n\n\tget currentStep(): number {\n\t\treturn this._currentStep\n\t}\n\n\tprivate _currentStep = 1\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.controller.setStep(this.currentStep)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<nav class=\"flex h-full w-full\" aria-label=\"Progress\">\n\t\t\t\t<ol class=\"flex flex-col flex-1\" role=\"list\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-steps-container': SchmancyStepsContainer\n\t}\n}\n"],"names":["StepsController","this","_currentStep","BehaviorSubject","asObservable","currentStep","value","step","next","stepsContext","createContext","Symbol","SchmancyStep","$LitElement","css","super","arguments","position","title","description","completed","lockBack","connectedCallback","subscription","steps","currentStep$","subscribe","updateFlexProperties","disconnectedCallback","unsubscribe","isActive","style","flex","_e","status","setStep","isComplete","connectorClasses","iconContainerClasses","textClasses","clickableClass","html","classMap","_onStepClick","when","__decorateClass","property","type","Number","prototype","String","Boolean","reflect","consume","context","state","customElement","SchmancyStepsContainer","constructor","controller","stepsController","oldValue","requestUpdate","render","provide"],"mappings":"4OAGO,EAAA,MAAMA,CAAN,CAAA,aACEC,CAAAA,KAAAC,aAAe,IAAIC,EAAAA,gBAAgB,CAAA,CAAC,CAE5C,IAAA,cACQ,CAAA,OAAAF,KAAKC,aAAaE,aAAa,CAAA,CAGvC,IAAIC,aAAAA,CACH,OAAOJ,KAAKC,aAAaI,KAAA,CAG1B,QAAQC,EAAAA,CACFN,KAAAC,aAAaM,KAAKD,CAAAA,CAAI,CAOtB,CAAA,MAAME,EAAeC,EAAAA,EAA+BC,OAAO,yNCbrDC,QAAAA,aAAN,cAA2BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAvC,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAWiCf,EAAAA,KAAAgB,SAAA,EAEHhB,KAAAiB,MAAA,GACMjB,KAAAkB,YAAA,GAGclB,KAAAmB,aAMhBnB,KAAAoB,SAAA,GAYxCpB,KAAQI,YAAc,CAAA,CAOtB,mBACCU,CAAAA,MAAMO,kBAENrB,EAAAA,KAAKsB,aAAetB,KAAKuB,MAAMC,aAAaC,UAAkBnB,IAC7DN,KAAKI,YAAcE,EAEnBN,KAAK0B,qBAAqB,CAAA,CAAA,EAG3B1B,KAAK0B,qBAAAA,CAAqB,CAG3B,sBAAAC,QACC3B,EAAAA,KAAKsB,eAALtB,MAAAA,EAAmB4B,cACnBd,MAAMa,qBAAAA,CAAqB,CAMpB,uBACD,MAAAE,EAAW7B,KAAKgB,WAAahB,KAAKI,YAIvCJ,KAAK8B,MAAMC,KAFRF,EAEe,WAGA,UACnB,CAOD,YACC,CAAA,OAAI7B,KAAKmB,WAAanB,KAAKgB,SAAWhB,KAAKuB,MAAMnB,Y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EACDrB,KAAA0D,WAAWxB,QAAQlC,KAAKI,WAAW,CAAA,CAGzC,QAAA0D,CACQ,OAAAtB,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAA,CAAA,EAtBRI,EAAA,CADCmB,IAAQ,CAAEV,QAAS7C,CAPRgD,CAAAA,CAAAA,EAAAA,+BAQZR,UAAA,kBAAA,CAGIJ,EAAAA,EAAA,CADHC,EAAAA,SAAS,CAAEC,KAAMC,OAAQI,QAAS,EAAA,CAAA,CAAA,EAVvBK,+BAWRR,UAAA,cAAA,CAXQQ,EAAAA,QAANA,uBAAAZ,EAAA,CADNW,EAAAA,cAAc,6BACFC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { c as f } from "./consume-fRVATvdE.js";
|
|
2
|
+
import { css as y, html as c } from "lit";
|
|
3
|
+
import { property as l, state as S, customElement as b } from "lit/decorators.js";
|
|
4
|
+
import { when as d } from "lit/directives/when.js";
|
|
5
|
+
import { $ as m } from "./litElement.mixin-CtugwVVz.js";
|
|
6
|
+
import { n as v, e as x } from "./provide-BLSgVvMJ.js";
|
|
7
|
+
import { BehaviorSubject as k } from "rxjs";
|
|
8
|
+
class C {
|
|
9
|
+
constructor() {
|
|
10
|
+
this._currentStep = new k(1);
|
|
11
|
+
}
|
|
12
|
+
get currentStep$() {
|
|
13
|
+
return this._currentStep.asObservable();
|
|
14
|
+
}
|
|
15
|
+
get currentStep() {
|
|
16
|
+
return this._currentStep.value;
|
|
17
|
+
}
|
|
18
|
+
setStep(e) {
|
|
19
|
+
this._currentStep.next(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const g = v(Symbol("SchmancyStepsContext"));
|
|
23
|
+
var $ = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (t, e, o, r) => {
|
|
24
|
+
for (var i, s = r > 1 ? void 0 : r ? w(e, o) : e, a = t.length - 1; a >= 0; a--) (i = t[a]) && (s = (r ? i(e, o, s) : i(s)) || s);
|
|
25
|
+
return r && s && $(e, o, s), s;
|
|
26
|
+
};
|
|
27
|
+
let p = class extends m(y`
|
|
28
|
+
:host {
|
|
29
|
+
display: grid;
|
|
30
|
+
/* Base display is just grid, flex properties will be applied dynamically */
|
|
31
|
+
}
|
|
32
|
+
`) {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments), this.position = 1, this.title = "", this.description = "", this.completed = !1, this.lockBack = !1, this.currentStep = 1;
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback(), this.subscription = this.steps.currentStep$.subscribe((t) => {
|
|
38
|
+
this.currentStep = t, this.updateFlexProperties();
|
|
39
|
+
}), this.updateFlexProperties();
|
|
40
|
+
}
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
var t;
|
|
43
|
+
(t = this.subscription) == null || t.unsubscribe(), super.disconnectedCallback();
|
|
44
|
+
}
|
|
45
|
+
updateFlexProperties() {
|
|
46
|
+
const t = this.position === this.currentStep;
|
|
47
|
+
this.style.flex = t ? "1 1 auto" : "0 0 auto";
|
|
48
|
+
}
|
|
49
|
+
get status() {
|
|
50
|
+
return this.completed || this.position < this.steps.currentStep ? "complete" : this.position === this.steps.currentStep ? "current" : "upcoming";
|
|
51
|
+
}
|
|
52
|
+
_onStepClick(t) {
|
|
53
|
+
this.lockBack && this.position < this.steps.currentStep || this.status !== "upcoming" && this.steps.setStep(this.position);
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
const t = this.position === this.currentStep, e = this.status === "complete", o = { "bg-tertiary-default": e, "bg-gray-300": !e }, r = { "relative border-solid z-10 flex size-5 items-center justify-center rounded-full": !0, "bg-tertiary-default group-hover:bg-tertiary-onContainer": e, "border-2 border-tertiary-default bg-white": !e && t, "border-2 border-gray-300 bg-white group-hover:border-gray-400": this.status === "upcoming" }, i = { "text-tertiary-default": t, "text-gray-500": !t }, s = t || e ? "cursor-pointer" : "";
|
|
57
|
+
return c`
|
|
58
|
+
<li class="relative">
|
|
59
|
+
<!-- Connector line -->
|
|
60
|
+
<div
|
|
61
|
+
class="absolute top-6 left-2.5 mt-0.5 -ml-px h-full w-0.5 ${this.classMap(o)}"
|
|
62
|
+
aria-hidden="true"
|
|
63
|
+
></div>
|
|
64
|
+
|
|
65
|
+
<!-- Step Button/Label -->
|
|
66
|
+
<button type="button" @click=${this._onStepClick} class="relative flex items-center group ${s}">
|
|
67
|
+
<span class="flex items-center h-10">
|
|
68
|
+
<span class=${this.classMap(r)}>
|
|
69
|
+
${e ? c`
|
|
70
|
+
<svg class="text-white size-3" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
71
|
+
<path
|
|
72
|
+
fill-rule="evenodd"
|
|
73
|
+
d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z"
|
|
74
|
+
clip-rule="evenodd"
|
|
75
|
+
/>
|
|
76
|
+
</svg>
|
|
77
|
+
` : c`
|
|
78
|
+
<span
|
|
79
|
+
class="size-2.5 rounded-full ${t ? "bg-tertiary-default" : "bg-transparent group-hover:bg-gray-300"}"
|
|
80
|
+
></span>
|
|
81
|
+
`}
|
|
82
|
+
</span>
|
|
83
|
+
</span>
|
|
84
|
+
|
|
85
|
+
<span class="flex flex-col items-start min-w-0 ml-4">
|
|
86
|
+
<schmancy-typography type="title">
|
|
87
|
+
<span class=${this.classMap(i)}>${this.title}</span>
|
|
88
|
+
</schmancy-typography>
|
|
89
|
+
${d(this.description, () => c`
|
|
90
|
+
<schmancy-typography type="label">
|
|
91
|
+
<span class="text-gray-500">${this.description}</span>
|
|
92
|
+
</schmancy-typography>
|
|
93
|
+
`)}
|
|
94
|
+
</span>
|
|
95
|
+
</button>
|
|
96
|
+
|
|
97
|
+
<!-- Render step content if the step is active, regardless of completion -->
|
|
98
|
+
${d(t, () => c`
|
|
99
|
+
<div class="pl-2 ml-2 block h-full pb-12">
|
|
100
|
+
<slot></slot>
|
|
101
|
+
</div>
|
|
102
|
+
`)}
|
|
103
|
+
</li>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
n([l({ type: Number })], p.prototype, "position", 2), n([l({ type: String })], p.prototype, "title", 2), n([l({ type: String })], p.prototype, "description", 2), n([l({ type: Boolean, reflect: !0 })], p.prototype, "completed", 2), n([l({ type: Boolean })], p.prototype, "lockBack", 2), n([f({ context: g })], p.prototype, "steps", 2), n([S()], p.prototype, "currentStep", 2), p = n([b("schmancy-step")], p);
|
|
108
|
+
var _ = Object.defineProperty, B = Object.getOwnPropertyDescriptor, h = (t, e, o, r) => {
|
|
109
|
+
for (var i, s = r > 1 ? void 0 : r ? B(e, o) : e, a = t.length - 1; a >= 0; a--) (i = t[a]) && (s = (r ? i(e, o, s) : i(s)) || s);
|
|
110
|
+
return r && s && _(e, o, s), s;
|
|
111
|
+
};
|
|
112
|
+
let u = class extends m(y`
|
|
113
|
+
:host {
|
|
114
|
+
display: block;
|
|
115
|
+
}
|
|
116
|
+
`) {
|
|
117
|
+
constructor() {
|
|
118
|
+
super(...arguments), this.controller = new C(), this.stepsController = this.controller, this._currentStep = 1;
|
|
119
|
+
}
|
|
120
|
+
set currentStep(t) {
|
|
121
|
+
const e = this._currentStep;
|
|
122
|
+
this._currentStep = t, this.controller.setStep(t), this.requestUpdate("currentStep", e);
|
|
123
|
+
}
|
|
124
|
+
get currentStep() {
|
|
125
|
+
return this._currentStep;
|
|
126
|
+
}
|
|
127
|
+
connectedCallback() {
|
|
128
|
+
super.connectedCallback(), this.controller.setStep(this.currentStep);
|
|
129
|
+
}
|
|
130
|
+
render() {
|
|
131
|
+
return c`
|
|
132
|
+
<nav class="flex h-full w-full" aria-label="Progress">
|
|
133
|
+
<ol class="flex flex-col flex-1" role="list">
|
|
134
|
+
<slot></slot>
|
|
135
|
+
</ol>
|
|
136
|
+
</nav>
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
h([x({ context: g })], u.prototype, "stepsController", 2), h([l({ type: Number, reflect: !0 })], u.prototype, "currentStep", 1), u = h([b("schmancy-steps-container")], u);
|
|
141
|
+
export {
|
|
142
|
+
p as S,
|
|
143
|
+
u as a,
|
|
144
|
+
C as b,
|
|
145
|
+
g as s
|
|
146
|
+
};
|
|
147
|
+
//# sourceMappingURL=schmancy-steps-container-Ke5dskhS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schmancy-steps-container-Ke5dskhS.js","sources":["../src/steps/steps.context.ts","../src/steps/schmancy-step.ts","../src/steps/schmancy-steps-container.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { BehaviorSubject } from 'rxjs'\n\nexport class StepsController {\n\tprivate _currentStep = new BehaviorSubject(1)\n\n\tget currentStep$() {\n\t\treturn this._currentStep.asObservable()\n\t}\n\n\tget currentStep() {\n\t\treturn this._currentStep.value\n\t}\n\n\tsetStep(step: number) {\n\t\tthis._currentStep.next(step)\n\t}\n}\n\n/**\n * The actual context object. We provide/consume this in the container and steps.\n */\nexport const stepsContext = createContext<StepsController>(Symbol('SchmancyStepsContext'))\n","import { consume } from '@lit/context'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { Subscription } from 'rxjs'\nimport { stepsContext, StepsController } from './steps.context'\nimport { $LitElement } from '@mixins/litElement.mixin'\n\n@customElement('schmancy-step')\nexport class SchmancyStep extends $LitElement(css`\n\t:host {\n\t\tdisplay: grid;\n\t\t/* Base display is just grid, flex properties will be applied dynamically */\n\t}\n`) {\n\t/**\n\t * The step's position (1-based). This is used to compare against\n\t * the container's current step to decide if it's \"complete\",\n\t * \"current\", or \"upcoming\".\n\t */\n\t@property({ type: Number }) position = 1\n\n\t@property({ type: String }) title = ''\n\t@property({ type: String }) description = ''\n\n\t// NEW: Allow a step to be explicitly marked as complete.\n\t@property({ type: Boolean, reflect: true }) completed = false\n\n\t/**\n\t * NEW: Lock API to disable users from going back.\n\t * When set to true, clicking on a previous (completed) step is ignored.\n\t */\n\t@property({ type: Boolean }) lockBack = false\n\n\t/**\n\t * Consume the shared StepsController from context.\n\t */\n\t@consume({ context: stepsContext })\n\tprivate steps!: StepsController\n\n\t/**\n\t * Local reactive copy of the container's current step number.\n\t */\n\t@state()\n\tprivate currentStep = 1\n\n\t/**\n\t * Keep a reference to our subscription so we can unsubscribe cleanly.\n\t */\n\tprivate subscription?: Subscription\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Subscribe to updates from the container's StepsController.\n\t\tthis.subscription = this.steps.currentStep$.subscribe(step => {\n\t\t\tthis.currentStep = step\n\t\t\t// When the current step changes, update the flex properties\n\t\t\tthis.updateFlexProperties()\n\t\t})\n\t\t// Initial update of flex properties\n\t\tthis.updateFlexProperties()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.subscription?.unsubscribe()\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t/**\n\t * Update the host element's flex properties based on active state\n\t */\n\tprivate updateFlexProperties() {\n\t\tconst isActive = this.position === this.currentStep\n\n\t\tif (isActive) {\n\t\t\t// Apply flex-grow when active\n\t\t\tthis.style.flex = '1 1 auto'\n\t\t} else {\n\t\t\t// Make it shrink when not active\n\t\t\tthis.style.flex = '0 0 auto'\n\t\t}\n\t}\n\n\t/**\n\t * Compute visual status for styling purposes. Note that if a step is explicitly\n\t * marked as completed, it always appears as complete even if it's active.\n\t */\n\tget status(): 'complete' | 'current' | 'upcoming' {\n\t\tif (this.completed || this.position < this.steps.currentStep) return 'complete'\n\t\tif (this.position === this.steps.currentStep) return 'current'\n\t\treturn 'upcoming'\n\t}\n\n\t/**\n\t * Click handler to allow navigation between completed (or active) steps.\n\t * With lockBack enabled, clicking on a previous step is ignored.\n\t */\n\tprivate _onStepClick(_e: Event) {\n\t\t// If lockBack is enabled and the user attempts to go back, do nothing.\n\t\tif (this.lockBack && this.position < this.steps.currentStep) {\n\t\t\treturn\n\t\t}\n\t\tif (this.status !== 'upcoming') {\n\t\t\tthis.steps.setStep(this.position)\n\t\t}\n\t}\n\n\trender() {\n\t\t// Determine if the step is currently active.\n\t\tconst isActive = this.position === this.currentStep\n\n\t\t// Use computed status for visual styling.\n\t\tconst isComplete = this.status === 'complete'\n\t\tconst isUpcoming = this.status === 'upcoming'\n\n\t\t// Tailwind (or similar) classes for styling.\n\t\tconst connectorClasses = {\n\t\t\t'bg-tertiary-default': isComplete,\n\t\t\t'bg-gray-300': !isComplete,\n\t\t}\n\n\t\tconst iconContainerClasses = {\n\t\t\t'relative border-solid z-10 flex size-5 items-center justify-center rounded-full': true,\n\t\t\t'bg-tertiary-default group-hover:bg-tertiary-onContainer': isComplete,\n\t\t\t'border-2 border-tertiary-default bg-white': !isComplete && isActive,\n\t\t\t'border-2 border-gray-300 bg-white group-hover:border-gray-400': isUpcoming,\n\t\t}\n\n\t\tconst textClasses = {\n\t\t\t'text-tertiary-default': isActive,\n\t\t\t'text-gray-500': !isActive,\n\t\t}\n\n\t\t// If the step is clickable (active or complete), add a pointer cursor.\n\t\tconst clickableClass = isActive || isComplete ? 'cursor-pointer' : ''\n\n\t\treturn html`\n\t\t\t<li class=\"relative\">\n\t\t\t\t<!-- Connector line -->\n\t\t\t\t<div\n\t\t\t\t\tclass=\"absolute top-6 left-2.5 mt-0.5 -ml-px h-full w-0.5 ${this.classMap(connectorClasses)}\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<!-- Step Button/Label -->\n\t\t\t\t<button type=\"button\" @click=${this._onStepClick} class=\"relative flex items-center group ${clickableClass}\">\n\t\t\t\t\t<span class=\"flex items-center h-10\">\n\t\t\t\t\t\t<span class=${this.classMap(iconContainerClasses)}>\n\t\t\t\t\t\t\t${isComplete\n\t\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t\t<svg class=\"text-white size-3\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t\td=\"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z\"\n\t\t\t\t\t\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"size-2.5 rounded-full ${isActive\n\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-tertiary-default'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'bg-transparent group-hover:bg-gray-300'}\"\n\t\t\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<span class=\"flex flex-col items-start min-w-0 ml-4\">\n\t\t\t\t\t\t<schmancy-typography type=\"title\">\n\t\t\t\t\t\t\t<span class=${this.classMap(textClasses)}>${this.title}</span>\n\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t${when(\n\t\t\t\t\t\t\tthis.description,\n\t\t\t\t\t\t\t() => html`\n\t\t\t\t\t\t\t\t<schmancy-typography type=\"label\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-gray-500\">${this.description}</span>\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\n\t\t\t\t<!-- Render step content if the step is active, regardless of completion -->\n\t\t\t\t${when(\n\t\t\t\t\tisActive,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"pl-2 ml-2 block h-full pb-12\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</li>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-step': SchmancyStep\n\t}\n}\n","import { provide } from '@lit/context'\nimport { $LitElement } from '@mixins/litElement.mixin'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { StepsController, stepsContext } from './steps.context'\n\n@customElement('schmancy-steps-container')\nexport class SchmancyStepsContainer extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprivate controller = new StepsController()\n\n\t@provide({ context: stepsContext })\n\tstepsController = this.controller\n\n\t@property({ type: Number, reflect: true })\n\tset currentStep(value: number) {\n\t\tconst oldValue = this._currentStep\n\t\tthis._currentStep = value\n\t\tthis.controller.setStep(value)\n\t\tthis.requestUpdate('currentStep', oldValue)\n\t}\n\n\tget currentStep(): number {\n\t\treturn this._currentStep\n\t}\n\n\tprivate _currentStep = 1\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.controller.setStep(this.currentStep)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<nav class=\"flex h-full w-full\" aria-label=\"Progress\">\n\t\t\t\t<ol class=\"flex flex-col flex-1\" role=\"list\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-steps-container': SchmancyStepsContainer\n\t}\n}\n"],"names":["StepsController","this","_currentStep","BehaviorSubject","currentStep$","asObservable","currentStep","value","step","next","stepsContext","createContext","Symbol","SchmancyStep","$LitElement","css","super","arguments","position","title","description","completed","lockBack","connectedCallback","subscription","steps","subscribe","updateFlexProperties","disconnectedCallback","unsubscribe","isActive","style","flex","_e","status","setStep","render","isComplete","connectorClasses","iconContainerClasses","textClasses","clickableClass","html","classMap","_onStepClick","when","__decorateClass","property","type","Number","prototype","String","Boolean","reflect","consume","context","state","customElement","SchmancyStepsContainer","constructor","controller","stepsController","oldValue","requestUpdate","provide"],"mappings":";;;;;;;AAGO,MAAMA,EAAAA;AAAAA,EAAN,cACEC;AAAAA,SAAAC,eAAe,IAAIC,EAAgB,CAAA;AAAA,EAAC;AAAA,EAE5C,IAAIC,eAAAA;AACI,WAAAH,KAAKC,aAAaG,aAAAA;AAAAA,EAAa;AAAA,EAGvC,IAAIC,cAAAA;AACH,WAAOL,KAAKC,aAAaK;AAAAA,EAAA;AAAA,EAG1B,QAAQC,GACFP;AAAAA,SAAAC,aAAaO,KAAKD,CAAI;AAAA,EAAA;AAAA;AAOtB,MAAME,IAAeC,EAA+BC,OAAO;;;;;ACbrD,IAAAC,IAAN,cAA2BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAvC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAWiChB,GAAAA,KAAAiB,WAAA,GAEHjB,KAAAkB,QAAA,IACMlB,KAAAmB,cAAA,IAGcnB,KAAAoB,gBAMhBpB,KAAAqB,WAAA,IAYxCrB,KAAQK,cAAc;AAAA,EAAA;AAAA,EAOtB,oBACCU;AAAAA,UAAMO,kBAENtB,GAAAA,KAAKuB,eAAevB,KAAKwB,MAAMrB,aAAasB,UAAkBlB;AAC7DP,WAAKK,cAAcE,GAEnBP,KAAK0B,qBAAqB;AAAA,IAAA,CAAA,GAG3B1B,KAAK0B,qBAAAA;AAAAA,EAAqB;AAAA,EAG3B,uBAAAC;;AACC3B,KAAAA,IAAAA,KAAKuB,iBAALvB,QAAAA,EAAmB4B,eACnBb,MAAMY,qBAAAA;AAAAA,EAAqB;AAAA,EAMpB;AACD,UAAAE,IAAW7B,KAAKiB,aAAajB,KAAKK;AAIvCL,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