@luzmo/lucero 1.0.1-alpha.9 → 1.0.2
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/README.md +74 -9
- package/components/accordion/index.cjs +1 -26
- package/components/accordion/index.js +8 -164
- package/components/accordion-BHBIfsLU.cjs +43 -0
- package/components/accordion-DC7cjb1c.js +152 -0
- package/components/action-bar/index.cjs +1 -22
- package/components/action-bar/index.js +8 -90
- package/components/action-bar-BMHZ4e_p.cjs +39 -0
- package/components/action-bar-CmLjsljR.js +92 -0
- package/components/action-button/index.cjs +1 -7
- package/components/action-button/index.js +8 -144
- package/components/action-button-B4_UEJle.js +121 -0
- package/components/action-button-G0PWSrZo.cjs +24 -0
- package/components/action-group/index.cjs +1 -1
- package/components/action-group/index.js +11 -12
- package/components/action-group-CH8FTW0i.cjs +20 -0
- package/components/action-group-DYKpp-mz.js +211 -0
- package/components/action-menu/index.cjs +1 -39
- package/components/action-menu/index.js +8 -109
- package/components/action-menu-CJyB0mmO.cjs +56 -0
- package/components/action-menu-FiS1vhW7.js +105 -0
- package/components/avatar/avatar.d.ts +5 -0
- package/components/avatar/index.cjs +1 -7
- package/components/avatar/index.js +8 -64
- package/components/avatar-CyY_ZSD0.js +65 -0
- package/components/avatar-PulwjkMI.cjs +24 -0
- package/components/badge/badge.d.ts +35 -0
- package/components/{random-id-CqvckpWe.cjs → badge/index.cjs} +1 -1
- package/components/badge/index.d.ts +8 -0
- package/components/badge/index.js +25 -0
- package/components/badge-D1Ry32wi.cjs +23 -0
- package/components/badge-D6p2hPj8.js +94 -0
- package/components/button/button-base.d.ts +16 -0
- package/components/button/button.d.ts +38 -2
- package/components/button/index.cjs +1 -3
- package/components/button/index.js +9 -110
- package/components/button-CRNRP8P0.js +115 -0
- package/components/button-D3ZTogni.cjs +20 -0
- package/components/button-base-BYV3Lp3P.cjs +25 -0
- package/components/button-base-SHgEJgk2.js +123 -0
- package/components/button-group/index.cjs +1 -1
- package/components/button-group/index.js +8 -42
- package/components/button-group-CJVpgiLq.js +46 -0
- package/components/button-group-rEK_YaF3.cjs +18 -0
- package/components/calendar/calendar.d.ts +67 -0
- package/components/calendar/index.cjs +1 -1
- package/components/calendar/index.d.ts +1 -0
- package/components/calendar/index.js +8 -11
- package/components/calendar-CKr5T_zV.js +619 -0
- package/components/calendar-WRhzTEyZ.cjs +142 -0
- package/components/chat-message/chat-message.d.ts +139 -0
- package/components/{random-id-ByCz1xaq.js → chat-message/index.cjs} +1 -9
- package/components/chat-message/index.d.ts +8 -0
- package/components/chat-message/index.js +25 -0
- package/components/chat-message-CNE-mGuP.cjs +149 -0
- package/components/chat-message-DJgocVNj.js +2295 -0
- package/components/chat-message-group/chat-message-group.d.ts +50 -0
- package/components/{when-CDZyJPvd.cjs → chat-message-group/index.cjs} +1 -5
- package/components/chat-message-group/index.d.ts +7 -0
- package/components/chat-message-group/index.js +25 -0
- package/components/chat-message-group-B4U2MzHx.js +100 -0
- package/components/chat-message-group-COmhCN-R.cjs +24 -0
- package/components/checkbox/checkbox.d.ts +7 -0
- package/components/checkbox/index.cjs +1 -8
- package/components/checkbox/index.js +8 -79
- package/components/checkbox-CPS-tR_i.js +89 -0
- package/components/checkbox-DFwDrIdY.cjs +25 -0
- package/components/checkbox-mixin-C5sLMo5L.js +67 -0
- package/components/{checkbox-mixin-BDN0dBtS.cjs → checkbox-mixin-D4HeLrMj.cjs} +3 -3
- package/components/chunk-D-qHiVGv.cjs +18 -0
- package/components/close-button-BeXYep8K.js +42 -0
- package/components/close-button-BzapEpcF.cjs +18 -0
- package/components/color-area/index.cjs +1 -63
- package/components/color-area/index.js +8 -364
- package/components/color-area-DA3ps2-c.cjs +80 -0
- package/components/color-area-DViRjuKo.js +300 -0
- package/components/color-controller-DueaXfnX.cjs +18 -0
- package/components/color-controller-G2_v2xSl.js +247 -0
- package/components/color-field/color-field.d.ts +1 -0
- package/components/color-field/index.cjs +1 -6
- package/components/color-field/index.js +8 -68
- package/components/color-field-CxdIoSq6.js +75 -0
- package/components/color-field-D7_7z2A2.cjs +23 -0
- package/components/color-handle/index.cjs +1 -7
- package/components/color-handle/index.js +8 -56
- package/components/color-handle-BOusOFFx.js +62 -0
- package/components/color-handle-Cka48yPY.cjs +24 -0
- package/components/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.js +11 -12
- package/components/color-loupe-DMk8uWZW.cjs +56 -0
- package/components/color-loupe-bEzi2P0y.js +76 -0
- package/components/color-menu/index.cjs +1 -69
- package/components/color-menu/index.js +8 -189
- package/components/color-menu-DwbTxeqv.cjs +89 -0
- package/components/color-menu-Lxc9PTzl.js +183 -0
- package/components/color-palette/index.cjs +1 -1
- package/components/color-palette/index.js +8 -71
- package/components/color-palette-349EkPMg.cjs +18 -0
- package/components/color-palette-BAdaNySC.js +80 -0
- package/components/color-palette-group/index.cjs +1 -11
- package/components/color-palette-group/index.js +8 -188
- package/components/color-palette-group-BvP09zmT.cjs +28 -0
- package/components/color-palette-group-D8Mavsd2.js +163 -0
- package/components/color-picker/color-picker.d.ts +3 -3
- package/components/color-picker/index.cjs +1 -31
- package/components/color-picker/index.js +8 -128
- package/components/color-picker-CSWiU-X5.cjs +48 -0
- package/components/color-picker-DqjfTvYf.js +126 -0
- package/components/color-slider/index.cjs +1 -1
- package/components/color-slider/index.js +8 -11
- package/components/color-slider-DxjJ72ue.cjs +57 -0
- package/components/color-slider-ihAIFt5p.js +421 -0
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → condition-attribute-with-id-DauPaLSS.cjs} +1 -14
- package/components/{query-assigned-nodes-C76XVPWY.js → condition-attribute-with-id-Duo51HZ7.js} +10 -18
- package/components/date-range-picker/date-range-picker.d.ts +184 -0
- package/components/{if-defined-C9YGdo33.cjs → date-range-picker/index.cjs} +1 -5
- package/components/date-range-picker/index.d.ts +8 -0
- package/components/date-range-picker/index.js +25 -0
- package/components/date-range-picker/types.d.ts +16 -0
- package/components/date-range-picker-BdRQep--.js +626 -0
- package/components/date-range-picker-CgitOe0i.cjs +187 -0
- package/components/date-time-picker/date-time-picker.d.ts +3 -3
- package/components/date-time-picker/index.cjs +1 -88
- package/components/date-time-picker/index.d.ts +1 -0
- package/components/date-time-picker/index.js +8 -1109
- package/components/date-time-picker/{types.d.ts → shared/types.d.ts} +1 -1
- package/components/date-time-picker-Bz8XwSOR.cjs +105 -0
- package/components/date-time-picker-Ct_ln8Ot.js +470 -0
- package/components/decorate-B2wePfNm.cjs +18 -0
- package/components/decorate-aGxJUVxg.js +91 -0
- package/components/{condition-attribute-with-id-DrQYZzFS.cjs → dependency-manger-CHy9t__e.cjs} +1 -1
- package/components/dependency-manger-DMrulWcJ.js +40 -0
- package/components/divider/index.cjs +1 -1
- package/components/divider/index.js +8 -44
- package/components/divider-Dn8XqbB6.cjs +18 -0
- package/components/divider-cU0lVwOp.js +59 -0
- package/components/divider.module-C65RfSUa.js +21 -0
- package/components/divider.module-CL60P_z8.cjs +18 -0
- package/components/element-resolution-Bs1x89vU.js +80 -0
- package/components/element-resolution-C0aiOB0Y.cjs +18 -0
- package/components/field-group/index.cjs +1 -1
- package/components/field-group/index.js +11 -12
- package/components/field-group-C7ROsWq3.js +57 -0
- package/components/field-group-OcI5Lgu7.cjs +23 -0
- package/components/field-label/index.cjs +1 -1
- package/components/field-label/index.js +11 -12
- package/components/field-label-BCl6R1uO.cjs +25 -0
- package/components/field-label-CtGCEmdp.js +87 -0
- package/components/focus-group-BshI1RpM.js +164 -0
- package/components/focus-group-SF8Kj7iB.cjs +18 -0
- package/components/focus-visible-B0NNezGc.cjs +18 -0
- package/components/focus-visible-CrooVCUu.js +58 -0
- package/components/focusable-BmS8IzhH.js +117 -0
- package/components/focusable-CupEoHmn.cjs +18 -0
- package/components/{base-BjTwmyRF.cjs → focusable-selectors-5n5liBn0.cjs} +1 -5
- package/components/{focusable-selectors-BgFlyFcY.cjs → focusable-selectors-Bg60_Kra.js} +13 -1
- package/components/{state-Deh-vKYE.js → get-label-from-slot-5vVnfSgN.js} +7 -11
- package/components/get-label-from-slot-LO_DZP60.cjs +18 -0
- package/components/icon/index.cjs +1 -1
- package/components/icon/index.js +8 -71
- package/components/icon-B7hKwn_q.cjs +18 -0
- package/components/icon-CwBAE1eU.js +59 -0
- package/components/index.cjs +1 -1
- package/components/index.js +78 -176
- package/components/infield-button/index.cjs +1 -5
- package/components/infield-button/index.js +8 -47
- package/components/infield-button-B2z0dLzq.js +54 -0
- package/components/infield-button-BVKotWqr.cjs +22 -0
- package/components/label/index.cjs +1 -1
- package/components/label/index.js +8 -34
- package/components/label-ClJE2esm.js +41 -0
- package/components/label-CqolZbJo.cjs +18 -0
- package/components/language-resolution-BYemISJC.cjs +18 -0
- package/components/language-resolution-BpfGTC29.js +43 -0
- package/components/like-anchor-BZJXts_H.cjs +32 -0
- package/components/like-anchor-DeOXX-MX.js +46 -0
- package/components/manage-help-text-CF0xBh0F.js +81 -0
- package/components/manage-help-text-D9VbYRf_.cjs +30 -0
- package/components/menu/index.cjs +1 -66
- package/components/menu/index.js +8 -879
- package/components/menu/menu-item.d.ts +8 -1
- package/components/menu/menu.d.ts +1 -0
- package/components/menu--ukVtSq7.js +749 -0
- package/components/menu-DAA51y45.cjs +108 -0
- package/components/multi-language-field/index.cjs +1 -22
- package/components/multi-language-field/index.js +8 -131
- package/components/multi-language-field/multi-language-field.d.ts +1 -0
- package/components/multi-language-field-BzY75rOY.js +122 -0
- package/components/multi-language-field-DmoMyCBH.cjs +40 -0
- package/components/number-field/index.cjs +1 -40
- package/components/number-field/index.js +8 -453
- package/components/number-field/number-field.d.ts +145 -0
- package/components/number-field-B4RSFeTR.cjs +57 -0
- package/components/number-field-C66dTUMM.js +402 -0
- package/components/observe-slot-presence-BCqd3VSd.js +55 -0
- package/components/observe-slot-presence-Dx8hzNzK.cjs +18 -0
- package/components/observe-slot-text-BhTcGuHY.cjs +18 -0
- package/components/observe-slot-text-Ddf1OC6F.js +71 -0
- package/components/options/index.cjs +1 -84
- package/components/options/index.js +8 -1160
- package/components/options/option.d.ts +16 -0
- package/components/options/options.d.ts +44 -4
- package/components/options-BPNAm4MW.cjs +101 -0
- package/components/options-Dz-ejkxF.js +484 -0
- package/components/overlay/index.cjs +1 -56
- package/components/overlay/index.js +10 -329
- package/components/overlay/overlay.d.ts +12 -1
- package/components/overlay/virtual-trigger.d.ts +3 -2
- package/components/overlay-8tN0KPbR.js +1115 -0
- package/components/overlay-CMd2Dnpv.cjs +73 -0
- package/components/overlay-CwR_36OV.js +227 -0
- package/components/overlay-DdrfkOry.cjs +47 -0
- package/components/pending-state-DFcNf5rd.js +50 -0
- package/components/{pending-state-CaH1si5b.cjs → pending-state-DIeF18qg.cjs} +4 -3
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +11 -15
- package/components/picker/picker.d.ts +1 -0
- package/components/picker-C4RVOxLq.cjs +123 -0
- package/components/picker-agQW7YNo.js +394 -0
- package/components/picker-button/index.cjs +1 -20
- package/components/picker-button/index.js +8 -70
- package/components/picker-button-BLbeT3Yu.js +72 -0
- package/components/picker-button-D34YXyXp.cjs +37 -0
- package/components/platform-B7Sk7Qon.cjs +18 -0
- package/components/{platform-BM-uMWpX.js → platform-D4V_cOJF.js} +29 -38
- package/components/popover/index.cjs +1 -1
- package/components/popover/index.js +11 -12
- package/components/popover-DyC9xGhX.js +58 -0
- package/components/popover-dgL04x6P.cjs +30 -0
- package/components/progress-bar/index.cjs +18 -0
- package/components/progress-bar/index.d.ts +7 -0
- package/components/progress-bar/index.js +25 -0
- package/components/progress-bar/progress-bar.d.ts +34 -0
- package/components/progress-bar-BR28tISC.cjs +31 -0
- package/components/progress-bar-DHgFRml1.js +119 -0
- package/components/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.js +11 -12
- package/components/progress-circle-Cg_ua9Ff.js +78 -0
- package/components/progress-circle-DuzwUiGN.cjs +33 -0
- package/components/progress-steps/index.cjs +18 -0
- package/components/progress-steps/index.d.ts +8 -0
- package/components/progress-steps/index.js +25 -0
- package/components/progress-steps/progress-steps.d.ts +148 -0
- package/components/progress-steps/types.d.ts +32 -0
- package/components/progress-steps-Da8aZWx3.js +262 -0
- package/components/progress-steps-WriXaZpE.cjs +96 -0
- package/components/prompt-box/controllers/attachments-controller.d.ts +35 -0
- package/components/prompt-box/controllers/recording-controller.d.ts +23 -0
- package/components/prompt-box/controllers/rich-input-controller.d.ts +89 -0
- package/components/prompt-box/controllers/trigger-menu-controller.d.ts +107 -0
- package/components/prompt-box/index.cjs +18 -0
- package/components/prompt-box/index.d.ts +9 -0
- package/components/prompt-box/index.js +25 -0
- package/components/prompt-box/keyboard-focus-tracker.d.ts +3 -0
- package/components/prompt-box/prompt-box-templates.d.ts +10 -0
- package/components/prompt-box/prompt-box.d.ts +194 -0
- package/components/prompt-box/range-from-point.d.ts +21 -0
- package/components/prompt-box/selection-utils.d.ts +39 -0
- package/components/prompt-box/slot-state-sync.d.ts +10 -0
- package/components/prompt-box/types.d.ts +112 -0
- package/components/prompt-box-BEloQP-R.js +1506 -0
- package/components/prompt-box-DV8Smf3Q.cjs +282 -0
- package/components/radio/index.cjs +1 -5
- package/components/radio/index.js +8 -174
- package/components/radio-BzEPGUmQ.js +141 -0
- package/components/radio-d-2GUbYE.cjs +22 -0
- package/components/{if-defined-DOaE2coe.js → random-id-B51lUxUB.cjs} +1 -10
- package/components/{when-CDK1Tt5Y.js → random-id-Dd4boCPV.js} +5 -10
- package/components/{focusable-selectors-B4YgbghQ.js → rolldown-runtime-CAFD8bLK.js} +10 -13
- package/components/roving-tabindex-B7x5ePUB.cjs +18 -0
- package/components/roving-tabindex-BP6mQbXf.js +62 -0
- package/components/{directive-oAbCiebi.js → scaled-indicator-BcO2BOsf.js} +24 -26
- package/components/scaled-indicator-p8-3k2cJ.cjs +26 -0
- package/components/search/index.cjs +1 -28
- package/components/search/index.js +8 -114
- package/components/search-CmLfd2dF.js +94 -0
- package/components/search-DRTD4xsE.cjs +45 -0
- package/components/segments-factory-CHo9oQw7.cjs +18 -0
- package/components/segments-factory-D0IveW-q.js +417 -0
- package/components/select/index.cjs +1 -140
- package/components/select/index.js +8 -602
- package/components/select/select.d.ts +26 -17
- package/components/select--vrG59GQ.cjs +158 -0
- package/components/select-DPeI0jP9.js +518 -0
- package/components/{language-resolution-8yZa5r_P.js → sized-mixin-DaBoZkVS.js} +38 -35
- package/components/sized-mixin-StFA4y0J.cjs +18 -0
- package/components/skeleton-loader/index.cjs +18 -0
- package/components/skeleton-loader/index.d.ts +7 -0
- package/components/skeleton-loader/index.js +25 -0
- package/components/skeleton-loader/skeleton-loader.d.ts +22 -0
- package/components/skeleton-loader-B8NgELvX.cjs +18 -0
- package/components/skeleton-loader-C1XG3m_u.js +46 -0
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +8 -1141
- package/components/slider/slider.d.ts +2 -0
- package/components/slider-3QBnq0S8.js +96 -0
- package/components/slider-uXRKcOz5.cjs +18 -0
- package/components/slottable-request-event-DZ2Z_BLk.js +29 -0
- package/components/{base-D76d76ww.js → slottable-request-event-gAcEQan2.cjs} +1 -9
- package/components/status-light/index.cjs +18 -0
- package/components/status-light/index.d.ts +8 -0
- package/components/status-light/index.js +25 -0
- package/components/status-light/status-light.d.ts +26 -0
- package/components/status-light-Bf8jGu4G.js +85 -0
- package/components/status-light-CBaAFRUc.cjs +21 -0
- package/components/strategies-DhxJGIZT.js +137 -0
- package/components/strategies-kuvLVIKO.cjs +18 -0
- package/components/streaming-listener-2NcP7ys7.js +77 -0
- package/components/streaming-listener-BnDW38lt.cjs +18 -0
- package/components/suggestion/index.cjs +18 -0
- package/components/suggestion/index.d.ts +8 -0
- package/components/suggestion/index.js +25 -0
- package/components/suggestion/suggestion.d.ts +45 -0
- package/components/suggestion-CEJiW_7y.cjs +23 -0
- package/components/suggestion-DK5gxxDI.js +76 -0
- package/components/swatch/index.cjs +1 -32
- package/components/swatch/index.js +8 -325
- package/components/swatch-BLuV-hlF.js +271 -0
- package/components/swatch-G70JUe6I.cjs +49 -0
- package/components/switch/index.cjs +1 -5
- package/components/switch/index.js +8 -56
- package/components/switch-BdE-hI69.js +60 -0
- package/components/switch-KzkrF-ob.cjs +22 -0
- package/components/tabs/index.cjs +1 -76
- package/components/tabs/index.js +8 -619
- package/components/tabs/tabs.d.ts +3 -9
- package/components/tabs-BfTgzdid.cjs +76 -0
- package/components/tabs-BthdwrmW.js +434 -0
- package/components/tags/index.cjs +1 -15
- package/components/tags/index.d.ts +1 -0
- package/components/tags/index.js +8 -156
- package/components/tags/tag.d.ts +28 -0
- package/components/tags/tags.d.ts +3 -1
- package/components/tags-B89eYzsB.js +203 -0
- package/components/tags-OBPAvjdV.cjs +47 -0
- package/components/text-field/index.cjs +1 -4
- package/components/text-field/index.js +9 -45
- package/components/text-field/text-field.d.ts +27 -0
- package/components/text-field-A4Obzs4l.cjs +21 -0
- package/components/text-field-BoGAvXvh.js +44 -0
- package/components/text-field-Cs8HYRYL.js +256 -0
- package/components/text-field-FJr8ZUhI.cjs +81 -0
- package/components/text-field.module-Btsve-VN.js +21 -0
- package/components/text-field.module-D5oDP7MB.cjs +18 -0
- package/components/toast/index.cjs +1 -34
- package/components/toast/index.js +8 -136
- package/components/toast-CJSQUzoW.cjs +51 -0
- package/components/toast-DKwphMrp.js +133 -0
- package/components/tooltip/index.cjs +1 -28
- package/components/tooltip/index.js +8 -205
- package/components/tooltip/tooltip.d.ts +12 -1
- package/components/tooltip-C3O4AQ1l.js +192 -0
- package/components/tooltip-DY1trLtg.cjs +45 -0
- package/components/top-nav/index.cjs +18 -0
- package/components/top-nav/index.d.ts +10 -0
- package/components/top-nav/index.js +25 -0
- package/components/top-nav/top-nav-item.d.ts +26 -0
- package/components/top-nav/top-nav.d.ts +45 -0
- package/components/top-nav-DVQ5ASMa.js +203 -0
- package/components/top-nav-DlTojz8S.cjs +45 -0
- package/components/utils.cjs +1 -1
- package/components/utils.js +8 -25
- package/components/voice-recorder-477xPHRU.js +134 -0
- package/components/voice-recorder-BUtmSvPO.cjs +18 -0
- package/custom-elements.json +1 -1
- package/index.d.ts +11 -1
- package/package.json +134 -5
- package/utils/button-interaction-controllers/interaction-controller.d.ts +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/scaled-indicator.d.ts +8 -0
- package/utils/voice-recorder.d.ts +121 -0
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-DQcRdcUa.js +0 -53
- package/components/clear-button-OFUFFe7G.cjs +0 -18
- package/components/close-button-Cbnb7XXj.cjs +0 -18
- package/components/close-button-CqHYZhum.js +0 -51
- package/components/color-controller-DTp1juRz.js +0 -3198
- package/components/color-controller-_ZwyhvaU.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/dependency-manger-CEXvGQUV.js +0 -54
- package/components/directive-C7oCP5Bh.cjs +0 -22
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cl54m8Yh.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/index-Wq3qZJGh.cjs +0 -113
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-4nDFv1Lq.js +0 -229
- package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-DTX7ggyF.js +0 -61
- package/components/picker-BfBP7XJN.js +0 -461
- package/components/picker-xIphqE6d.cjs +0 -123
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/slottable-request-event-DggLA4Rx.js +0 -31
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-BTkr42k4.cjs +0 -85
- package/components/text-field-ol9Ed5lQ.js +0 -314
- package/components/text-field.module-ColtFhf_.js +0 -21
- package/components/text-field.module-p_VF2tC_.cjs +0 -18
- package/components/unit-input/index.cjs +0 -43
- package/components/unit-input/index.d.ts +0 -7
- package/components/unit-input/index.js +0 -183
- package/components/unit-input/unit-input.d.ts +0 -33
- /package/components/date-time-picker/{helpers.d.ts → shared/helpers.d.ts} +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date/day-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date/month-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date/year-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date-time-segments.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/editable-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/literal-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/clear-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/decrement-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/increment-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/input-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/segments-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/segments-factory.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/segments-formatter.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/day-period-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/hour-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/millisecond-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/minute-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/second-segment.d.ts +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./decorate-B2wePfNm.cjs`),t=require(`./sized-mixin-StFA4y0J.cjs`),n=require(`./focusable-CupEoHmn.cjs`),r=require(`./roving-tabindex-B7x5ePUB.cjs`);let i=require(`lit`),a=require(`lit/decorators.js`),o=require(`@luzmo/icons`),s=require(`lit/directives/when.js`),c=require(`lit/directives/if-defined.js`),l=require(`@lit-labs/observers/mutation-controller.js`);var u=`@media (forced-colors:active){:host{--highcontrast-swatch-disabled-icon-color:GrayText;--highcontrast-swatch-focus-indicator-color:ButtonText;--highcontrast-swatch-background-color-selected:Background;--highcontrast-swatch-border-color-selected:Highlight;--highcontrast-swatch-border-color:ButtonText;--highcontrast-swatch-fill-foreground-color:ButtonText}.fill{forced-color-adjust:none}:host([disabled]),:host([disabled]){--highcontrast-swatch-border-color:GrayText}}:host{box-sizing:border-box;inline-size:var(--luzmo-swatch-size,var(--swatch-size));block-size:var(--luzmo-swatch-size,var(--swatch-size));-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;display:flex;position:relative}.disabled-icon{inline-size:var(--luzmo-swatch-disabled-icon-size,var(--swatch-disabled-icon-size));block-size:var(--luzmo-swatch-disabled-icon-size,var(--swatch-disabled-icon-size))}:host,:host:before{border-radius:var(--luzmo-swatch-border-radius,var(--swatch-border-radius))}:host([selected]){background-color:var(--highcontrast-swatch-background-color-selected,var(--luzmo-swatch-inner-border-color-selected,var(--swatch-inner-border-color-selected)))}:host([selected]) .fill:before{box-shadow:none;border-radius:0}:host([selected]):before{opacity:1}:host .is-image .fill:before{background-color:initial}:host([mixed-value]) .fill{background:0 0;background:var(--picked-color,transparent)}:host([mixed-value]) .mixed-value-icon{color:var(--swatch-dash-icon-color);display:block}:host([nothing]) .fill{background-color:initial;background-color:var(--picked-color,transparent);background-image:none}:host([nothing]) .fill:after{inline-size:var(--luzmo-swatch-slash-thickness,var(--swatch-slash-thickness));content:"";background:var(--highcontrast-swatch-fill-foreground-color,var(--luzmo-swatch-slash-icon-color,var(--swatch-slash-icon-color)));block-size:200%;position:absolute;transform:rotate(-45deg)}:host([nothing][shape=rectangle]) .fill:after{transform:rotate(-25deg)}:host([disabled]) .disabled-icon,:host([disabled]) .disabled-icon{display:block}:host:before{content:"";opacity:0;pointer-events:none;position:absolute;inset:0;border-width:var(--luzmo-swatch-border-thickness-selected,var(--swatch-border-thickness-selected))!important;border-style:solid!important;border-color:var(--highcontrast-swatch-border-color-selected,var(--luzmo-swatch-border-color-selected,var(--swatch-border-color-selected)))!important}:host:after{content:"";inset:calc(var(--luzmo-swatch-focus-indicator-gap,var(--swatch-focus-indicator-gap)) * -2);background-color:var(--luzmo-swatch-focus-indicator-background-color,var(--luzmo-background-color));z-index:-1;opacity:0;border-radius:var(--luzmo-swatch-focus-indicator-border-radius,var(--swatch-focus-indicator-border-radius));transition:opacity var(--luzmo-animation-duration) ease-in-out;position:absolute;border-width:var(--luzmo-swatch-focus-indicator-width,var(--swatch-focus-indicator-width))!important;border-style:solid!important;border-color:var(--highcontrast-swatch-focus-indicator-color,var(--luzmo-swatch-focus-indicator-color,var(--swatch-focus-indicator-color)))!important}:host(:focus-visible):after{opacity:1}.fill{box-sizing:border-box;border-radius:var(--luzmo-swatch-border-radius,var(--swatch-border-radius));justify-content:center;align-items:center;block-size:100%;inline-size:100%;display:flex;position:relative;overflow:hidden}.fill:before{content:"";z-index:0;box-sizing:border-box;box-shadow:inset 0 0 0 var(--luzmo-swatch-border-thickness,var(--swatch-border-thickness)) var(--highcontrast-swatch-border-color,var(--luzmo-swatch-border-color,var(--swatch-border-color)));border-radius:var(--luzmo-swatch-border-radius,var(--swatch-border-radius));position:absolute;inset:0}:host([border=none]) .fill:before,.fill:before{background-color:initial;background-color:var(--picked-color,transparent)}:host([border=none]) .fill:before{box-shadow:none}.mixed-value-icon{pointer-events:none;color:var(--picked-color,transparent);display:none}.disabled-icon{z-index:1;pointer-events:none;color:var(--highcontrast-swatch-disabled-icon-color,var(--luzmo-swatch-disabled-icon-color,var(--swatch-disabled-icon-color)));stroke:var(--highcontrast-swatch-disabled-icon-color,var(--luzmo-swatch-disabled-icon-color,var(--swatch-disabled-icon-color)));display:none;position:relative}.disabled-icon path:first-child{fill:var(--highcontrast-swatch-disabled-icon-color,var(--luzmo-swatch-disabled-icon-color,var(--swatch-disabled-icon-color)))}.disabled-icon path:last-child{fill:var(--luzmo-swatch-icon-border-color,var(--swatch-icon-border-color))}:host([shape=rectangle]){inline-size:calc(var(--luzmo-swatch-size,var(--swatch-size)) * 2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before{border-radius:0}:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before{border-radius:100%}:host([selected]) .fill{width:calc(var(--luzmo-swatch-size,var(--swatch-size)) - 2 * var(--luzmo-swatch-border-thickness-selected,var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap,var(--swatch-focus-indicator-gap)));height:calc(var(--luzmo-swatch-size,var(--swatch-size)) - 2 * var(--luzmo-swatch-border-thickness-selected,var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap,var(--swatch-focus-indicator-gap)))}:host([selected][shape=rectangle]) .fill{width:calc(var(--luzmo-swatch-size,var(--swatch-size)) * 2 - 2 * var(--luzmo-swatch-border-thickness-selected,var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap,var(--swatch-focus-indicator-gap)))}::slotted([slot=image]){object-fit:contain;block-size:100%;inline-size:100%;transition:width var(--luzmo-animation-duration) ease-in-out, height var(--luzmo-animation-duration) ease-in-out}:host([size=xl]){--swatch-size:var(--luzmo-component-height-xl);--swatch-disabled-icon-size:24px;--swatch-slash-thickness:6px}:host([size=l]){--swatch-size:var(--luzmo-component-height-l);--swatch-disabled-icon-size:20px;--swatch-slash-thickness:5px}:host([size=s]){--swatch-size:var(--luzmo-component-height-s);--swatch-disabled-icon-size:16px;--swatch-slash-thickness:3px}:host([size=xs]){--swatch-size:var(--luzmo-component-height-xs);--swatch-disabled-icon-size:16px;--swatch-slash-thickness:2px}:host([size=xxs]){--swatch-size:var(--luzmo-component-height-xxs);--swatch-disabled-icon-size:14px;--swatch-slash-thickness:2px}:host{--swatch-size:var(--luzmo-component-height);--swatch-disabled-icon-size:18px;--swatch-slash-thickness:4px;--swatch-border-radius:var(--luzmo-border-radius-s);--swatch-focus-indicator-border-radius:var(--luzmo-border-radius-s);--swatch-border-thickness:var(--luzmo-border-width);--swatch-border-thickness-selected:var(--luzmo-border-width);--swatch-focus-indicator-width:var(--luzmo-indicator-width);--swatch-focus-indicator-gap:var(--luzmo-indicator-gap);--swatch-border-color:var(--luzmo-border-color-down);--swatch-icon-border-color:var(--luzmo-border-color);--swatch-border-color-selected:var(--luzmo-border-color-full-down);--swatch-inner-border-color-selected:var(--luzmo-background-color);--swatch-disabled-icon-color:#fff;--swatch-dash-icon-color:var(--luzmo-font-color);--swatch-slash-icon-color:var(--luzmo-negative-color);--swatch-focus-indicator-color:var(--luzmo-primary)}.fill:before,:host([border=none]) .fill:before{background:var(--picked-color,transparent)}:host .is-image .fill:before{background:0 0}:host .opacity-checkerboard{background:repeating-conic-gradient(var(--luzmo-swatch-checkerboard-light,#fff) 0 25%, var(--luzmo-swatch-checkerboard-dark,#e6e6e6) 0 50%) var(--luzmo-swatch-checkerboard-position,left top)/calc(var(--luzmo-swatch-checkerboard-size,8px) * 2) calc(var(--luzmo-swatch-checkerboard-size,8px) * 2)}`,d=class extends t.n(n.t,{validSizes:[`xxs`,`xs`,`s`,`m`,`l`,`xl`],noDefaultSize:!0}){constructor(...e){super(...e),this.color=``,this.label=``,this.mixedValue=!1,this.nothing=!1,this.role=`button`,this.selected=!1,this.readonly=!1,this.renderDisabled=()=>i.html`
|
|
19
|
+
<svg
|
|
20
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
21
|
+
class="disabled-icon"
|
|
22
|
+
viewBox="0 0 20 20"
|
|
23
|
+
>
|
|
24
|
+
<path
|
|
25
|
+
d="M9.889,1a8.889,8.889,0,1,0,8.889,8.889A8.889,8.889,0,0,0,9.889,1Zm6.667,8.889a6.635,6.635,0,0,1-1.233,3.863l-9.3-9.3A6.667,6.667,0,0,1,16.556,9.889Zm-13.333,0A6.636,6.636,0,0,1,4.455,6.026l9.3,9.3A6.667,6.667,0,0,1,3.222,9.889Z"
|
|
26
|
+
stroke="none"
|
|
27
|
+
fill="var(--swatch-disabled-icon-color)"
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
d="M 9.888889312744141 1 C 4.979689598083496 1 1 4.979689598083496 1 9.888889312744141 C 1 14.7980899810791 4.979689598083496 18.77777862548828 9.888889312744141 18.77777862548828 C 14.7980899810791 18.77777862548828 18.77777862548828 14.7980899810791 18.77777862548828 9.888889312744141 C 18.77777862548828 4.979689598083496 14.7980899810791 1 9.888889312744141 1 M 15.32277870178223 13.75166893005371 L 6.02610969543457 4.454998970031738 C 8.059318542480469 3.009572982788086 10.72937774658203 2.820217132568359 12.9462194442749 3.964249610900879 C 15.16304969787598 5.10828971862793 16.55568885803223 7.394259452819824 16.5555591583252 9.888889312744141 C 16.55776977539062 11.27357959747314 16.126708984375 12.62425994873047 15.32277870178223 13.75166893005371 M 9.888258934020996 16.55648612976074 C 8.843273162841797 16.55648612976074 7.794573783874512 16.31111145019531 6.831318855285645 15.8139591217041 C 4.614439010620117 14.66977882385254 3.221879959106445 12.38361930847168 3.222219467163086 9.888889312744141 C 3.220088958740234 8.504219055175781 3.651140213012695 7.153559684753418 4.454998970031738 6.02610969543457 L 13.75166893005371 15.32333946228027 C 12.60186290740967 16.14075088500977 11.24825286865234 16.55648612976074 9.888258934020996 16.55648612976074 M 9.888889312744141 0 C 15.34163951873779 0 19.77777862548828 4.436139106750488 19.77777862548828 9.888889312744141 C 19.77777862548828 15.34163951873779 15.34163951873779 19.77777862548828 9.888889312744141 19.77777862548828 C 4.436139106750488 19.77777862548828 0 15.34163951873779 0 9.888889312744141 C 0 4.436139106750488 4.436139106750488 0 9.888889312744141 0 Z M 15.10232830047607 12.11699867248535 C 15.40205764770508 11.41858959197998 15.55679702758789 10.66494941711426 15.5555591583252 9.89048957824707 C 15.5556697845459 7.759209632873535 14.38009929656982 5.829549789428711 12.48761940002441 4.852889060974121 C 11.68764972686768 4.440059661865234 10.78924942016602 4.22184944152832 9.889529228210449 4.22184944152832 C 9.114802360534668 4.22184944152832 8.360831260681152 4.377038955688477 7.661839485168457 4.676509857177734 L 15.10232830047607 12.11699867248535 Z M 12.11597919464111 15.10181331634521 L 4.675475120544434 7.660861015319824 C 4.375750541687012 8.359296798706055 4.221027374267578 9.112875938415527 4.222219467163086 9.887349128723145 C 4.221929550170898 12.01874923706055 5.397418975830078 13.94855880737305 7.289958953857422 14.92533874511719 C 8.08997917175293 15.3382396697998 8.988459587097168 15.55648994445801 9.888258934020996 15.55648994445801 C 10.66298007965088 15.55648994445801 11.41698551177979 15.40128421783447 12.11597919464111 15.10181331634521 Z"
|
|
31
|
+
stroke="none"
|
|
32
|
+
fill="var(--swatch-disabled-icon-stroke-color)"
|
|
33
|
+
/>
|
|
34
|
+
</svg>
|
|
35
|
+
`,this.renderMixedValue=()=>(0,o.luzmoIcon)(o.luzmoDash)}static get styles(){return[(0,i.unsafeCSS)(u)]}get value(){return this._value||this.color||this.label}set value(e){if(e===this._value)return;let t=this.value;this._value=e,this.requestUpdate(`value`,t)}get focusElement(){return this}toggle(e){this.readonly||(this.selected=e??!this.selected)}handleClick(){this.disabled||this.mixedValue||(this.toggle(),this.dispatchEvent(new Event(`change`,{cancelable:!0,bubbles:!0}))||this.toggle())}handleKeydown(e){let{code:t}=e;switch(t){case`Space`:e.preventDefault(),this.addEventListener(`keyup`,this.handleKeyup);break;default:break}}handleKeypress(e){let{code:t}=e;switch(t){case`Enter`:case`NumpadEnter`:this.click();break;default:break}}handleKeyup(e){let{code:t}=e;switch(t){case`Space`:this.removeEventListener(`keyup`,this.handleKeyup),this.click();break;default:break}}render(){return i.html`
|
|
36
|
+
<div
|
|
37
|
+
class="opacity-checkerboard fill"
|
|
38
|
+
style=${(0,c.ifDefined)(this.color?`--picked-color: ${this.color}`:void 0)}
|
|
39
|
+
>
|
|
40
|
+
<slot name="image"></slot>
|
|
41
|
+
${(0,s.when)(this.disabled,this.renderDisabled)}
|
|
42
|
+
${(0,s.when)(this.mixedValue,this.renderMixedValue)}
|
|
43
|
+
</div>
|
|
44
|
+
`}willUpdate(e){if(this.getAttribute(`role`)||this.setAttribute(`role`,`button`),(e.has(`selected`)||e.has(`role`))&&!this.readonly){let t=this.role===`button`?`aria-pressed`:`aria-checked`,n=this.role===`button`?`aria-checked`:`aria-pressed`;e.has(`role`)&&this.removeAttribute(n),this.setAttribute(t,this.selected?`true`:`false`)}(e.has(`label`)||e.has(`color`)||e.has(`mixedValue`)||e.has(`nothing`))&&(this.label!==this.color&&this.label?.length?this.setAttribute(`aria-label`,this.label):this.color?this.setAttribute(`aria-label`,this.color):this.mixedValue?this.setAttribute(`aria-label`,`Mixed`):this.nothing?this.setAttribute(`aria-label`,`None`):this.removeAttribute(`aria-label`))}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`click`,this.handleClick),this.addEventListener(`keydown`,this.handleKeydown),this.addEventListener(`keypress`,this.handleKeypress),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`)}};e.t([(0,a.property)({reflect:!0})],d.prototype,`border`,void 0),e.t([(0,a.property)()],d.prototype,`color`,void 0),e.t([(0,a.property)()],d.prototype,`label`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`mixed-value`})],d.prototype,`mixedValue`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],d.prototype,`nothing`,void 0),e.t([(0,a.property)({reflect:!0})],d.prototype,`role`,void 0),e.t([(0,a.property)({reflect:!0})],d.prototype,`rounding`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],d.prototype,`selected`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],d.prototype,`readonly`,void 0),e.t([(0,a.property)({reflect:!0})],d.prototype,`shape`,void 0),e.t([(0,a.property)()],d.prototype,`value`,null);var f=`:host{justify-content:flex-start;align-items:flex-start;gap:var(--luzmo-swatch-group-spacing-regular,var(--swatch-group-spacing-regular));flex-flow:wrap;display:inline-flex}:host([density=compact]){gap:var(--luzmo-swatch-group-spacing-compact,var(--swatch-group-spacing-compact))}:host([density=spacious]){gap:var(--luzmo-swatch-group-spacing-spacious,var(--swatch-group-spacing-spacious))}:host{--swatch-group-spacing-compact:2px;--swatch-group-spacing-regular:4px;--swatch-group-spacing-spacious:8px}`,p=class extends t.n(e.n,{validSizes:[`xs`,`s`,`m`,`l`],noDefaultSize:!0}){static get styles(){return[(0,i.unsafeCSS)(f)]}get selected(){return this._selected}set selected(e){if(e===this.selected)return;let t=this.selected;this._selected=e,this.requestUpdate(`selected`,t)}constructor(){super(),this._selected=[],this.selectedSet=new Set,this.rovingTabindexController=new r.t(this,{focusInIndex:e=>{let t=-1,n=e.findIndex((n,r)=>(!e[t]&&!n.disabled&&(t=r),n.selected&&!n.disabled));return e[n]?n:t},elements:()=>this.swatches,isFocusableElement:e=>!e.disabled}),this.manageChange=async()=>{let e=new Set;this.selectedSet=new Set(this.selected),await Promise.all(this.swatches.map(e=>e.updateComplete)),this.swatches.forEach(t=>{e.add(t.value),t.selected&&this.selectedSet.add(t.value)}),this.selectedSet.forEach(t=>{e.has(t)||this.selectedSet.delete(t)}),this._selected=[...this.selectedSet],this.rovingTabindexController.clearElementCache()},new l.MutationController(this,{config:{attributes:!0,childList:!0,subtree:!0},callback:()=>{this.manageChange()}})}focus(e){this.rovingTabindexController.focus(e)}handleChange(e){e.stopPropagation();let t=this.selected;if(!this.selects){e.preventDefault();return}if(this.selects===`single`){let{target:t}=e;if(t.tabIndex=0,t.selected=!0,this.selectedSet.has(t.value))return;this.selectedSet.clear(),this.selectedSet.add(t.value),this.rovingTabindexController.elements.forEach(e=>{e!==t&&(e.selected=!1)})}else if(this.selects===`multiple`){let{target:t}=e;t.selected?this.selectedSet.add(t.value):this.selectedSet.delete(t.value)}this._selected=[...this.selectedSet],this.dispatchEvent(new Event(`change`,{cancelable:!0,bubbles:!0}))||(this._selected=t,e.preventDefault())}getPassthroughSwatchActions(e){let t={};e.has(`selects`)&&(this.selects||e.get(`selects`)!==void 0)&&(t.selects=this.selects),e.has(`border`)&&(this.border||e.get(`border`)!==void 0)&&(t.border=this.border),e.has(`rounding`)&&(this.rounding||e.get(`rounding`)!==void 0)&&(t.rounding=this.rounding),e.has(`size`)&&(this.size!==`m`||e.get(`size`)!==void 0)&&(t.size=this.size),e.has(`shape`)&&(this.shape||e.get(`shape`)!==void 0)&&(t.shape=this.shape);let n=[];return Object.keys(t).length>0&&n.push(e=>{`border`in t&&(e.border=t.border),`rounding`in t&&(e.rounding=t.rounding),`shape`in t&&(e.shape=t.shape),`size`in t&&(e.size=t.size)}),n}getSelectionSwatchActions(e){let t=[];if(!e.has(`selects`))return t;this.selects?this.setAttribute(`role`,this.selects===`single`?`radiogroup`:`group`):this.removeAttribute(`role`);let n=this.selects?{single:`radio`,multiple:`checkbox`}[this.selects]:`button`;return t.push(e=>{e.setAttribute(`role`,n)}),t}render(){return i.html`
|
|
45
|
+
<slot
|
|
46
|
+
@change=${this.handleChange}
|
|
47
|
+
@slotchange=${this.manageChange}
|
|
48
|
+
></slot>
|
|
49
|
+
`}willUpdate(e){let t=[...this.getPassthroughSwatchActions(e),...this.getSelectionSwatchActions(e)],n=new Set(this.selected),r=new Set;e.has(`selected`)&&t.push(e=>{r.add(e.value),e.selected=!!(n.has(e.value)||!this.hasUpdated&&e.selected)});let i=()=>{n=new Set(this.selected),this.swatches.forEach(e=>{t.forEach(t=>{t(e)})}),e.has(`selected`)&&(this._selected=[...n.values()].filter(e=>r.has(e)))};this.hasUpdated?i():this.renderRoot.addEventListener(`slotchange`,()=>{requestAnimationFrame(i)},{once:!0})}};e.t([(0,a.property)({reflect:!0})],p.prototype,`border`,void 0),e.t([(0,a.property)({reflect:!0})],p.prototype,`density`,void 0),e.t([(0,a.property)({reflect:!0})],p.prototype,`rounding`,void 0),e.t([(0,a.property)({type:Array})],p.prototype,`selected`,null),e.t([(0,a.property)()],p.prototype,`selects`,void 0),e.t([(0,a.property)({reflect:!0})],p.prototype,`shape`,void 0),e.t([(0,a.queryAssignedElements)({flatten:!0})],p.prototype,`swatches`,void 0),customElements.get(`luzmo-swatch`)||customElements.define(`luzmo-swatch`,d),customElements.get(`luzmo-swatch-group`)||customElements.define(`luzmo-swatch-group`,p),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -15,8 +15,4 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../base-CBCg3yyw.cjs"),d=require("../sized-mixin-CPxE5C96.cjs"),n=require("../focusable-EbipgXRh.cjs"),u=require("../checkbox-mixin-BDN0dBtS.cjs");class w extends u.checkboxMixin(n.Focusable){get focusElement(){return this.inputElement}}const s=':host{--switch-focus-indicator-width: var( --luzmo-focus-indicator-width, var(--luzmo-indicator-width) );min-block-size:var(--luzmo-switch-height, var(--switch-min-height));--switch-track-height: var(--switch-control-height);max-inline-size:100%;vertical-align:top;align-items:flex-start;display:inline-flex;position:relative}#input{box-sizing:border-box;inline-size:100%;block-size:100%;opacity:0;z-index:1;cursor:pointer;margin:0;padding:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host([checked]) #input+#switch:before{transform:translate(calc(var(--luzmo-switch-control-width, var(--switch-control-width)) - 100%))}:host([checked]) #input+#switch:dir(rtl):before,:host([dir=rtl][checked]) #input+#switch:before{transform:translate(calc((var(--luzmo-switch-control-width, var(--switch-control-width)) - 100%) * -1))}:host([disabled]) #input{cursor:not-allowed}#input:focus-visible+#switch:after{margin:calc(var(--luzmo-focus-indicator-gap, var(--switch-focus-indicator-gap)) * -1)}#label{color:var(--highcontrast-switch-label-color-default, var(--luzmo-switch-label-color-default, var(--switch-label-color-default)));margin-inline:var(--luzmo-switch-control-label-spacing, var(--switch-control-label-spacing));font-size:var(--luzmo-switch-font-size, var(--switch-font-size));line-height:var(--luzmo-switch-line-height, 1.3);transition:color calc(var(--luzmo-animation-duration) * 2) ease-in-out;margin-block-start:var(--luzmo-switch-spacing-top-to-label, var(--switch-spacing-top-to-label));margin-block-end:0}#switch{box-sizing:border-box;inline-size:var(--luzmo-switch-control-width, var(--switch-control-width));margin-block:calc(var(--luzmo-switch-height, var(--switch-min-height)) - var(--luzmo-switch-control-height, var(--switch-control-height)) - var(--luzmo-switch-spacing-top-to-control, var(--switch-spacing-top-to-control)));vertical-align:middle;transition:background var(--luzmo-animation-duration) ease-in-out,border var(--luzmo-animation-duration) ease-in-out;block-size:var(--luzmo-switch-track-height, var(--switch-track-height));border-radius:calc(var(--luzmo-switch-control-height, var(--switch-control-height)) / 2);flex-grow:0;flex-shrink:0;margin-inline:0;display:inline-block;position:relative;inset-inline:0}#switch:before{box-sizing:border-box;transition:background var(--luzmo-animation-duration) ease-in-out,border var(--luzmo-animation-duration) ease-in-out,transform var(--luzmo-animation-duration) ease-in-out,box-shadow var(--luzmo-animation-duration) ease-in-out;inline-size:var(--luzmo-switch-control-height, var(--switch-control-height));block-size:var(--luzmo-switch-control-height, var(--switch-control-height));box-shadow:var(--luzmo-switch-control-box-shadow, var(--switch-control-box-shadow));border-width:var(--luzmo-switch-border-width, var(--luzmo-switch-border-width, var(--luzmo-border-width)));border-radius:calc(var(--luzmo-switch-control-height, var(--switch-control-height)) / 2);border-style:solid}#switch:after,#switch:before{content:"";display:block;position:absolute;inset-block-start:0;inset-inline-start:0}#switch:after{border-radius:calc(var(--luzmo-switch-control-height, var(--switch-control-height)) / 2 + var(--luzmo-focus-indicator-gap, var(--switch-focus-indicator-gap)) * 2);transition:opacity var(--luzmo-animation-duration) ease-out,margin var(--luzmo-animation-duration) ease-out;margin:0;inset-block-end:0;inset-inline-end:0}#switch{background-color:var(--highcontrast-switch-background-color, var(--luzmo-switch-background-color, var(--switch-background-color)))}#switch:before{background-color:var(--highcontrast-switch-handle-background-color, var(--luzmo-switch-handle-background-color, var(--switch-handle-background-color)));border-color:var(--highcontrast-switch-handle-border-color-default, var(--luzmo-switch-handle-border-color-default, var(--switch-handle-border-color-default)))}:host(:active) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-down, var(--luzmo-switch-handle-border-color-down, var(--switch-handle-border-color-down)))}:host(:active) #input~#label{color:var(--highcontrast-switch-label-color-down, var(--luzmo-switch-label-color-down, var(--switch-label-color-down)))}:host(:active[checked]) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-down, var(--luzmo-switch-background-color-selected-down, var(--switch-background-color-selected-down)))}:host(:active[checked]) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-down, var(--luzmo-switch-handle-border-color-selected-down, var(--switch-handle-border-color-selected-down)))}#input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width, var(--luzmo-focus-indicator-width, var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color, var(--luzmo-switch-focus-indicator-color, var(--switch-focus-indicator-color)))}#input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus, var(--luzmo-switch-handle-border-color-focus, var(--switch-handle-border-color-focus)))}:host([checked]) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus, var(--luzmo-switch-background-color-selected-focus, var(--switch-background-color-selected-focus)))}:host([checked]) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus, var(--luzmo-switch-handle-border-color-selected-focus, var(--switch-handle-border-color-selected-focus)))}#input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus, var(--luzmo-switch-label-color-focus, var(--switch-label-color-focus)))}@media (hover: hover){:host(:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-hover, var(--luzmo-switch-handle-border-color-hover, var(--switch-handle-border-color-hover)));box-shadow:var(--luzmo-switch-control-box-shadow, var(--switch-control-box-shadow, none));background-color:var(--highcontrast-switch-background-color-hover, var(--luzmo-switch-background-color-hover, var(--switch-background-color-hover, var(--luzmo-background-color-hover))))}:host(:hover) #input~#label{color:var(--highcontrast-switch-label-color-hover, var(--luzmo-switch-label-color-hover, var(--switch-label-color-hover)))}:host([checked]:hover) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-hover, var(--luzmo-switch-background-color-selected-hover, var(--switch-background-color-selected-hover)))}:host([checked]:hover) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-hover, var(--luzmo-switch-handle-border-color-selected-hover, var(--switch-handle-border-color-selected-hover)))}:host([disabled]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled, var(--luzmo-switch-background-color-disabled, var(--switch-background-color-disabled)))}:host([disabled]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled, var(--luzmo-switch-label-color-disabled, var(--switch-label-color-disabled)))}:host([disabled][checked]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled, var(--luzmo-switch-background-color-selected-disabled, var(--switch-background-color-selected-disabled)))}:host([disabled][checked]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled][checked]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled, var(--luzmo-switch-label-color-disabled, var(--switch-label-color-disabled)))}:host(:hover) #input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width, var(--luzmo-focus-indicator-width, var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color, var(--luzmo-switch-focus-indicator-color, var(--switch-focus-indicator-color)))}:host(:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus, var(--luzmo-switch-handle-border-color-focus, var(--switch-handle-border-color-focus)))}:host([checked]:hover) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus, var(--luzmo-switch-background-color-selected-focus, var(--switch-background-color-selected-focus)))}:host([checked]:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus, var(--luzmo-switch-handle-border-color-selected-focus, var(--switch-handle-border-color-selected-focus)))}:host(:hover) #input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus, var(--luzmo-switch-label-color-focus, var(--switch-label-color-focus)))}}:host([checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-default, var(--luzmo-switch-background-color-selected-default, var(--switch-background-color-selected-default)))}:host([checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-default, var(--luzmo-switch-handle-border-color-selected-default, var(--switch-handle-border-color-selected-default)))}:host([disabled]) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled, var(--luzmo-switch-background-color-disabled, var(--switch-background-color-disabled)))}:host([disabled]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled][checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled, var(--luzmo-switch-background-color-selected-disabled, var(--switch-background-color-selected-disabled)))}:host([disabled][checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled]) #input~#label{color:var(--highcontrast-switch-label-color-disabled, var(--luzmo-switch-label-color-disabled, var(--switch-label-color-disabled)))}@media (forced-colors: active){:host{--highcontrast-switch-label-color-default: ButtonText;--highcontrast-switch-label-color-hover: ButtonText;--highcontrast-switch-label-color-down: ButtonText;--highcontrast-switch-label-color-focus: ButtonText;--highcontrast-switch-label-color-disabled: GrayText;--highcontrast-switch-handle-background-color: ButtonFace;--highcontrast-switch-handle-border-color-default: ButtonText;--highcontrast-switch-handle-border-color-hover: Highlight;--highcontrast-switch-handle-border-color-down: Highlight;--highcontrast-switch-handle-border-color-focus: Highlight;--highcontrast-switch-handle-border-color-disabled: Highlight;--highcontrast-switch-handle-border-color-selected-default: Highlight;--highcontrast-switch-handle-border-color-selected-hover: Highlight;--highcontrast-switch-handle-border-color-selected-down: Highlight;--highcontrast-switch-handle-border-color-selected-focus: Highlight;--highcontrast-switch-background-color: ButtonFace;--highcontrast-switch-background-color-selected-default: Highlight;--highcontrast-switch-background-color-selected-hover: Highlight;--highcontrast-switch-background-color-selected-down: Highlight;--highcontrast-switch-background-color-selected-focus: Highlight;--highcontrast-switch-background-color-selected-disabled: Highlight;--highcontrast-switch-focus-indicator-color: ButtonText;forced-color-adjust:none}#input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px ButtonText}}@media (forced-colors: active) and (hover: hover){:host(:hover) #input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px Highlight}:host([disabled][checked]:hover) #input+#switch{background-color:GrayText;box-shadow:inset 0 0 0 1px GrayText}:host([disabled][checked]:hover) #input+#switch:before{background-color:ButtonFace;border-color:GrayText}}@media (forced-colors: active){:host([disabled]) #input:not(:checked)+#switch{background-color:ButtonFace;box-shadow:inset 0 0 0 1px GrayText}:host([disabled]) #input:not(:checked)+#switch:before{background-color:ButtonFace;border-color:GrayText}:host([disabled][checked]) #input+#switch{background-color:GrayText;box-shadow:inset 0 0 0 1px GrayText}:host([disabled][checked]) #input+#switch:before{background-color:ButtonFace;border-color:GrayText}:host([disabled]) #input~#label{color:GrayText}}:host{--switch-handle-border-color-default: var(--luzmo-selected-color);--switch-handle-border-color-hover: var(--luzmo-selected-color-hover);--switch-handle-border-color-down: var(--luzmo-selected-color-down);--switch-handle-border-color-focus: var(--luzmo-selected-color-focus);--switch-handle-border-color-selected-default: var( --luzmo-selected-color-hover );--switch-handle-border-color-selected-hover: var(--luzmo-selected-color-down);--switch-handle-border-color-selected-down: var( --luzmo-selected-color-hard-down );--switch-handle-border-color-selected-focus: var(--luzmo-selected-color-down);--switch-focus-indicator-gap: var(--luzmo-indicator-gap);--switch-label-color-default: var(--luzmo-selected-color-hard);--switch-label-color-hover: var(--luzmo-selected-color-hard-hover);--switch-label-color-down: var(--luzmo-selected-color-hard-down);--switch-label-color-focus: var(--luzmo-selected-color-hard-focus);--switch-label-color-disabled: var(--luzmo-disabled-color);--switch-background-color: var(--luzmo-border-color);--switch-background-color-disabled: var(--luzmo-background-color-disabled);--switch-background-color-selected-disabled: var(--luzmo-disabled-color);--switch-background-color-selected-default: var(--luzmo-selected-color-hover);--switch-background-color-selected-hover: var(--luzmo-selected-color-down);--switch-background-color-selected-down: var( --luzmo-selected-color-hard-down );--switch-background-color-selected-focus: var(--luzmo-selected-color-down);--switch-focus-indicator-width: var(luzmo-indicator-width);--switch-focus-indicator-color: var(--luzmo-primary);--switch-handle-background-color: var(--luzmo-background-color);--switch-handle-border-color-disabled: var(--luzmo-disabled-color);--switch-spacing-top-to-control: calc( (var(--switch-min-height) - var(--switch-control-height)) / 2 )}:host([disabled]){--switch-label-color-default: var(--luzmo-disabled-color)}:host([emphasized]){--switch-background-color-selected-default: var(--luzmo-primary);--switch-background-color-selected-hover: var(--luzmo-primary-hover);--switch-background-color-selected-down: var(--luzmo-primary-down);--switch-background-color-selected-focus: var(--luzmo-primary-focus);--switch-handle-border-color-selected-default: var(--luzmo-primary);--switch-handle-border-color-selected-hover: var(--luzmo-primary-hover);--switch-handle-border-color-selected-down: var(--luzmo-primary-down);--switch-handle-border-color-selected-focus: var(--luzmo-primary-focus)}:host([size=s]){--switch-min-height: 24px;--switch-control-width: 23px;--switch-control-height: var(--luzmo-font-size-s);--switch-control-label-spacing: var(--luzmo-spacing-3);--switch-spacing-top-to-label: 4px;--switch-font-size: var(--luzmo-font-size-s)}:host{--switch-min-height: 32px;--switch-control-width: 26px;--switch-control-height: var(--luzmo-font-size);--switch-control-label-spacing: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--switch-spacing-top-to-label: 6px;--switch-font-size: var(--luzmo-font-size)}:host([size=l]){--switch-min-height: 40px;--switch-control-width: 28px;--switch-control-height: var(--luzmo-font-size-l);--switch-control-label-spacing: var(--luzmo-spacing-4);--switch-spacing-top-to-label: 9px;--switch-font-size: var(--luzmo-font-size-l)}:host([size=xl]){--switch-min-height: 48px;--switch-control-width: 32px;--switch-control-height: var(--luzmo-font-size-xl);--switch-control-label-spacing: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--switch-spacing-top-to-label: 12px;--switch-font-size: var(--luzmo-font-size-xl)}:host([disabled]){pointer-events:none}:host([thumb=overflow]){--luzmo-switch-border-width: 0px;--switch-control-width: calc(var(--switch-control-height) * 2);--switch-control-box-shadow: 0 .125rem .25rem rgba(var(--luzmo-border-color-rgb), .2), inset 0 0 0 .0625rem rgba(var(--luzmo-border-color-rgb), .2)}:host([thumb=overflow]) #switch{margin-top:calc((var(--luzmo-switch-min-height, var(--switch-min-height)) - var(--luzmo-switch-track-height, var(--switch-track-height))) / 2)}:host([thumb=overflow]) #switch:before{inset-block-start:calc(-1 * (var(--luzmo-switch-control-height, var(--switch-control-height)) - var(--luzmo-switch-track-height, var(--switch-track-height))) / 2)}:host([thumb=overflow][size=s]){--switch-track-height: 10px;--switch-control-height: 16px;--switch-focus-indicator-gap: 5px}:host([thumb=overflow]){--switch-track-height: 10px;--switch-control-height: 18px;--switch-focus-indicator-gap: 6px}:host([thumb=overflow][size=l]){--switch-track-height: 12px;--switch-control-height: 20px;--switch-focus-indicator-gap: 7px}:host([thumb=overflow][size=xl]){--switch-track-height: 12px;--switch-control-height: 22px;--switch-focus-indicator-gap: 8px}';var b=Object.defineProperty,h=(t,o,l,v)=>{for(var r=void 0,i=t.length-1,a;i>=0;i--)(a=t[i])&&(r=a(o,l,r)||r);return r&&b(o,l,r),r};class e extends d.SizedMixin(w){constructor(){super(...arguments),this.emphasized=!1,this.thumb="overflow"}static get styles(){return window.hasOwnProperty("ShadyDOM")?[c.r(s)]:[c.r(s)]}render(){return c.x`
|
|
19
|
-
${super.render()}
|
|
20
|
-
<span id="switch"></span>
|
|
21
|
-
<label id="label" for="input"><slot></slot></label>
|
|
22
|
-
`}firstUpdated(o){super.firstUpdated(o),this.inputElement.setAttribute("role","switch")}updated(o){o.has("checked")&&this.inputElement.setAttribute("aria-checked",this.checked?"true":"false")}}h([c.n({type:Boolean,reflect:!0})],e.prototype,"emphasized");h([c.n({type:String,reflect:!0})],e.prototype,"thumb");customElements.get("luzmo-switch")||customElements.define("luzmo-switch",e);exports.LuzmoSwitch=e;
|
|
18
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../switch-KzkrF-ob.cjs`);exports.LuzmoSwitch=e.t;
|
|
@@ -15,59 +15,11 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
n();
|
|
29
|
-
class v extends m(w) {
|
|
30
|
-
get focusElement() {
|
|
31
|
-
return this.inputElement;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const s = ':host{--switch-focus-indicator-width: var( --luzmo-focus-indicator-width, var(--luzmo-indicator-width) );min-block-size:var(--luzmo-switch-height, var(--switch-min-height));--switch-track-height: var(--switch-control-height);max-inline-size:100%;vertical-align:top;align-items:flex-start;display:inline-flex;position:relative}#input{box-sizing:border-box;inline-size:100%;block-size:100%;opacity:0;z-index:1;cursor:pointer;margin:0;padding:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host([checked]) #input+#switch:before{transform:translate(calc(var(--luzmo-switch-control-width, var(--switch-control-width)) - 100%))}:host([checked]) #input+#switch:dir(rtl):before,:host([dir=rtl][checked]) #input+#switch:before{transform:translate(calc((var(--luzmo-switch-control-width, var(--switch-control-width)) - 100%) * -1))}:host([disabled]) #input{cursor:not-allowed}#input:focus-visible+#switch:after{margin:calc(var(--luzmo-focus-indicator-gap, var(--switch-focus-indicator-gap)) * -1)}#label{color:var(--highcontrast-switch-label-color-default, var(--luzmo-switch-label-color-default, var(--switch-label-color-default)));margin-inline:var(--luzmo-switch-control-label-spacing, var(--switch-control-label-spacing));font-size:var(--luzmo-switch-font-size, var(--switch-font-size));line-height:var(--luzmo-switch-line-height, 1.3);transition:color calc(var(--luzmo-animation-duration) * 2) ease-in-out;margin-block-start:var(--luzmo-switch-spacing-top-to-label, var(--switch-spacing-top-to-label));margin-block-end:0}#switch{box-sizing:border-box;inline-size:var(--luzmo-switch-control-width, var(--switch-control-width));margin-block:calc(var(--luzmo-switch-height, var(--switch-min-height)) - var(--luzmo-switch-control-height, var(--switch-control-height)) - var(--luzmo-switch-spacing-top-to-control, var(--switch-spacing-top-to-control)));vertical-align:middle;transition:background var(--luzmo-animation-duration) ease-in-out,border var(--luzmo-animation-duration) ease-in-out;block-size:var(--luzmo-switch-track-height, var(--switch-track-height));border-radius:calc(var(--luzmo-switch-control-height, var(--switch-control-height)) / 2);flex-grow:0;flex-shrink:0;margin-inline:0;display:inline-block;position:relative;inset-inline:0}#switch:before{box-sizing:border-box;transition:background var(--luzmo-animation-duration) ease-in-out,border var(--luzmo-animation-duration) ease-in-out,transform var(--luzmo-animation-duration) ease-in-out,box-shadow var(--luzmo-animation-duration) ease-in-out;inline-size:var(--luzmo-switch-control-height, var(--switch-control-height));block-size:var(--luzmo-switch-control-height, var(--switch-control-height));box-shadow:var(--luzmo-switch-control-box-shadow, var(--switch-control-box-shadow));border-width:var(--luzmo-switch-border-width, var(--luzmo-switch-border-width, var(--luzmo-border-width)));border-radius:calc(var(--luzmo-switch-control-height, var(--switch-control-height)) / 2);border-style:solid}#switch:after,#switch:before{content:"";display:block;position:absolute;inset-block-start:0;inset-inline-start:0}#switch:after{border-radius:calc(var(--luzmo-switch-control-height, var(--switch-control-height)) / 2 + var(--luzmo-focus-indicator-gap, var(--switch-focus-indicator-gap)) * 2);transition:opacity var(--luzmo-animation-duration) ease-out,margin var(--luzmo-animation-duration) ease-out;margin:0;inset-block-end:0;inset-inline-end:0}#switch{background-color:var(--highcontrast-switch-background-color, var(--luzmo-switch-background-color, var(--switch-background-color)))}#switch:before{background-color:var(--highcontrast-switch-handle-background-color, var(--luzmo-switch-handle-background-color, var(--switch-handle-background-color)));border-color:var(--highcontrast-switch-handle-border-color-default, var(--luzmo-switch-handle-border-color-default, var(--switch-handle-border-color-default)))}:host(:active) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-down, var(--luzmo-switch-handle-border-color-down, var(--switch-handle-border-color-down)))}:host(:active) #input~#label{color:var(--highcontrast-switch-label-color-down, var(--luzmo-switch-label-color-down, var(--switch-label-color-down)))}:host(:active[checked]) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-down, var(--luzmo-switch-background-color-selected-down, var(--switch-background-color-selected-down)))}:host(:active[checked]) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-down, var(--luzmo-switch-handle-border-color-selected-down, var(--switch-handle-border-color-selected-down)))}#input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width, var(--luzmo-focus-indicator-width, var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color, var(--luzmo-switch-focus-indicator-color, var(--switch-focus-indicator-color)))}#input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus, var(--luzmo-switch-handle-border-color-focus, var(--switch-handle-border-color-focus)))}:host([checked]) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus, var(--luzmo-switch-background-color-selected-focus, var(--switch-background-color-selected-focus)))}:host([checked]) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus, var(--luzmo-switch-handle-border-color-selected-focus, var(--switch-handle-border-color-selected-focus)))}#input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus, var(--luzmo-switch-label-color-focus, var(--switch-label-color-focus)))}@media (hover: hover){:host(:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-hover, var(--luzmo-switch-handle-border-color-hover, var(--switch-handle-border-color-hover)));box-shadow:var(--luzmo-switch-control-box-shadow, var(--switch-control-box-shadow, none));background-color:var(--highcontrast-switch-background-color-hover, var(--luzmo-switch-background-color-hover, var(--switch-background-color-hover, var(--luzmo-background-color-hover))))}:host(:hover) #input~#label{color:var(--highcontrast-switch-label-color-hover, var(--luzmo-switch-label-color-hover, var(--switch-label-color-hover)))}:host([checked]:hover) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-hover, var(--luzmo-switch-background-color-selected-hover, var(--switch-background-color-selected-hover)))}:host([checked]:hover) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-hover, var(--luzmo-switch-handle-border-color-selected-hover, var(--switch-handle-border-color-selected-hover)))}:host([disabled]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled, var(--luzmo-switch-background-color-disabled, var(--switch-background-color-disabled)))}:host([disabled]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled, var(--luzmo-switch-label-color-disabled, var(--switch-label-color-disabled)))}:host([disabled][checked]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled, var(--luzmo-switch-background-color-selected-disabled, var(--switch-background-color-selected-disabled)))}:host([disabled][checked]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled][checked]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled, var(--luzmo-switch-label-color-disabled, var(--switch-label-color-disabled)))}:host(:hover) #input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width, var(--luzmo-focus-indicator-width, var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color, var(--luzmo-switch-focus-indicator-color, var(--switch-focus-indicator-color)))}:host(:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus, var(--luzmo-switch-handle-border-color-focus, var(--switch-handle-border-color-focus)))}:host([checked]:hover) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus, var(--luzmo-switch-background-color-selected-focus, var(--switch-background-color-selected-focus)))}:host([checked]:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus, var(--luzmo-switch-handle-border-color-selected-focus, var(--switch-handle-border-color-selected-focus)))}:host(:hover) #input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus, var(--luzmo-switch-label-color-focus, var(--switch-label-color-focus)))}}:host([checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-default, var(--luzmo-switch-background-color-selected-default, var(--switch-background-color-selected-default)))}:host([checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-default, var(--luzmo-switch-handle-border-color-selected-default, var(--switch-handle-border-color-selected-default)))}:host([disabled]) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled, var(--luzmo-switch-background-color-disabled, var(--switch-background-color-disabled)))}:host([disabled]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled][checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled, var(--luzmo-switch-background-color-selected-disabled, var(--switch-background-color-selected-disabled)))}:host([disabled][checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled, var(--luzmo-switch-handle-border-color-disabled, var(--switch-handle-border-color-disabled)))}:host([disabled]) #input~#label{color:var(--highcontrast-switch-label-color-disabled, var(--luzmo-switch-label-color-disabled, var(--switch-label-color-disabled)))}@media (forced-colors: active){:host{--highcontrast-switch-label-color-default: ButtonText;--highcontrast-switch-label-color-hover: ButtonText;--highcontrast-switch-label-color-down: ButtonText;--highcontrast-switch-label-color-focus: ButtonText;--highcontrast-switch-label-color-disabled: GrayText;--highcontrast-switch-handle-background-color: ButtonFace;--highcontrast-switch-handle-border-color-default: ButtonText;--highcontrast-switch-handle-border-color-hover: Highlight;--highcontrast-switch-handle-border-color-down: Highlight;--highcontrast-switch-handle-border-color-focus: Highlight;--highcontrast-switch-handle-border-color-disabled: Highlight;--highcontrast-switch-handle-border-color-selected-default: Highlight;--highcontrast-switch-handle-border-color-selected-hover: Highlight;--highcontrast-switch-handle-border-color-selected-down: Highlight;--highcontrast-switch-handle-border-color-selected-focus: Highlight;--highcontrast-switch-background-color: ButtonFace;--highcontrast-switch-background-color-selected-default: Highlight;--highcontrast-switch-background-color-selected-hover: Highlight;--highcontrast-switch-background-color-selected-down: Highlight;--highcontrast-switch-background-color-selected-focus: Highlight;--highcontrast-switch-background-color-selected-disabled: Highlight;--highcontrast-switch-focus-indicator-color: ButtonText;forced-color-adjust:none}#input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px ButtonText}}@media (forced-colors: active) and (hover: hover){:host(:hover) #input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px Highlight}:host([disabled][checked]:hover) #input+#switch{background-color:GrayText;box-shadow:inset 0 0 0 1px GrayText}:host([disabled][checked]:hover) #input+#switch:before{background-color:ButtonFace;border-color:GrayText}}@media (forced-colors: active){:host([disabled]) #input:not(:checked)+#switch{background-color:ButtonFace;box-shadow:inset 0 0 0 1px GrayText}:host([disabled]) #input:not(:checked)+#switch:before{background-color:ButtonFace;border-color:GrayText}:host([disabled][checked]) #input+#switch{background-color:GrayText;box-shadow:inset 0 0 0 1px GrayText}:host([disabled][checked]) #input+#switch:before{background-color:ButtonFace;border-color:GrayText}:host([disabled]) #input~#label{color:GrayText}}:host{--switch-handle-border-color-default: var(--luzmo-selected-color);--switch-handle-border-color-hover: var(--luzmo-selected-color-hover);--switch-handle-border-color-down: var(--luzmo-selected-color-down);--switch-handle-border-color-focus: var(--luzmo-selected-color-focus);--switch-handle-border-color-selected-default: var( --luzmo-selected-color-hover );--switch-handle-border-color-selected-hover: var(--luzmo-selected-color-down);--switch-handle-border-color-selected-down: var( --luzmo-selected-color-hard-down );--switch-handle-border-color-selected-focus: var(--luzmo-selected-color-down);--switch-focus-indicator-gap: var(--luzmo-indicator-gap);--switch-label-color-default: var(--luzmo-selected-color-hard);--switch-label-color-hover: var(--luzmo-selected-color-hard-hover);--switch-label-color-down: var(--luzmo-selected-color-hard-down);--switch-label-color-focus: var(--luzmo-selected-color-hard-focus);--switch-label-color-disabled: var(--luzmo-disabled-color);--switch-background-color: var(--luzmo-border-color);--switch-background-color-disabled: var(--luzmo-background-color-disabled);--switch-background-color-selected-disabled: var(--luzmo-disabled-color);--switch-background-color-selected-default: var(--luzmo-selected-color-hover);--switch-background-color-selected-hover: var(--luzmo-selected-color-down);--switch-background-color-selected-down: var( --luzmo-selected-color-hard-down );--switch-background-color-selected-focus: var(--luzmo-selected-color-down);--switch-focus-indicator-width: var(luzmo-indicator-width);--switch-focus-indicator-color: var(--luzmo-primary);--switch-handle-background-color: var(--luzmo-background-color);--switch-handle-border-color-disabled: var(--luzmo-disabled-color);--switch-spacing-top-to-control: calc( (var(--switch-min-height) - var(--switch-control-height)) / 2 )}:host([disabled]){--switch-label-color-default: var(--luzmo-disabled-color)}:host([emphasized]){--switch-background-color-selected-default: var(--luzmo-primary);--switch-background-color-selected-hover: var(--luzmo-primary-hover);--switch-background-color-selected-down: var(--luzmo-primary-down);--switch-background-color-selected-focus: var(--luzmo-primary-focus);--switch-handle-border-color-selected-default: var(--luzmo-primary);--switch-handle-border-color-selected-hover: var(--luzmo-primary-hover);--switch-handle-border-color-selected-down: var(--luzmo-primary-down);--switch-handle-border-color-selected-focus: var(--luzmo-primary-focus)}:host([size=s]){--switch-min-height: 24px;--switch-control-width: 23px;--switch-control-height: var(--luzmo-font-size-s);--switch-control-label-spacing: var(--luzmo-spacing-3);--switch-spacing-top-to-label: 4px;--switch-font-size: var(--luzmo-font-size-s)}:host{--switch-min-height: 32px;--switch-control-width: 26px;--switch-control-height: var(--luzmo-font-size);--switch-control-label-spacing: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--switch-spacing-top-to-label: 6px;--switch-font-size: var(--luzmo-font-size)}:host([size=l]){--switch-min-height: 40px;--switch-control-width: 28px;--switch-control-height: var(--luzmo-font-size-l);--switch-control-label-spacing: var(--luzmo-spacing-4);--switch-spacing-top-to-label: 9px;--switch-font-size: var(--luzmo-font-size-l)}:host([size=xl]){--switch-min-height: 48px;--switch-control-width: 32px;--switch-control-height: var(--luzmo-font-size-xl);--switch-control-label-spacing: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--switch-spacing-top-to-label: 12px;--switch-font-size: var(--luzmo-font-size-xl)}:host([disabled]){pointer-events:none}:host([thumb=overflow]){--luzmo-switch-border-width: 0px;--switch-control-width: calc(var(--switch-control-height) * 2);--switch-control-box-shadow: 0 .125rem .25rem rgba(var(--luzmo-border-color-rgb), .2), inset 0 0 0 .0625rem rgba(var(--luzmo-border-color-rgb), .2)}:host([thumb=overflow]) #switch{margin-top:calc((var(--luzmo-switch-min-height, var(--switch-min-height)) - var(--luzmo-switch-track-height, var(--switch-track-height))) / 2)}:host([thumb=overflow]) #switch:before{inset-block-start:calc(-1 * (var(--luzmo-switch-control-height, var(--switch-control-height)) - var(--luzmo-switch-track-height, var(--switch-track-height))) / 2)}:host([thumb=overflow][size=s]){--switch-track-height: 10px;--switch-control-height: 16px;--switch-focus-indicator-gap: 5px}:host([thumb=overflow]){--switch-track-height: 10px;--switch-control-height: 18px;--switch-focus-indicator-gap: 6px}:host([thumb=overflow][size=l]){--switch-track-height: 12px;--switch-control-height: 20px;--switch-focus-indicator-gap: 7px}:host([thumb=overflow][size=xl]){--switch-track-height: 12px;--switch-control-height: 22px;--switch-focus-indicator-gap: 8px}';
|
|
35
|
-
var g = Object.defineProperty, d = (o, r, l, z) => {
|
|
36
|
-
for (var c = void 0, e = o.length - 1, i; e >= 0; e--)
|
|
37
|
-
(i = o[e]) && (c = i(r, l, c) || c);
|
|
38
|
-
return c && g(r, l, c), c;
|
|
39
|
-
};
|
|
40
|
-
class t extends b(v) {
|
|
41
|
-
constructor() {
|
|
42
|
-
super(...arguments), this.emphasized = !1, this.thumb = "overflow";
|
|
43
|
-
}
|
|
44
|
-
static get styles() {
|
|
45
|
-
return window.hasOwnProperty("ShadyDOM") ? [a(s)] : [a(s)];
|
|
46
|
-
}
|
|
47
|
-
render() {
|
|
48
|
-
return u`
|
|
49
|
-
${super.render()}
|
|
50
|
-
<span id="switch"></span>
|
|
51
|
-
<label id="label" for="input"><slot></slot></label>
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
firstUpdated(r) {
|
|
55
|
-
super.firstUpdated(r), this.inputElement.setAttribute("role", "switch");
|
|
56
|
-
}
|
|
57
|
-
updated(r) {
|
|
58
|
-
r.has("checked") && this.inputElement.setAttribute(
|
|
59
|
-
"aria-checked",
|
|
60
|
-
this.checked ? "true" : "false"
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
d([
|
|
65
|
-
h({ type: Boolean, reflect: !0 })
|
|
66
|
-
], t.prototype, "emphasized");
|
|
67
|
-
d([
|
|
68
|
-
h({ type: String, reflect: !0 })
|
|
69
|
-
], t.prototype, "thumb");
|
|
70
|
-
customElements.get("luzmo-switch") || customElements.define("luzmo-switch", t);
|
|
71
|
-
export {
|
|
72
|
-
t as LuzmoSwitch
|
|
73
|
-
};
|
|
18
|
+
(() => {
|
|
19
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
20
|
+
let e = document.createElement("style");
|
|
21
|
+
e.setAttribute("data-luzmo-vars", ""), e.textContent = "html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-full-down: color-mix(in oklch, var(--luzmo-border-color-full), black 45%);--luzmo-border-color-full-focus: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-font-color-down: color-mix(in oklch, var(--luzmo-font-color), black 20%);--luzmo-font-color-focus: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-primary: #4434ff;--luzmo-primary-hover: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-down: color-mix(in oklch, var(--luzmo-primary), black 20%);--luzmo-primary-focus: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5%);--luzmo-background-color-down: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 7%), black 1%);--luzmo-background-color-focus: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5%);--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: color-mix(in oklch, var(--luzmo-background-color-highlight), black 25%);--luzmo-background-color-highlight-down: color-mix(in oklch, var(--luzmo-background-color-highlight), black 45%);--luzmo-background-color-highlight-focus: color-mix(in oklch, var(--luzmo-background-color-highlight), black 25%);--luzmo-secondary: #d000d0;--luzmo-secondary-hover: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-down: color-mix(in oklch, var(--luzmo-secondary), black 20%);--luzmo-secondary-focus: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 208, 0, 208;--luzmo-scrollbar-size: 6px;--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba( var(--luzmo-border-color-rgb), 0.4 );--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-width: thin;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-down: color-mix(in oklch, var(--luzmo-negative-color), black 20%);--luzmo-negative-color-focus: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-negative-inverse-color: #ffffff;--luzmo-positive-color: rgb(18, 133, 90);--luzmo-positive-color-hover: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-down: color-mix(in oklch, var(--luzmo-positive-color), black 20%);--luzmo-positive-color-focus: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-rgb: 18, 133, 90;--luzmo-positive-inverse-color: #ffffff;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-down: color-mix(in oklch, var(--luzmo-selected-color), black 45%);--luzmo-selected-color-focus: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-selected-color-hard-down: color-mix(in oklch, var(--luzmo-selected-color-hard), black 45%);--luzmo-selected-color-hard-focus: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-informative-color: #1670dd;--luzmo-informative-color-rgb: 22, 112, 221;--luzmo-notice-color: rgb(229, 127, 0);--luzmo-seafoam-color: rgb(0, 140, 140);--luzmo-indigo-color: rgb(68, 52, 255);--luzmo-purple-color: rgb(112, 48, 210);--luzmo-fuchsia-color: rgb(205, 30, 170);--luzmo-magenta-color: rgb(203, 36, 98);--luzmo-yellow-color: rgb(228, 208, 0);--luzmo-gray-color: rgb(110, 110, 110);--luzmo-red-color: rgb(202, 34, 28);--luzmo-orange-color: rgb(218, 123, 17);--luzmo-chartreuse-color: rgb(85, 135, 0);--luzmo-celery-color: rgb(48, 134, 22);--luzmo-green-color: rgb(18, 133, 90);--luzmo-cyan-color: rgb(0, 134, 180);--luzmo-blue-color: rgb(22, 112, 221);--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 10px;--luzmo-icon-size-xs: 12px;--luzmo-icon-size-s: 14px;--luzmo-icon-size-m: 16px;--luzmo-icon-size-l: 18px;--luzmo-icon-size-xl: 20px;--luzmo-icon-size-xxl: 32px}", document.head.appendChild(e);
|
|
22
|
+
}
|
|
23
|
+
})();
|
|
24
|
+
import { t as e } from "../switch-BdE-hI69.js";
|
|
25
|
+
export { e as LuzmoSwitch };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { t as e } from "./decorate-aGxJUVxg.js";
|
|
19
|
+
import { n as t } from "./sized-mixin-DaBoZkVS.js";
|
|
20
|
+
import { t as n } from "./focusable-BmS8IzhH.js";
|
|
21
|
+
import { t as r } from "./checkbox-mixin-C5sLMo5L.js";
|
|
22
|
+
import { html as i, unsafeCSS as a } from "lit";
|
|
23
|
+
import { property as o } from "lit/decorators.js";
|
|
24
|
+
//#region src/components/checkbox/checkbox-base.ts
|
|
25
|
+
var s = class extends r(n) {
|
|
26
|
+
get focusElement() {
|
|
27
|
+
return this.inputElement;
|
|
28
|
+
}
|
|
29
|
+
}, c = ":host{--switch-focus-indicator-width:var(--luzmo-focus-indicator-width,var(--luzmo-indicator-width));min-block-size:var(--luzmo-switch-height,var(--switch-min-height));--switch-track-height:var(--switch-control-height);vertical-align:top;max-inline-size:100%;font-family:var(--luzmo-switch-font-family,var(--luzmo-font-family));align-items:flex-start;display:inline-flex;position:relative}#input{box-sizing:border-box;opacity:0;z-index:1;cursor:pointer;block-size:100%;inline-size:100%;margin:0;padding:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host([checked]) #input+#switch:before{transform:translateX(calc(var(--luzmo-switch-control-width,var(--switch-control-width)) - 100%))}:host([dir=rtl][checked]) #input+#switch:before{transform:translateX(calc((var(--luzmo-switch-control-width,var(--switch-control-width)) - 100%) * -1))}:host([checked]) #input+#switch:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):before{transform:translateX(calc((var(--luzmo-switch-control-width,var(--switch-control-width)) - 100%) * -1))}:host([disabled]) #input,:host([disabled]) #input{cursor:not-allowed}#input:focus-visible+#switch:after{margin:calc(var(--luzmo-focus-indicator-gap,var(--switch-focus-indicator-gap)) * -1)}#label{color:var(--highcontrast-switch-label-color-default,var(--luzmo-switch-label-color-default,var(--switch-label-color-default)));margin-inline:var(--luzmo-switch-control-label-spacing,var(--switch-control-label-spacing));font-size:var(--luzmo-switch-font-size,var(--switch-font-size));line-height:var(--luzmo-switch-line-height,1.3);transition:color calc(var(--luzmo-animation-duration) * 2) ease-in-out;margin-block-start:var(--luzmo-switch-spacing-top-to-label,var(--switch-spacing-top-to-label));margin-block-end:0}#switch{box-sizing:border-box;inline-size:var(--luzmo-switch-control-width,var(--switch-control-width));margin-block:calc(var(--luzmo-switch-height,var(--switch-min-height)) - var(--luzmo-switch-control-height,var(--switch-control-height)) - var(--luzmo-switch-spacing-top-to-control,var(--switch-spacing-top-to-control)));vertical-align:middle;transition:background var(--luzmo-animation-duration) ease-in-out, border var(--luzmo-animation-duration) ease-in-out;block-size:var(--luzmo-switch-track-height,var(--switch-track-height));border-radius:calc(var(--luzmo-switch-control-height,var(--switch-control-height)) / 2);flex-grow:0;flex-shrink:0;margin-inline:0;display:inline-block;position:relative;inset-inline:0}#switch:before{box-sizing:border-box;transition:background var(--luzmo-animation-duration) ease-in-out, border var(--luzmo-animation-duration) ease-in-out, transform var(--luzmo-animation-duration) ease-in-out, box-shadow var(--luzmo-animation-duration) ease-in-out;inline-size:var(--luzmo-switch-control-height,var(--switch-control-height));block-size:var(--luzmo-switch-control-height,var(--switch-control-height));box-shadow:var(--luzmo-switch-control-box-shadow,var(--switch-control-box-shadow));border-width:var(--luzmo-switch-border-width,var(--luzmo-switch-border-width,var(--luzmo-border-width)));border-radius:calc(var(--luzmo-switch-control-height,var(--switch-control-height)) / 2);border-style:solid}#switch:after,#switch:before{content:\"\";display:block;position:absolute;inset-block-start:0;inset-inline-start:0}#switch:after{border-radius:calc(var(--luzmo-switch-control-height,var(--switch-control-height)) / 2 + var(--luzmo-focus-indicator-gap,var(--switch-focus-indicator-gap)) * 2);transition:opacity var(--luzmo-animation-duration) ease-out, margin var(--luzmo-animation-duration) ease-out;margin:0;inset-block-end:0;inset-inline-end:0}#switch{background-color:var(--highcontrast-switch-background-color,var(--luzmo-switch-background-color,var(--switch-background-color)))}#switch:before{background-color:var(--highcontrast-switch-handle-background-color,var(--luzmo-switch-handle-background-color,var(--switch-handle-background-color)));border-color:var(--highcontrast-switch-handle-border-color-default,var(--luzmo-switch-handle-border-color-default,var(--switch-handle-border-color-default)))}:host(:active) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-down,var(--luzmo-switch-handle-border-color-down,var(--switch-handle-border-color-down)))}:host(:active) #input~#label{color:var(--highcontrast-switch-label-color-down,var(--luzmo-switch-label-color-down,var(--switch-label-color-down)))}:host(:active[checked]) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-down,var(--luzmo-switch-background-color-selected-down,var(--switch-background-color-selected-down)))}:host(:active[checked]) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-down,var(--luzmo-switch-handle-border-color-selected-down,var(--switch-handle-border-color-selected-down)))}#input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width,var(--luzmo-focus-indicator-width,var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color,var(--luzmo-switch-focus-indicator-color,var(--switch-focus-indicator-color)))}#input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus,var(--luzmo-switch-handle-border-color-focus,var(--switch-handle-border-color-focus)))}:host([checked]) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus,var(--luzmo-switch-background-color-selected-focus,var(--switch-background-color-selected-focus)))}:host([checked]) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus,var(--luzmo-switch-handle-border-color-selected-focus,var(--switch-handle-border-color-selected-focus)))}#input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus,var(--luzmo-switch-label-color-focus,var(--switch-label-color-focus)))}@media (hover:hover){:host(:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-hover,var(--luzmo-switch-handle-border-color-hover,var(--switch-handle-border-color-hover)));box-shadow:var(--luzmo-switch-control-box-shadow,var(--switch-control-box-shadow,none));background-color:var(--highcontrast-switch-background-color-hover,var(--luzmo-switch-background-color-hover,var(--switch-background-color-hover,var(--luzmo-background-color-hover))))}:host(:hover) #input~#label{color:var(--highcontrast-switch-label-color-hover,var(--luzmo-switch-label-color-hover,var(--switch-label-color-hover)))}:host([checked]:hover) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-hover,var(--luzmo-switch-background-color-selected-hover,var(--switch-background-color-selected-hover)))}:host([checked]:hover) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-hover,var(--luzmo-switch-handle-border-color-selected-hover,var(--switch-handle-border-color-selected-hover)))}:host([disabled]:hover) #input+#switch,:host([disabled]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled,var(--luzmo-switch-background-color-disabled,var(--switch-background-color-disabled)))}:host([disabled]:hover) #input+#switch:before,:host([disabled]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled]:hover) #input~#label,:host([disabled]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled,var(--luzmo-switch-label-color-disabled,var(--switch-label-color-disabled)))}:host([disabled][checked]:hover) #input+#switch,:host([disabled][checked]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled,var(--luzmo-switch-background-color-selected-disabled,var(--switch-background-color-selected-disabled)))}:host([disabled][checked]:hover) #input+#switch:before,:host([disabled][checked]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled][checked]:hover) #input~#label,:host([disabled][checked]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled,var(--luzmo-switch-label-color-disabled,var(--switch-label-color-disabled)))}:host(:hover) #input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width,var(--luzmo-focus-indicator-width,var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color,var(--luzmo-switch-focus-indicator-color,var(--switch-focus-indicator-color)))}:host(:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus,var(--luzmo-switch-handle-border-color-focus,var(--switch-handle-border-color-focus)))}:host([checked]:hover) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus,var(--luzmo-switch-background-color-selected-focus,var(--switch-background-color-selected-focus)))}:host([checked]:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus,var(--luzmo-switch-handle-border-color-selected-focus,var(--switch-handle-border-color-selected-focus)))}:host(:hover) #input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus,var(--luzmo-switch-label-color-focus,var(--switch-label-color-focus)))}}:host([checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-default,var(--luzmo-switch-background-color-selected-default,var(--switch-background-color-selected-default)))}:host([checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-default,var(--luzmo-switch-handle-border-color-selected-default,var(--switch-handle-border-color-selected-default)))}:host([disabled]) #input+#switch,:host([disabled]) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled,var(--luzmo-switch-background-color-disabled,var(--switch-background-color-disabled)))}:host([disabled]) #input+#switch:before,:host([disabled]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled][checked]) #input+#switch,:host([disabled][checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled,var(--luzmo-switch-background-color-selected-disabled,var(--switch-background-color-selected-disabled)))}:host([disabled][checked]) #input+#switch:before,:host([disabled][checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled]) #input~#label,:host([disabled]) #input~#label{color:var(--highcontrast-switch-label-color-disabled,var(--luzmo-switch-label-color-disabled,var(--switch-label-color-disabled)))}@media (forced-colors:active){:host{--highcontrast-switch-label-color-default:ButtonText;--highcontrast-switch-label-color-hover:ButtonText;--highcontrast-switch-label-color-down:ButtonText;--highcontrast-switch-label-color-focus:ButtonText;--highcontrast-switch-label-color-disabled:GrayText;--highcontrast-switch-handle-background-color:ButtonFace;--highcontrast-switch-handle-border-color-default:ButtonText;--highcontrast-switch-handle-border-color-hover:Highlight;--highcontrast-switch-handle-border-color-down:Highlight;--highcontrast-switch-handle-border-color-focus:Highlight;--highcontrast-switch-handle-border-color-disabled:Highlight;--highcontrast-switch-handle-border-color-selected-default:Highlight;--highcontrast-switch-handle-border-color-selected-hover:Highlight;--highcontrast-switch-handle-border-color-selected-down:Highlight;--highcontrast-switch-handle-border-color-selected-focus:Highlight;--highcontrast-switch-background-color:ButtonFace;--highcontrast-switch-background-color-selected-default:Highlight;--highcontrast-switch-background-color-selected-hover:Highlight;--highcontrast-switch-background-color-selected-down:Highlight;--highcontrast-switch-background-color-selected-focus:Highlight;--highcontrast-switch-background-color-selected-disabled:Highlight;--highcontrast-switch-focus-indicator-color:ButtonText;forced-color-adjust:none}#input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px buttontext}}@media (forced-colors:active) and (hover:hover){:host(:hover) #input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px highlight}:host([disabled][checked]:hover) #input+#switch,:host([disabled][checked]:hover) #input+#switch{background-color:graytext;box-shadow:inset 0 0 0 1px graytext}:host([disabled][checked]:hover) #input+#switch:before,:host([disabled][checked]:hover) #input+#switch:before{background-color:buttonface;border-color:graytext}}@media (forced-colors:active){:host([disabled]) #input:not(:checked)+#switch,:host([disabled]) #input:not(:checked)+#switch{background-color:buttonface;box-shadow:inset 0 0 0 1px graytext}:host([disabled]) #input:not(:checked)+#switch:before,:host([disabled]) #input:not(:checked)+#switch:before{background-color:buttonface;border-color:graytext}:host([disabled][checked]) #input+#switch,:host([disabled][checked]) #input+#switch{background-color:graytext;box-shadow:inset 0 0 0 1px graytext}:host([disabled][checked]) #input+#switch:before,:host([disabled][checked]) #input+#switch:before{background-color:buttonface;border-color:graytext}:host([disabled]) #input~#label,:host([disabled]) #input~#label{color:graytext}}:host{--switch-handle-border-color-default:var(--luzmo-selected-color);--switch-handle-border-color-hover:var(--luzmo-selected-color-hover);--switch-handle-border-color-down:var(--luzmo-selected-color-down);--switch-handle-border-color-focus:var(--luzmo-selected-color-focus);--switch-handle-border-color-selected-default:var(--luzmo-selected-color-hover);--switch-handle-border-color-selected-hover:var(--luzmo-selected-color-down);--switch-handle-border-color-selected-down:var(--luzmo-selected-color-hard-down);--switch-handle-border-color-selected-focus:var(--luzmo-selected-color-down);--switch-focus-indicator-gap:var(--luzmo-indicator-gap);--switch-label-color-default:var(--luzmo-selected-color-hard);--switch-label-color-hover:var(--luzmo-selected-color-hard-hover);--switch-label-color-down:var(--luzmo-selected-color-hard-down);--switch-label-color-focus:var(--luzmo-selected-color-hard-focus);--switch-label-color-disabled:var(--luzmo-disabled-color);--switch-background-color:var(--luzmo-border-color);--switch-background-color-disabled:var(--luzmo-background-color-disabled);--switch-background-color-selected-disabled:var(--luzmo-disabled-color);--switch-background-color-selected-default:var(--luzmo-selected-color-hover);--switch-background-color-selected-hover:var(--luzmo-selected-color-down);--switch-background-color-selected-down:var(--luzmo-selected-color-hard-down);--switch-background-color-selected-focus:var(--luzmo-selected-color-down);--switch-focus-indicator-width:var(--luzmo-indicator-width);--switch-focus-indicator-color:var(--luzmo-primary);--switch-handle-background-color:var(--luzmo-background-color);--switch-handle-border-color-disabled:var(--luzmo-disabled-color);--switch-spacing-top-to-control:calc((var(--switch-min-height) - var(--switch-control-height)) / 2)}:host([disabled]){--switch-label-color-default:var(--luzmo-disabled-color)}:host([emphasized]){--switch-background-color-selected-default:var(--luzmo-primary);--switch-background-color-selected-hover:var(--luzmo-primary-hover);--switch-background-color-selected-down:var(--luzmo-primary-down);--switch-background-color-selected-focus:var(--luzmo-primary-focus);--switch-handle-border-color-selected-default:var(--luzmo-primary);--switch-handle-border-color-selected-hover:var(--luzmo-primary-hover);--switch-handle-border-color-selected-down:var(--luzmo-primary-down);--switch-handle-border-color-selected-focus:var(--luzmo-primary-focus)}:host([size=s]){--switch-min-height:24px;--switch-control-width:23px;--switch-control-height:var(--luzmo-font-size-s);--switch-control-label-spacing:var(--luzmo-spacing-3);--switch-spacing-top-to-label:4px;--switch-font-size:var(--luzmo-font-size-s)}:host{--switch-min-height:32px;--switch-control-width:26px;--switch-control-height:var(--luzmo-font-size);--switch-control-label-spacing:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--switch-spacing-top-to-label:6px;--switch-font-size:var(--luzmo-font-size)}:host([size=l]){--switch-min-height:40px;--switch-control-width:28px;--switch-control-height:var(--luzmo-font-size-l);--switch-control-label-spacing:var(--luzmo-spacing-4);--switch-spacing-top-to-label:9px;--switch-font-size:var(--luzmo-font-size-l)}:host([size=xl]){--switch-min-height:48px;--switch-control-width:32px;--switch-control-height:var(--luzmo-font-size-xl);--switch-control-label-spacing:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--switch-spacing-top-to-label:12px;--switch-font-size:var(--luzmo-font-size-xl)}:host([disabled]){pointer-events:none}:host([thumb=overflow]){--luzmo-switch-border-width:0px;--switch-control-width:calc(var(--switch-control-height) * 2);--switch-control-box-shadow:0 .125rem .25rem rgba(var(--luzmo-border-color-rgb), .2), inset 0 0 0 .0625rem rgba(var(--luzmo-border-color-rgb), .2)}:host([thumb=overflow]) #switch{margin-top:calc((var(--luzmo-switch-min-height,var(--switch-min-height)) - var(--luzmo-switch-track-height,var(--switch-track-height))) / 2)}:host([thumb=overflow]) #switch:before{inset-block-start:calc(-1 * (var(--luzmo-switch-control-height,var(--switch-control-height)) - var(--luzmo-switch-track-height,var(--switch-track-height))) / 2)}:host([thumb=overflow][size=s]){--switch-track-height:10px;--switch-control-height:16px;--switch-focus-indicator-gap:5px}:host([thumb=overflow]){--switch-track-height:10px;--switch-control-height:18px;--switch-focus-indicator-gap:6px}:host([thumb=overflow][size=l]){--switch-track-height:12px;--switch-control-height:20px;--switch-focus-indicator-gap:7px}:host([thumb=overflow][size=xl]){--switch-track-height:12px;--switch-control-height:22px;--switch-focus-indicator-gap:8px}", l = class extends t(s) {
|
|
30
|
+
constructor(...e) {
|
|
31
|
+
super(...e), this.emphasized = !1, this.thumb = "overflow";
|
|
32
|
+
}
|
|
33
|
+
static get styles() {
|
|
34
|
+
return window.hasOwnProperty("ShadyDOM"), [a(c)];
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return i`
|
|
38
|
+
${super.render()}
|
|
39
|
+
<span id="switch"></span>
|
|
40
|
+
<label id="label" for="input"><slot></slot></label>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
firstUpdated(e) {
|
|
44
|
+
super.firstUpdated(e), this.inputElement.setAttribute("role", "switch");
|
|
45
|
+
}
|
|
46
|
+
updated(e) {
|
|
47
|
+
e.has("checked") && this.inputElement.setAttribute("aria-checked", this.checked ? "true" : "false");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/components/switch/index.ts
|
|
52
|
+
e([o({
|
|
53
|
+
type: Boolean,
|
|
54
|
+
reflect: !0
|
|
55
|
+
})], l.prototype, "emphasized", void 0), e([o({
|
|
56
|
+
type: String,
|
|
57
|
+
reflect: !0
|
|
58
|
+
})], l.prototype, "thumb", void 0), customElements.get("luzmo-switch") || customElements.define("luzmo-switch", l);
|
|
59
|
+
//#endregion
|
|
60
|
+
export { l as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./decorate-B2wePfNm.cjs`),t=require(`./sized-mixin-StFA4y0J.cjs`),n=require(`./focusable-CupEoHmn.cjs`),r=require(`./checkbox-mixin-D4HeLrMj.cjs`);let i=require(`lit`),a=require(`lit/decorators.js`);var o=class extends r.t(n.t){get focusElement(){return this.inputElement}},s=`:host{--switch-focus-indicator-width:var(--luzmo-focus-indicator-width,var(--luzmo-indicator-width));min-block-size:var(--luzmo-switch-height,var(--switch-min-height));--switch-track-height:var(--switch-control-height);vertical-align:top;max-inline-size:100%;font-family:var(--luzmo-switch-font-family,var(--luzmo-font-family));align-items:flex-start;display:inline-flex;position:relative}#input{box-sizing:border-box;opacity:0;z-index:1;cursor:pointer;block-size:100%;inline-size:100%;margin:0;padding:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host([checked]) #input+#switch:before{transform:translateX(calc(var(--luzmo-switch-control-width,var(--switch-control-width)) - 100%))}:host([dir=rtl][checked]) #input+#switch:before{transform:translateX(calc((var(--luzmo-switch-control-width,var(--switch-control-width)) - 100%) * -1))}:host([checked]) #input+#switch:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):before{transform:translateX(calc((var(--luzmo-switch-control-width,var(--switch-control-width)) - 100%) * -1))}:host([disabled]) #input,:host([disabled]) #input{cursor:not-allowed}#input:focus-visible+#switch:after{margin:calc(var(--luzmo-focus-indicator-gap,var(--switch-focus-indicator-gap)) * -1)}#label{color:var(--highcontrast-switch-label-color-default,var(--luzmo-switch-label-color-default,var(--switch-label-color-default)));margin-inline:var(--luzmo-switch-control-label-spacing,var(--switch-control-label-spacing));font-size:var(--luzmo-switch-font-size,var(--switch-font-size));line-height:var(--luzmo-switch-line-height,1.3);transition:color calc(var(--luzmo-animation-duration) * 2) ease-in-out;margin-block-start:var(--luzmo-switch-spacing-top-to-label,var(--switch-spacing-top-to-label));margin-block-end:0}#switch{box-sizing:border-box;inline-size:var(--luzmo-switch-control-width,var(--switch-control-width));margin-block:calc(var(--luzmo-switch-height,var(--switch-min-height)) - var(--luzmo-switch-control-height,var(--switch-control-height)) - var(--luzmo-switch-spacing-top-to-control,var(--switch-spacing-top-to-control)));vertical-align:middle;transition:background var(--luzmo-animation-duration) ease-in-out, border var(--luzmo-animation-duration) ease-in-out;block-size:var(--luzmo-switch-track-height,var(--switch-track-height));border-radius:calc(var(--luzmo-switch-control-height,var(--switch-control-height)) / 2);flex-grow:0;flex-shrink:0;margin-inline:0;display:inline-block;position:relative;inset-inline:0}#switch:before{box-sizing:border-box;transition:background var(--luzmo-animation-duration) ease-in-out, border var(--luzmo-animation-duration) ease-in-out, transform var(--luzmo-animation-duration) ease-in-out, box-shadow var(--luzmo-animation-duration) ease-in-out;inline-size:var(--luzmo-switch-control-height,var(--switch-control-height));block-size:var(--luzmo-switch-control-height,var(--switch-control-height));box-shadow:var(--luzmo-switch-control-box-shadow,var(--switch-control-box-shadow));border-width:var(--luzmo-switch-border-width,var(--luzmo-switch-border-width,var(--luzmo-border-width)));border-radius:calc(var(--luzmo-switch-control-height,var(--switch-control-height)) / 2);border-style:solid}#switch:after,#switch:before{content:"";display:block;position:absolute;inset-block-start:0;inset-inline-start:0}#switch:after{border-radius:calc(var(--luzmo-switch-control-height,var(--switch-control-height)) / 2 + var(--luzmo-focus-indicator-gap,var(--switch-focus-indicator-gap)) * 2);transition:opacity var(--luzmo-animation-duration) ease-out, margin var(--luzmo-animation-duration) ease-out;margin:0;inset-block-end:0;inset-inline-end:0}#switch{background-color:var(--highcontrast-switch-background-color,var(--luzmo-switch-background-color,var(--switch-background-color)))}#switch:before{background-color:var(--highcontrast-switch-handle-background-color,var(--luzmo-switch-handle-background-color,var(--switch-handle-background-color)));border-color:var(--highcontrast-switch-handle-border-color-default,var(--luzmo-switch-handle-border-color-default,var(--switch-handle-border-color-default)))}:host(:active) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-down,var(--luzmo-switch-handle-border-color-down,var(--switch-handle-border-color-down)))}:host(:active) #input~#label{color:var(--highcontrast-switch-label-color-down,var(--luzmo-switch-label-color-down,var(--switch-label-color-down)))}:host(:active[checked]) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-down,var(--luzmo-switch-background-color-selected-down,var(--switch-background-color-selected-down)))}:host(:active[checked]) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-down,var(--luzmo-switch-handle-border-color-selected-down,var(--switch-handle-border-color-selected-down)))}#input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width,var(--luzmo-focus-indicator-width,var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color,var(--luzmo-switch-focus-indicator-color,var(--switch-focus-indicator-color)))}#input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus,var(--luzmo-switch-handle-border-color-focus,var(--switch-handle-border-color-focus)))}:host([checked]) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus,var(--luzmo-switch-background-color-selected-focus,var(--switch-background-color-selected-focus)))}:host([checked]) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus,var(--luzmo-switch-handle-border-color-selected-focus,var(--switch-handle-border-color-selected-focus)))}#input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus,var(--luzmo-switch-label-color-focus,var(--switch-label-color-focus)))}@media (hover:hover){:host(:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-hover,var(--luzmo-switch-handle-border-color-hover,var(--switch-handle-border-color-hover)));box-shadow:var(--luzmo-switch-control-box-shadow,var(--switch-control-box-shadow,none));background-color:var(--highcontrast-switch-background-color-hover,var(--luzmo-switch-background-color-hover,var(--switch-background-color-hover,var(--luzmo-background-color-hover))))}:host(:hover) #input~#label{color:var(--highcontrast-switch-label-color-hover,var(--luzmo-switch-label-color-hover,var(--switch-label-color-hover)))}:host([checked]:hover) #input:enabled+#switch{background-color:var(--highcontrast-switch-background-color-selected-hover,var(--luzmo-switch-background-color-selected-hover,var(--switch-background-color-selected-hover)))}:host([checked]:hover) #input:enabled+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-hover,var(--luzmo-switch-handle-border-color-selected-hover,var(--switch-handle-border-color-selected-hover)))}:host([disabled]:hover) #input+#switch,:host([disabled]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled,var(--luzmo-switch-background-color-disabled,var(--switch-background-color-disabled)))}:host([disabled]:hover) #input+#switch:before,:host([disabled]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled]:hover) #input~#label,:host([disabled]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled,var(--luzmo-switch-label-color-disabled,var(--switch-label-color-disabled)))}:host([disabled][checked]:hover) #input+#switch,:host([disabled][checked]:hover) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled,var(--luzmo-switch-background-color-selected-disabled,var(--switch-background-color-selected-disabled)))}:host([disabled][checked]:hover) #input+#switch:before,:host([disabled][checked]:hover) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled][checked]:hover) #input~#label,:host([disabled][checked]:hover) #input~#label{color:var(--highcontrast-switch-label-color-disabled,var(--luzmo-switch-label-color-disabled,var(--switch-label-color-disabled)))}:host(:hover) #input:focus-visible+#switch:after{box-shadow:0 0 0 var(--luzmo-switch-focus-indicator-width,var(--luzmo-focus-indicator-width,var(--switch-focus-indicator-width))) var(--highcontrast-switch-focus-indicator-color,var(--luzmo-switch-focus-indicator-color,var(--switch-focus-indicator-color)))}:host(:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-focus,var(--luzmo-switch-handle-border-color-focus,var(--switch-handle-border-color-focus)))}:host([checked]:hover) #input:focus-visible+#switch{background-color:var(--highcontrast-switch-background-color-selected-focus,var(--luzmo-switch-background-color-selected-focus,var(--switch-background-color-selected-focus)))}:host([checked]:hover) #input:focus-visible+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-focus,var(--luzmo-switch-handle-border-color-selected-focus,var(--switch-handle-border-color-selected-focus)))}:host(:hover) #input:focus-visible~#label{color:var(--highcontrast-switch-label-color-focus,var(--luzmo-switch-label-color-focus,var(--switch-label-color-focus)))}}:host([checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-default,var(--luzmo-switch-background-color-selected-default,var(--switch-background-color-selected-default)))}:host([checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-selected-default,var(--luzmo-switch-handle-border-color-selected-default,var(--switch-handle-border-color-selected-default)))}:host([disabled]) #input+#switch,:host([disabled]) #input+#switch{background-color:var(--highcontrast-switch-background-color-disabled,var(--luzmo-switch-background-color-disabled,var(--switch-background-color-disabled)))}:host([disabled]) #input+#switch:before,:host([disabled]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled][checked]) #input+#switch,:host([disabled][checked]) #input+#switch{background-color:var(--highcontrast-switch-background-color-selected-disabled,var(--luzmo-switch-background-color-selected-disabled,var(--switch-background-color-selected-disabled)))}:host([disabled][checked]) #input+#switch:before,:host([disabled][checked]) #input+#switch:before{border-color:var(--highcontrast-switch-handle-border-color-disabled,var(--luzmo-switch-handle-border-color-disabled,var(--switch-handle-border-color-disabled)))}:host([disabled]) #input~#label,:host([disabled]) #input~#label{color:var(--highcontrast-switch-label-color-disabled,var(--luzmo-switch-label-color-disabled,var(--switch-label-color-disabled)))}@media (forced-colors:active){:host{--highcontrast-switch-label-color-default:ButtonText;--highcontrast-switch-label-color-hover:ButtonText;--highcontrast-switch-label-color-down:ButtonText;--highcontrast-switch-label-color-focus:ButtonText;--highcontrast-switch-label-color-disabled:GrayText;--highcontrast-switch-handle-background-color:ButtonFace;--highcontrast-switch-handle-border-color-default:ButtonText;--highcontrast-switch-handle-border-color-hover:Highlight;--highcontrast-switch-handle-border-color-down:Highlight;--highcontrast-switch-handle-border-color-focus:Highlight;--highcontrast-switch-handle-border-color-disabled:Highlight;--highcontrast-switch-handle-border-color-selected-default:Highlight;--highcontrast-switch-handle-border-color-selected-hover:Highlight;--highcontrast-switch-handle-border-color-selected-down:Highlight;--highcontrast-switch-handle-border-color-selected-focus:Highlight;--highcontrast-switch-background-color:ButtonFace;--highcontrast-switch-background-color-selected-default:Highlight;--highcontrast-switch-background-color-selected-hover:Highlight;--highcontrast-switch-background-color-selected-down:Highlight;--highcontrast-switch-background-color-selected-focus:Highlight;--highcontrast-switch-background-color-selected-disabled:Highlight;--highcontrast-switch-focus-indicator-color:ButtonText;forced-color-adjust:none}#input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px buttontext}}@media (forced-colors:active) and (hover:hover){:host(:hover) #input:not(:checked)+#switch{box-shadow:inset 0 0 0 1px highlight}:host([disabled][checked]:hover) #input+#switch,:host([disabled][checked]:hover) #input+#switch{background-color:graytext;box-shadow:inset 0 0 0 1px graytext}:host([disabled][checked]:hover) #input+#switch:before,:host([disabled][checked]:hover) #input+#switch:before{background-color:buttonface;border-color:graytext}}@media (forced-colors:active){:host([disabled]) #input:not(:checked)+#switch,:host([disabled]) #input:not(:checked)+#switch{background-color:buttonface;box-shadow:inset 0 0 0 1px graytext}:host([disabled]) #input:not(:checked)+#switch:before,:host([disabled]) #input:not(:checked)+#switch:before{background-color:buttonface;border-color:graytext}:host([disabled][checked]) #input+#switch,:host([disabled][checked]) #input+#switch{background-color:graytext;box-shadow:inset 0 0 0 1px graytext}:host([disabled][checked]) #input+#switch:before,:host([disabled][checked]) #input+#switch:before{background-color:buttonface;border-color:graytext}:host([disabled]) #input~#label,:host([disabled]) #input~#label{color:graytext}}:host{--switch-handle-border-color-default:var(--luzmo-selected-color);--switch-handle-border-color-hover:var(--luzmo-selected-color-hover);--switch-handle-border-color-down:var(--luzmo-selected-color-down);--switch-handle-border-color-focus:var(--luzmo-selected-color-focus);--switch-handle-border-color-selected-default:var(--luzmo-selected-color-hover);--switch-handle-border-color-selected-hover:var(--luzmo-selected-color-down);--switch-handle-border-color-selected-down:var(--luzmo-selected-color-hard-down);--switch-handle-border-color-selected-focus:var(--luzmo-selected-color-down);--switch-focus-indicator-gap:var(--luzmo-indicator-gap);--switch-label-color-default:var(--luzmo-selected-color-hard);--switch-label-color-hover:var(--luzmo-selected-color-hard-hover);--switch-label-color-down:var(--luzmo-selected-color-hard-down);--switch-label-color-focus:var(--luzmo-selected-color-hard-focus);--switch-label-color-disabled:var(--luzmo-disabled-color);--switch-background-color:var(--luzmo-border-color);--switch-background-color-disabled:var(--luzmo-background-color-disabled);--switch-background-color-selected-disabled:var(--luzmo-disabled-color);--switch-background-color-selected-default:var(--luzmo-selected-color-hover);--switch-background-color-selected-hover:var(--luzmo-selected-color-down);--switch-background-color-selected-down:var(--luzmo-selected-color-hard-down);--switch-background-color-selected-focus:var(--luzmo-selected-color-down);--switch-focus-indicator-width:var(--luzmo-indicator-width);--switch-focus-indicator-color:var(--luzmo-primary);--switch-handle-background-color:var(--luzmo-background-color);--switch-handle-border-color-disabled:var(--luzmo-disabled-color);--switch-spacing-top-to-control:calc((var(--switch-min-height) - var(--switch-control-height)) / 2)}:host([disabled]){--switch-label-color-default:var(--luzmo-disabled-color)}:host([emphasized]){--switch-background-color-selected-default:var(--luzmo-primary);--switch-background-color-selected-hover:var(--luzmo-primary-hover);--switch-background-color-selected-down:var(--luzmo-primary-down);--switch-background-color-selected-focus:var(--luzmo-primary-focus);--switch-handle-border-color-selected-default:var(--luzmo-primary);--switch-handle-border-color-selected-hover:var(--luzmo-primary-hover);--switch-handle-border-color-selected-down:var(--luzmo-primary-down);--switch-handle-border-color-selected-focus:var(--luzmo-primary-focus)}:host([size=s]){--switch-min-height:24px;--switch-control-width:23px;--switch-control-height:var(--luzmo-font-size-s);--switch-control-label-spacing:var(--luzmo-spacing-3);--switch-spacing-top-to-label:4px;--switch-font-size:var(--luzmo-font-size-s)}:host{--switch-min-height:32px;--switch-control-width:26px;--switch-control-height:var(--luzmo-font-size);--switch-control-label-spacing:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--switch-spacing-top-to-label:6px;--switch-font-size:var(--luzmo-font-size)}:host([size=l]){--switch-min-height:40px;--switch-control-width:28px;--switch-control-height:var(--luzmo-font-size-l);--switch-control-label-spacing:var(--luzmo-spacing-4);--switch-spacing-top-to-label:9px;--switch-font-size:var(--luzmo-font-size-l)}:host([size=xl]){--switch-min-height:48px;--switch-control-width:32px;--switch-control-height:var(--luzmo-font-size-xl);--switch-control-label-spacing:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--switch-spacing-top-to-label:12px;--switch-font-size:var(--luzmo-font-size-xl)}:host([disabled]){pointer-events:none}:host([thumb=overflow]){--luzmo-switch-border-width:0px;--switch-control-width:calc(var(--switch-control-height) * 2);--switch-control-box-shadow:0 .125rem .25rem rgba(var(--luzmo-border-color-rgb), .2), inset 0 0 0 .0625rem rgba(var(--luzmo-border-color-rgb), .2)}:host([thumb=overflow]) #switch{margin-top:calc((var(--luzmo-switch-min-height,var(--switch-min-height)) - var(--luzmo-switch-track-height,var(--switch-track-height))) / 2)}:host([thumb=overflow]) #switch:before{inset-block-start:calc(-1 * (var(--luzmo-switch-control-height,var(--switch-control-height)) - var(--luzmo-switch-track-height,var(--switch-track-height))) / 2)}:host([thumb=overflow][size=s]){--switch-track-height:10px;--switch-control-height:16px;--switch-focus-indicator-gap:5px}:host([thumb=overflow]){--switch-track-height:10px;--switch-control-height:18px;--switch-focus-indicator-gap:6px}:host([thumb=overflow][size=l]){--switch-track-height:12px;--switch-control-height:20px;--switch-focus-indicator-gap:7px}:host([thumb=overflow][size=xl]){--switch-track-height:12px;--switch-control-height:22px;--switch-focus-indicator-gap:8px}`,c=class extends t.n(o){constructor(...e){super(...e),this.emphasized=!1,this.thumb=`overflow`}static get styles(){return window.hasOwnProperty(`ShadyDOM`),[(0,i.unsafeCSS)(s)]}render(){return i.html`
|
|
19
|
+
${super.render()}
|
|
20
|
+
<span id="switch"></span>
|
|
21
|
+
<label id="label" for="input"><slot></slot></label>
|
|
22
|
+
`}firstUpdated(e){super.firstUpdated(e),this.inputElement.setAttribute(`role`,`switch`)}updated(e){e.has(`checked`)&&this.inputElement.setAttribute(`aria-checked`,this.checked?`true`:`false`)}};e.t([(0,a.property)({type:Boolean,reflect:!0})],c.prototype,`emphasized`,void 0),e.t([(0,a.property)({type:String,reflect:!0})],c.prototype,`thumb`,void 0),customElements.get(`luzmo-switch`)||customElements.define(`luzmo-switch`,c),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -15,79 +15,4 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
${this.hasIcon?s.x` <slot name="icon"></slot> `:s.E}
|
|
20
|
-
<label id="item-label" ?hidden=${!this.hasLabel}>
|
|
21
|
-
${this.slotHasContent?s.E:this.label}
|
|
22
|
-
<slot>${this.label}</slot>
|
|
23
|
-
</label>
|
|
24
|
-
`}firstUpdated(t){super.firstUpdated(t),this.setAttribute("role","tab"),this.hasAttribute("id")||(this.id=`luzmo-tab-${y.randomID()}`)}updated(t){super.updated(t),t.has("selected")&&(this.setAttribute("aria-selected",this.selected?"true":"false"),this.setAttribute("tabindex",this.selected?"0":"-1")),t.has("disabled")&&(this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"))}}v([s.n({type:Boolean,reflect:!0})],u.prototype,"disabled");v([s.n({reflect:!0})],u.prototype,"label");v([s.n({type:Boolean,reflect:!0})],u.prototype,"selected");v([s.n({type:Boolean,reflect:!0})],u.prototype,"vertical");v([s.n({type:String,reflect:!0})],u.prototype,"value");const U=":host{display:inline-flex;font-family:var(--luzmo-tab-panel-font-family, var(--luzmo-font-family))}:host(:not([selected])){display:none}:host(:focus-visible){outline:var(--luzmo-tab-panel-indicator-color, var(--luzmo-indicator-color)) solid var(--luzmo-tab-panel-indicator-width, var(--luzmo-indicator-width))}";var D=Object.defineProperty,k=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&D(t,o,e),e};class p extends s.LuzmoElement{constructor(){super(...arguments),this.selected=!1,this.value=""}static get styles(){return[s.r(U)]}handleFocusin(){this.removeAttribute("tabindex")}handleFocusout(){this.tabIndex=this.selected?0:-1}render(){return s.x`
|
|
25
|
-
<slot
|
|
26
|
-
@focusin=${this.handleFocusin}
|
|
27
|
-
@focusout=${this.handleFocusout}
|
|
28
|
-
></slot>
|
|
29
|
-
`}firstUpdated(){this.slot="tab-panel",this.setAttribute("role","tabpanel"),this.tabIndex=0,this.hasAttribute("id")||(this.id=`luzmo-tab-panel-${y.randomID()}`)}updated(t){t.has("selected")&&(this.selected?(this.removeAttribute("aria-hidden"),this.tabIndex=0):(this.setAttribute("aria-hidden","true"),this.tabIndex=-1))}}k([s.n({type:Boolean,reflect:!0})],p.prototype,"selected");k([s.n({type:String,reflect:!0})],p.prototype,"value");/**
|
|
30
|
-
* @license
|
|
31
|
-
* Copyright 2021 Google LLC
|
|
32
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/class O{constructor(t,{target:o,config:i,callback:e,skipInitial:a}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,o!==null&&this.t.add(o??t),this.o=a??this.o,this.callback=e,window.IntersectionObserver?(this.u=new IntersectionObserver(r=>{const z=this.i;this.i=!1,this.o&&z||(this.handleChanges(r),this.h.requestUpdate())},i),t.addController(this)):console.warn("IntersectionController error: browser does not support IntersectionObserver.")}handleChanges(t){var o;this.value=(o=this.callback)==null?void 0:o.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){const t=this.u.takeRecords();t.length&&this.handleChanges(t)}observe(t){this.t.add(t),this.u.observe(t),this.i=!0}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}/**
|
|
34
|
-
* @license
|
|
35
|
-
* Copyright 2021 Google LLC
|
|
36
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/class C{constructor(t,{target:o,config:i,callback:e,skipInitial:a}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,o!==null&&this.t.add(o??t),this.l=i,this.o=a??this.o,this.callback=e,window.ResizeObserver?(this.u=new ResizeObserver(r=>{this.handleChanges(r),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var o;this.value=(o=this.callback)==null?void 0:o.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}const T="#list{--tabs-item-height: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-3) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-s);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size)}:host([size=s]) #list{--tabs-item-height: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: var(--luzmo-spacing-4);--tabs-icon-size: var(--luzmo-icon-size-xs);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size-s)}:host([size=l]) #list{--tabs-item-height: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-m);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-l)}:host([size=xl]) #list{--tabs-item-height: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-l);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-xl)}:host([compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-2) )}:host([size=s][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-s) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-1) )}:host([size=l][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-l) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3)) )}:host([size=xl][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-xl) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) )}",F="#list{--tabs-color: var(--luzmo-font-color);--tabs-color-selected: var(--luzmo-font-color-down);--tabs-color-hover: var(--luzmo-font-color-hover);--tabs-color-key-focus: var(--luzmo-font-color-focus);--tabs-color-disabled: var(--luzmo-disabled-color);--tabs-font-family: var(--luzmo-font-family);--tabs-font-style: var(--luzmo-font-style);--tabs-font-size: var(--luzmo-font-size);--tabs-line-height: var(--luzmo-line-height);--tabs-focus-indicator-width: var(--luzmo-indicator-width);--tabs-focus-indicator-border-radius: var(--luzmo-border-radius);--tabs-focus-indicator-color: var(--luzmo-indicator-color);--tabs-selection-indicator-color: var(--luzmo-font-color-down);--tabs-list-background-direction: top;--tabs-divider-size: 2px;--tabs-divider-border-radius: 1px;--tabs-animation-duration: var(--luzmo-animation-duration);--tabs-animation-ease: ease-in-out}:host([emphasized]) #list{--luzmo-tabs-color-selected: var( --luzmo-tabs-color-selected-emphasized, var(--luzmo-primary) );--luzmo-tabs-color-hover: var( --luzmo-tabs-color-hover-emphasized, var(--luzmo-primary-hover) );--luzmo-tabs-color-key-focus: var( --luzmo-tabs-color-key-focus-emphasized, var(--luzmo-primary-focus) );--luzmo-tabs-selection-indicator-color: var( --luzmo-tabs-selection-indicator-color-emphasized, var(--luzmo-primary-down) )}:host([direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}:host([direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical-right, left )}:host([direction^=vertical]) #list:dir(rtl),:host([dir=rtl][direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, left )}:host([direction^=vertical-right]) #list:dir(rtl),:host([dir=rtl][direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}#list{z-index:0;vertical-align:top;background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));margin:0;padding-block:0;display:flex;position:relative}::slotted([selected]:not([slot])){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}::slotted([disabled]:not([slot])){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}#selection-indicator{background-color:var(--highcontrast-tabs-selection-indicator-color, var(--luzmo-tabs-selection-indicator-color, var(--tabs-selection-indicator-color)));z-index:0;transition:transform var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) var(--luzmo-tabs-animation-ease, var(--tabs-animation-ease));transform-origin:0 0;border-radius:var(--luzmo-tabs-divider-border-radius, var(--tabs-divider-border-radius));position:absolute;inset-inline-start:0}:host([direction^=horizontal]) #list{align-items:center}:host([direction^=horizontal]) #list ::slotted(:not([slot])){vertical-align:top}:host([direction^=horizontal]) ::slotted(:not(:first-child)){margin-inline-start:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([direction^=horizontal]) #list #selection-indicator{block-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-end:0}:host([direction^=horizontal][compact]) #list{box-sizing:initial;align-items:end}:host([quiet]) #list{background:none;border-color:transparent;display:inline-flex}:host([quiet]) #selection-indicator{padding-inline-start:var(--luzmo-tabs-start-to-item-quiet)}:host([direction^=vertical]) #list,:host([direction^=vertical-right]) #list{flex-direction:column;padding:0;display:inline-flex}:host([direction^=vertical-right][quiet]) #list,:host([direction^=vertical][quiet]) #list{border-color:transparent}:host([direction^=vertical]) #list ::slotted(:not([slot])),:host([direction^=vertical-right]) #list ::slotted(:not([slot])){block-size:var(--luzmo-tabs-item-height, var(--tabs-item-height));line-height:var(--luzmo-tabs-item-height, var(--tabs-item-height));margin-block-end:var(--luzmo-tabs-item-vertical-spacing, var(--tabs-item-vertical-spacing));margin-inline-start:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));margin-inline-end:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));padding-block:0}:host([direction^=vertical]) #list ::slotted(:not([slot])):before,:host([direction^=vertical-right]) #list ::slotted(:not([slot])):before{inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}:host([direction^=vertical]) #list #selection-indicator,:host([direction^=vertical-right]) #list #selection-indicator{inline-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-start:0;inset-inline-start:0}:host([direction^=vertical-right]) #list #selection-indicator{inset-inline:auto 0}@media (forced-colors: active){#list{--highcontrast-tabs-divider-background-color: var(--luzmo-border-color);--highcontrast-tabs-selection-indicator-color: Highlight;--highcontrast-tabs-focus-indicator-color: CanvasText;--highcontrast-tabs-focus-indicator-background-color: Highlight;--highcontrast-tabs-color: ButtonText;--highcontrast-tabs-color-hover: ButtonText;--highcontrast-tabs-color-selected: HighlightText;--highcontrast-tabs-color-key-focus: ButtonText;--highcontrast-tabs-color-disabled: GrayText;forced-color-adjust:none}#list ::slotted([selected]:not([slot])):before{background-color:var(--highcontrast-tabs-focus-indicator-background-color)}:host([direction^=vertical][compact]) #list #list ::slotted(:not([slot])):before{block-size:100%;inset-block-start:0}:host([quiet]) #list{background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)))}}#list{--tabs-font-weight: var(--luzmo-font-weight);--tabs-divider-background-color: var(--luzmo-border-color)}:host{display:grid;grid-template-columns:100%;position:relative}:host(:not([direction^=vertical])){grid-template-rows:auto 1fr}:host([direction^=vertical]){grid-template-columns:auto 1fr}:host([dir=rtl]) #selection-indicator{left:0;right:auto}:host([direction=vertical-right]) #list #selection-indicator{inset-inline:auto 0}#list{justify-content:var(--luzmo-tabs-list-justify-content)}:host([disabled]) #list{pointer-events:none}:host([disabled]) #list #selection-indicator{background-color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([disabled]) ::slotted(sp-tab){color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([direction=vertical-right]) #list #selection-indicator,:host([direction=vertical]) #list #selection-indicator{inset-block-start:0}#selection-indicator.first-position{transition:none}:host([dir][direction=horizontal]) #list.scroll{scrollbar-width:none;overflow:auto hidden}:host([dir][direction=horizontal]) #list.scroll::-webkit-scrollbar{display:none}";var R=Object.defineProperty,c=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&R(t,o,e),e};const h={baseSize:100,noSelectionStyle:"transform: translateX(0px) scaleX(0) scaleY(0)",transformX(l,t){const o=t/this.baseSize;return`transform: translateX(${l}px) scaleX(${o});`},transformY(l,t){const o=t/this.baseSize;return`transform: translateY(${l}px) scaleY(${o});`},baseStyles(){return s.i`
|
|
38
|
-
:host([direction='vertical-right']) #selection-indicator,
|
|
39
|
-
:host([direction='vertical']) #selection-indicator {
|
|
40
|
-
height: ${this.baseSize}px;
|
|
41
|
-
}
|
|
42
|
-
:host([dir][direction='horizontal']) #selection-indicator {
|
|
43
|
-
width: ${this.baseSize}px;
|
|
44
|
-
}
|
|
45
|
-
`}};function M(l,t,o,i){const e=l+(t==="rtl"?-1:1),a=o[e],r=i.scrollLeft+i.offsetWidth;return a?a.offsetLeft-i.offsetWidth:r}function W(l,t,o,i){const e=l+(t==="rtl"?1:-1),a=o[e],r=t==="rtl"?-i.offsetWidth:0;return a?a.offsetLeft+a.offsetWidth:r}class n extends S.SizedMixin($.Focusable,{noDefaultSize:!0}){constructor(){super(),this.auto=!1,this.compact=!1,this.direction="horizontal",this.emphasized=!1,this.label="",this.enableTabsScroll=!1,this.quiet=!1,this.selectionIndicatorStyle=h.noSelectionStyle,this.shouldAnimate=!1,this.selected="",this._tabs=[],this.resizeController=new C(this,{callback:()=>{this.updateSelectionIndicator()}}),this.rovingTabindexController=new q.RovingTabindexController(this,{focusInIndex:t=>{let o=0;return t.find((e,a)=>{const r=this.selected?e.value===this.selected:!e.disabled;return o=a,r})?o:-1},direction:()=>"both",elementEnterAction:t=>{this.auto&&(this.shouldAnimate=!0,this.selectTarget(t))},elements:()=>this.tabs,isFocusableElement:t=>!this.disabled&&!t.disabled,listenerScope:()=>this.tabList}),this.onTabsScroll=()=>{this.dispatchEvent(new Event("luzmo-tabs-scroll",{bubbles:!0,composed:!0}))},this.onClick=t=>{if(this.disabled)return;const o=t.composedPath().find(i=>i.parentElement===this);!o||o.disabled||(this.shouldAnimate=!0,this.selectTarget(o))},this.onKeyDown=t=>{if(t.code==="Enter"||t.code==="Space"){t.preventDefault();const o=t.target;o&&this.selectTarget(o)}},this.updateCheckedState=()=>{if(this.tabs.forEach(t=>{t.removeAttribute("selected")}),this.selected){const t=this.tabs.find(o=>o.value===this.selected);t?t.selected=!0:this.selected=""}else{const t=this.tabs[0];t&&t.setAttribute("tabindex","0")}this.updateSelectionIndicator()},this.updateSelectionIndicator=async()=>{const t=this.tabs.find(e=>e.selected);if(!t){this.selectionIndicatorStyle=h.noSelectionStyle;return}await Promise.all([t.updateComplete,document.fonts?document.fonts.ready:Promise.resolve()]);const{width:o,height:i}=t.getBoundingClientRect();this.selectionIndicatorStyle=this.direction==="horizontal"?h.transformX(t.offsetLeft,o):h.transformY(t.offsetTop,i)},new O(this,{config:{root:null,rootMargin:"0px",threshold:[0,1]},callback:()=>{this.updateSelectionIndicator()}})}static get styles(){return[s.r(T),s.r(F),h.baseStyles()]}set tabs(t){t!==this.tabs&&(this._tabs.forEach(o=>{this.resizeController.unobserve(o)}),t.forEach(o=>{this.resizeController.observe(o)}),this._tabs=t,this.rovingTabindexController.clearElementCache())}get tabs(){return this._tabs}get focusElement(){return this.rovingTabindexController.focusInElement||this}limitDeltaToInterval(t,o){return i=>i<t?t:i>o?o:i}scrollTabs(t,o="smooth"){var g;if(t===0)return;const{scrollLeft:i,clientWidth:e,scrollWidth:a}=this.tabList,r=a-e-Math.abs(i),z=this.dir==="ltr"?this.limitDeltaToInterval(-i,r):this.limitDeltaToInterval(-r,Math.abs(i));(g=this.tabList)==null||g.scrollBy({left:z(t),top:0,behavior:o})}get scrollState(){if(this.tabList){const{scrollLeft:t,clientWidth:o,scrollWidth:i}=this.tabList,e=Math.abs(t)>0,a=Math.ceil(Math.abs(t))<i-o;return{canScrollLeft:this.dir==="ltr"?e:a,canScrollRight:this.dir==="ltr"?a:e}}return{}}async getUpdateComplete(){const t=await super.getUpdateComplete(),i=[...this.children].map(e=>e.updateComplete!==void 0?e.updateComplete:Promise.resolve(!0));return await Promise.all(i),t}getNecessaryAutoScroll(t){const o=this.tabs[t],i=o.offsetLeft+o.offsetWidth,e=this.tabList.scrollLeft+this.tabList.offsetWidth,a=o.offsetLeft,r=this.tabList.scrollLeft;return i>e?M(t,this.dir,this.tabs,this.tabList):a<r?W(t,this.dir,this.tabs,this.tabList):-1}async scrollToSelection(){if(!this.enableTabsScroll||!this.selected)return;await this.updateComplete;const t=this.tabs.findIndex(o=>o.value===this.selected);if(t!==-1&&this.tabList){const o=this.getNecessaryAutoScroll(t);o!==-1&&this.tabList.scrollTo({left:o})}}updated(t){super.updated(t),t.has("selected")&&this.scrollToSelection()}managePanels({target:t}){t.assignedElements().map(i=>{const{value:e,id:a}=i,r=this.querySelector(`[role="tab"][value="${e}"]`);r&&(r.setAttribute("aria-controls",a),i.setAttribute("aria-labelledby",r.id)),i.selected=e===this.selected})}render(){return s.x`
|
|
46
|
-
<div
|
|
47
|
-
class=${m.e({scroll:this.enableTabsScroll})}
|
|
48
|
-
aria-label=${x.o(this.label??void 0)}
|
|
49
|
-
@click=${this.onClick}
|
|
50
|
-
@keydown=${this.onKeyDown}
|
|
51
|
-
@scroll=${this.onTabsScroll}
|
|
52
|
-
id="list"
|
|
53
|
-
role="tablist"
|
|
54
|
-
part="tablist"
|
|
55
|
-
>
|
|
56
|
-
<slot @slotchange=${this.onSlotChange}></slot>
|
|
57
|
-
<div
|
|
58
|
-
id="selection-indicator"
|
|
59
|
-
class=${x.o(this.shouldAnimate?void 0:"first-position")}
|
|
60
|
-
style=${this.selectionIndicatorStyle}
|
|
61
|
-
role="presentation"
|
|
62
|
-
></div>
|
|
63
|
-
</div>
|
|
64
|
-
<slot name="tab-panel" @slotchange=${this.managePanels}></slot>
|
|
65
|
-
`}willUpdate(t){if(!this.hasUpdated){const o=this.querySelector(":scope > [selected]");o&&this.selectTarget(o)}if(super.willUpdate(t),t.has("selected")){if(this.tabs.length>0&&this.updateCheckedState(),t.get("selected")){const i=this.querySelector(`[role="tabpanel"][value="${t.get("selected")}"]`);i&&(i.selected=!1)}const o=this.querySelector(`[role="tabpanel"][value="${this.selected}"]`);o&&(o.selected=!0)}t.has("direction")&&(this.direction==="horizontal"?this.removeAttribute("aria-orientation"):this.setAttribute("aria-orientation","vertical")),t.has("dir")&&this.updateSelectionIndicator(),t.has("disabled")&&(this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")),!this.shouldAnimate&&t.get("shouldAnimate")!==void 0&&(this.shouldAnimate=!0)}selectTarget(t){const o=t.getAttribute("value");if(o){const i=this.selected;this.selected=o,this.dispatchEvent(new Event("change",{cancelable:!0}))||(this.selected=i)}}onSlotChange(){this.tabs=this.slotEl.assignedElements().filter(t=>t.getAttribute("role")==="tab"),this.updateCheckedState()}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.updateSelectionIndicator),"fonts"in document&&document.fonts.addEventListener("loadingdone",this.updateSelectionIndicator)}disconnectedCallback(){window.removeEventListener("resize",this.updateSelectionIndicator),"fonts"in document&&document.fonts.removeEventListener("loadingdone",this.updateSelectionIndicator),super.disconnectedCallback()}}c([s.n({type:Boolean})],n.prototype,"auto");c([s.n({type:Boolean,reflect:!0})],n.prototype,"compact");c([s.n({reflect:!0})],n.prototype,"dir");c([s.n({reflect:!0})],n.prototype,"direction");c([s.n({type:Boolean,reflect:!0})],n.prototype,"emphasized");c([s.n()],n.prototype,"label");c([s.n({type:Boolean})],n.prototype,"enableTabsScroll");c([s.n({type:Boolean,reflect:!0})],n.prototype,"quiet");c([s.n({attribute:!1})],n.prototype,"selectionIndicatorStyle");c([s.n({attribute:!1})],n.prototype,"shouldAnimate");c([f.e("slot")],n.prototype,"slotEl");c([f.e("#list")],n.prototype,"tabList");c([s.n({reflect:!0})],n.prototype,"selected");const j=':host{top:0;right:0;bottom:0;left:0;width:100%;--tabs-divider-size: 2px;--tab-item-height-m: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-m);--tabs-overflow-icon-color: var(--luzmo-font-color-focus);--tabs-overflow-shadow-color: var(--luzmo-background-color);--tabs-overflow-shadow-width: 50px;--luzmo-action-button-icon-size: var(--luzmo-font-size);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-4));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-4))}:host([size=s]){--tab-item-height-s: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-overflow-button-height: calc( var(--tab-item-height-s) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-s);--luzmo-action-button-icon-size: var(--luzmo-font-size-s);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-3));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-3))}:host([size=l]){--tab-item-height-l: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-l) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-l);--luzmo-action-button-icon-size: var(--luzmo-font-size-l);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) )}:host([size=xl]){--tab-item-height-xl: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-xl) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-xl);--luzmo-action-button-icon-size: var(--luzmo-font-size-xl);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) )}:host([compact]){--tabs-overflow-button-height: calc( var(--tab-item-compact-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--luzmo-action-button-icon-size: var(--luzmo-font-size-s)}luzmo-action-button{width:var(--luzmo-tabs-overflow-button-size, var(--tabs-overflow-button-size));height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));position:absolute;z-index:2;border:none;text-align:center;box-shadow:none;background:transparent;color:var(--luzmo-tabs-overflow-icon-color, var(--tabs-overflow-icon-color))}luzmo-action-button.left-scroll{visibility:hidden;left:var(--luzmo-tabs-overflow-previous-button-left, var(--tabs-overflow-previous-button-left))}luzmo-action-button.right-scroll{visibility:hidden;right:var(--luzmo-tabs-overflow-next-button-right, var(--tabs-overflow-next-button-right))}luzmo-action-button.left-scroll.show,luzmo-action-button.right-scroll.show{visibility:visible}.tabs-overflow-container{position:relative}.tabs-overflow-container:before,.tabs-overflow-container:after{content:"";visibility:hidden;position:absolute;z-index:1;height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));width:var(--luzmo-tabs-overflow-shadow-width, var(--tabs-overflow-shadow-width));pointer-events:none;inset-block-start:0}.tabs-overflow-container:before{background:transparent linear-gradient(270deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;left:0}.tabs-overflow-container:after{background:transparent linear-gradient(90deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;right:0}.tabs-overflow-container.left-shadow:before,.tabs-overflow-container.right-shadow:after{visibility:visible}';var H=Object.defineProperty,b=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&H(t,o,e),e};class d extends S.SizedMixin(s.LuzmoElement){constructor(){super(),this.compact=!1,this.labelPrevious="Scroll to previous tabs",this.labelNext="Scroll to next tabs",this.overflowState={canScrollLeft:!1,canScrollRight:!1},this.scrollFactor=.5,this.resizeController=new C(this,{target:this,callback:()=>{this._updateScrollState()}})}static get styles(){return[s.r(j),s.r(T)]}get scrollContent(){return this.tabs}firstUpdated(t){super.firstUpdated(t);const[o]=this.scrollContent;o&&(o.enableTabsScroll=!0),this.resizeController.observe(this.overflowContainer)}async _handleSlotChange(){const[t]=this.scrollContent;await(t==null?void 0:t.updateComplete),this._updateScrollState()}_updateScrollState(){const{scrollContent:t,overflowState:o}=this;if(t){const[i]=this.scrollContent,{canScrollLeft:e,canScrollRight:a}=(i==null?void 0:i.scrollState)||{canScrollLeft:!1,canScrollRight:!1};this.overflowState={...o,canScrollLeft:e,canScrollRight:a}}}_handleScrollClick(t){const o=t.currentTarget,[i]=this.scrollContent,e=i.clientWidth*this.scrollFactor,a=o.classList.contains("left-scroll")?-e:e;i.scrollTabs(a,"smooth")}updated(t){super.updated(t),t.has("dir")&&this._updateScrollState()}render(){const{canScrollRight:t,canScrollLeft:o}=this.overflowState,i=this.labelPrevious,e=this.labelNext;return s.x`
|
|
66
|
-
<div
|
|
67
|
-
class=${m.e({"tabs-overflow-container":!0,"left-shadow":o,"right-shadow":t})}
|
|
68
|
-
>
|
|
69
|
-
<luzmo-action-button
|
|
70
|
-
class=${m.e({"left-scroll":!0,show:o})}
|
|
71
|
-
aria-label=${i}
|
|
72
|
-
quiet
|
|
73
|
-
dir="rtl"
|
|
74
|
-
tabindex="-1"
|
|
75
|
-
@click=${this._handleScrollClick}
|
|
76
|
-
>
|
|
77
|
-
<luzmo-icon slot="icon" .icon=${w.k}></luzmo-icon>
|
|
78
|
-
</luzmo-action-button>
|
|
79
|
-
<luzmo-action-button
|
|
80
|
-
class=${m.e({"right-scroll":!0,show:t})}
|
|
81
|
-
aria-label=${e}
|
|
82
|
-
quiet
|
|
83
|
-
tabindex="-1"
|
|
84
|
-
@click=${this._handleScrollClick}
|
|
85
|
-
>
|
|
86
|
-
<luzmo-icon slot="icon" .icon=${w.S}></luzmo-icon>
|
|
87
|
-
</luzmo-action-button>
|
|
88
|
-
<slot
|
|
89
|
-
@slotchange=${this._handleSlotChange}
|
|
90
|
-
@luzmo-tabs-scroll=${this._updateScrollState}
|
|
91
|
-
></slot>
|
|
92
|
-
</div>
|
|
93
|
-
`}}b([s.n({type:Boolean,reflect:!0})],d.prototype,"compact");b([s.n({type:String,attribute:"label-previous"})],d.prototype,"labelPrevious");b([s.n({type:String,attribute:"label-next"})],d.prototype,"labelNext");b([s.n({reflect:!0})],d.prototype,"dir");b([A.r()],d.prototype,"overflowState");b([_.o({selector:"luzmo-tabs",flatten:!0})],d.prototype,"tabs");b([f.e(".tabs-overflow-container")],d.prototype,"overflowContainer");customElements.get("luzmo-tab")||customElements.define("luzmo-tab",u);customElements.get("luzmo-tabs")||customElements.define("luzmo-tabs",n);customElements.get("luzmo-tab-panel")||customElements.define("luzmo-tab-panel",p);customElements.get("luzmo-tabs-overflow")||customElements.define("luzmo-tabs-overflow",d);exports.LuzmoTab=u;exports.LuzmoTabPanel=p;exports.LuzmoTabs=n;exports.LuzmoTabsOverflow=d;
|
|
18
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../tabs-BfTgzdid.cjs`);exports.LuzmoTab=e.i,exports.LuzmoTabPanel=e.r,exports.LuzmoTabs=e.n,exports.LuzmoTabsOverflow=e.t;
|