@mhmo91/schmancy 0.10.36 → 0.10.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +54 -31
- package/dist/SchmancyElement-BNnyBOwk.js +286 -0
- package/dist/{SchmancyElement-C3CpdNsi.js.map → SchmancyElement-BNnyBOwk.js.map} +1 -1
- package/dist/SchmancyElement-C41uPa6l.cjs +2 -0
- package/dist/{SchmancyElement-BBzRWB1w.cjs.map → SchmancyElement-C41uPa6l.cjs.map} +1 -1
- package/dist/agent/schmancy.agent.js +2432 -2361
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/schmancy.manifest.json +4 -22
- package/dist/area-2FrTZI_T.cjs +21 -0
- package/dist/area-2FrTZI_T.cjs.map +1 -0
- package/dist/{area-BA96mwFY.js → area-KVDzhT4s.js} +4 -4
- package/dist/area-KVDzhT4s.js.map +1 -0
- package/dist/area.cjs +1 -1
- package/dist/area.js +2 -2
- package/dist/{audio-D52h1jAT.js → audio-D3gnp15Y.js} +1 -1
- package/dist/{audio-D52h1jAT.js.map → audio-D3gnp15Y.js.map} +1 -1
- package/dist/{audio-B_jT9Xr7.cjs → audio-EaD0Ggfh.cjs} +1 -1
- package/dist/{audio-B_jT9Xr7.cjs.map → audio-EaD0Ggfh.cjs.map} +1 -1
- package/dist/audio.cjs +1 -1
- package/dist/audio.js +2 -2
- package/dist/autocomplete-DMmxsvUe.cjs +115 -0
- package/dist/autocomplete-DMmxsvUe.cjs.map +1 -0
- package/dist/{autocomplete-CI4QJXAN.js → autocomplete-DWiEqlQf.js} +96 -96
- package/dist/autocomplete-DWiEqlQf.js.map +1 -0
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +3 -3
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{boat-_N1x5U_3.js → boat-DmyG7y1V.js} +4 -4
- package/dist/{boat-_N1x5U_3.js.map → boat-DmyG7y1V.js.map} +1 -1
- package/dist/{boat-I4B1UNMc.cjs → boat-dB1_qLm0.cjs} +1 -1
- package/dist/{boat-I4B1UNMc.cjs.map → boat-dB1_qLm0.cjs.map} +1 -1
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/breadcrumb.cjs +3 -3
- package/dist/breadcrumb.cjs.map +1 -1
- package/dist/breadcrumb.js +4 -4
- package/dist/breadcrumb.js.map +1 -1
- package/dist/{busy-BIUonyPk.cjs → busy-Cj_PV7oC.cjs} +1 -1
- package/dist/{busy-BIUonyPk.cjs.map → busy-Cj_PV7oC.cjs.map} +1 -1
- package/dist/{busy-CCB3qKnh.js → busy-enYCTssB.js} +2 -2
- package/dist/{busy-CCB3qKnh.js.map → busy-enYCTssB.js.map} +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/{button-C89bPnHt.js → button-BQSOVnHn.js} +10 -9
- package/dist/button-BQSOVnHn.js.map +1 -0
- package/dist/button-WRmXlNyw.cjs +62 -0
- package/dist/button-WRmXlNyw.cjs.map +1 -0
- package/dist/button.cjs +6 -6
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +17 -16
- package/dist/button.js.map +1 -1
- package/dist/{card-CFsCgJKZ.js → card-BHTz1GwB.js} +16 -16
- package/dist/card-BHTz1GwB.js.map +1 -0
- package/dist/{card-BO93_oxQ.cjs → card-ThG_ZaQE.cjs} +3 -3
- package/dist/card-ThG_ZaQE.cjs.map +1 -0
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-CFUBUFtW.cjs → checkbox-C4zeib84.cjs} +2 -2
- package/dist/{checkbox-CFUBUFtW.cjs.map → checkbox-C4zeib84.cjs.map} +1 -1
- package/dist/{checkbox-Bh7q0djq.js → checkbox-Ce0DlAdW.js} +6 -6
- package/dist/{checkbox-Bh7q0djq.js.map → checkbox-Ce0DlAdW.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-BfzpsyV1.cjs → chips-B1jui8Pe.cjs} +3 -3
- package/dist/chips-B1jui8Pe.cjs.map +1 -0
- package/dist/{chips-6YaoRmeG.js → chips-DAy6v93f.js} +20 -19
- package/dist/chips-DAy6v93f.js.map +1 -0
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +2 -2
- package/dist/connectivity.cjs +1 -1
- package/dist/connectivity.js +3 -3
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/cursor-glow-Ah7VXSj7.js.map +1 -1
- package/dist/cursor-glow-Bulq-38P.cjs.map +1 -1
- package/dist/{date-range-N-A249O9.cjs → date-range-BUaPgbTZ.cjs} +2 -2
- package/dist/date-range-BUaPgbTZ.cjs.map +1 -0
- package/dist/{date-range-CEo_Kjqw.js → date-range-NTpoA1in.js} +4 -4
- package/dist/date-range-NTpoA1in.js.map +1 -0
- package/dist/{date-range-inline-DFopysWF.cjs → date-range-inline-D0I6k84h.cjs} +1 -1
- package/dist/{date-range-inline-DFopysWF.cjs.map → date-range-inline-D0I6k84h.cjs.map} +1 -1
- package/dist/{date-range-inline-BwialV9j.js → date-range-inline-DjRdMZ1z.js} +2 -2
- package/dist/{date-range-inline-BwialV9j.js.map → date-range-inline-DjRdMZ1z.js.map} +1 -1
- package/dist/date-range-inline.cjs +1 -1
- package/dist/date-range-inline.js +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +2 -2
- package/dist/{details-GtpfI2hA.js → details-CY49XVfp.js} +43 -35
- package/dist/details-CY49XVfp.js.map +1 -0
- package/dist/details-DQNj2oaU.cjs +164 -0
- package/dist/details-DQNj2oaU.cjs.map +1 -0
- package/dist/details.cjs +1 -1
- package/dist/details.js +1 -1
- package/dist/{directives-CvYGSW_a.cjs → directives-Bb0S1DKZ.cjs} +4 -4
- package/dist/directives-Bb0S1DKZ.cjs.map +1 -0
- package/dist/{directives-C2dXgpCY.js → directives-Bfm1lkoy.js} +30 -23
- package/dist/directives-Bfm1lkoy.js.map +1 -0
- package/dist/directives.cjs +1 -1
- package/dist/directives.js +2 -2
- package/dist/{divider-D0pGX2VB.js → divider-BeyX_C0A.js} +2 -2
- package/dist/{divider-D0pGX2VB.js.map → divider-BeyX_C0A.js.map} +1 -1
- package/dist/{divider-rNsWCvMi.cjs → divider-Ck2C1sKl.cjs} +1 -1
- package/dist/{divider-rNsWCvMi.cjs.map → divider-Ck2C1sKl.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +2 -2
- package/dist/{expand-FcKAzJta.js → expand-BYsSEtp6.js} +53 -53
- package/dist/expand-BYsSEtp6.js.map +1 -0
- package/dist/expand-CUF163mg.cjs +141 -0
- package/dist/expand-CUF163mg.cjs.map +1 -0
- package/dist/expand.cjs +1 -1
- package/dist/expand.js +1 -1
- package/dist/fab.cjs +1 -1
- package/dist/fab.js +2 -2
- package/dist/{float-CQ1WEp3M.js → float-Cgllk_H9.js} +2 -2
- package/dist/{float-CQ1WEp3M.js.map → float-Cgllk_H9.js.map} +1 -1
- package/dist/{float-CDjgxWyy.cjs → float-OvqX0nqG.cjs} +1 -1
- package/dist/{float-CDjgxWyy.cjs.map → float-OvqX0nqG.cjs.map} +1 -1
- package/dist/float.cjs +1 -1
- package/dist/float.js +1 -1
- package/dist/form-4GKROq2P.cjs +27 -0
- package/dist/form-4GKROq2P.cjs.map +1 -0
- package/dist/{form-H24puioV.js → form-DxaV_Ose.js} +39 -39
- package/dist/form-DxaV_Ose.js.map +1 -0
- package/dist/form.cjs +3 -3
- package/dist/form.cjs.map +1 -1
- package/dist/form.js +34 -34
- package/dist/form.js.map +1 -1
- package/dist/gravity-6pL6CfIr.cjs.map +1 -1
- package/dist/gravity-sVK3zGBF.js.map +1 -1
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/{icons-DBxfN91B.js → icons-CJ2mXcBi.js} +9 -9
- package/dist/icons-CJ2mXcBi.js.map +1 -0
- package/dist/icons-sZ-LybA9.cjs +24 -0
- package/dist/icons-sZ-LybA9.cjs.map +1 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/{iframe-BDVElN8z.js → iframe-DWvN5nGB.js} +11 -11
- package/dist/iframe-DWvN5nGB.js.map +1 -0
- package/dist/{iframe-CG-z9qev.cjs → iframe-DpCv-QH2.cjs} +7 -7
- package/dist/iframe-DpCv-QH2.cjs.map +1 -0
- package/dist/iframe.cjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +37 -37
- package/dist/{input-Bt_o4sYo.js → input-BCCHz6tB.js} +7 -7
- package/dist/input-BCCHz6tB.js.map +1 -0
- package/dist/{input-B14Nn6xD.cjs → input-Z-3N5JMv.cjs} +2 -2
- package/dist/input-Z-3N5JMv.cjs.map +1 -0
- package/dist/{input-chip-DEqO0DXc.js → input-chip-BOrcKH-H.js} +2 -2
- package/dist/{input-chip-DEqO0DXc.js.map → input-chip-BOrcKH-H.js.map} +1 -1
- package/dist/{input-chip-ugYu9Fn9.cjs → input-chip-ChAgRCXZ.cjs} +1 -1
- package/dist/{input-chip-ugYu9Fn9.cjs.map → input-chip-ChAgRCXZ.cjs.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.js +3 -3
- package/dist/kbd.cjs +1 -1
- package/dist/kbd.js +2 -2
- package/dist/{layout-BJ_43VrH.js → layout-CFiG3lNT.js} +1 -1
- package/dist/{layout-BJ_43VrH.js.map → layout-CFiG3lNT.js.map} +1 -1
- package/dist/{layout-DF9ZaQ-b.cjs → layout-DZ4dpLh9.cjs} +1 -1
- package/dist/{layout-DF9ZaQ-b.cjs.map → layout-DZ4dpLh9.cjs.map} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +2 -2
- package/dist/lazy-BaAiIUru.js +19 -0
- package/dist/lazy-BaAiIUru.js.map +1 -0
- package/dist/lazy-C-7a4FAe.cjs +1 -0
- package/dist/lazy-C-7a4FAe.cjs.map +1 -0
- package/dist/{lightbox-ZmuoBBFT.js → lightbox-B7Y4Nij_.js} +2 -2
- package/dist/lightbox-B7Y4Nij_.js.map +1 -0
- package/dist/{lightbox-B47Zoqv-.cjs → lightbox-Dpwsn8Qr.cjs} +1 -1
- package/dist/lightbox-Dpwsn8Qr.cjs.map +1 -0
- package/dist/lightbox.cjs +1 -1
- package/dist/lightbox.js +1 -1
- package/dist/{list-CaSWrlG2.cjs → list-BhM-6dAi.cjs} +1 -1
- package/dist/{list-CaSWrlG2.cjs.map → list-BhM-6dAi.cjs.map} +1 -1
- package/dist/{list-C47xzld_.js → list-C5WVoIfJ.js} +2 -2
- package/dist/{list-C47xzld_.js.map → list-C5WVoIfJ.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/magnetic-DKtc4umC.cjs.map +1 -1
- package/dist/magnetic-DaOOv5Dz.js.map +1 -1
- package/dist/{menu-8RObM6Ie.js → menu-CBAAJoHu.js} +3 -3
- package/dist/{menu-8RObM6Ie.js.map → menu-CBAAJoHu.js.map} +1 -1
- package/dist/{menu-Jpsy85SX.cjs → menu-DFQjJk3H.cjs} +1 -1
- package/dist/{menu-Jpsy85SX.cjs.map → menu-DFQjJk3H.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/{mixins-DTzfFVyv.js → mixins-DGBI7YPO.js} +11 -11
- package/dist/mixins-DGBI7YPO.js.map +1 -0
- package/dist/{mixins-DPdzC9ZH.cjs → mixins-fIpzhVMd.cjs} +1 -1
- package/dist/mixins-fIpzhVMd.cjs.map +1 -0
- package/dist/mixins.cjs +1 -1
- package/dist/mixins.js +2 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-rail.cjs +3 -3
- package/dist/navigation-rail.cjs.map +1 -1
- package/dist/navigation-rail.js +11 -10
- package/dist/navigation-rail.js.map +1 -1
- package/dist/notification-B6yDL91t.cjs +24 -0
- package/dist/notification-B6yDL91t.cjs.map +1 -0
- package/dist/{notification-Ccktcj9H.js → notification-BB9OBRCr.js} +22 -22
- package/dist/notification-BB9OBRCr.js.map +1 -0
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-CkMxwBqU.js → option-B21ImL0k.js} +2 -2
- package/dist/{option-CkMxwBqU.js.map → option-B21ImL0k.js.map} +1 -1
- package/dist/{option-0aNiVB3Q.cjs → option-CJQM5I9q.cjs} +1 -1
- package/dist/{option-0aNiVB3Q.cjs.map → option-CJQM5I9q.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{overlay-H3Wt_dgQ.js → overlay-CWsihJ-E.js} +75 -67
- package/dist/overlay-CWsihJ-E.js.map +1 -0
- package/dist/overlay-DkIX9Ig3.cjs +58 -0
- package/dist/overlay-DkIX9Ig3.cjs.map +1 -0
- package/dist/overlay.cjs +1 -1
- package/dist/{overlay.confirm-body-Dxn_wNm3.js → overlay.confirm-body-CPqqPNks.js} +10 -10
- package/dist/overlay.confirm-body-CPqqPNks.js.map +1 -0
- package/dist/{overlay.confirm-body-CR9xaqOE.cjs → overlay.confirm-body-DwTfiNlV.cjs} +3 -3
- package/dist/overlay.confirm-body-DwTfiNlV.cjs.map +1 -0
- package/dist/overlay.js +4 -4
- package/dist/overlay.service-DU1nqh6A.cjs +1 -0
- package/dist/{overlay.service-DEj3rfRr.cjs.map → overlay.service-DU1nqh6A.cjs.map} +1 -1
- package/dist/{overlay.service-C46kOtUi.js → overlay.service-KTgBxjFb.js} +4 -4
- package/dist/{overlay.service-C46kOtUi.js.map → overlay.service-KTgBxjFb.js.map} +1 -1
- package/dist/{progress-zs18GR6C.cjs → progress-B-Qg44XY.cjs} +1 -1
- package/dist/{progress-zs18GR6C.cjs.map → progress-B-Qg44XY.cjs.map} +1 -1
- package/dist/{progress-BK7gSq8j.js → progress-CUSS1sNz.js} +2 -2
- package/dist/{progress-BK7gSq8j.js.map → progress-CUSS1sNz.js.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-group-1HCpzRUB.js → radio-group-AHLvrN8O.js} +7 -7
- package/dist/radio-group-AHLvrN8O.js.map +1 -0
- package/dist/{radio-group-DbYlyPc-.cjs → radio-group-BEtvCSS1.cjs} +2 -2
- package/dist/radio-group-BEtvCSS1.cjs.map +1 -0
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/range.cjs +1 -1
- package/dist/range.js +2 -2
- package/dist/select-BWpV2iv-.cjs +56 -0
- package/dist/select-BWpV2iv-.cjs.map +1 -0
- package/dist/{select-CEyhNtZ2.js → select-Cawz88lG.js} +46 -46
- package/dist/select-Cawz88lG.js.map +1 -0
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +2 -2
- package/dist/skills/SKILL.md +17 -11
- package/dist/skills/overlay.md +14 -7
- package/dist/skills/schmancy/SKILL.md +17 -11
- package/dist/skills/schmancy/overlay.md +14 -7
- package/dist/skills/schmancy/steps.md +68 -34
- package/dist/skills/steps.md +68 -34
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +2 -2
- package/dist/{sound.service-DO4SmUUT.js → sound.service-CK-5zob-.js} +4 -3
- package/dist/sound.service-CK-5zob-.js.map +1 -0
- package/dist/{sound.service-G_8GV_6L.cjs → sound.service-D2GGaBXc.cjs} +1 -1
- package/dist/sound.service-D2GGaBXc.cjs.map +1 -0
- package/dist/{splash-screen-B1mM4_xz.js → splash-screen-BUEtjHXC.js} +13 -13
- package/dist/splash-screen-BUEtjHXC.js.map +1 -0
- package/dist/{splash-screen-cbz4bxjB.cjs → splash-screen-DqPuipox.cjs} +6 -6
- package/dist/splash-screen-DqPuipox.cjs.map +1 -0
- package/dist/splash-screen.cjs +1 -1
- package/dist/splash-screen.js +1 -1
- package/dist/{src-tncsWsTY.js → src-CIqAj3Eh.js} +45 -45
- package/dist/src-CIqAj3Eh.js.map +1 -0
- package/dist/{src-czeiuT1m.cjs → src-CYqBQTyt.cjs} +6 -6
- package/dist/src-CYqBQTyt.cjs.map +1 -0
- package/dist/{state-Cx0aoL5e.cjs → state-BxDNox-2.cjs} +1 -1
- package/dist/{state-Cx0aoL5e.cjs.map → state-BxDNox-2.cjs.map} +1 -1
- package/dist/{state-DJDp3N7J.js → state-CnZCDMT0.js} +9 -9
- package/dist/{state-DJDp3N7J.js.map → state-CnZCDMT0.js.map} +1 -1
- package/dist/state.cjs +1 -1
- package/dist/state.js +2 -2
- package/dist/steps.cjs +35 -19
- package/dist/steps.cjs.map +1 -1
- package/dist/steps.js +96 -73
- package/dist/steps.js.map +1 -1
- package/dist/{surface-CYBl8_a3.js → surface-BMdG3dKQ.js} +2 -2
- package/dist/{surface-CYBl8_a3.js.map → surface-BMdG3dKQ.js.map} +1 -1
- package/dist/{surface-C3cxTcJD.cjs → surface-CWwYD_z2.cjs} +1 -1
- package/dist/{surface-C3cxTcJD.cjs.map → surface-CWwYD_z2.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/switch.cjs +4 -4
- package/dist/switch.cjs.map +1 -1
- package/dist/switch.js +11 -11
- package/dist/switch.js.map +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +2 -2
- package/dist/{tabs-DHy93Q3N.js → tabs-CDQYDc6v.js} +2 -2
- package/dist/{tabs-DHy93Q3N.js.map → tabs-CDQYDc6v.js.map} +1 -1
- package/dist/{tabs-ORQ_Zd43.cjs → tabs-CbD9E1gd.cjs} +1 -1
- package/dist/{tabs-ORQ_Zd43.cjs.map → tabs-CbD9E1gd.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/textarea-Brgi-vD2.cjs +43 -0
- package/dist/textarea-Brgi-vD2.cjs.map +1 -0
- package/dist/{textarea-DHIMt-ly.js → textarea-MPyrMi-S.js} +4 -4
- package/dist/textarea-MPyrMi-S.js.map +1 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-CJpjkqHr.cjs → theme-BMbXoqi0.cjs} +1 -1
- package/dist/{theme-CJpjkqHr.cjs.map → theme-BMbXoqi0.cjs.map} +1 -1
- package/dist/{theme-CgI9PRco.js → theme-DZu-xmVp.js} +5 -5
- package/dist/{theme-CgI9PRco.js.map → theme-DZu-xmVp.js.map} +1 -1
- package/dist/{theme-button--FuBkuVr.cjs → theme-button-B0OLb-43.cjs} +1 -1
- package/dist/{theme-button--FuBkuVr.cjs.map → theme-button-B0OLb-43.cjs.map} +1 -1
- package/dist/{theme-button-D-FXb3oO.js → theme-button-D_qGvEYs.js} +2 -2
- package/dist/{theme-button-D-FXb3oO.js.map → theme-button-D_qGvEYs.js.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +3 -3
- package/dist/{theme.service-BfTK1Wtl.js → theme.service-7VkM-hVf.js} +15 -11
- package/dist/theme.service-7VkM-hVf.js.map +1 -0
- package/dist/theme.service-B15FdjOS.cjs +1 -0
- package/dist/theme.service-B15FdjOS.cjs.map +1 -0
- package/dist/tree.cjs +4 -4
- package/dist/tree.cjs.map +1 -1
- package/dist/tree.js +8 -8
- package/dist/tree.js.map +1 -1
- package/dist/{typography-CxA3sx9B.cjs → typography-D4Fo1UGh.cjs} +3 -3
- package/dist/{typography-CxA3sx9B.cjs.map → typography-D4Fo1UGh.cjs.map} +1 -1
- package/dist/{typography-BEGLfHwz.js → typography-SZhjb_4R.js} +9 -9
- package/dist/{typography-BEGLfHwz.js.map → typography-SZhjb_4R.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/dist/visually-hidden.cjs +1 -1
- package/dist/visually-hidden.js +2 -2
- package/dist/{window-B_n4P9az.js → window-BDVyrBnk.js} +101 -100
- package/dist/window-BDVyrBnk.js.map +1 -0
- package/dist/window-BbBYjm7R.cjs +59 -0
- package/dist/window-BbBYjm7R.cjs.map +1 -0
- package/dist/window.cjs +1 -1
- package/dist/window.js +1 -1
- package/package.json +1 -1
- package/skills/schmancy/SKILL.md +17 -11
- package/skills/schmancy/overlay.md +14 -7
- package/skills/schmancy/steps.md +68 -34
- package/src/area/area.component.ts +1 -1
- package/src/area/area.service.test.ts +2 -2
- package/src/area/area.service.ts +1 -1
- package/src/area/lazy.ts +87 -83
- package/src/audio/sound.service.ts +3 -3
- package/src/breadcrumb/breadcrumb.ts +2 -2
- package/src/button/button.ts +11 -11
- package/src/button/icon-button.ts +18 -18
- package/src/card/card.ts +16 -16
- package/src/content-drawer/drawer.ts +6 -6
- package/src/details/details.ts +55 -55
- package/src/directives/ai-badge.ts +2 -1
- package/src/directives/animate-text.ts +2 -1
- package/src/directives/art/art.directive.ts +2 -1
- package/src/directives/battery.ts +2 -1
- package/src/directives/confirm-click.ts +5 -3
- package/src/directives/cursor-glow.ts +2 -1
- package/src/directives/cycle-text.ts +2 -1
- package/src/directives/depth-of-field.ts +2 -1
- package/src/directives/drag.ts +4 -2
- package/src/directives/fyi.ts +2 -1
- package/src/directives/gravity.ts +2 -1
- package/src/directives/hummingbird.ts +2 -1
- package/src/directives/intersect.ts +3 -2
- package/src/directives/liquid.ts +2 -1
- package/src/directives/living-border.ts +2 -1
- package/src/directives/long-press.ts +2 -1
- package/src/directives/magnetic.ts +2 -1
- package/src/directives/missed-punch.ts +2 -1
- package/src/directives/nebula.ts +6 -5
- package/src/directives/overflow-within.ts +2 -1
- package/src/directives/reveal.ts +193 -118
- package/src/directives/urgent.ts +2 -1
- package/src/directives/working-snake.ts +2 -1
- package/src/expand/expand-root.component.ts +27 -27
- package/src/expand/expand.component.ts +48 -48
- package/src/form/fields/autocomplete/autocomplete.ts +154 -154
- package/src/form/fields/checkbox/checkbox.ts +4 -4
- package/src/form/fields/chips/chips.ts +2 -2
- package/src/form/fields/chips/filter-chip.ts +15 -15
- package/src/form/fields/date-range/date-range.ts +2 -2
- package/src/form/fields/input/input.ts +12 -12
- package/src/form/fields/radio-group/radio-button.ts +2 -2
- package/src/form/fields/radio-group/radio-group.ts +3 -3
- package/src/form/fields/select/select.ts +56 -56
- package/src/form/fields/switch/switch.ts +10 -10
- package/src/form/fields/textarea/textarea.ts +2 -2
- package/src/form/form-summary.ts +33 -33
- package/src/form/form.ts +45 -45
- package/src/icons/icon.ts +10 -8
- package/src/iframe/iframe.ts +11 -11
- package/src/lightbox/flip-directive.ts +2 -1
- package/src/lightbox/lightbox.directive.ts +2 -1
- package/src/nav-drawer/navbar.ts +3 -3
- package/src/navigation-rail/navigation-rail.ts +10 -10
- package/src/notification/notification.ts +22 -22
- package/src/overlay/overlay.component.ts +106 -83
- package/src/overlay/overlay.confirm-body.ts +4 -4
- package/src/overlay/overlay.service.ts +3 -3
- package/src/overlay/overlay.types.ts +4 -2
- package/src/splash-screen/splash-screen.ts +11 -11
- package/src/state/index.ts +12 -12
- package/src/state/schmancy-context.ts +9 -9
- package/src/steps/index.ts +1 -1
- package/src/steps/schmancy-step.ts +91 -65
- package/src/steps/{schmancy-steps-container.ts → schmancy-steps.ts} +18 -38
- package/src/steps/steps.context.ts +5 -4
- package/src/steps/steps.test.ts +120 -0
- package/src/teleport/teleport.component.ts +2 -2
- package/src/theme/theme.service.ts +17 -17
- package/src/tree/tree.ts +7 -7
- package/src/typography/typography.ts +7 -7
- package/src/window/window-manager.ts +20 -20
- package/src/window/window.ts +100 -100
- package/types/mixins/SchmancyElement.d.ts +3 -2
- package/types/mixins/formField.mixin.d.ts +1 -1
- package/types/src/area/area.service.d.ts +1 -1
- package/types/src/area/lazy.d.ts +0 -6
- package/types/src/audio/sound.service.d.ts +1 -2
- package/types/src/breadcrumb/breadcrumb.d.ts +1 -1
- package/types/src/button/button.d.ts +3 -3
- package/types/src/button/icon-button.d.ts +6 -7
- package/types/src/card/card.d.ts +5 -5
- package/types/src/content-drawer/drawer.d.ts +1 -1
- package/types/src/details/details.d.ts +2 -21
- package/types/src/directives/ai-badge.d.ts +2 -2
- package/types/src/directives/animate-text.d.ts +2 -2
- package/types/src/directives/art/art.directive.d.ts +2 -2
- package/types/src/directives/battery.d.ts +2 -2
- package/types/src/directives/confirm-click.d.ts +2 -2
- package/types/src/directives/cursor-glow.d.ts +2 -2
- package/types/src/directives/cycle-text.d.ts +2 -2
- package/types/src/directives/depth-of-field.d.ts +2 -2
- package/types/src/directives/drag.d.ts +4 -4
- package/types/src/directives/fyi.d.ts +2 -2
- package/types/src/directives/gravity.d.ts +2 -2
- package/types/src/directives/hummingbird.d.ts +2 -2
- package/types/src/directives/intersect.d.ts +2 -2
- package/types/src/directives/liquid.d.ts +2 -2
- package/types/src/directives/living-border.d.ts +2 -2
- package/types/src/directives/long-press.d.ts +2 -2
- package/types/src/directives/magnetic.d.ts +2 -2
- package/types/src/directives/missed-punch.d.ts +2 -2
- package/types/src/directives/nebula.d.ts +2 -2
- package/types/src/directives/overflow-within.d.ts +2 -2
- package/types/src/directives/reveal.d.ts +17 -7
- package/types/src/directives/urgent.d.ts +2 -2
- package/types/src/directives/working-snake.d.ts +2 -2
- package/types/src/expand/expand-root.component.d.ts +8 -8
- package/types/src/expand/expand.component.d.ts +11 -11
- package/types/src/form/fields/autocomplete/autocomplete.d.ts +29 -29
- package/types/src/form/fields/checkbox/checkbox.d.ts +1 -1
- package/types/src/form/fields/chips/chips.d.ts +1 -1
- package/types/src/form/fields/chips/filter-chip.d.ts +1 -2
- package/types/src/form/fields/input/input.d.ts +3 -3
- package/types/src/form/fields/radio-group/radio-button.d.ts +1 -1
- package/types/src/form/fields/radio-group/radio-group.d.ts +1 -1
- package/types/src/form/fields/select/select.d.ts +8 -8
- package/types/src/form/fields/switch/switch.d.ts +3 -3
- package/types/src/form/fields/textarea/textarea.d.ts +1 -1
- package/types/src/form/form-summary.d.ts +7 -7
- package/types/src/form/form.d.ts +11 -11
- package/types/src/icons/icon.d.ts +2 -2
- package/types/src/iframe/iframe.d.ts +3 -3
- package/types/src/lightbox/flip-directive.d.ts +2 -2
- package/types/src/lightbox/lightbox.directive.d.ts +2 -2
- package/types/src/nav-drawer/navbar.d.ts +1 -1
- package/types/src/navigation-rail/navigation-rail.d.ts +2 -2
- package/types/src/notification/notification.d.ts +8 -8
- package/types/src/overlay/overlay.component.d.ts +16 -16
- package/types/src/overlay/overlay.confirm-body.d.ts +1 -1
- package/types/src/overlay/overlay.types.d.ts +4 -2
- package/types/src/splash-screen/splash-screen.d.ts +2 -2
- package/types/src/state/index.d.ts +1 -1
- package/types/src/state/schmancy-context.d.ts +3 -3
- package/types/src/steps/index.d.ts +1 -1
- package/types/src/steps/schmancy-step.d.ts +8 -23
- package/types/src/steps/{schmancy-steps-container.d.ts → schmancy-steps.d.ts} +8 -9
- package/types/src/steps/steps.context.d.ts +2 -1
- package/types/src/steps/steps.test.d.ts +2 -0
- package/types/src/teleport/teleport.component.d.ts +1 -1
- package/types/src/theme/theme.service.d.ts +1 -4
- package/types/src/tree/tree.d.ts +3 -3
- package/types/src/typography/typography.d.ts +1 -1
- package/types/src/window/window-manager.d.ts +2 -2
- package/types/src/window/window.d.ts +20 -20
- package/dist/SchmancyElement-BBzRWB1w.cjs +0 -2
- package/dist/SchmancyElement-C3CpdNsi.js +0 -284
- package/dist/area-BA96mwFY.js.map +0 -1
- package/dist/area-DtyQDdOF.cjs +0 -21
- package/dist/area-DtyQDdOF.cjs.map +0 -1
- package/dist/autocomplete-Bts5Jwwr.cjs +0 -115
- package/dist/autocomplete-Bts5Jwwr.cjs.map +0 -1
- package/dist/autocomplete-CI4QJXAN.js.map +0 -1
- package/dist/button-C89bPnHt.js.map +0 -1
- package/dist/button-CkwQH-g3.cjs +0 -62
- package/dist/button-CkwQH-g3.cjs.map +0 -1
- package/dist/card-BO93_oxQ.cjs.map +0 -1
- package/dist/card-CFsCgJKZ.js.map +0 -1
- package/dist/chips-6YaoRmeG.js.map +0 -1
- package/dist/chips-BfzpsyV1.cjs.map +0 -1
- package/dist/date-range-CEo_Kjqw.js.map +0 -1
- package/dist/date-range-N-A249O9.cjs.map +0 -1
- package/dist/details-BLRPV8sY.cjs +0 -164
- package/dist/details-BLRPV8sY.cjs.map +0 -1
- package/dist/details-GtpfI2hA.js.map +0 -1
- package/dist/directives-C2dXgpCY.js.map +0 -1
- package/dist/directives-CvYGSW_a.cjs.map +0 -1
- package/dist/expand-FcKAzJta.js.map +0 -1
- package/dist/expand-tffQHGbZ.cjs +0 -141
- package/dist/expand-tffQHGbZ.cjs.map +0 -1
- package/dist/form-H24puioV.js.map +0 -1
- package/dist/form-VYhbbir3.cjs +0 -27
- package/dist/form-VYhbbir3.cjs.map +0 -1
- package/dist/icons-B_a1HStW.cjs +0 -24
- package/dist/icons-B_a1HStW.cjs.map +0 -1
- package/dist/icons-DBxfN91B.js.map +0 -1
- package/dist/iframe-BDVElN8z.js.map +0 -1
- package/dist/iframe-CG-z9qev.cjs.map +0 -1
- package/dist/input-B14Nn6xD.cjs.map +0 -1
- package/dist/input-Bt_o4sYo.js.map +0 -1
- package/dist/lazy-CayEFyC3.cjs +0 -1
- package/dist/lazy-CayEFyC3.cjs.map +0 -1
- package/dist/lazy-D-bO2r4m.js +0 -13
- package/dist/lazy-D-bO2r4m.js.map +0 -1
- package/dist/lightbox-B47Zoqv-.cjs.map +0 -1
- package/dist/lightbox-ZmuoBBFT.js.map +0 -1
- package/dist/mixins-DPdzC9ZH.cjs.map +0 -1
- package/dist/mixins-DTzfFVyv.js.map +0 -1
- package/dist/notification-Ccktcj9H.js.map +0 -1
- package/dist/notification-DSkB-sn0.cjs +0 -24
- package/dist/notification-DSkB-sn0.cjs.map +0 -1
- package/dist/overlay-BS-ta-zq.cjs +0 -58
- package/dist/overlay-BS-ta-zq.cjs.map +0 -1
- package/dist/overlay-H3Wt_dgQ.js.map +0 -1
- package/dist/overlay.confirm-body-CR9xaqOE.cjs.map +0 -1
- package/dist/overlay.confirm-body-Dxn_wNm3.js.map +0 -1
- package/dist/overlay.service-DEj3rfRr.cjs +0 -1
- package/dist/radio-group-1HCpzRUB.js.map +0 -1
- package/dist/radio-group-DbYlyPc-.cjs.map +0 -1
- package/dist/select-B-SSmUDe.cjs +0 -56
- package/dist/select-B-SSmUDe.cjs.map +0 -1
- package/dist/select-CEyhNtZ2.js.map +0 -1
- package/dist/sound.service-DO4SmUUT.js.map +0 -1
- package/dist/sound.service-G_8GV_6L.cjs.map +0 -1
- package/dist/splash-screen-B1mM4_xz.js.map +0 -1
- package/dist/splash-screen-cbz4bxjB.cjs.map +0 -1
- package/dist/src-czeiuT1m.cjs.map +0 -1
- package/dist/src-tncsWsTY.js.map +0 -1
- package/dist/textarea-CEUaDURR.cjs +0 -43
- package/dist/textarea-CEUaDURR.cjs.map +0 -1
- package/dist/textarea-DHIMt-ly.js.map +0 -1
- package/dist/theme.service-BfTK1Wtl.js.map +0 -1
- package/dist/theme.service-Dg7LO0Qz.cjs +0 -1
- package/dist/theme.service-Dg7LO0Qz.cjs.map +0 -1
- package/dist/window-B_n4P9az.js.map +0 -1
- package/dist/window-Vl1u1-EG.cjs +0 -59
- package/dist/window-Vl1u1-EG.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-BQSOVnHn.js","names":["#ariaLabel"],"sources":["../src/button/context.ts","../src/button/button.ts"],"sourcesContent":["import { createContext } from '@lit/context'\n\nexport type SchmancyButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'\n\n/**\n * Provided by `<schmancy-button>` to its descendants so children\n * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n */\nexport const SchmancyButtonSizeContext = createContext<SchmancyButtonSize>('schmancy-button-size')\n","import { provide } from '@lit/context'\nimport { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { SchmancyButtonSizeContext, type SchmancyButtonSize } from './context'\n\nexport interface SchmancyButtonEventMap {\n\tSchmancyFocus: CustomEvent<void>\n\tSchmancyBlur: CustomEvent<void>\n}\n\nexport type ButtonVariant = 'elevated' | 'filled' | 'filled tonal' | 'tonal' | 'outlined' | 'text'\nexport type ButtonColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral'\n\n/**\n * A button component.\n * @element schmancy-button\n * @slot - The default slot.\n * @slot prefix - The prefix slot.\n * @slot suffix - The suffix slot.\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-button')\nexport class SchmancyButton extends SchmancyElement {\n\tstatic styles = [css`:host{\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\tposition: relative;\n\t\ttouch-action: manipulation;\n\t\tborder-radius: 1rem;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 4px 16px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 20%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.97);\n\t\tbox-shadow: 0 1px 4px -2px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 10%, transparent);\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n\t:host *,\n\t* {\n\t\ttouch-action: manipulation;\n\t}`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\tstatic formAssociated = true\n\tprivate internals: ElementInternals | undefined\n\t/**\n\t * When this button is `type=\"submit\"` and lives inside a <schmancy-form>,\n\t * the observer mirrors the form's `aria-busy` attribute onto this button\n\t * while a submit is in flight. Stays focusable; disabled buttons drop from\n\t * the tab order and are unreachable to AT (WCAG 2.2 AA).\n\t */\n\tprivate formBusyObserver?: MutationObserver\n\n\tconstructor() {\n\t\tsuper()\n\t\ttry {\n\t\t\tthis.internals = this.attachInternals()\n\t\t} catch {\n\t\t\tthis.internals = undefined\n\t\t}\n\t\t// Translate clicks into native form semantics so the button works\n\t\t// inside any <form>, not just inside <schmancy-form>.\n\t\tthis.addEventListener('click', (e: MouseEvent) => {\n\t\t\tif (this.disabled) {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopImmediatePropagation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = this.internals?.form\n\t\t\tif (!form) return\n\t\t\tif (this.type === 'submit') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.requestSubmit()\n\t\t\t} else if (this.type === 'reset') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.reset()\n\t\t\t}\n\t\t})\n\t}\n\n\t/** Associated form, when placed inside a <form>. */\n\tget form(): HTMLFormElement | null {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tformDisabledCallback(disabled: boolean): void {\n\t\tthis.disabled = disabled\n\t}\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\t// Mirror the closest <schmancy-form>'s aria-busy onto this submit button\n\t\t// so the user gets a visible busy state during async submit handlers.\n\t\t// Schmancy-form sets aria-busy=\"true\" while status === 'submitting'.\n\t\tif (this.type !== 'submit') return\n\t\tconst form = this.closest('schmancy-form') as HTMLElement | null\n\t\tif (!form) return\n\t\tconst sync = () => {\n\t\t\tconst busy = form.getAttribute('aria-busy') === 'true'\n\t\t\tif (busy) {\n\t\t\t\tthis.setAttribute('aria-busy', 'true')\n\t\t\t\tthis.internals?.states.add('submitting')\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute('aria-busy')\n\t\t\t\tthis.internals?.states.delete('submitting')\n\t\t\t}\n\t\t}\n\t\tsync()\n\t\tthis.formBusyObserver = new MutationObserver(sync)\n\t\tthis.formBusyObserver.observe(form, { attributes: true, attributeFilter: ['aria-busy'] })\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.formBusyObserver?.disconnect()\n\t\tthis.formBusyObserver = undefined\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\t#ariaLabel!: string\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The color of the button.\n\t * @attr\n\t * @default Depends on variant: 'primary' for filled/elevated/outlined/text, 'secondary' for tonal\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic color?: ButtonColor\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t * @public\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The size of the button.\n\t * Provided as `SchmancyButtonSizeContext` to descendant elements so children\n\t * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n\t * @attr\n\t * @type {'xxs' | 'xs' | 'sm' | 'md' | 'lg'}\n\t * @default 'md'\n\t * @public\n\t */\n\t@provide({ context: SchmancyButtonSizeContext })\n\t@property({ type: String })\n\tpublic size: SchmancyButtonSize = 'md'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this.#ariaLabel\n\t\tthis.#ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this.#ariaLabel\n\t}\n\n\t@queryAssignedElements({\n\t\tslot: 'prefix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate prefixImgs!: HTMLImageElement[]\n\n\t@queryAssignedElements({\n\t\tslot: 'suffix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate suffixImgs!: HTMLImageElement[]\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\t/**\n\t * Get the effective color based on variant if not explicitly set\n\t * M3 spec: filled = primary, tonal = secondary, others = primary\n\t */\n\tprotected get effectiveColor(): ButtonColor {\n\t\tif (this.color) return this.color\n\n\t\t// Map 'tonal' to 'filled tonal' for checking\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant\n\n\t\t// M3 defaults: tonal uses secondary, others use primary\n\t\treturn effectiveVariant === 'filled tonal' ? 'secondary' : 'primary'\n\t}\n\n\tprotected get imgClasses(): string[] {\n\t\t// M3 spec: icon sizes scale with button size\n\t\tconst sizeMap = {\n\t\t\txxs: 'w-3 h-3', // 12px for 24px button (ultra-compact)\n\t\t\txs: 'w-4 h-4', // 16px for 32px button (M3 dense)\n\t\t\tsm: 'w-5 h-5', // 20px for 40px button (M3 default)\n\t\t\tmd: 'w-6 h-6', // 24px for 48px button (M3 large)\n\t\t\tlg: 'w-7 h-7' // 28px for 56px button (M3 extra large)\n\t\t}\n\t\treturn [sizeMap[this.size], 'object-contain']\n\t}\n\n\tfirstUpdated() {\n\t\t// Add image classes and ensure decorative images have an empty alt.\n\t\tthis.prefixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t\tthis.suffixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 transition-all duration-200 relative rounded-2xl flex justify-center items-center outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden flex-1 overflow-hidden':\n\t\t\t\ttrue,\n\t\t\t// Height - M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (large) → 56dp (XL)\n\t\t\t'h-6': this.size === 'xxs', // 24px - Ultra-compact\n\t\t\t'h-8': this.size === 'xs', // 32px - M3 dense/compact\n\t\t\t'h-10': this.size === 'sm', // 40px - M3 default\n\t\t\t'h-12': this.size === 'md', // 48px - M3 large\n\t\t\t'h-14': this.size === 'lg', // 56px - M3 extra large\n\t\t\t// Padding - M3 spec: horizontal padding 24dp default, scaled proportionally\n\t\t\t'py-1 px-2': this.size === 'xxs', // 4px/8px for 24px height\n\t\t\t'py-2 px-4': this.size === 'xs', // 8px/16px for 32px height\n\t\t\t'py-2.5 px-5': this.size === 'sm', // 10px/20px for 40px height\n\t\t\t'py-3 px-6': this.size === 'md', // 12px/24px for 48px height (M3 default)\n\t\t\t'py-4 px-7': this.size === 'lg', // 16px/28px for 56px height\n\t\t\t// Typography - M3 spec: label-large (14px) default, scaled\n\t\t\t'text-[10px] font-medium leading-3': this.size === 'xxs', // 10px\n\t\t\t'text-xs font-medium leading-4': this.size === 'xs', // 12px\n\t\t\t'text-sm font-medium leading-5': this.size === 'sm' || this.size === 'md', // 14px - M3 label-large\n\t\t\t'text-base font-medium leading-6': this.size === 'lg', // 16px\n\t\t\t// Letter spacing - M3 spec\n\t\t\t'tracking-[0.1px]': true,\n\t\t\t// Gap - Scaled with size\n\t\t\t'gap-0.5': this.size === 'xxs', // 2px\n\t\t\t'gap-1': this.size === 'xs', // 4px\n\t\t\t'gap-1.5': this.size === 'sm', // 6px\n\t\t\t'gap-2': this.size === 'md', // 8px\n\t\t\t'gap-2.5': this.size === 'lg', // 10px\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'w-full tex-center': this.width === 'full',\n\t\t\t// Elevated variant\n\t\t\t'bg-surface-low shadow-xs': effectiveVariant === 'elevated',\n\t\t\t// Outlined variant\n\t\t\t'bg-transparent border-1 border-solid': effectiveVariant === 'outlined',\n\t\t\t'border-outline': effectiveVariant === 'outlined' && this.effectiveColor === 'primary',\n\t\t\t'border-success-default': effectiveVariant === 'outlined' && this.effectiveColor === 'success',\n\t\t\t'border-error-default': effectiveVariant === 'outlined' && this.effectiveColor === 'error',\n\t\t\t'border-warning-default': effectiveVariant === 'outlined' && this.effectiveColor === 'warning',\n\t\t\t'border-info-default': effectiveVariant === 'outlined' && this.effectiveColor === 'info',\n\t\t\t'border-secondary-default': effectiveVariant === 'outlined' && this.effectiveColor === 'secondary',\n\t\t\t'border-outline-variant': effectiveVariant === 'outlined' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - background colors\n\t\t\t'bg-primary-default': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-default': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-default': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'bg-error-default': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-default': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-default': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerHighest': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - text colors\n\t\t\t'text-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'text-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'text-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'text-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'text-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - background colors\n\t\t\t'bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - text colors\n\t\t\t'text-primary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'text-error-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'text-warning-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'text-info-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t// Text and elevated variants - text colors\n\t\t\t'text-primary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'secondary',\n\t\t\t'text-success-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'success',\n\t\t\t'text-error-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'error',\n\t\t\t'text-warning-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'warning',\n\t\t\t'text-info-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'info',\n\t\t\t'text-surface-onVariant': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined' || effectiveVariant === 'filled tonal') && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'absolute inset-0 hover:opacity-[0.08] z-0 rounded-2xl': true,\n\t\t\t// M3 focus and pressed states\n\t\t\t'focus-visible:opacity-[0.10]': true, // M3 focus state\n\t\t\t'active:opacity-[0.10]': true, // M3 pressed state\n\t\t\t// Filled variant hover\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Outlined, elevated, text variants hover\n\t\t\t'hover:bg-primary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-onVariant': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal hover\n\t\t\t'hover:bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this.preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-button': SchmancyButton\n\t}\n}\n"],"mappings":";;;;;;;;AAQA,IAAa,IAA4B,EAAkC,sBAAA,GCkBpE,IAAA,cAA6B,EAAA;CAAA;EAAA,KAAA,SACnB,CAAC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAgCiB;GAAA,GACjC,EAAW;GACd,MAAM;GACN,gBAAA,CAAgB;EAAA;CAAA;CAAA;EAAA,KAAA,iBAAA,CAGO;CAAA;CAUxB,cAAA;EACC,MAAA,GAAA,KAAA,UA4E+B,QAAA,KAAA,QAmBA,QAAA,KAAA,OAaE,MAAA,KAAA,OAQW,UAAA,KAAA,WAAA,CAe3B;EAlIjB,IAAA;GACC,KAAK,YAAY,KAAK,gBAAA;EACvB,QAAA;GACC,KAAK,YAAA,KAAY;EAClB;EAGA,KAAK,iBAAiB,UAAU,MAAA;GAC/B,IAAI,KAAK,UAGR,OAFA,EAAE,eAAA,GAAA,KACF,EAAE,yBAAA;GAGH,IAAM,IAAO,KAAK,WAAW;GACxB,MACD,KAAK,SAAS,YACjB,EAAE,eAAA,GACF,EAAK,cAAA,KACK,KAAK,SAAS,YACxB,EAAE,eAAA,GACF,EAAK,MAAA;EAA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A,GAAA,EAAA,CAGA,EAAsB;CACtB,MAAM;CACN,SAAA,CAAS;CACT,UAAU;AAAA,CAAA,CAAA,GACV,EAAA,WAAA,cAAA,KAAA,CAAA,GAAA,IAAA,EAAA,CAlND,EAAc,iBAAA,CAAA,GAAiB,CAAA;AAAA,SAAA,KAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-C41uPa6l.cjs`);require(`./mixins-fIpzhVMd.cjs`);const t=require(`./magnetic-DKtc4umC.cjs`);let n=require(`@lit/context`),r=require(`lit/decorators.js`),i=require(`lit`),a=require(`lit/directives/if-defined.js`),o=require(`lit/directives/when.js`);var s=(0,n.createContext)(`schmancy-button-size`),c=class extends e.t{static{this.styles=[i.css`:host{
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
position: relative;
|
|
5
|
+
touch-action: manipulation;
|
|
6
|
+
border-radius: 1rem;
|
|
7
|
+
transition:
|
|
8
|
+
box-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
9
|
+
transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
10
|
+
}
|
|
11
|
+
:host([width="full"]) {
|
|
12
|
+
display: flex;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
:host(:hover:not([disabled])) {
|
|
16
|
+
box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 20%, transparent);
|
|
17
|
+
}
|
|
18
|
+
:host(:active:not([disabled])) {
|
|
19
|
+
transform: scale(0.97);
|
|
20
|
+
box-shadow: 0 1px 4px -2px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 10%, transparent);
|
|
21
|
+
transition-duration: 100ms;
|
|
22
|
+
}
|
|
23
|
+
@media (prefers-reduced-motion: reduce) {
|
|
24
|
+
:host { transition: none; }
|
|
25
|
+
:host(:hover:not([disabled])) { box-shadow: none; }
|
|
26
|
+
:host(:active:not([disabled])) { transform: none; box-shadow: none; }
|
|
27
|
+
}
|
|
28
|
+
:host *,
|
|
29
|
+
* {
|
|
30
|
+
touch-action: manipulation;
|
|
31
|
+
}`]}static{this.shadowRootOptions={...i.LitElement.shadowRootOptions,mode:`open`,delegatesFocus:!0}}static{this.formAssociated=!0}constructor(){super(),this.variant=`text`,this.width=`auto`,this.size=`md`,this.type=`button`,this.disabled=!1;try{this.internals=this.attachInternals()}catch{this.internals=void 0}this.addEventListener(`click`,e=>{if(this.disabled)return e.preventDefault(),void e.stopImmediatePropagation();let t=this.internals?.form;t&&(this.type===`submit`?(e.preventDefault(),t.requestSubmit()):this.type===`reset`&&(e.preventDefault(),t.reset()))})}get form(){return this.internals?.form??null}formDisabledCallback(e){this.disabled=e}connectedCallback(){if(super.connectedCallback(),this.type!==`submit`)return;let e=this.closest(`schmancy-form`);if(!e)return;let t=()=>{e.getAttribute(`aria-busy`)===`true`?(this.setAttribute(`aria-busy`,`true`),this.internals?.states.add(`submitting`)):(this.removeAttribute(`aria-busy`),this.internals?.states.delete(`submitting`))};t(),this.formBusyObserver=new MutationObserver(t),this.formBusyObserver.observe(e,{attributes:!0,attributeFilter:[`aria-busy`]})}disconnectedCallback(){this.formBusyObserver?.disconnect(),this.formBusyObserver=void 0,super.disconnectedCallback()}#e;set ariaLabel(e){let t=this.#e;this.#e=e,this.hasAttribute(`aria-label`)&&this.removeAttribute(`aria-label`),this.requestUpdate(`ariaLabel`,t)}get ariaLabel(){return this.#e}focus(e){this.nativeElement.focus(e)}blur(){this.nativeElement.blur()}get effectiveColor(){return this.color?this.color:(this.variant===`tonal`?`filled tonal`:this.variant)===`filled tonal`?`secondary`:`primary`}get imgClasses(){return[{xxs:`w-3 h-3`,xs:`w-4 h-4`,sm:`w-5 h-5`,md:`w-6 h-6`,lg:`w-7 h-7`}[this.size],`object-contain`]}firstUpdated(){this.prefixImgs?.forEach(e=>{e.classList.add(...this.imgClasses),e.hasAttribute(`alt`)||e.setAttribute(`alt`,``)}),this.suffixImgs?.forEach(e=>{e.classList.add(...this.imgClasses),e.hasAttribute(`alt`)||e.setAttribute(`alt`,``)})}click(){this.dispatchEvent(new Event(`click`,{bubbles:!0,composed:!0}))}preventDefault(e){e.preventDefault(),e.stopPropagation()}render(){let e=this.variant===`tonal`?`filled tonal`:this.variant,n={"z-0 transition-all duration-200 relative rounded-2xl flex justify-center items-center outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden flex-1 overflow-hidden":!0,"h-6":this.size===`xxs`,"h-8":this.size===`xs`,"h-10":this.size===`sm`,"h-12":this.size===`md`,"h-14":this.size===`lg`,"py-1 px-2":this.size===`xxs`,"py-2 px-4":this.size===`xs`,"py-2.5 px-5":this.size===`sm`,"py-3 px-6":this.size===`md`,"py-4 px-7":this.size===`lg`,"text-[10px] font-medium leading-3":this.size===`xxs`,"text-xs font-medium leading-4":this.size===`xs`,"text-sm font-medium leading-5":this.size===`sm`||this.size===`md`,"text-base font-medium leading-6":this.size===`lg`,"tracking-[0.1px]":!0,"gap-0.5":this.size===`xxs`,"gap-1":this.size===`xs`,"gap-1.5":this.size===`sm`,"gap-2":this.size===`md`,"gap-2.5":this.size===`lg`,"cursor-pointer":!this.disabled,"opacity-[0.38]":this.disabled,"hover:shadow-sm":!this.disabled&&e===`elevated`,"w-full tex-center":this.width===`full`,"bg-surface-low shadow-xs":e===`elevated`,"bg-transparent border-1 border-solid":e===`outlined`,"border-outline":e===`outlined`&&this.effectiveColor===`primary`,"border-success-default":e===`outlined`&&this.effectiveColor===`success`,"border-error-default":e===`outlined`&&this.effectiveColor===`error`,"border-warning-default":e===`outlined`&&this.effectiveColor===`warning`,"border-info-default":e===`outlined`&&this.effectiveColor===`info`,"border-secondary-default":e===`outlined`&&this.effectiveColor===`secondary`,"border-outline-variant":e===`outlined`&&this.effectiveColor===`neutral`,"bg-primary-default":e===`filled`&&this.effectiveColor===`primary`,"bg-secondary-default":e===`filled`&&this.effectiveColor===`secondary`,"bg-success-default":e===`filled`&&this.effectiveColor===`success`,"bg-error-default":e===`filled`&&this.effectiveColor===`error`,"bg-warning-default":e===`filled`&&this.effectiveColor===`warning`,"bg-info-default":e===`filled`&&this.effectiveColor===`info`,"bg-surface-containerHighest":e===`filled`&&this.effectiveColor===`neutral`,"text-primary-on":e===`filled`&&this.effectiveColor===`primary`,"text-secondary-on":e===`filled`&&this.effectiveColor===`secondary`,"text-success-on":e===`filled`&&this.effectiveColor===`success`,"text-error-on":e===`filled`&&this.effectiveColor===`error`,"text-warning-on":e===`filled`&&this.effectiveColor===`warning`,"text-info-on":e===`filled`&&this.effectiveColor===`info`,"text-surface-on":e===`filled`&&this.effectiveColor===`neutral`,"bg-primary-container":e===`filled tonal`&&this.effectiveColor===`primary`,"bg-secondary-container":e===`filled tonal`&&this.effectiveColor===`secondary`,"bg-success-container":e===`filled tonal`&&this.effectiveColor===`success`,"bg-error-container":e===`filled tonal`&&this.effectiveColor===`error`,"bg-warning-container":e===`filled tonal`&&this.effectiveColor===`warning`,"bg-info-container":e===`filled tonal`&&this.effectiveColor===`info`,"bg-surface-containerLow":e===`filled tonal`&&this.effectiveColor===`neutral`,"text-primary-onContainer":e===`filled tonal`&&this.effectiveColor===`primary`,"text-secondary-onContainer":e===`filled tonal`&&this.effectiveColor===`secondary`,"text-success-onContainer":e===`filled tonal`&&this.effectiveColor===`success`,"text-error-onContainer":e===`filled tonal`&&this.effectiveColor===`error`,"text-warning-onContainer":e===`filled tonal`&&this.effectiveColor===`warning`,"text-info-onContainer":e===`filled tonal`&&this.effectiveColor===`info`,"text-primary-default":(e===`text`||e===`elevated`||e===`outlined`)&&this.effectiveColor===`primary`,"text-secondary-default":(e===`text`||e===`elevated`||e===`outlined`)&&this.effectiveColor===`secondary`,"text-success-default":(e===`text`||e===`elevated`||e===`outlined`)&&this.effectiveColor===`success`,"text-error-default":(e===`text`||e===`elevated`||e===`outlined`)&&this.effectiveColor===`error`,"text-warning-default":(e===`text`||e===`elevated`||e===`outlined`)&&this.effectiveColor===`warning`,"text-info-default":(e===`text`||e===`elevated`||e===`outlined`)&&this.effectiveColor===`info`,"text-surface-onVariant":(e===`text`||e===`elevated`||e===`outlined`||e===`filled tonal`)&&this.effectiveColor===`neutral`},r={"absolute inset-0 hover:opacity-[0.08] z-0 rounded-2xl":!0,"focus-visible:opacity-[0.10]":!0,"active:opacity-[0.10]":!0,"hover:bg-primary-on":e===`filled`&&this.effectiveColor===`primary`,"hover:bg-secondary-on":e===`filled`&&this.effectiveColor===`secondary`,"hover:bg-success-on":e===`filled`&&this.effectiveColor===`success`,"hover:bg-error-on":e===`filled`&&this.effectiveColor===`error`,"hover:bg-warning-on":e===`filled`&&this.effectiveColor===`warning`,"hover:bg-info-on":e===`filled`&&this.effectiveColor===`info`,"hover:bg-surface-on":e===`filled`&&this.effectiveColor===`neutral`,"hover:bg-primary-default":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`primary`,"hover:bg-secondary-default":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`secondary`,"hover:bg-success-default":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`success`,"hover:bg-error-default":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`error`,"hover:bg-warning-default":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`warning`,"hover:bg-info-default":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`info`,"hover:bg-surface-onVariant":(e===`outlined`||e===`elevated`||e===`text`)&&this.effectiveColor===`neutral`,"hover:bg-primary-container":e===`filled tonal`&&this.effectiveColor===`primary`,"hover:bg-secondary-container":e===`filled tonal`&&this.effectiveColor===`secondary`,"hover:bg-success-container":e===`filled tonal`&&this.effectiveColor===`success`,"hover:bg-error-container":e===`filled tonal`&&this.effectiveColor===`error`,"hover:bg-warning-container":e===`filled tonal`&&this.effectiveColor===`warning`,"hover:bg-info-container":e===`filled tonal`&&this.effectiveColor===`info`,"hover:bg-surface-containerLow":e===`filled tonal`&&this.effectiveColor===`neutral`};return this.href?i.html`
|
|
32
|
+
<a
|
|
33
|
+
${t.t({strength:3,radius:60})}
|
|
34
|
+
part="base"
|
|
35
|
+
href=${(0,a.ifDefined)(this.disabled?void 0:this.href)}
|
|
36
|
+
aria-label=${(0,a.ifDefined)(this.ariaLabel)}
|
|
37
|
+
class="${this.classMap(n)}"
|
|
38
|
+
tabindex=${this.disabled?`-1`:`0`}
|
|
39
|
+
aria-disabled=${this.disabled}
|
|
40
|
+
@click=${this.disabled?this.preventDefault:void 0}
|
|
41
|
+
>
|
|
42
|
+
${(0,o.when)(!this.disabled,()=>i.html`<div class="${this.classMap(r)}"></div>`)}
|
|
43
|
+
<slot name="prefix"></slot>
|
|
44
|
+
<slot></slot>
|
|
45
|
+
<slot name="suffix"></slot>
|
|
46
|
+
</a>
|
|
47
|
+
`:i.html`
|
|
48
|
+
<button
|
|
49
|
+
${t.t({strength:3,radius:60})}
|
|
50
|
+
part="base"
|
|
51
|
+
aria-label=${(0,a.ifDefined)(this.ariaLabel)}
|
|
52
|
+
?disabled=${this.disabled}
|
|
53
|
+
class="${this.classMap(n)}"
|
|
54
|
+
type=${(0,a.ifDefined)(this.type)}
|
|
55
|
+
tabindex=${(0,a.ifDefined)(this.disabled?`-1`:void 0)}
|
|
56
|
+
>
|
|
57
|
+
${(0,o.when)(!this.disabled,()=>i.html`<div class="${this.classMap(r)}"></div>`)}
|
|
58
|
+
<slot name="prefix"></slot>
|
|
59
|
+
<slot></slot>
|
|
60
|
+
<slot name="suffix"></slot>
|
|
61
|
+
</button>
|
|
62
|
+
`}};e.u([(0,r.query)(`[part="base"]`,!0)],c.prototype,`nativeElement`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],c.prototype,`variant`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],c.prototype,`color`,void 0),e.u([(0,r.property)({reflect:!0})],c.prototype,`width`,void 0),e.u([(0,n.provide)({context:s}),(0,r.property)({type:String})],c.prototype,`size`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],c.prototype,`type`,void 0),e.u([(0,r.property)()],c.prototype,`href`,void 0),e.u([(0,r.property)({type:Boolean,reflect:!0})],c.prototype,`disabled`,void 0),e.u([(0,r.property)({attribute:`aria-label`})],c.prototype,`ariaLabel`,null),e.u([(0,r.queryAssignedElements)({slot:`prefix`,flatten:!0,selector:`img`})],c.prototype,`prefixImgs`,void 0),e.u([(0,r.queryAssignedElements)({slot:`suffix`,flatten:!0,selector:`img`})],c.prototype,`suffixImgs`,void 0),c=e.u([(0,r.customElement)(`schmancy-button`)],c),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-WRmXlNyw.cjs","names":["#ariaLabel"],"sources":["../src/button/context.ts","../src/button/button.ts"],"sourcesContent":["import { createContext } from '@lit/context'\n\nexport type SchmancyButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'\n\n/**\n * Provided by `<schmancy-button>` to its descendants so children\n * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n */\nexport const SchmancyButtonSizeContext = createContext<SchmancyButtonSize>('schmancy-button-size')\n","import { provide } from '@lit/context'\nimport { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { SchmancyButtonSizeContext, type SchmancyButtonSize } from './context'\n\nexport interface SchmancyButtonEventMap {\n\tSchmancyFocus: CustomEvent<void>\n\tSchmancyBlur: CustomEvent<void>\n}\n\nexport type ButtonVariant = 'elevated' | 'filled' | 'filled tonal' | 'tonal' | 'outlined' | 'text'\nexport type ButtonColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral'\n\n/**\n * A button component.\n * @element schmancy-button\n * @slot - The default slot.\n * @slot prefix - The prefix slot.\n * @slot suffix - The suffix slot.\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-button')\nexport class SchmancyButton extends SchmancyElement {\n\tstatic styles = [css`:host{\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\tposition: relative;\n\t\ttouch-action: manipulation;\n\t\tborder-radius: 1rem;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 4px 16px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 20%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.97);\n\t\tbox-shadow: 0 1px 4px -2px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 10%, transparent);\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n\t:host *,\n\t* {\n\t\ttouch-action: manipulation;\n\t}`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\tstatic formAssociated = true\n\tprivate internals: ElementInternals | undefined\n\t/**\n\t * When this button is `type=\"submit\"` and lives inside a <schmancy-form>,\n\t * the observer mirrors the form's `aria-busy` attribute onto this button\n\t * while a submit is in flight. Stays focusable; disabled buttons drop from\n\t * the tab order and are unreachable to AT (WCAG 2.2 AA).\n\t */\n\tprivate formBusyObserver?: MutationObserver\n\n\tconstructor() {\n\t\tsuper()\n\t\ttry {\n\t\t\tthis.internals = this.attachInternals()\n\t\t} catch {\n\t\t\tthis.internals = undefined\n\t\t}\n\t\t// Translate clicks into native form semantics so the button works\n\t\t// inside any <form>, not just inside <schmancy-form>.\n\t\tthis.addEventListener('click', (e: MouseEvent) => {\n\t\t\tif (this.disabled) {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopImmediatePropagation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = this.internals?.form\n\t\t\tif (!form) return\n\t\t\tif (this.type === 'submit') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.requestSubmit()\n\t\t\t} else if (this.type === 'reset') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.reset()\n\t\t\t}\n\t\t})\n\t}\n\n\t/** Associated form, when placed inside a <form>. */\n\tget form(): HTMLFormElement | null {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tformDisabledCallback(disabled: boolean): void {\n\t\tthis.disabled = disabled\n\t}\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\t// Mirror the closest <schmancy-form>'s aria-busy onto this submit button\n\t\t// so the user gets a visible busy state during async submit handlers.\n\t\t// Schmancy-form sets aria-busy=\"true\" while status === 'submitting'.\n\t\tif (this.type !== 'submit') return\n\t\tconst form = this.closest('schmancy-form') as HTMLElement | null\n\t\tif (!form) return\n\t\tconst sync = () => {\n\t\t\tconst busy = form.getAttribute('aria-busy') === 'true'\n\t\t\tif (busy) {\n\t\t\t\tthis.setAttribute('aria-busy', 'true')\n\t\t\t\tthis.internals?.states.add('submitting')\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute('aria-busy')\n\t\t\t\tthis.internals?.states.delete('submitting')\n\t\t\t}\n\t\t}\n\t\tsync()\n\t\tthis.formBusyObserver = new MutationObserver(sync)\n\t\tthis.formBusyObserver.observe(form, { attributes: true, attributeFilter: ['aria-busy'] })\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.formBusyObserver?.disconnect()\n\t\tthis.formBusyObserver = undefined\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\t#ariaLabel!: string\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The color of the button.\n\t * @attr\n\t * @default Depends on variant: 'primary' for filled/elevated/outlined/text, 'secondary' for tonal\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic color?: ButtonColor\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t * @public\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The size of the button.\n\t * Provided as `SchmancyButtonSizeContext` to descendant elements so children\n\t * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n\t * @attr\n\t * @type {'xxs' | 'xs' | 'sm' | 'md' | 'lg'}\n\t * @default 'md'\n\t * @public\n\t */\n\t@provide({ context: SchmancyButtonSizeContext })\n\t@property({ type: String })\n\tpublic size: SchmancyButtonSize = 'md'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this.#ariaLabel\n\t\tthis.#ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this.#ariaLabel\n\t}\n\n\t@queryAssignedElements({\n\t\tslot: 'prefix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate prefixImgs!: HTMLImageElement[]\n\n\t@queryAssignedElements({\n\t\tslot: 'suffix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate suffixImgs!: HTMLImageElement[]\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\t/**\n\t * Get the effective color based on variant if not explicitly set\n\t * M3 spec: filled = primary, tonal = secondary, others = primary\n\t */\n\tprotected get effectiveColor(): ButtonColor {\n\t\tif (this.color) return this.color\n\n\t\t// Map 'tonal' to 'filled tonal' for checking\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant\n\n\t\t// M3 defaults: tonal uses secondary, others use primary\n\t\treturn effectiveVariant === 'filled tonal' ? 'secondary' : 'primary'\n\t}\n\n\tprotected get imgClasses(): string[] {\n\t\t// M3 spec: icon sizes scale with button size\n\t\tconst sizeMap = {\n\t\t\txxs: 'w-3 h-3', // 12px for 24px button (ultra-compact)\n\t\t\txs: 'w-4 h-4', // 16px for 32px button (M3 dense)\n\t\t\tsm: 'w-5 h-5', // 20px for 40px button (M3 default)\n\t\t\tmd: 'w-6 h-6', // 24px for 48px button (M3 large)\n\t\t\tlg: 'w-7 h-7' // 28px for 56px button (M3 extra large)\n\t\t}\n\t\treturn [sizeMap[this.size], 'object-contain']\n\t}\n\n\tfirstUpdated() {\n\t\t// Add image classes and ensure decorative images have an empty alt.\n\t\tthis.prefixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t\tthis.suffixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 transition-all duration-200 relative rounded-2xl flex justify-center items-center outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden flex-1 overflow-hidden':\n\t\t\t\ttrue,\n\t\t\t// Height - M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (large) → 56dp (XL)\n\t\t\t'h-6': this.size === 'xxs', // 24px - Ultra-compact\n\t\t\t'h-8': this.size === 'xs', // 32px - M3 dense/compact\n\t\t\t'h-10': this.size === 'sm', // 40px - M3 default\n\t\t\t'h-12': this.size === 'md', // 48px - M3 large\n\t\t\t'h-14': this.size === 'lg', // 56px - M3 extra large\n\t\t\t// Padding - M3 spec: horizontal padding 24dp default, scaled proportionally\n\t\t\t'py-1 px-2': this.size === 'xxs', // 4px/8px for 24px height\n\t\t\t'py-2 px-4': this.size === 'xs', // 8px/16px for 32px height\n\t\t\t'py-2.5 px-5': this.size === 'sm', // 10px/20px for 40px height\n\t\t\t'py-3 px-6': this.size === 'md', // 12px/24px for 48px height (M3 default)\n\t\t\t'py-4 px-7': this.size === 'lg', // 16px/28px for 56px height\n\t\t\t// Typography - M3 spec: label-large (14px) default, scaled\n\t\t\t'text-[10px] font-medium leading-3': this.size === 'xxs', // 10px\n\t\t\t'text-xs font-medium leading-4': this.size === 'xs', // 12px\n\t\t\t'text-sm font-medium leading-5': this.size === 'sm' || this.size === 'md', // 14px - M3 label-large\n\t\t\t'text-base font-medium leading-6': this.size === 'lg', // 16px\n\t\t\t// Letter spacing - M3 spec\n\t\t\t'tracking-[0.1px]': true,\n\t\t\t// Gap - Scaled with size\n\t\t\t'gap-0.5': this.size === 'xxs', // 2px\n\t\t\t'gap-1': this.size === 'xs', // 4px\n\t\t\t'gap-1.5': this.size === 'sm', // 6px\n\t\t\t'gap-2': this.size === 'md', // 8px\n\t\t\t'gap-2.5': this.size === 'lg', // 10px\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'w-full tex-center': this.width === 'full',\n\t\t\t// Elevated variant\n\t\t\t'bg-surface-low shadow-xs': effectiveVariant === 'elevated',\n\t\t\t// Outlined variant\n\t\t\t'bg-transparent border-1 border-solid': effectiveVariant === 'outlined',\n\t\t\t'border-outline': effectiveVariant === 'outlined' && this.effectiveColor === 'primary',\n\t\t\t'border-success-default': effectiveVariant === 'outlined' && this.effectiveColor === 'success',\n\t\t\t'border-error-default': effectiveVariant === 'outlined' && this.effectiveColor === 'error',\n\t\t\t'border-warning-default': effectiveVariant === 'outlined' && this.effectiveColor === 'warning',\n\t\t\t'border-info-default': effectiveVariant === 'outlined' && this.effectiveColor === 'info',\n\t\t\t'border-secondary-default': effectiveVariant === 'outlined' && this.effectiveColor === 'secondary',\n\t\t\t'border-outline-variant': effectiveVariant === 'outlined' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - background colors\n\t\t\t'bg-primary-default': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-default': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-default': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'bg-error-default': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-default': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-default': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerHighest': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - text colors\n\t\t\t'text-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'text-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'text-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'text-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'text-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - background colors\n\t\t\t'bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - text colors\n\t\t\t'text-primary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'text-error-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'text-warning-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'text-info-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t// Text and elevated variants - text colors\n\t\t\t'text-primary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'secondary',\n\t\t\t'text-success-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'success',\n\t\t\t'text-error-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'error',\n\t\t\t'text-warning-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'warning',\n\t\t\t'text-info-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'info',\n\t\t\t'text-surface-onVariant': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined' || effectiveVariant === 'filled tonal') && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'absolute inset-0 hover:opacity-[0.08] z-0 rounded-2xl': true,\n\t\t\t// M3 focus and pressed states\n\t\t\t'focus-visible:opacity-[0.10]': true, // M3 focus state\n\t\t\t'active:opacity-[0.10]': true, // M3 pressed state\n\t\t\t// Filled variant hover\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Outlined, elevated, text variants hover\n\t\t\t'hover:bg-primary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-onVariant': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal hover\n\t\t\t'hover:bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this.preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-button': SchmancyButton\n\t}\n}\n"],"mappings":"0TAQA,IAAa,GAAA,EAAA,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
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-C41uPa6l.cjs`);require(`./mixins-fIpzhVMd.cjs`);const t=require(`./magnetic-DKtc4umC.cjs`),n=require(`./button-WRmXlNyw.cjs`);let r=require(`lit/decorators.js`),i=require(`lit`),a=require(`lit/directives/if-defined.js`),o=require(`lit/directives/when.js`);var s=class extends e.t{constructor(...e){super(...e),this.size=`md`,this.variant=`text`,this.width=`auto`,this.type=`button`,this.disabled=!1,this.text=!1}static{this.styles=[i.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
border-radius: 9999px;
|
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./ch
|
|
|
23
23
|
:host(:hover:not([disabled])) { box-shadow: none; }
|
|
24
24
|
:host(:active:not([disabled])) { transform: none; box-shadow: none; }
|
|
25
25
|
}
|
|
26
|
-
`]}static{this.shadowRootOptions={...i.LitElement.shadowRootOptions,mode:`open`,delegatesFocus:!0}}connectedCallback(){super.connectedCallback(),this.
|
|
26
|
+
`]}static{this.shadowRootOptions={...i.LitElement.shadowRootOptions,mode:`open`,delegatesFocus:!0}}#e;connectedCallback(){super.connectedCallback(),this.captureIcon(),this.observer=new MutationObserver(()=>this.captureIcon()),this.observer.observe(this,{childList:!0,characterData:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect()}captureIcon(){this.icon||this.text||(this.capturedIcon=this.textContent?.trim()||void 0)}set ariaLabel(e){let t=this.#e;this.#e=e,this.hasAttribute(`aria-label`)&&this.removeAttribute(`aria-label`),this.requestUpdate(`ariaLabel`,t)}get ariaLabel(){return this.#e}focus(e){this.nativeElement.focus(e)}blur(){this.nativeElement.blur()}click(){this.dispatchEvent(new Event(`click`,{bubbles:!0,composed:!0}))}preventDefault(e){e.preventDefault(),e.stopPropagation()}firstUpdated(){}render(){let e=this.variant===`tonal`?`filled tonal`:this.variant,n={"z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden":!0,"opacity-[0.38]":this.disabled,"cursor-pointer":!this.disabled,"hover:shadow-xs":!this.disabled&&(e===`outlined`||e===`text`||e===`filled`||e===`filled tonal`),"hover:shadow-sm":!this.disabled&&e===`elevated`,"flex-1 text-center":this.width===`full`,"bg-surface-low text-primary-default shadow-xs":e===`elevated`,"bg-transparent text-primary-default border-1 border-outline":e===`outlined`,"bg-primary-default text-primary-on":e===`filled`,"bg-secondary-container text-secondary-onContainer":e===`filled tonal`,"text-primary-default":e===`text`,"p-1.5":this.size===`xxs`,"p-2":this.size===`xs`,"p-2.5":this.size===`sm`,"p-3":this.size===`md`,"p-4":this.size===`lg`,"p-5":this.size===`xl`},r={"hover:opacity-[0.08] rounded-full z-0":!0,"hover:bg-primary-on":e===`filled`,"hover:bg-primary-default":e===`outlined`||e===`elevated`||e===`text`,"hover:bg-secondary-container":e===`filled tonal`},s=this.size===`xxs`?`text-xs`:this.size===`xs`?`text-base`:this.size===`sm`?`text-xl`:this.size===`md`||this.size===`lg`?`text-2xl`:`text-4xl`;return this.href?i.html`
|
|
27
27
|
<a
|
|
28
28
|
${t.t({strength:3,radius:50})}
|
|
29
29
|
part="base"
|
|
@@ -32,12 +32,12 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./ch
|
|
|
32
32
|
class="${this.classMap(n)}"
|
|
33
33
|
tabindex=${this.disabled?`-1`:`0`}
|
|
34
34
|
aria-disabled=${this.disabled}
|
|
35
|
-
@click=${this.disabled?this.
|
|
35
|
+
@click=${this.disabled?this.preventDefault:void 0}
|
|
36
36
|
>
|
|
37
37
|
${(0,o.when)(!this.disabled,()=>i.html`<div class="absolute inset-0 ${this.classMap(r)}"></div>`)}
|
|
38
38
|
${this.text?i.html`<slot></slot>`:i.html`
|
|
39
39
|
<slot style="display:none"></slot>
|
|
40
|
-
<schmancy-icon class=${s}>${this.icon||this.
|
|
40
|
+
<schmancy-icon class=${s}>${this.icon||this.capturedIcon}</schmancy-icon>
|
|
41
41
|
`}
|
|
42
42
|
</a>
|
|
43
43
|
`:i.html`
|
|
@@ -53,7 +53,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./ch
|
|
|
53
53
|
${(0,o.when)(!this.disabled,()=>i.html`<div class="absolute inset-0 ${this.classMap(r)}"></div>`)}
|
|
54
54
|
${this.text?i.html`<slot></slot>`:i.html`
|
|
55
55
|
<slot style="display:none"></slot>
|
|
56
|
-
<schmancy-icon class=${s}>${this.icon||this.
|
|
56
|
+
<schmancy-icon class=${s}>${this.icon||this.capturedIcon}</schmancy-icon>
|
|
57
57
|
`}
|
|
58
58
|
</button>
|
|
59
|
-
`}};e.u([(0,r.query)(`[part="base"]`,!0)],s.prototype,`nativeElement`,void 0),e.u([(0,r.property)({type:String})],s.prototype,`size`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],s.prototype,`variant`,void 0),e.u([(0,r.property)({reflect:!0})],s.prototype,`width`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],s.prototype,`type`,void 0),e.u([(0,r.property)()],s.prototype,`href`,void 0),e.u([(0,r.property)({type:Boolean,reflect:!0})],s.prototype,`disabled`,void 0),e.u([(0,r.property)({type:Boolean,reflect:!0})],s.prototype,`text`,void 0),e.u([(0,r.property)({type:String})],s.prototype,`icon`,void 0),e.u([(0,r.state)()],s.prototype,`
|
|
59
|
+
`}};e.u([(0,r.query)(`[part="base"]`,!0)],s.prototype,`nativeElement`,void 0),e.u([(0,r.property)({type:String})],s.prototype,`size`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],s.prototype,`variant`,void 0),e.u([(0,r.property)({reflect:!0})],s.prototype,`width`,void 0),e.u([(0,r.property)({reflect:!0,type:String})],s.prototype,`type`,void 0),e.u([(0,r.property)()],s.prototype,`href`,void 0),e.u([(0,r.property)({type:Boolean,reflect:!0})],s.prototype,`disabled`,void 0),e.u([(0,r.property)({type:Boolean,reflect:!0})],s.prototype,`text`,void 0),e.u([(0,r.property)({type:String})],s.prototype,`icon`,void 0),e.u([(0,r.state)()],s.prototype,`capturedIcon`,void 0),e.u([(0,r.property)({attribute:`aria-label`})],s.prototype,`ariaLabel`,null),s=e.u([(0,r.customElement)(`schmancy-icon-button`)],s),Object.defineProperty(exports,`SchmancyButton`,{enumerable:!0,get:function(){return n.t}}),Object.defineProperty(exports,`SchmnacyIconButton`,{enumerable:!0,get:function(){return s}});
|
package/dist/button.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.cjs","names":[],"sources":["../src/button/icon-button.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement, PropertyValueMap } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { ButtonVariant } from './button'\n\n/**\n * An icon button component.\n * @element schmancy-icon-button\n * @slot - The default slot (usually an icon or glyph).\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-icon-button')\nexport class SchmnacyIconButton extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: inline-flex;\n\t\tborder-radius: 9999px;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 2px 12px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 18%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.92);\n\t\tbox-shadow: none;\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\tprivate _ariaLabel!: string\n\n\t/**\n\t * The size of the icon.\n\t * @attr\n\t * @default 'md'\n\t */\n\t@property({ type: String })\n\tpublic size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md'\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/**\n\t * Render slot content as text instead of wrapping in schmancy-icon.\n\t * Use this when you want to display text labels in the button.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic text = false\n\n\t/**\n\t * Icon name - use this instead of slot content to prevent translation breaking icons.\n\t * Example: <schmancy-icon-button icon=\"add\"></schmancy-icon-button>\n\t * @attr\n\t */\n\t@property({ type: String })\n\tpublic icon?: string\n\n\t// Reactively captured icon name from slot content (translation-proof).\n\t// Mirrors <schmancy-icon>: a MutationObserver on the light DOM keeps this\n\t// in sync no matter how the consumer passes the name — a plain text node,\n\t// a dynamic ${...} binding (Lit mutates the text node's data in place, so\n\t// no slotchange ever fires), or a nested <schmancy-icon> element.\n\t// `textContent` flattens through all three.\n\t@state()\n\tprivate _capturedIcon?: string\n\n\tprivate _observer?: MutationObserver\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis._captureIcon()\n\t\tthis._observer = new MutationObserver(() => this._captureIcon())\n\t\tthis._observer.observe(this, { childList: true, characterData: true, subtree: true })\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis._observer?.disconnect()\n\t}\n\n\tprivate _captureIcon(): void {\n\t\tif (this.icon || this.text) return\n\t\tthis._capturedIcon = this.textContent?.trim() || undefined\n\t}\n\n\t// Manage aria-label manually so that we can always use our internal property.\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this._ariaLabel\n\t\tthis._ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this._ariaLabel\n\t}\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate _preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValueMap<unknown> | Map<PropertyKey, unknown>): void {\n\t\t// Add any first-update logic here if needed.\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(effectiveVariant === 'outlined' ||\n\t\t\t\t\teffectiveVariant === 'text' ||\n\t\t\t\t\teffectiveVariant === 'filled' ||\n\t\t\t\t\teffectiveVariant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'flex-1 text-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': effectiveVariant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-outline': effectiveVariant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': effectiveVariant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': effectiveVariant === 'filled tonal',\n\t\t\t'text-primary-default': effectiveVariant === 'text',\n\t\t\t// M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (standard) → 56dp (large)\n\t\t\t'p-1.5': this.size === 'xxs', // 6px padding = 24px total (12px icon) - Ultra-compact\n\t\t\t'p-2': this.size === 'xs', // 8px padding = 32px total (16px icon) - M3 dense\n\t\t\t'p-2.5': this.size === 'sm', // 10px padding = 40px total (20px icon) - M3 default\n\t\t\t'p-3': this.size === 'md', // 12px padding = 48px total (24px icon) - M3 standard\n\t\t\t'p-4': this.size === 'lg', // 16px padding = 56px total (24px icon) - M3 large\n\t\t\t'p-5': this.size === 'xl', // 20px padding = 80px total (40px icon) - custom XL\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'hover:opacity-[0.08] rounded-full z-0': true,\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled',\n\t\t\t'hover:bg-primary-default': effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal',\n\t\t}\n\n\t\tconst iconSizeClass = this.size === 'xxs' ? 'text-xs' : this.size === 'xs' ? 'text-base' : this.size === 'sm' ? 'text-xl' : this.size === 'md' ? 'text-2xl' : this.size === 'lg' ? 'text-2xl' : 'text-4xl';\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this._preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t${this.text\n\t\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this._capturedIcon}</schmancy-icon>\n\t\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t${this.text\n\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t: html`\n\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this._capturedIcon}</schmancy-icon>\n\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon-button': SchmnacyIconButton\n\t}\n}\n"],"mappings":"sYAeO,IAAA,EAAA,cAAiC,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,KA6CiB,KAAA,KAAA,QAQxB,OAAA,KAAA,MASA,OAAA,KAAA,KAQa,SAAA,KAAA,SAAA,CAe3B,EAAA,KAAA,KAAA,CAQJ,CAAA,CAAA,OAAA,KAAA,OA5FE,CAAC,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;iCA2BiB,CAAA,GACjC,EAAA,WAAW,kBACd,KAAM,OACN,eAAA,CAAgB,CAAA,CAAA,CAmFjB,mBAAA,CACC,MAAM,kBAAA,EACN,KAAK,aAAA,EACL,KAAK,UAAY,IAAI,qBAAuB,KAAK,aAAA,CAAA,EACjD,KAAK,UAAU,QAAQ,KAAM,CAAE,UAAA,CAAW,EAAM,cAAA,CAAe,EAAM,QAAA,CAAS,CAAA,CAAA,CAC/E,CAEA,sBAAA,CACC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IAAA,UAAA,CAAA,OAAA,EAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,qBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"button.cjs","names":["#ariaLabel"],"sources":["../src/button/icon-button.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { ButtonVariant } from './button'\n\n/**\n * An icon button component.\n * @element schmancy-icon-button\n * @slot - The default slot (usually an icon or glyph).\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-icon-button')\nexport class SchmnacyIconButton extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: inline-flex;\n\t\tborder-radius: 9999px;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 2px 12px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 18%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.92);\n\t\tbox-shadow: none;\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\t#ariaLabel!: string\n\n\t/**\n\t * The size of the icon.\n\t * @attr\n\t * @default 'md'\n\t */\n\t@property({ type: String })\n\tpublic size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md'\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/**\n\t * Render slot content as text instead of wrapping in schmancy-icon.\n\t * Use this when you want to display text labels in the button.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic text = false\n\n\t/**\n\t * Icon name - use this instead of slot content to prevent translation breaking icons.\n\t * Example: <schmancy-icon-button icon=\"add\"></schmancy-icon-button>\n\t * @attr\n\t */\n\t@property({ type: String })\n\tpublic icon?: string\n\n\t// Reactively captured icon name from slot content (translation-proof).\n\t// Mirrors <schmancy-icon>: a MutationObserver on the light DOM keeps this\n\t// in sync no matter how the consumer passes the name — a plain text node,\n\t// a dynamic ${...} binding (Lit mutates the text node's data in place, so\n\t// no slotchange ever fires), or a nested <schmancy-icon> element.\n\t// `textContent` flattens through all three.\n\t@state()\n\tprivate capturedIcon?: string\n\n\tprivate observer?: MutationObserver\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.captureIcon()\n\t\tthis.observer = new MutationObserver(() => this.captureIcon())\n\t\tthis.observer.observe(this, { childList: true, characterData: true, subtree: true })\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.observer?.disconnect()\n\t}\n\n\tprivate captureIcon(): void {\n\t\tif (this.icon || this.text) return\n\t\tthis.capturedIcon = this.textContent?.trim() || undefined\n\t}\n\n\t// Manage aria-label manually so that we can always use our internal property.\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this.#ariaLabel\n\t\tthis.#ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this.#ariaLabel\n\t}\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\tprotected firstUpdated(): void {\n\t\t// Add any first-update logic here if needed.\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(effectiveVariant === 'outlined' ||\n\t\t\t\t\teffectiveVariant === 'text' ||\n\t\t\t\t\teffectiveVariant === 'filled' ||\n\t\t\t\t\teffectiveVariant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'flex-1 text-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': effectiveVariant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-outline': effectiveVariant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': effectiveVariant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': effectiveVariant === 'filled tonal',\n\t\t\t'text-primary-default': effectiveVariant === 'text',\n\t\t\t// M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (standard) → 56dp (large)\n\t\t\t'p-1.5': this.size === 'xxs', // 6px padding = 24px total (12px icon) - Ultra-compact\n\t\t\t'p-2': this.size === 'xs', // 8px padding = 32px total (16px icon) - M3 dense\n\t\t\t'p-2.5': this.size === 'sm', // 10px padding = 40px total (20px icon) - M3 default\n\t\t\t'p-3': this.size === 'md', // 12px padding = 48px total (24px icon) - M3 standard\n\t\t\t'p-4': this.size === 'lg', // 16px padding = 56px total (24px icon) - M3 large\n\t\t\t'p-5': this.size === 'xl', // 20px padding = 80px total (40px icon) - custom XL\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'hover:opacity-[0.08] rounded-full z-0': true,\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled',\n\t\t\t'hover:bg-primary-default': effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal',\n\t\t}\n\n\t\tconst iconSizeClass = this.size === 'xxs' ? 'text-xs' : this.size === 'xs' ? 'text-base' : this.size === 'sm' ? 'text-xl' : this.size === 'md' ? 'text-2xl' : this.size === 'lg' ? 'text-2xl' : 'text-4xl';\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this.preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t${this.text\n\t\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this.capturedIcon}</schmancy-icon>\n\t\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t${this.text\n\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t: html`\n\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this.capturedIcon}</schmancy-icon>\n\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon-button': SchmnacyIconButton\n\t}\n}\n"],"mappings":"sYAeO,IAAA,EAAA,cAAiC,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,KA6CiB,KAAA,KAAA,QAQxB,OAAA,KAAA,MASA,OAAA,KAAA,KAQa,SAAA,KAAA,SAAA,CAe3B,EAAA,KAAA,KAAA,CAQJ,CAAA,CAAA,OAAA,KAAA,OA5FE,CAAC,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;iCA2BiB,CAAA,GACjC,EAAA,WAAW,kBACd,KAAM,OACN,eAAA,CAAgB,CAAA,CAAA,CAMjB,GA6EA,mBAAA,CACC,MAAM,kBAAA,EACN,KAAK,YAAA,EACL,KAAK,SAAW,IAAI,qBAAuB,KAAK,YAAA,CAAA,EAChD,KAAK,SAAS,QAAQ,KAAM,CAAE,UAAA,CAAW,EAAM,cAAA,CAAe,EAAM,QAAA,CAAS,CAAA,CAAA,CAC9E,CAEA,sBAAA,CACC,MAAM,qBAAA,EACN,KAAK,UAAU,WAAA,CAChB,CAEA,aAAA,CACK,KAAK,MAAQ,KAAK,OACtB,KAAK,aAAe,KAAK,aAAa,KAAA,GAAA,IAAU,GACjD,CAGA,IAAA,UAA8B,EAAA,CAC7B,IAAM,EAAS,KAAA,GACf,KAAA,GAAkB,EAEd,KAAK,aAAa,YAAA,GACrB,KAAK,gBAAgB,YAAA,EAEtB,KAAK,cAAc,YAAa,CAAA,CACjC,CAEA,IAAA,WACoB,CACnB,OAAO,KAAA,EACR,CAGA,MAAsB,EAAA,CACrB,KAAK,cAAc,MAAM,CAAA,CAC1B,CAGA,MA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AA,CAAA,CAAA,EAAQ,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAAA,CAAA,EAQ/B,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAOA,CAAE,KAAM,QAAS,QAAA,CAAS,CAAA,CAAA,CAAA,EAAM,EAAA,UAAA,WAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAQhC,CAAE,KAAM,QAAS,QAAA,CAAS,CAAA,CAAA,CAAA,EAAM,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAQhC,CAAE,KAAM,MAAA,CAAA,CAAA,EAAQ,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EASnB,EAAA,UAAA,eAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAiCG,CAAE,UAAW,YAAA,CAAA,CAAA,EAAc,EAAA,UAAA,YAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA/IvB,sBAAA,CAAA,EAAsB,CAAA,EAAA,OAAA,eAAA,QAAA,iBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,EAAA,CAAA,CAAA,CAAA,EAAA,OAAA,eAAA,QAAA,qBAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
package/dist/button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e, u as t } from "./SchmancyElement-
|
|
2
|
-
import "./mixins-
|
|
1
|
+
import { t as e, u as t } from "./SchmancyElement-BNnyBOwk.js";
|
|
2
|
+
import "./mixins-DGBI7YPO.js";
|
|
3
3
|
import { t as n } from "./magnetic-DaOOv5Dz.js";
|
|
4
|
-
import { t as r } from "./button-
|
|
4
|
+
import { t as r } from "./button-BQSOVnHn.js";
|
|
5
5
|
import { customElement as i, property as a, query as o, state as s } from "lit/decorators.js";
|
|
6
6
|
import { LitElement as c, css as l, html as u } from "lit";
|
|
7
7
|
import { ifDefined as d } from "lit/directives/if-defined.js";
|
|
@@ -45,25 +45,26 @@ var p = class extends e {
|
|
|
45
45
|
delegatesFocus: !0
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
+
#e;
|
|
48
49
|
connectedCallback() {
|
|
49
|
-
super.connectedCallback(), this.
|
|
50
|
+
super.connectedCallback(), this.captureIcon(), this.observer = new MutationObserver(() => this.captureIcon()), this.observer.observe(this, {
|
|
50
51
|
childList: !0,
|
|
51
52
|
characterData: !0,
|
|
52
53
|
subtree: !0
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
disconnectedCallback() {
|
|
56
|
-
super.disconnectedCallback(), this.
|
|
57
|
+
super.disconnectedCallback(), this.observer?.disconnect();
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
this.icon || this.text || (this.
|
|
59
|
+
captureIcon() {
|
|
60
|
+
this.icon || this.text || (this.capturedIcon = this.textContent?.trim() || void 0);
|
|
60
61
|
}
|
|
61
62
|
set ariaLabel(e) {
|
|
62
|
-
let t = this
|
|
63
|
-
this
|
|
63
|
+
let t = this.#e;
|
|
64
|
+
this.#e = e, this.hasAttribute("aria-label") && this.removeAttribute("aria-label"), this.requestUpdate("ariaLabel", t);
|
|
64
65
|
}
|
|
65
66
|
get ariaLabel() {
|
|
66
|
-
return this
|
|
67
|
+
return this.#e;
|
|
67
68
|
}
|
|
68
69
|
focus(e) {
|
|
69
70
|
this.nativeElement.focus(e);
|
|
@@ -77,10 +78,10 @@ var p = class extends e {
|
|
|
77
78
|
composed: !0
|
|
78
79
|
}));
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
preventDefault(e) {
|
|
81
82
|
e.preventDefault(), e.stopPropagation();
|
|
82
83
|
}
|
|
83
|
-
firstUpdated(
|
|
84
|
+
firstUpdated() {}
|
|
84
85
|
render() {
|
|
85
86
|
let e = this.variant === "tonal" ? "filled tonal" : this.variant, t = {
|
|
86
87
|
"z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden": !0,
|
|
@@ -118,12 +119,12 @@ var p = class extends e {
|
|
|
118
119
|
class="${this.classMap(t)}"
|
|
119
120
|
tabindex=${this.disabled ? "-1" : "0"}
|
|
120
121
|
aria-disabled=${this.disabled}
|
|
121
|
-
@click=${this.disabled ? this.
|
|
122
|
+
@click=${this.disabled ? this.preventDefault : void 0}
|
|
122
123
|
>
|
|
123
124
|
${f(!this.disabled, () => u`<div class="absolute inset-0 ${this.classMap(r)}"></div>`)}
|
|
124
125
|
${this.text ? u`<slot></slot>` : u`
|
|
125
126
|
<slot style="display:none"></slot>
|
|
126
|
-
<schmancy-icon class=${i}>${this.icon || this.
|
|
127
|
+
<schmancy-icon class=${i}>${this.icon || this.capturedIcon}</schmancy-icon>
|
|
127
128
|
`}
|
|
128
129
|
</a>
|
|
129
130
|
` : u`
|
|
@@ -142,7 +143,7 @@ var p = class extends e {
|
|
|
142
143
|
${f(!this.disabled, () => u`<div class="absolute inset-0 ${this.classMap(r)}"></div>`)}
|
|
143
144
|
${this.text ? u`<slot></slot>` : u`
|
|
144
145
|
<slot style="display:none"></slot>
|
|
145
|
-
<schmancy-icon class=${i}>${this.icon || this.
|
|
146
|
+
<schmancy-icon class=${i}>${this.icon || this.capturedIcon}</schmancy-icon>
|
|
146
147
|
`}
|
|
147
148
|
</button>
|
|
148
149
|
`;
|
|
@@ -160,5 +161,5 @@ t([o("[part=\"base\"]", !0)], p.prototype, "nativeElement", void 0), t([a({ type
|
|
|
160
161
|
})], p.prototype, "disabled", void 0), t([a({
|
|
161
162
|
type: Boolean,
|
|
162
163
|
reflect: !0
|
|
163
|
-
})], p.prototype, "text", void 0), t([a({ type: String })], p.prototype, "icon", void 0), t([s()], p.prototype, "
|
|
164
|
+
})], p.prototype, "text", void 0), t([a({ type: String })], p.prototype, "icon", void 0), t([s()], p.prototype, "capturedIcon", void 0), t([a({ attribute: "aria-label" })], p.prototype, "ariaLabel", null), p = t([i("schmancy-icon-button")], p);
|
|
164
165
|
export { r as SchmancyButton, p as SchmnacyIconButton };
|
package/dist/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../src/button/icon-button.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement, PropertyValueMap } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { ButtonVariant } from './button'\n\n/**\n * An icon button component.\n * @element schmancy-icon-button\n * @slot - The default slot (usually an icon or glyph).\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-icon-button')\nexport class SchmnacyIconButton extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: inline-flex;\n\t\tborder-radius: 9999px;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 2px 12px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 18%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.92);\n\t\tbox-shadow: none;\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\tprivate _ariaLabel!: string\n\n\t/**\n\t * The size of the icon.\n\t * @attr\n\t * @default 'md'\n\t */\n\t@property({ type: String })\n\tpublic size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md'\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/**\n\t * Render slot content as text instead of wrapping in schmancy-icon.\n\t * Use this when you want to display text labels in the button.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic text = false\n\n\t/**\n\t * Icon name - use this instead of slot content to prevent translation breaking icons.\n\t * Example: <schmancy-icon-button icon=\"add\"></schmancy-icon-button>\n\t * @attr\n\t */\n\t@property({ type: String })\n\tpublic icon?: string\n\n\t// Reactively captured icon name from slot content (translation-proof).\n\t// Mirrors <schmancy-icon>: a MutationObserver on the light DOM keeps this\n\t// in sync no matter how the consumer passes the name — a plain text node,\n\t// a dynamic ${...} binding (Lit mutates the text node's data in place, so\n\t// no slotchange ever fires), or a nested <schmancy-icon> element.\n\t// `textContent` flattens through all three.\n\t@state()\n\tprivate _capturedIcon?: string\n\n\tprivate _observer?: MutationObserver\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis._captureIcon()\n\t\tthis._observer = new MutationObserver(() => this._captureIcon())\n\t\tthis._observer.observe(this, { childList: true, characterData: true, subtree: true })\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis._observer?.disconnect()\n\t}\n\n\tprivate _captureIcon(): void {\n\t\tif (this.icon || this.text) return\n\t\tthis._capturedIcon = this.textContent?.trim() || undefined\n\t}\n\n\t// Manage aria-label manually so that we can always use our internal property.\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this._ariaLabel\n\t\tthis._ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this._ariaLabel\n\t}\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate _preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValueMap<unknown> | Map<PropertyKey, unknown>): void {\n\t\t// Add any first-update logic here if needed.\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(effectiveVariant === 'outlined' ||\n\t\t\t\t\teffectiveVariant === 'text' ||\n\t\t\t\t\teffectiveVariant === 'filled' ||\n\t\t\t\t\teffectiveVariant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'flex-1 text-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': effectiveVariant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-outline': effectiveVariant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': effectiveVariant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': effectiveVariant === 'filled tonal',\n\t\t\t'text-primary-default': effectiveVariant === 'text',\n\t\t\t// M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (standard) → 56dp (large)\n\t\t\t'p-1.5': this.size === 'xxs', // 6px padding = 24px total (12px icon) - Ultra-compact\n\t\t\t'p-2': this.size === 'xs', // 8px padding = 32px total (16px icon) - M3 dense\n\t\t\t'p-2.5': this.size === 'sm', // 10px padding = 40px total (20px icon) - M3 default\n\t\t\t'p-3': this.size === 'md', // 12px padding = 48px total (24px icon) - M3 standard\n\t\t\t'p-4': this.size === 'lg', // 16px padding = 56px total (24px icon) - M3 large\n\t\t\t'p-5': this.size === 'xl', // 20px padding = 80px total (40px icon) - custom XL\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'hover:opacity-[0.08] rounded-full z-0': true,\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled',\n\t\t\t'hover:bg-primary-default': effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal',\n\t\t}\n\n\t\tconst iconSizeClass = this.size === 'xxs' ? 'text-xs' : this.size === 'xs' ? 'text-base' : this.size === 'sm' ? 'text-xl' : this.size === 'md' ? 'text-2xl' : this.size === 'lg' ? 'text-2xl' : 'text-4xl';\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this._preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t${this.text\n\t\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this._capturedIcon}</schmancy-icon>\n\t\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t${this.text\n\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t: html`\n\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this._capturedIcon}</schmancy-icon>\n\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon-button': SchmnacyIconButton\n\t}\n}\n"],"mappings":";;;;;;;;AAeO,IAAA,IAAA,cAAiC,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,CAAA,GAAA,KAAA,OA6CiB,MAAA,KAAA,UAQxB,QAAA,KAAA,QASA,QAAA,KAAA,OAQa,UAAA,KAAA,WAAA,CAe3B,GAAA,KAAA,OAAA,CAQJ;CAAA;CAAA;EAAA,KAAA,SA5FE,CAAC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA2BiB;GAAA,GACjC,EAAW;GACd,MAAM;GACN,gBAAA,CAAgB;EAAA;CAAA;CAmFjB,oBAAA;EACC,MAAM,kBAAA,GACN,KAAK,aAAA,GACL,KAAK,YAAY,IAAI,uBAAuB,KAAK,aAAA,CAAA,GACjD,KAAK,UAAU,QAAQ,MAAM;GAAE,WAAA,CAAW;GAAM,eAAA,CAAe;GAAM,SAAA,CAAS;EAAA,CAAA;CAC/E;CAEA,uBAAA;EACC,MAAM,qBAAA,GACN,KAAK,WAAW,WAAA;CACjB;CAEA,eAAA;EACK,KAAK,QAAQ,KAAK,SACtB,KAAK,gBAAgB,KAAK,aAAa,KAAA,KAAA,KAAU;CAClD;CAGA,IAAA,UAA8B,GAAA;EAC7B,IAAM,IAAS,KAAK;EACpB,KAAK,aAAa,GAEd,KAAK,aAAa,YAAA,KACr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,SAAA,KAAA,CAAA,GAAA,EAAA,CAQ1B,EAAS;CAAE,SAAA,CAAS;CAAM,MAAM;AAAA,CAAA,CAAA,GAAQ,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CAQxC,EAAA,CAAA,GAAS,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CAOT,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;AAAA,CAAA,CAAA,GAAM,EAAA,WAAA,YAAA,KAAA,CAAA,GAAA,EAAA,CAQzC,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;AAAA,CAAA,CAAA,GAAM,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CAQzC,EAAS,EAAE,MAAM,OAAA,CAAA,CAAA,GAAQ,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CASzB,EAAA,CAAA,GAAM,EAAA,WAAA,iBAAA,KAAA,CAAA,GAAA,EAAA,CAiCN,EAAS,EAAE,WAAW,aAAA,CAAA,CAAA,GAAc,EAAA,WAAA,aAAA,IAAA,GAAA,IAAA,EAAA,CA/IrC,EAAc,sBAAA,CAAA,GAAsB,CAAA;AAAA,SAAA,KAAA,gBAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"button.js","names":["#ariaLabel"],"sources":["../src/button/icon-button.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { ButtonVariant } from './button'\n\n/**\n * An icon button component.\n * @element schmancy-icon-button\n * @slot - The default slot (usually an icon or glyph).\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-icon-button')\nexport class SchmnacyIconButton extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: inline-flex;\n\t\tborder-radius: 9999px;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 2px 12px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 18%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.92);\n\t\tbox-shadow: none;\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\t#ariaLabel!: string\n\n\t/**\n\t * The size of the icon.\n\t * @attr\n\t * @default 'md'\n\t */\n\t@property({ type: String })\n\tpublic size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md'\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/**\n\t * Render slot content as text instead of wrapping in schmancy-icon.\n\t * Use this when you want to display text labels in the button.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic text = false\n\n\t/**\n\t * Icon name - use this instead of slot content to prevent translation breaking icons.\n\t * Example: <schmancy-icon-button icon=\"add\"></schmancy-icon-button>\n\t * @attr\n\t */\n\t@property({ type: String })\n\tpublic icon?: string\n\n\t// Reactively captured icon name from slot content (translation-proof).\n\t// Mirrors <schmancy-icon>: a MutationObserver on the light DOM keeps this\n\t// in sync no matter how the consumer passes the name — a plain text node,\n\t// a dynamic ${...} binding (Lit mutates the text node's data in place, so\n\t// no slotchange ever fires), or a nested <schmancy-icon> element.\n\t// `textContent` flattens through all three.\n\t@state()\n\tprivate capturedIcon?: string\n\n\tprivate observer?: MutationObserver\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.captureIcon()\n\t\tthis.observer = new MutationObserver(() => this.captureIcon())\n\t\tthis.observer.observe(this, { childList: true, characterData: true, subtree: true })\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.observer?.disconnect()\n\t}\n\n\tprivate captureIcon(): void {\n\t\tif (this.icon || this.text) return\n\t\tthis.capturedIcon = this.textContent?.trim() || undefined\n\t}\n\n\t// Manage aria-label manually so that we can always use our internal property.\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this.#ariaLabel\n\t\tthis.#ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this.#ariaLabel\n\t}\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\tprotected firstUpdated(): void {\n\t\t// Add any first-update logic here if needed.\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(effectiveVariant === 'outlined' ||\n\t\t\t\t\teffectiveVariant === 'text' ||\n\t\t\t\t\teffectiveVariant === 'filled' ||\n\t\t\t\t\teffectiveVariant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'flex-1 text-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': effectiveVariant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-outline': effectiveVariant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': effectiveVariant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': effectiveVariant === 'filled tonal',\n\t\t\t'text-primary-default': effectiveVariant === 'text',\n\t\t\t// M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (standard) → 56dp (large)\n\t\t\t'p-1.5': this.size === 'xxs', // 6px padding = 24px total (12px icon) - Ultra-compact\n\t\t\t'p-2': this.size === 'xs', // 8px padding = 32px total (16px icon) - M3 dense\n\t\t\t'p-2.5': this.size === 'sm', // 10px padding = 40px total (20px icon) - M3 default\n\t\t\t'p-3': this.size === 'md', // 12px padding = 48px total (24px icon) - M3 standard\n\t\t\t'p-4': this.size === 'lg', // 16px padding = 56px total (24px icon) - M3 large\n\t\t\t'p-5': this.size === 'xl', // 20px padding = 80px total (40px icon) - custom XL\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'hover:opacity-[0.08] rounded-full z-0': true,\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled',\n\t\t\t'hover:bg-primary-default': effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal',\n\t\t}\n\n\t\tconst iconSizeClass = this.size === 'xxs' ? 'text-xs' : this.size === 'xs' ? 'text-base' : this.size === 'sm' ? 'text-xl' : this.size === 'md' ? 'text-2xl' : this.size === 'lg' ? 'text-2xl' : 'text-4xl';\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this.preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t${this.text\n\t\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t\t: html`\n\t\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this.capturedIcon}</schmancy-icon>\n\t\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 50 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t${this.text\n\t\t\t\t\t? html`<slot></slot>`\n\t\t\t\t\t: html`\n\t\t\t\t\t\t<slot style=\"display:none\"></slot>\n\t\t\t\t\t\t<schmancy-icon class=${iconSizeClass}>${this.icon || this.capturedIcon}</schmancy-icon>\n\t\t\t\t\t`\n\t\t\t\t}\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon-button': SchmnacyIconButton\n\t}\n}\n"],"mappings":";;;;;;;;AAeO,IAAA,IAAA,cAAiC,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,CAAA,GAAA,KAAA,OA6CiB,MAAA,KAAA,UAQxB,QAAA,KAAA,QASA,QAAA,KAAA,OAQa,UAAA,KAAA,WAAA,CAe3B,GAAA,KAAA,OAAA,CAQJ;CAAA;CAAA;EAAA,KAAA,SA5FE,CAAC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA2BiB;GAAA,GACjC,EAAW;GACd,MAAM;GACN,gBAAA,CAAgB;EAAA;CAAA;CAMjB;CA6EA,oBAAA;EACC,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mancyElement-
|
|
2
|
-
import "./mixins-
|
|
1
|
+
import { t as e, u as t } from "./SchmancyElement-BNnyBOwk.js";
|
|
2
|
+
import "./mixins-DGBI7YPO.js";
|
|
3
3
|
import { t as n } from "./cursor-glow-Ah7VXSj7.js";
|
|
4
4
|
import { customElement as r, property as i, state as a } from "lit/decorators.js";
|
|
5
5
|
import { LitElement as o, css as s, html as c } from "lit";
|
|
@@ -26,18 +26,18 @@ var d = class extends e {
|
|
|
26
26
|
super(...e), this.type = "elevated", this.interactive = !1, this.disabled = !1, this.dragged = !1, this.role = "article", this.ariaLabel = "", this.pressed = !1, this.ripples = [], this.nextRippleId = 0, this.handleClick = (e) => {
|
|
27
27
|
if (this.disabled || !this.interactive) return;
|
|
28
28
|
let t = this.getBoundingClientRect();
|
|
29
|
-
this.
|
|
29
|
+
this.triggerAction(e.clientX - t.left, e.clientY - t.top);
|
|
30
30
|
}, this.handleKeyDown = (e) => {
|
|
31
31
|
if (!this.disabled && this.interactive && (e.key === "Enter" || e.key === " ")) {
|
|
32
|
-
e.preventDefault(), this.
|
|
32
|
+
e.preventDefault(), this.setPressed(!0);
|
|
33
33
|
let t = this.getBoundingClientRect();
|
|
34
|
-
this.
|
|
34
|
+
this.triggerAction(t.width / 2, t.height / 2);
|
|
35
35
|
}
|
|
36
36
|
}, this.handleKeyUp = (e) => {
|
|
37
|
-
e.key !== "Enter" && e.key !== " " || this.
|
|
37
|
+
e.key !== "Enter" && e.key !== " " || this.setPressed(!1);
|
|
38
38
|
}, this.handleMouseDown = () => {
|
|
39
|
-
!this.disabled && this.interactive && this.
|
|
40
|
-
}, this.handleMouseUp = () => this.
|
|
39
|
+
!this.disabled && this.interactive && this.setPressed(!0);
|
|
40
|
+
}, this.handleMouseUp = () => this.setPressed(!1), this.handleMouseLeave = () => this.setPressed(!1);
|
|
41
41
|
}
|
|
42
42
|
static {
|
|
43
43
|
this.styles = [s`
|
|
@@ -133,15 +133,15 @@ var d = class extends e {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
connectedCallback() {
|
|
136
|
-
super.connectedCallback(), this.
|
|
136
|
+
super.connectedCallback(), this.updateAriaAttributes();
|
|
137
137
|
}
|
|
138
138
|
updated(e) {
|
|
139
|
-
super.updated(e), (e.has("interactive") || e.has("disabled")) && this.
|
|
139
|
+
super.updated(e), (e.has("interactive") || e.has("disabled")) && this.updateAriaAttributes();
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
updateAriaAttributes() {
|
|
142
142
|
this.interactive && !this.disabled ? (this.setAttribute("tabindex", "0"), this.role && this.role !== "article" || (this.role = this.href ? "link" : "button")) : (this.removeAttribute("tabindex"), this.role !== "button" && this.role !== "link" || (this.role = "article"));
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
addRipple(e, t) {
|
|
145
145
|
let n = this.nextRippleId++;
|
|
146
146
|
this.ripples = [...this.ripples, {
|
|
147
147
|
x: e,
|
|
@@ -151,17 +151,17 @@ var d = class extends e {
|
|
|
151
151
|
this.ripples = this.ripples.filter((e) => e.id !== n);
|
|
152
152
|
}, 600);
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
navigate() {
|
|
155
155
|
this.href && (this.target === "_blank" ? window.open(this.href, "_blank") : window.location.href = this.href);
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
this.
|
|
157
|
+
triggerAction(e, t) {
|
|
158
|
+
this.addRipple(e, t), this.navigate(), this.dispatchEvent(new CustomEvent("schmancy-click", {
|
|
159
159
|
detail: { value: this.type },
|
|
160
160
|
bubbles: !0,
|
|
161
161
|
composed: !0
|
|
162
162
|
}));
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
setPressed(e) {
|
|
165
165
|
this.pressed = e, e ? this.setAttribute("pressed", "") : this.removeAttribute("pressed");
|
|
166
166
|
}
|
|
167
167
|
render() {
|