@luzmo/lucero 0.0.4 → 0.0.6
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/components/accordion/accordion-item.d.ts +24 -0
- package/components/accordion/accordion.d.ts +42 -0
- package/components/accordion/index.cjs +43 -0
- package/components/accordion/index.d.ts +10 -0
- package/{lib → components}/accordion/index.js +10 -11
- package/components/action-bar/action-bar.d.ts +42 -0
- package/components/action-bar/index.cjs +39 -0
- package/components/action-bar/index.d.ts +7 -0
- package/{lib → components}/action-bar/index.js +9 -10
- package/components/action-button/action-button.d.ts +81 -0
- package/components/action-button/index.cjs +24 -0
- package/components/action-button/index.d.ts +7 -0
- package/{lib → components}/action-button/index.js +6 -7
- package/components/action-group/action-group.d.ts +50 -0
- package/{lib → components}/action-group/index.cjs +1 -1
- package/components/action-group/index.d.ts +7 -0
- package/{lib → components}/action-group/index.js +1 -1
- package/{lib/action-group-BoIH8s8R.js → components/action-group-B7oQXv30.js} +11 -12
- package/components/action-group-C8YUQzt8.cjs +20 -0
- package/components/action-menu/action-menu.d.ts +40 -0
- package/{lib → components}/action-menu/index.cjs +5 -5
- package/components/action-menu/index.d.ts +7 -0
- package/{lib → components}/action-menu/index.js +10 -11
- package/{lib/async-directive-FGzMycjH.js → components/async-directive-BhRGSTWB.js} +1 -1
- package/{lib/async-directive-CV2MII86.cjs → components/async-directive-_65ULPLK.cjs} +1 -1
- package/components/avatar/avatar.d.ts +31 -0
- package/components/avatar/index.cjs +24 -0
- package/components/avatar/index.d.ts +7 -0
- package/{lib → components}/avatar/index.js +13 -14
- package/components/base-CxUap9HL.js +665 -0
- package/components/base-rtxi7uaR.cjs +40 -0
- package/components/button/button-base.d.ts +44 -0
- package/components/button/button.d.ts +59 -0
- package/components/button/clear-button.d.ts +22 -0
- package/components/button/close-button.d.ts +24 -0
- package/components/button/index.cjs +20 -0
- package/components/button/index.d.ts +13 -0
- package/{lib → components}/button/index.js +11 -12
- package/{lib/button-base-DgtT6sU5.js → components/button-base-CgrTYVgq.js} +11 -12
- package/components/button-base-DjqSZyn2.cjs +25 -0
- package/components/button-group/button-group.d.ts +19 -0
- package/components/button-group/index.cjs +18 -0
- package/components/button-group/index.d.ts +7 -0
- package/{lib → components}/button-group/index.js +7 -8
- package/components/checkbox/checkbox-base.d.ts +9 -0
- package/components/checkbox/checkbox-mixin.d.ts +14 -0
- package/components/checkbox/checkbox.d.ts +54 -0
- package/components/checkbox/index.cjs +25 -0
- package/components/checkbox/index.d.ts +7 -0
- package/{lib → components}/checkbox/index.js +5 -6
- package/{lib/checkbox-mixin-DegQlk5C.js → components/checkbox-mixin-BRluTF9s.js} +15 -16
- package/{lib/checkbox-mixin-H0Hm-VLk.cjs → components/checkbox-mixin-iB-0ivgo.cjs} +3 -3
- package/{lib/clear-button-Ap5H3UyH.js → components/clear-button-CyLF5dx_.js} +6 -7
- package/components/clear-button-DFXE6MLx.cjs +18 -0
- package/components/close-button-CcD-aVqh.cjs +18 -0
- package/{lib/close-button-CGISEF33.js → components/close-button-CzpdWCWI.js} +8 -9
- package/components/color-area/color-area.d.ts +67 -0
- package/components/color-area/index.cjs +80 -0
- package/components/color-area/index.d.ts +7 -0
- package/{lib → components}/color-area/index.js +9 -10
- package/components/color-field/color-field.d.ts +20 -0
- package/components/color-field/index.cjs +23 -0
- package/components/color-field/index.d.ts +7 -0
- package/{lib → components}/color-field/index.js +2 -3
- package/components/color-handle/color-handle.d.ts +13 -0
- package/components/color-handle/index.cjs +24 -0
- package/components/color-handle/index.d.ts +7 -0
- package/{lib → components}/color-handle/index.js +2 -3
- package/components/color-loupe/color-loupe.d.ts +7 -0
- package/{lib → components}/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.d.ts +7 -0
- package/{lib → components}/color-loupe/index.js +1 -1
- package/components/color-loupe-BN3k1ACF.cjs +56 -0
- package/{lib/color-loupe-DBEApMDT.js → components/color-loupe-CD-dhmB1.js} +3 -4
- package/components/color-menu/color-menu.d.ts +54 -0
- package/components/color-menu/index.cjs +86 -0
- package/components/color-menu/index.d.ts +7 -0
- package/{lib → components}/color-menu/index.js +9 -10
- package/components/color-picker/color-picker.d.ts +39 -0
- package/components/color-picker/index.cjs +48 -0
- package/components/color-picker/index.d.ts +7 -0
- package/{lib → components}/color-picker/index.js +33 -34
- package/components/color-slider/color-slider.d.ts +57 -0
- package/components/color-slider/index.cjs +57 -0
- package/components/color-slider/index.d.ts +7 -0
- package/{lib → components}/color-slider/index.js +5 -6
- package/{lib/directive-helpers-C2vOfhFx.cjs → components/directive-helpers-C3pAxRR3.cjs} +1 -1
- package/{lib/directive-helpers-BLDZnGQv.js → components/directive-helpers-D0vm0gvF.js} +1 -1
- package/components/divider/divider.d.ts +24 -0
- package/components/divider/index.cjs +18 -0
- package/components/divider/index.d.ts +7 -0
- package/{lib → components}/divider/index.js +5 -6
- package/components/field-group/field-group.d.ts +24 -0
- package/{lib → components}/field-group/index.cjs +1 -1
- package/components/field-group/index.d.ts +7 -0
- package/{lib → components}/field-group/index.js +1 -1
- package/{lib/field-group-CBWafIUV.js → components/field-group-DAImvhSF.js} +2 -3
- package/components/field-group-d5Hkb8UW.cjs +23 -0
- package/components/field-label/field-label.d.ts +50 -0
- package/{lib → components}/field-label/index.cjs +1 -1
- package/components/field-label/index.d.ts +7 -0
- package/{lib → components}/field-label/index.js +1 -1
- package/components/field-label-D1zKXSG6.cjs +25 -0
- package/{lib/field-label-BK_tk8vP.js → components/field-label-DY9iRmRI.js} +14 -15
- package/{lib/focusable-DbUg-3Vp.js → components/focusable-Bze9xE25.js} +1 -1
- package/{lib/focusable-Dv_6CFaY.cjs → components/focusable-DyyBr-J-.cjs} +1 -1
- package/components/icon/icon-base.d.ts +11 -0
- package/components/icon/icon.d.ts +12 -0
- package/components/icon/index.cjs +18 -0
- package/components/icon/index.d.ts +7 -0
- package/{lib → components}/icon/index.js +4 -5
- package/{lib/if-defined-Cv6xanXh.cjs → components/if-defined-C-8FyBSN.cjs} +2 -2
- package/{lib/if-defined-CYpcjGCb.js → components/if-defined-XzWkhMhg.js} +1 -1
- package/{lib/index-yNcLzjhM.cjs → components/index-CNtoBntg.cjs} +15 -15
- package/{lib/index-ovT-qVzf.js → components/index-Ci6Jnhu4.js} +8 -9
- package/components/index.cjs +27 -0
- package/{lib/legend-position → components}/index.js +150 -28
- package/components/infield-button/index.cjs +22 -0
- package/components/infield-button/index.d.ts +7 -0
- package/{lib → components}/infield-button/index.js +3 -4
- package/components/infield-button/infield-button.d.ts +25 -0
- package/components/label/index.cjs +18 -0
- package/components/label/index.d.ts +7 -0
- package/{lib → components}/label/index.js +1 -2
- package/components/label/label.d.ts +7 -0
- package/components/legend-position/index.d.ts +7 -0
- package/components/legend-position/legend-position.d.ts +10 -0
- package/{lib/like-anchor-K8W0QYwC.cjs → components/like-anchor-DKuw8fJA.cjs} +4 -4
- package/{lib/like-anchor-cDeGGeHh.js → components/like-anchor-DnsAwo_O.js} +8 -9
- package/{lib/manage-help-text-2mSEy-AD.js → components/manage-help-text-B-FXFXgT.js} +8 -8
- package/{lib/manage-help-text-iOk-zmy8.cjs → components/manage-help-text-I5aYDAKT.cjs} +3 -3
- package/{lib → components}/menu/index.cjs +1 -1
- package/components/menu/index.d.ts +16 -0
- package/{lib → components}/menu/index.js +1 -1
- package/components/menu/menu-divider.d.ts +14 -0
- package/components/menu/menu-group.d.ts +17 -0
- package/components/menu/menu-item.d.ts +125 -0
- package/components/menu/menu.d.ts +119 -0
- package/components/multi-language-field/index.cjs +39 -0
- package/components/multi-language-field/index.d.ts +7 -0
- package/{lib → components}/multi-language-field/index.js +6 -7
- package/components/multi-language-field/multi-language-field.d.ts +41 -0
- package/components/number-field/index.cjs +57 -0
- package/components/number-field/index.d.ts +7 -0
- package/{lib → components}/number-field/index.js +23 -24
- package/components/number-field/number-field.d.ts +113 -0
- package/{lib/observe-slot-text-BmsCNJig.cjs → components/observe-slot-text-DeSKIzvP.cjs} +1 -1
- package/{lib/observe-slot-text-BoFRF-VI.js → components/observe-slot-text-DrM71me1.js} +1 -1
- package/components/overlay/abstract-overlay.d.ts +72 -0
- package/components/overlay/click-controller.d.ts +14 -0
- package/components/overlay/events.d.ts +23 -0
- package/components/overlay/full-size-plugin.d.ts +12 -0
- package/components/overlay/hover-controller.d.ts +20 -0
- package/components/overlay/index.cjs +73 -0
- package/components/overlay/index.d.ts +22 -0
- package/{lib → components}/overlay/index.js +53 -36
- package/components/overlay/interaction-controller.d.ts +38 -0
- package/components/overlay/loader.d.ts +4 -0
- package/components/overlay/longpress-controller.d.ts +21 -0
- package/components/overlay/overlay-dialog.d.ts +4 -0
- package/components/overlay/overlay-events.d.ts +11 -0
- package/components/overlay/overlay-no-popover.d.ts +4 -0
- package/components/overlay/overlay-popover.d.ts +4 -0
- package/components/overlay/overlay-stack.d.ts +44 -0
- package/components/overlay/overlay-timer.d.ts +21 -0
- package/components/overlay/overlay-trigger-directive.d.ts +26 -0
- package/components/overlay/overlay-trigger.d.ts +53 -0
- package/components/overlay/overlay-types.d.ts +50 -0
- package/components/overlay/overlay.d.ts +464 -0
- package/components/overlay/placement-controller.d.ts +157 -0
- package/components/overlay/slottable-request-directive.d.ts +17 -0
- package/components/overlay/slottable-request-event.d.ts +12 -0
- package/components/overlay/strategies.d.ts +8 -0
- package/components/overlay/virtual-trigger.d.ts +7 -0
- package/{lib/overlay-C7QKFqRc.js → components/overlay-C2Cck0Az.js} +53 -43
- package/components/overlay-dn6Xe_vz.cjs +47 -0
- package/{lib/pending-state-D5KTK4_1.js → components/pending-state--XOfTjzE.js} +2 -2
- package/{lib/pending-state-Dbc2HIM2.cjs → components/pending-state-BeJ7iP-O.cjs} +2 -2
- package/components/picker/desktop-controller.d.ts +7 -0
- package/{lib → components}/picker/index.cjs +1 -1
- package/components/picker/index.d.ts +7 -0
- package/{lib → components}/picker/index.js +2 -2
- package/components/picker/interaction-controller.d.ts +43 -0
- package/components/picker/mobile-controller.d.ts +9 -0
- package/components/picker/picker.d.ts +154 -0
- package/components/picker/strategies.d.ts +6 -0
- package/components/picker-8cOc-jjh.cjs +127 -0
- package/components/picker-BZAWrSDk.js +655 -0
- package/{lib → components}/popover/index.cjs +1 -1
- package/components/popover/index.d.ts +7 -0
- package/{lib → components}/popover/index.js +1 -1
- package/components/popover/popover.d.ts +29 -0
- package/components/popover-CCzs4VH8.cjs +30 -0
- package/{lib/popover-ZRVxogyp.js → components/popover-D0EliN0L.js} +7 -8
- package/{lib → components}/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.d.ts +7 -0
- package/{lib → components}/progress-circle/index.js +1 -1
- package/components/progress-circle/progress-circle.d.ts +35 -0
- package/components/progress-circle-DYSSkjlY.cjs +33 -0
- package/{lib/progress-circle-DpXiqW6a.js → components/progress-circle-_-9sAlMM.js} +5 -6
- package/components/radio/index.cjs +22 -0
- package/components/radio/index.d.ts +10 -0
- package/{lib → components}/radio/index.js +10 -11
- package/components/radio/radio-group.d.ts +27 -0
- package/components/radio/radio.d.ts +39 -0
- package/components/search/index.cjs +45 -0
- package/components/search/index.d.ts +7 -0
- package/{lib → components}/search/index.js +3 -4
- package/components/search/search.d.ts +27 -0
- package/{lib/sized-mixin-BSYHt8nT.cjs → components/sized-mixin-BAI6NiE2.cjs} +1 -1
- package/{lib/sized-mixin-Dl0KoEcV.js → components/sized-mixin-DcJTTohI.js} +1 -1
- package/components/slider/index.cjs +18 -0
- package/components/slider/index.d.ts +7 -0
- package/{lib → components}/slider/index.js +5 -6
- package/components/slider/slider.d.ts +24 -0
- package/{lib/state-BAO-13Bs.js → components/state-D8vot9IB.js} +1 -1
- package/{lib/state-DReJ3hB6.cjs → components/state-WWHLNMRG.cjs} +1 -1
- package/{lib/streaming-listener-DLo0wkMc.js → components/streaming-listener-BbmNyKWO.js} +2 -2
- package/components/streaming-listener-C2A7ZJZP.cjs +18 -0
- package/{lib/style-map-BqvQDFJt.js → components/style-map-CoBJRbvu.js} +1 -1
- package/{lib/style-map-BjBGQ_u3.cjs → components/style-map-DH0jkl7s.cjs} +2 -2
- package/components/swatch/index.cjs +49 -0
- package/components/swatch/index.d.ts +10 -0
- package/{lib → components}/swatch/index.js +9 -10
- package/components/swatch/swatch-group.d.ts +41 -0
- package/components/swatch/swatch.d.ts +40 -0
- package/components/switch/index.cjs +22 -0
- package/components/switch/index.d.ts +7 -0
- package/{lib → components}/switch/index.js +6 -7
- package/components/switch/switch.d.ts +27 -0
- package/components/tags/index.cjs +32 -0
- package/components/tags/index.d.ts +10 -0
- package/{lib → components}/tags/index.js +17 -18
- package/components/tags/tag.d.ts +29 -0
- package/components/tags/tags.d.ts +28 -0
- package/components/text-field/help-text-manager.d.ts +19 -0
- package/components/text-field/help-text.d.ts +20 -0
- package/components/text-field/index.cjs +21 -0
- package/components/text-field/index.d.ts +14 -0
- package/{lib → components}/text-field/index.js +9 -9
- package/components/text-field/manage-help-text.d.ts +13 -0
- package/components/text-field/text-field.d.ts +142 -0
- package/{lib/text-field-DPk332j9.js → components/text-field-05QNK_Lj.js} +28 -30
- package/{lib/text-field-C6Aa7XOb.cjs → components/text-field-BU7yxiOR.cjs} +15 -15
- package/components/toast/index.cjs +51 -0
- package/components/toast/index.d.ts +7 -0
- package/{lib → components}/toast/index.js +2 -3
- package/components/toast/toast.d.ts +77 -0
- package/components/tooltip/index.cjs +45 -0
- package/components/tooltip/index.d.ts +8 -0
- package/{lib → components}/tooltip/index.js +10 -11
- package/components/tooltip/tooltip-directive.d.ts +5 -0
- package/components/tooltip/tooltip.d.ts +55 -0
- package/components/unit-input/index.cjs +43 -0
- package/components/unit-input/index.d.ts +7 -0
- package/{lib → components}/unit-input/index.js +5 -6
- package/components/unit-input/unit-input.d.ts +33 -0
- package/index.d.ts +39 -0
- package/package.json +139 -101
- package/utils/base.d.ts +16 -0
- package/utils/condition-attribute-with-id.d.ts +2 -0
- package/utils/first-focusable-in.d.ts +3 -0
- package/utils/focus-visible.d.ts +29 -0
- package/utils/focusable-selectors.d.ts +2 -0
- package/utils/focusable.d.ts +58 -0
- package/utils/get-css-variable.d.ts +1 -0
- package/utils/get-label-from-slot.d.ts +1 -0
- package/utils/like-anchor.d.ts +23 -0
- package/utils/observe-slot-presence.d.ts +12 -0
- package/utils/observe-slot-text.d.ts +11 -0
- package/utils/platform.d.ts +10 -0
- package/utils/random-id.d.ts +1 -0
- package/utils/reactive-controllers/color.d.ts +54 -0
- package/utils/reactive-controllers/dependency-manger.d.ts +26 -0
- package/utils/reactive-controllers/element-resolution.d.ts +23 -0
- package/utils/reactive-controllers/focus-group.d.ts +62 -0
- package/utils/reactive-controllers/language-resolution.d.ts +11 -0
- package/utils/reactive-controllers/match-media.d.ts +13 -0
- package/utils/reactive-controllers/pending-state.d.ts +41 -0
- package/utils/reactive-controllers/roving-tabindex.d.ts +19 -0
- package/utils/reparent-child.d.ts +4 -0
- package/utils/sized-mixin.d.ts +17 -0
- package/utils/streaming-listener.d.ts +48 -0
- package/lib/accordion/index.cjs +0 -43
- package/lib/action-bar/index.cjs +0 -39
- package/lib/action-button/index.cjs +0 -24
- package/lib/action-group-D4MxBrq8.cjs +0 -20
- package/lib/avatar/index.cjs +0 -24
- package/lib/base-BCmA9Wxv.cjs +0 -30
- package/lib/base-nYalvNMy.js +0 -390
- package/lib/button/index.cjs +0 -20
- package/lib/button-base-B0iB_JTv.cjs +0 -25
- package/lib/button-group/index.cjs +0 -18
- package/lib/checkbox/index.cjs +0 -25
- package/lib/clear-button-D0djuaLb.cjs +0 -18
- package/lib/close-button-BrfeZvjk.cjs +0 -18
- package/lib/color-area/index.cjs +0 -80
- package/lib/color-field/index.cjs +0 -23
- package/lib/color-handle/index.cjs +0 -24
- package/lib/color-loupe-BICpNqFs.cjs +0 -56
- package/lib/color-menu/index.cjs +0 -86
- package/lib/color-picker/index.cjs +0 -48
- package/lib/color-slider/index.cjs +0 -57
- package/lib/divider/index.cjs +0 -18
- package/lib/field-group-TUFvhJkk.cjs +0 -23
- package/lib/field-label-BrJaeORz.cjs +0 -25
- package/lib/icon/index.cjs +0 -18
- package/lib/index.cjs +0 -18
- package/lib/index.js +0 -133
- package/lib/infield-button/index.cjs +0 -22
- package/lib/label/index.cjs +0 -18
- package/lib/legend-position/index.cjs +0 -27
- package/lib/lit-html-B3ugcwD9.js +0 -248
- package/lib/lit-html-p4Oxv2-5.cjs +0 -24
- package/lib/multi-language-field/index.cjs +0 -39
- package/lib/number-field/index.cjs +0 -57
- package/lib/overlay/index.cjs +0 -73
- package/lib/overlay-DScraBAi.cjs +0 -47
- package/lib/picker--2OCYWnV.js +0 -657
- package/lib/picker-B9W7Haf4.cjs +0 -127
- package/lib/popover-CVbjhSnx.cjs +0 -30
- package/lib/progress-circle-CiJoS8J7.cjs +0 -33
- package/lib/radio/index.cjs +0 -22
- package/lib/search/index.cjs +0 -45
- package/lib/slider/index.cjs +0 -18
- package/lib/streaming-listener-Bw4jE33f.cjs +0 -18
- package/lib/swatch/index.cjs +0 -49
- package/lib/switch/index.cjs +0 -22
- package/lib/tags/index.cjs +0 -32
- package/lib/text-field/index.cjs +0 -21
- package/lib/toast/index.cjs +0 -51
- package/lib/tooltip/index.cjs +0 -45
- package/lib/unit-input/index.cjs +0 -43
- /package/{lib → components}/base-BjTwmyRF.cjs +0 -0
- /package/{lib → components}/base-D76d76ww.js +0 -0
- /package/{lib → components}/color-Bg3tYsAQ.js +0 -0
- /package/{lib → components}/color-DphK4hwx.cjs +0 -0
- /package/{lib → components}/condition-attribute-with-id-DrQYZzFS.cjs +0 -0
- /package/{lib → components}/condition-attribute-with-id-Dv4lSRbe.js +0 -0
- /package/{lib → components}/dependency-manger-C5HCkMMB.cjs +0 -0
- /package/{lib → components}/dependency-manger-CEXvGQUV.js +0 -0
- /package/{lib → components}/directive-C7oCP5Bh.cjs +0 -0
- /package/{lib → components}/directive-oAbCiebi.js +0 -0
- /package/{lib → components}/divider.module-CXMNveQc.cjs +0 -0
- /package/{lib → components}/divider.module-DwOuLGU3.js +0 -0
- /package/{lib → components}/element-resolution-BvRLGqIU.cjs +0 -0
- /package/{lib → components}/element-resolution-FCUT-wql.js +0 -0
- /package/{lib → components}/focus-group-DHeTq18L.js +0 -0
- /package/{lib → components}/focus-group-DnxZUBhQ.cjs +0 -0
- /package/{lib → components}/focus-visible-B0P9aY_G.cjs +0 -0
- /package/{lib → components}/focus-visible-DBlJGoEW.js +0 -0
- /package/{lib → components}/focusable-selectors-B4YgbghQ.js +0 -0
- /package/{lib → components}/focusable-selectors-BgFlyFcY.cjs +0 -0
- /package/{lib → components}/index-C1chwzNp.js +0 -0
- /package/{lib → components}/index-DCKCHDTt.cjs +0 -0
- /package/{lib → components}/mutation-controller-DH7YOCyj.js +0 -0
- /package/{lib → components}/mutation-controller-DkOMCW-c.cjs +0 -0
- /package/{lib → components}/platform-CQzYNWKq.cjs +0 -0
- /package/{lib → components}/platform-DQYMG7JI.js +0 -0
- /package/{lib → components}/query-BL-TJj7K.cjs +0 -0
- /package/{lib → components}/query-D_KR_GUc.js +0 -0
- /package/{lib → components}/query-assigned-elements-DjfhL1cl.js +0 -0
- /package/{lib → components}/query-assigned-elements-DsKsfk7G.cjs +0 -0
- /package/{lib → components}/query-assigned-nodes-BcKWmGzy.cjs +0 -0
- /package/{lib → components}/query-assigned-nodes-C76XVPWY.js +0 -0
- /package/{lib → components}/random-id-ByCz1xaq.js +0 -0
- /package/{lib → components}/random-id-CqvckpWe.cjs +0 -0
- /package/{lib → components}/roving-tabindex-By_fCy_e.cjs +0 -0
- /package/{lib → components}/roving-tabindex-DOg4z6ZU.js +0 -0
- /package/{lib → components}/slottable-request-event-BfUUt1Mh.cjs +0 -0
- /package/{lib → components}/slottable-request-event-DggLA4Rx.js +0 -0
- /package/{lib → components}/when-CDK1Tt5Y.js +0 -0
- /package/{lib → components}/when-CDZyJPvd.cjs +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
"use strict";const n=require("@luzmo/icons"),b=require("./sized-mixin-BSYHt8nT.cjs"),i=require("lit"),e=require("./base-BCmA9Wxv.cjs");require("./icon/index.cjs");const d=require("./button-base-B0iB_JTv.cjs"),h=':host{cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;font-family:var(--luzmo-button-font-family, var(--luzmo-sans-font-family-stack, var(--luzmo-font-family)));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:var(--luzmo-button-line-height, var(--luzmo-line-height, 1.3));text-transform:none;vertical-align:top;-webkit-appearance:button;transition:background var(--luzmo-button-animation-duration, var(--luzmo-animation-duration)) ease-out,border-color var(--luzmo-button-animation-duration, var(--luzmo-animation-duration)) ease-out,color var(--luzmo-button-animation-duration, var(--luzmo-animation-duration)) ease-out,box-shadow var(--luzmo-button-animation-duration, var(--luzmo-animation-duration)) ease-out;border-style:solid;margin:0;-webkit-text-decoration:none;text-decoration:none;overflow:visible}:host(:focus){outline:none}:host([disabled]){cursor:default}:host a{-webkit-user-select:none;user-select:none;-webkit-appearance:none}@media (forced-colors: active){:host{--highcontrast-close-button-icon-color-disabled: GrayText;--highcontrast-close-button-icon-color-down: Highlight;--highcontrast-close-button-icon-color-hover: Highlight;--highcontrast-close-button-icon-color-focus: Highlight;--highcontrast-close-button-background-color-default: ButtonFace;--highcontrast-close-button-focus-indicator-color: ButtonText}:host(:focus-visible):after{forced-color-adjust:none;margin:var(--luzmo-close-button-focus-indicator-gap, var(--close-button-focus-indicator-gap));transition:opacity var(--luzmo-close-button-animation-duration, var(--close-button-animation-duration)) ease-out,margin var(--luzmo-close-button-animation-duraction, var(--close-button-animation-duration)) ease-out}:host([static-color=black]){--highcontrast-close-button-static-background-color-default: ButtonFace;--highcontrast-close-button-icon-color-default: Highlight;--highcontrast-close-button-icon-color-disabled: GrayText}:host([static-color=white]){--highcontrast-close-button-static-background-color-default: ButtonFace;--highcontrast-close-button-icon-color-default: Highlight;--highcontrast-close-button-icon-color-disabled: Highlight}}:host{block-size:var(--luzmo-close-button-height, var(--close-button-size));inline-size:var(--luzmo-close-button-width, var(--close-button-size));font-size:var(--luzmo-close-button-icon-size, var(--close-button-icon-size));color:inherit;border-radius:var(--luzmo-close-button-border-radius, var(--close-button-size));transition:border-color var(--luzmo-close-button-animation-duration, var(--close-button-animation-duration)) ease-in-out;margin-inline:var(--luzmo-close-button-margin-inline);justify-content:center;align-items:center;align-self:var(--luzmo-close-button-align-self);border-width:0;border-color:#0000;flex-direction:row;margin-block-start:var(--luzmo-close-button-margin-top);padding:0;display:inline-flex;position:relative}:host:after{pointer-events:none;content:"";margin:calc(var(--luzmo-close-button-focus-indicator-gap, var(--close-button-focus-indicator-gap)) * -1);border-radius:calc(var(--luzmo-close-button-size, var(--close-button-size)) + var(--luzmo-close-button-focus-indicator-gap, var(--close-button-focus-indicator-gap)));transition:box-shadow var(--luzmo-close-button-animation-duration, var(--close-button-animation-duration)) ease-in-out;position:absolute;inset-block:0;inset-inline:0}:host(:focus-visible){box-shadow:none;outline:none}:host(:focus-visible):after{box-shadow:0 0 0 var(--luzmo-close-button-focus-indicator-thickness, var(--close-button-focus-indicator-thickness)) var(--highcontrast-close-button-focus-indicator-color, var(--luzmo-close-button-focus-indicator-color, var(--close-button-focus-indicator-color)))}:host(:not([disabled])){background-color:var(--highcontrast-close-button-background-color-default, var(--luzmo-close-button-background-color-default, var(--close-button-background-color-default)))}:host(:not([disabled]):is(:active,[active])){background-color:var(--luzmo-close-button-background-color-down, var(--close-button-background-color-down))}:host(:not([disabled]):is(:active,[active])) .icon{color:var(--highcontrast-close-button-icon-color-down, var(--luzmo-close-button-icon-color-down, var(--close-button-icon-color-down)))}:host([focused]:not([disabled])),:host(:not([disabled]):focus-visible){background-color:var(--luzmo-close-button-background-color-focus, var(--close-button-background-color-focus))}:host([focused]:not([disabled])) .icon,:host(:not([disabled]):focus-visible) .icon{color:var(--highcontrast-close-button-icon-color-focus, var(--luzmo-close-button-icon-color-focus, var(--close-button-icon-color-focus)))}:host(:not([disabled])) .icon{color:var(--luzmo-close-button-icon-color-default, var(--close-button-icon-color-default))}:host([focused]:not([disabled])) .icon,:host(:not([disabled]):focus) .icon{color:var(--highcontrast-close-button-icon-color-focus, var(--luzmo-close-button-icon-color-focus, var(--close-button-icon-color-focus)))}:host([disabled]){background-color:var(--luzmo-close-button-background-color-default, var(--close-button-background-color-default))}:host([disabled]) .icon{color:var(--highcontrast-close-button-icon-color-disabled, var(--luzmo-close-button-icon-color-disabled, var(--close-button-icon-color-disabled)))}:host([static-color=black]:not([disabled])),:host([static-color=white]:not([disabled])){background-color:var(--highcontrast-close-button-static-background-color-default, var(--luzmo-close-button-static-background-color-default, var(--close-button-static-background-color-default)))}@media (hover: hover){:host(:not([disabled]):hover){--luzmo-icon-color: var( --luzmo-close-button-icon-color-hover, var(--close-button-icon-color-hover) );background-color:var(--luzmo-close-button-background-color-hover, var(--close-button-background-color-hover))}:host(:not([disabled]):hover) .icon{color:var(--highcontrast-close-button-icon-color-hover, var(--luzmo-close-button-icon-color-hover, var(--close-button-icon-color-hover)))}:host([static-color=black]:not([disabled]):hover),:host([static-color=white]:not([disabled]):hover){background-color:var(--highcontrast-close-button-static-background-color-hover, var(--luzmo-close-button-static-background-color-hover, var(--close-button-static-background-color-hover)))}:host([static-color=black]:not([disabled]):hover) .icon,:host([static-color=white]:not([disabled]):hover) .icon{color:var(--highcontrast-close-button-icon-color-default, var(--luzmo-close-button-icon-color-default, var(--close-button-icon-color-default)))}}:host([static-color=black]:not([disabled]):is(:active,[active])),:host([static-color=white]:not([disabled]):is(:active,[active])){background-color:var(--highcontrast-close-button-static-background-color-down, var(--luzmo-close-button-static-background-color-down, var(--close-button-static-background-color-down)))}:host([static-color=black]:not([disabled]):is(:active,[active])) .icon,:host([static-color=white]:not([disabled]):is(:active,[active])) .icon{color:var(--highcontrast-close-button-icon-color-default, var(--luzmo-close-button-icon-color-default, var(--close-button-icon-color-default)))}:host([static-color=black][focused]:not([disabled])),:host([static-color=black]:not([disabled]):focus-visible),:host([static-color=white][focused]:not([disabled])),:host([static-color=white]:not([disabled]):focus-visible){background-color:var(--highcontrast-close-button-static-background-color-focus, var(--luzmo-close-button-static-background-color-focus, var(--close-button-static-background-color-focus)))}:host([static-color=black][focused]:not([disabled])) .icon,:host([static-color=black]:not([disabled]):focus) .icon,:host([static-color=black]:not([disabled]):focus-visible) .icon,:host([static-color=white][focused]:not([disabled])) .icon,:host([static-color=white]:not([disabled]):focus) .icon,:host([static-color=white]:not([disabled]):focus-visible) .icon{color:var(--highcontrast-close-button-icon-color-default, var(--luzmo-close-button-icon-color-default, var(--close-button-icon-color-default)))}:host([static-color=black]:not([disabled])) .icon,:host([static-color=white]:not([disabled])) .icon{color:var(--luzmo-close-button-icon-color-default, var(--close-button-icon-color-default))}:host([static-color=black][disabled]) .icon,:host([static-color=white][disabled]) .icon{color:var(--highcontrast-close-button-icon-disabled, var(--luzmo-close-button-icon-color-disabled, var(--close-button-icon-color-disabled)))}.icon{margin:0}:host{--close-button-background-color-default: transparent;--close-button-background-color-hover: var(--luzmo-background-color-hover);--close-button-background-color-down: var(--luzmo-background-color-down);--close-button-background-color-focus: var(--luzmo-background-color-focus);--close-button-icon-color-default: var(--luzmo-font-color);--close-button-icon-color-hover: var(--luzmo-font-color-hover);--close-button-icon-color-down: var(--luzmo-font-color-down);--close-button-icon-color-focus: var(--luzmo-font-color-focus);--close-button-icon-color-disabled: var(--luzmo-color-disabled);--close-button-focus-indicator-thickness: var(--luzmo-indicator-width);--close-button-focus-indicator-gap: var(--luzmo-indicator-gap);--close-button-focus-indicator-color: var(--luzmo-indicator-color);--close-button-animation-duration: var(--luzmo-animation-duration);--close-button-size: var(--luzmo-component-height)}:host([static-color=white]){--close-button-static-background-color-default: transparent;--close-button-static-background-color-hover: rgba(255, 255, 255, .2);--close-button-static-background-color-down: rgba(255, 255, 255, .4);--close-button-static-background-color-focus: rgba(255, 255, 255, .2);--close-button-icon-color-default: rgb(255, 255, 255);--close-button-icon-color-disabled: rgba(255, 255, 255, .2);--close-button-focus-indicator-color: rgb(255, 255, 255)}:host([static-color=black]){--close-button-static-background-color-default: transparent;--close-button-static-background-color-hover: rgba(0, 0, 0, .2);--close-button-static-background-color-down: rgba(0, 0, 0, .4);--close-button-static-background-color-focus: rgba(0, 0, 0, .2);--close-button-icon-color-default: rgb(0, 0, 0);--close-button-icon-color-disabled: rgba(0, 0, 0, .2);--close-button-focus-indicator-color: rgb(0, 0, 0)}:host([size=s]){--close-button-size: var(--luzmo-component-height-s);--close-button-icon-size: var(--luzmo-font-size-s)}:host{--close-button-size: var(--luzmo-component-height);--close-button-icon-size: var(--luzmo-font-size)}:host([size=l]){--close-button-size: var(--luzmo-component-height-l);--close-button-icon-size: var(--luzmo-font-size-l)}:host([size=xl]){--close-button-size: var(--luzmo-component-height-xl);--close-button-icon-size: var(--luzmo-font-size-xl)}';var v=Object.defineProperty,u=(o,c,a,f)=>{for(var t=void 0,l=o.length-1,s;l>=0;l--)(s=o[l])&&(t=s(c,a,t)||t);return t&&v(c,a,t),t};const g=o=>{const c=o==="s"?n.luzmoClose12:o==="l"?n.luzmoClose16:n.luzmoClose14;return i.html` <div class="icon" slot="icon">${n.luzmoIcon(c)}</div> `};class r extends b.SizedMixin(d.ButtonBase,{noDefaultSize:!0}){constructor(){super(...arguments),this.variant=""}static get styles(){return[...super.styles,i.unsafeCSS(h)]}get buttonContent(){return[g(this.size)]}}u([e.n({reflect:!0})],r.prototype,"variant");u([e.n({reflect:!0,attribute:"static-color"})],r.prototype,"staticColor");exports.LuzmoCloseButton=r;
|
package/lib/color-area/index.cjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("lit"),a=require("../base-BCmA9Wxv.cjs"),f=require("../query-BL-TJj7K.cjs"),b=require("../if-defined-Cv6xanXh.cjs");require("../color-handle/index.cjs");const v=require("../platform-CQzYNWKq.cjs"),w=require("../color-DphK4hwx.cjs"),g=require("../streaming-listener-Bw4jE33f.cjs"),C="@media (forced-colors: active){:host{--highcontrast-color-area-border-color-disabled: GrayText;--highcontrast-color-area-border-color: Canvas;--highcontrast-color-area-fill-color-disabled: Canvas}.gradient,:host([disabled]){forced-color-adjust:none}}:host{cursor:default;-webkit-user-select:none;user-select:none;min-inline-size:var(--luzmo-color-area-min-width, 64px);min-block-size:var(--luzmo-color-area-min-height, 64px);inline-size:var(--luzmo-color-area-width, 192px);block-size:var(--luzmo-color-area-height, 192px);box-sizing:border-box;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color, var(--luzmo-color-area-border-color, var(--luzmo-border-color)));display:inline-block;position:relative}:host([focused]){z-index:1}:host([disabled]){pointer-events:none;background:var(--highcontrast-color-area-fill-color-disabled, var(--luzmo-color-area-disabled-background-color, var(--luzmo-dimmed-color)));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color-disabled)}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width, 192px) - var(--luzmo-border-width)));inset-block-start:0}.handle:dir(rtl),:host([dir=rtl]) .handle{inset-inline-end:0}.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s))}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--luzmo-color-area-default-width))}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}";var x=Object.defineProperty,$=Object.getOwnPropertyDescriptor,s=(p,e,t,r)=>{for(var o=r>1?void 0:r?$(e,t):e,n=p.length-1,l;n>=0;n--)(l=p[n])&&(o=(r?l(e,t,o):l(o))||o);return r&&o&&x(e,t,o),o};class i extends a.LuzmoElement{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.labelX="saturation",this.labelY="luminosity",this.isLTR=!0,this.languageResolver=new g.LanguageResolutionController(this),this.colorController=new w.ColorController(this,{extractColorFromState:()=>({h:this.hue,s:this.x,v:this.y}),applyColorToState:({s:e,v:t})=>{this._x=e,this._y=t,this.requestUpdate()}}),this.activeAxis="x",this._x=1,this._y=1,this.step=.01,this.altered=0,this.activeKeys=new Set,this._valueChanged=!1,this._pointerDown=!1}static get styles(){return[m.unsafeCSS(C)]}get hue(){return this.colorController.hue}set hue(e){this.colorController.hue=e}get value(){return this.colorController.color}get color(){return this.colorController.color}set color(e){this.colorController.color=e}get x(){return this._x}set x(e){if(e===this.x)return;const t=this.x;this._x=e,this.inputX&&(this.inputX.value=e.toString(),this._x=this.inputX.valueAsNumber),this.requestUpdate("x",t),this.colorController.applyColorFromState()}get y(){return this._y}set y(e){if(e===this.y)return;const t=this.y;this._y=e,this.inputY&&(this.inputY.value=e.toString(),this._y=this.inputY.valueAsNumber),this.requestUpdate("y",t),this.colorController.applyColorFromState()}focus(e={}){super.focus(e),this.forwardFocus()}forwardFocus(){this.activeAxis==="x"?this.inputX.focus():this.inputY.focus()}handleFocus(){this.focused=!0,this._valueChanged=!1}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1,this._valueChanged=!1)}handleKeydown(e){const{code:t}=e;this.focused=!0,this.altered=[e.shiftKey,e.ctrlKey,e.altKey].filter(o=>!!o).length,(t.search("Arrow")===0||t.search("Page")===0||t.search("Home")===0||t.search("End")===0)&&(e.preventDefault(),this.activeKeys.add(t),this.handleKeypress())}handleKeypress(){let e=0,t=0;const r=Math.max(this.step,this.altered*5*this.step);this.activeKeys.forEach(o=>{switch(o){case"ArrowUp":{t=r;break}case"ArrowDown":{t=r*-1;break}case"ArrowLeft":{e=this.step*(this.isLTR?-1:1);break}case"ArrowRight":{e=this.step*(this.isLTR?1:-1);break}case"PageUp":{t=r*10;break}case"PageDown":{t=r*-10;break}case"Home":{e=r*(this.isLTR?-10:10);break}case"End":{e=r*(this.isLTR?10:-10);break}}}),e!==0?(this.activeAxis="x",this.inputX.focus()):t!==0&&(this.activeAxis="y",this.inputY.focus()),this.x=Math.min(1,Math.max(this.x+e,0)),this.y=Math.min(1,Math.max(this.y+t,0)),this.colorController.savePreviousColor(),this.colorController.applyColorFromState(),(e!==0||t!==0)&&(this._valueChanged=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor())}handleKeyup(e){e.preventDefault();const{code:t}=e;this.activeKeys.delete(t)}handleInput(e){const{valueAsNumber:t,name:r}=e.target;this[r]=t,this.colorController.applyColorFromState()}handleChange(e){this.handleInput(e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerdown(e){if(e.button!==0){e.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),e.target.setPointerCapture(e.pointerId),e.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(e){const[t,r]=this.calculateHandlePosition(e);this._valueChanged=!1,this.x=t,this.y=1-r,this.colorController.applyColorFromState(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(e){e.preventDefault(),this._pointerDown=!1,e.target.releasePointerCapture(e.pointerId);const t=this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}));this.inputX.focus(),e.pointerType==="mouse"&&(this.focused=!1),t||this.colorController.restorePreviousColor()}calculateHandlePosition(e){if(!this.boundingClientRect)return[this.x,this.y];const t=this.boundingClientRect,r=t.left,o=t.top,n=e.clientX,l=e.clientY,h=t.width,d=t.height,u=Math.max(0,Math.min(1,(n-r)/h)),c=Math.max(0,Math.min(1,(l-o)/d));return[this.isLTR?u:1-u,c]}handleAreaPointerdown(e){e.button===0&&(e.stopPropagation(),e.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",e)),this.handlePointermove(e))}render(){const{width:e=0,height:t=0}=this.boundingClientRect||{},r=v.isAndroid()||v.isIOS(),n="Color Picker",l=b.o(r?void 0:"2d slider"),h=this.labelX,d=this.labelY,u=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.x),c=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.y),y=`linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`;return m.html`
|
|
19
|
-
<div
|
|
20
|
-
@pointerdown=${this.handleAreaPointerdown}
|
|
21
|
-
class="gradient"
|
|
22
|
-
style="background: ${y}"
|
|
23
|
-
>
|
|
24
|
-
<slot name="gradient"></slot>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<luzmo-color-handle
|
|
28
|
-
tabindex=${b.o(this.focused?void 0:"0")}
|
|
29
|
-
@focus=${this.forwardFocus}
|
|
30
|
-
?focused=${this.focused}
|
|
31
|
-
class="handle"
|
|
32
|
-
color=${this.colorController.getHslString()}
|
|
33
|
-
?disabled=${this.disabled}
|
|
34
|
-
style=${`transform: translate(${(this.isLTR?this.x:1-this.x)*e}px, ${t-this.y*t}px);`}
|
|
35
|
-
${g.streamingListener({start:["pointerdown",this.handlePointerdown],streamInside:["pointermove",this.handlePointermove],end:[["pointerup","pointercancel","pointerleave"],this.handlePointerup]})}
|
|
36
|
-
></luzmo-color-handle>
|
|
37
|
-
|
|
38
|
-
<fieldset
|
|
39
|
-
class="fieldset"
|
|
40
|
-
aria-label=${b.o(r?n:void 0)}
|
|
41
|
-
>
|
|
42
|
-
<div role="presentation">
|
|
43
|
-
<input
|
|
44
|
-
type="range"
|
|
45
|
-
class="slider"
|
|
46
|
-
name="x"
|
|
47
|
-
aria-label=${r?h:`${h} ${n}`}
|
|
48
|
-
aria-roledescription=${l}
|
|
49
|
-
aria-orientation="horizontal"
|
|
50
|
-
aria-valuetext=${r?u:`${u}, ${h}${this._valueChanged?"":`, ${c}, ${d}`}`}
|
|
51
|
-
min="0"
|
|
52
|
-
max="1"
|
|
53
|
-
step=${this.step}
|
|
54
|
-
tabindex="-1"
|
|
55
|
-
.value=${String(this.x)}
|
|
56
|
-
@input=${this.handleInput}
|
|
57
|
-
@change=${this.handleChange}
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
<div role="presentation">
|
|
61
|
-
<input
|
|
62
|
-
type="range"
|
|
63
|
-
class="slider"
|
|
64
|
-
name="y"
|
|
65
|
-
aria-label=${r?d:`${d} ${n}`}
|
|
66
|
-
aria-roledescription=${l}
|
|
67
|
-
aria-orientation="vertical"
|
|
68
|
-
aria-valuetext=${r?c:`${c}, ${d}${this._valueChanged?"":`, ${u}, ${h}`}`}
|
|
69
|
-
orient="vertical"
|
|
70
|
-
min="0"
|
|
71
|
-
max="1"
|
|
72
|
-
step=${this.step}
|
|
73
|
-
tabindex="-1"
|
|
74
|
-
.value=${String(this.y)}
|
|
75
|
-
@input=${this.handleInput}
|
|
76
|
-
@change=${this.handleChange}
|
|
77
|
-
/>
|
|
78
|
-
</div>
|
|
79
|
-
</fieldset>
|
|
80
|
-
`}firstUpdated(e){super.firstUpdated(e),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur),this.addEventListener("keyup",this.handleKeyup),this.addEventListener("keydown",this.handleKeydown)}updated(e){if(super.updated(e),this.x!==this.inputX.valueAsNumber&&(this._x=this.inputX.valueAsNumber),this.y!==this.inputY.valueAsNumber&&(this._y=this.inputY.valueAsNumber),e.has("focused")&&this.focused){const t=this.inputX.parentElement,r=this.inputY.parentElement;if(!t.shadowRoot&&!r.shadowRoot){t.attachShadow({mode:"open"}),r.attachShadow({mode:"open"});const o='<div tabindex="-1"><slot></slot></div>';t.shadowRoot.innerHTML=o,r.shadowRoot.innerHTML=o}}}connectedCallback(){var e;super.connectedCallback(),!this.observer&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(t=>{for(const r of t)this.boundingClientRect=r.contentRect;this.requestUpdate()})),(e=this.observer)==null||e.observe(this)}disconnectedCallback(){var e;(e=this.observer)==null||e.unobserve(this),super.disconnectedCallback()}}s([a.n({type:String,reflect:!0})],i.prototype,"dir",2);s([a.n({type:Boolean,reflect:!0})],i.prototype,"disabled",2);s([a.n({type:Boolean,reflect:!0})],i.prototype,"focused",2);s([a.n({type:String,attribute:"label-x"})],i.prototype,"labelX",2);s([a.n({type:String,attribute:"label-y"})],i.prototype,"labelY",2);s([a.n({type:Boolean,attribute:"is-ltr"})],i.prototype,"isLTR",2);s([f.e(".handle")],i.prototype,"handle",2);s([a.n({type:Number})],i.prototype,"hue",1);s([a.n({type:String})],i.prototype,"value",1);s([a.n({type:String})],i.prototype,"color",1);s([a.n({attribute:!1})],i.prototype,"activeAxis",2);s([a.n({type:Number})],i.prototype,"x",1);s([a.n({type:Number})],i.prototype,"y",1);s([a.n({type:Number})],i.prototype,"step",2);s([f.e('[name="x"]')],i.prototype,"inputX",2);s([f.e('[name="y"]')],i.prototype,"inputY",2);customElements.get("luzmo-color-area")||customElements.define("luzmo-color-area",i);exports.LuzmoColorArea=i;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lit"),a=require("../base-BCmA9Wxv.cjs"),h=require("../text-field-C6Aa7XOb.cjs"),u=require("../index-DCKCHDTt.cjs");var c=Object.defineProperty,d=(i,e,l,v)=>{for(var t=void 0,o=i.length-1,n;o>=0;o--)(n=i[o])&&(t=n(e,l,t)||t);return t&&c(e,l,t),t};class s extends h.LuzmoTextFieldBase{constructor(){super(...arguments),this.viewColor=!1,this._value="",this.cachedColor=null,this.cachedTinyColor=null}static get styles(){return[...super.styles]}set value(e){if(e===this.value)return;const l=this._value;this._value=e,this.requestUpdate("value",l)}get value(){return this._value}getColorValue(){if(!this.value)return"";if(!this.cachedColor||this.cachedColor!==this.value){const e=new u.TinyColor(this.value);this.cachedColor=e.isValid?e.toRgbString():""}return this.cachedColor}renderColorHandle(){return this.viewColor?r.html`
|
|
19
|
-
<luzmo-color-handle
|
|
20
|
-
size="m"
|
|
21
|
-
color=${this.getColorValue()}
|
|
22
|
-
></luzmo-color-handle>
|
|
23
|
-
`:r.html``}render(){return this.viewColor&&Promise.resolve().then(()=>require("../color-handle/index.cjs")),r.html` ${super.render()} ${this.renderColorHandle()} `}checkValidity(){let e=super.checkValidity();return this.value&&((!this.cachedTinyColor||this.cachedTinyColor.originalInput!==this.value)&&(this.cachedTinyColor=new u.TinyColor(this.value)),this.valid=e=this.cachedTinyColor.isValid,this.invalid=!e),e}}d([a.n({type:Boolean,attribute:"view-color"})],s.prototype,"viewColor");customElements.get("luzmo-color-field")||customElements.define("luzmo-color-field",s);exports.LuzmoColorField=s;
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../color-loupe-BICpNqFs.cjs");const l=require("../base-BCmA9Wxv.cjs"),c=require("lit"),u=':host{touch-action:none;transition:inline-size var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),block-size var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),border-width var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),margin-inline var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),margin-block var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out)}:host{background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2);background-position:50%}:host(:focus){outline:none}:host{z-index:1;box-sizing:border-box;inline-size:var(--luzmo-color-handle-size, 16px);block-size:var(--luzmo-color-handle-size, 16px);margin-inline:calc(var(--luzmo-color-handle-size, 16px) / 2 * -1);margin-block:calc(var(--luzmo-color-handle-size, 16px) / 2 * -1);border-width:var(--luzmo-color-handle-border-width, 2px);border-color:var(--luzmo-color-handle-border-color, rgb(255, 255, 255));box-shadow:0 0 0 var(--luzmo-color-handle-outer-border-width, 1px) var(--luzmo-color-handle-outer-border-color, rgba(0, 0, 0, .42));transition:all var(--luzmo-color-handle-animation-duration, 0) var(--luzmo-color-handle-animation-easing, ease-in-out);border-style:solid}:host,:host:after{border-radius:100%;display:block;position:absolute}:host:after{content:"";inset-inline:calc(50% - var(--luzmo-color-handle-hitarea-size, 24px) / 2);inset-block:calc(50% - var(--luzmo-color-handle-hitarea-size, 24px) / 2);inline-size:var(--luzmo-color-handle-hitarea-size, 24px);block-size:var(--luzmo-color-handle-hitarea-size, 24px);border-radius:var(--luzmo-color-handle-hitarea-border-radius, 100%)}:host([focused]),:host(:focus-visible){inline-size:var(--luzmo-color-handle-focused-size, 32px);block-size:var(--luzmo-color-handle-focused-size, 32px);margin-inline:calc(var(--luzmo-color-handle-size, 16px) * -1);margin-block:calc(var(--luzmo-color-handle-size, 16px) * -1);outline:none}:host([disabled]){pointer-events:none;border-color:var(--highcontrast-color-handle-border-color-disabled, var(--luzmo-color-handle-border-color-disabled, var(--luzmo-font-color-disabled)));background:var(--highcontrast-color-handle-fill-color-disabled, var(--luzmo-color-handle-fill-color-disabled, var(--luzmo-font-color-disabled)));box-shadow:none}:host([disabled]) .inner{display:none}.inner{inline-size:100%;block-size:100%;box-shadow:inset 0 0 0 var(--luzmo-color-handle-inner-border-width, var(--luzmo-border-width)) var(--luzmo-color-handle-inner-border-color, rgba(0, 0, 0, .42));background-color:var(--luzmo-picked-color);border-radius:100%}@media (forced-colors: active){:host{forced-color-adjust:none}:host([disabled]){--highcontrast-color-handle-border-color-disabled: GrayText;--highcontrast-color-handle-fill-color-disabled: Canvas}}';var h=Object.defineProperty,a=(t,o,s,m)=>{for(var r=void 0,n=t.length-1,d;n>=0;n--)(d=t[n])&&(r=d(o,s,r)||r);return r&&h(o,s,r),r};const i=class i extends l.LuzmoElement{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.open=!1,this.color="rgba(255, 0, 0, 0.5)"}handlePointerdown(o){o.pointerType==="touch"&&(this.open=!0),this.setPointerCapture(o.pointerId)}handlePointerup(o){this.open=!1,this.releasePointerCapture(o.pointerId)}render(){return c.html`
|
|
19
|
-
<div class="inner" style="background-color: ${this.color}"></div>
|
|
20
|
-
<luzmo-color-loupe
|
|
21
|
-
color=${this.color}
|
|
22
|
-
?open=${this.open&&!this.disabled}
|
|
23
|
-
></luzmo-color-loupe>
|
|
24
|
-
`}firstUpdated(o){super.firstUpdated(o),this.addEventListener("pointerdown",this.handlePointerdown),this.addEventListener("pointerup",this.handlePointerup),this.addEventListener("pointercancel",this.handlePointerup)}};i.styles=c.unsafeCSS(u);let e=i;a([l.n({type:Boolean,reflect:!0})],e.prototype,"disabled");a([l.n({type:Boolean,reflect:!0})],e.prototype,"focused");a([l.n({type:Boolean,reflect:!0})],e.prototype,"open");a([l.n({type:String})],e.prototype,"color");customElements.get("luzmo-color-handle")||customElements.define("luzmo-color-handle",e);exports.LuzmoColorHandle=e;
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
"use strict";const l=require("./base-BCmA9Wxv.cjs"),u=require("lit"),n=':host{inline-size:var(--luzmo-color-loupe-width, 48px);block-size:var(--luzmo-color-loupe-height, 64px);transform:translateY(var(--luzmo-color-loupe-animation-distance, 8px));opacity:0;transform-origin:bottom;pointer-events:none;filter:drop-shadow(var(--luzmo-color-loupe-drop-shadow-x, 0) var(--luzmo-color-loupe-drop-shadow-y, 2px) var(--luzmo-color-loupe-drop-shadow-blur, 8px) var(--luzmo-color-loupe-drop-shadow-color, rgba(0, 0, 0, .25)));transition:transform .1s ease-in-out,opacity .125s ease-in-out;position:absolute;inset-block-end:calc(var(--luzmo-color-handle-size, 16px) - var(--luzmo-color-handle-outer-border-width, 1px) + var(--luzmo-color-loupe-offset, 12px));inset-inline-end:calc(50% - var(--luzmo-color-loupe-width, 48px) / 2)}:host:dir(rtl),:host([dir=rtl]){inset-inline-end:calc(50% - var(--luzmo-color-loupe-width, 48px) / 2 - 1px)}:host([open]){opacity:1;transform:translate(0)}.luzmo-color-loupe-inner-border{fill:var(--luzmo-picked-color);stroke:var(--luzmo-color-loupe-inner-border-color, rgba(0, 0, 0, .1));stroke-width:var(--luzmo-color-loupe-inner-border-width, 1px)}.luzmo-color-loupe-outer-border{fill:none;stroke:var(--luzmo-color-loupe-outer-border-color, white);stroke-width:calc(var(--luzmo-color-loupe-outer-border-width, 2px) + 2px);transform:translate(calc((var(--luzmo-color-loupe-outer-border-width, 2px) + 2px) / 2))}.luzmo-color-loupe-checkerboard-pattern{fill:var(--luzmo-color-loupe-checkerboard-dark-color, rgb(230, 230, 230))}.luzmo-color-loupe-checkerboard-background{fill:var(--luzmo-color-loupe-checkerboard-light-color, rgb(255, 255, 255))}.luzmo-color-loupe-checkerboard-fill{fill:var(--luzmo-color-loupe-checkerboard-fill, url(#checkerboard-primary))}@media (forced-colors: active){:host{--highcontrast-colorloupe-outer-border-color: CanvasText}}svg{width:inherit;height:inherit}.loupe-clipped{clip-path:path("M23 61.575C19.0044 57.435 15.2591 53.0606 11.784 48.475C8.68949 44.4532 5.96348 40.1608 3.639 35.65C1.224 30.8 0 26.549 0 23C0.00319993 17.6937 1.84059 12.5516 5.20091 8.44488C8.56122 4.33815 13.2378 1.51928 18.4385 0.465803C23.6392 -0.587678 29.0442 0.189006 33.7378 2.66428C38.4314 5.13955 42.125 9.16122 44.193 14.048C45.3915 16.88 46.0061 19.9248 46 23C46 26.551 44.774 30.811 42.355 35.661C40.0274 40.1747 37.298 44.4698 34.2 48.494C30.7297 53.0728 26.9898 57.4409 23 61.575ZZ")}.opacity-checkerboard{position:absolute;top:2px;left:2px;block-size:100%;inline-size:100%}.opacity-checkerboard{background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}';var d=Object.defineProperty,s=(a,c,i,h)=>{for(var o=void 0,e=a.length-1,p;e>=0;e--)(p=a[e])&&(o=p(c,i,o)||o);return o&&d(c,i,o),o};const t=class t extends l.LuzmoElement{constructor(){super(...arguments),this.open=!1,this.color="rgba(255, 0, 0, 0.5)"}render(){return u.html`
|
|
19
|
-
<div class="opacity-checkerboard loupe-clipped"></div>
|
|
20
|
-
<div class="luzmo-color-loupe-inner-border loupe-clipped"></div>
|
|
21
|
-
<div class="luzmo-color-loupe-outer-border loupe-clipped"></div>
|
|
22
|
-
<svg
|
|
23
|
-
aria-hidden="true"
|
|
24
|
-
class="luzmo-color-loupe is-open"
|
|
25
|
-
overflow="visible"
|
|
26
|
-
style="--luzmo-picked-color: ${this.color}; position: absolute;"
|
|
27
|
-
>
|
|
28
|
-
<defs>
|
|
29
|
-
<path
|
|
30
|
-
id="loupe-path"
|
|
31
|
-
d="M23 61.575C19.0044 57.435 15.2591 53.0606 11.784 48.475C8.68949 44.4532 5.96348 40.1608 3.639 35.65C1.224 30.8 0 26.549 0 23C0.00319993 17.6937 1.84059 12.5516 5.20091 8.44488C8.56122 4.33815 13.2378 1.51928 18.4385 0.465803C23.6392 -0.587678 29.0442 0.189006 33.7378 2.66428C38.4314 5.13955 42.125 9.16122 44.193 14.048C45.3915 16.88 46.0061 19.9248 46 23C46 26.551 44.774 30.811 42.355 35.661C40.0274 40.1747 37.298 44.4698 34.2 48.494C30.7297 53.0728 26.9898 57.4409 23 61.575ZZ"
|
|
32
|
-
transform="translate(2, 2)"
|
|
33
|
-
/>
|
|
34
|
-
<mask id="loupe-mask">
|
|
35
|
-
<rect x="0" y="0" height="100" width="100" fill="white" />
|
|
36
|
-
<use xlink:href="#path" fill="black" />
|
|
37
|
-
</mask>
|
|
38
|
-
</defs>
|
|
39
|
-
|
|
40
|
-
<g class="luzmo-color-loupe-loupe">
|
|
41
|
-
<g>
|
|
42
|
-
<use
|
|
43
|
-
xlink:href="#loupe-path"
|
|
44
|
-
mask="url(#loupe-mask)"
|
|
45
|
-
transform="translate(2, 2)"
|
|
46
|
-
class="luzmo-color-loupe-inner-border"
|
|
47
|
-
/>
|
|
48
|
-
<use
|
|
49
|
-
xlink:href="#loupe-path"
|
|
50
|
-
mask="url(#loupe-mask)"
|
|
51
|
-
class="luzmo-color-loupe-outer-border"
|
|
52
|
-
/>
|
|
53
|
-
</g>
|
|
54
|
-
</g>
|
|
55
|
-
</svg>
|
|
56
|
-
`}};t.styles=u.unsafeCSS(n);let r=t;s([l.n({type:Boolean,reflect:!0})],r.prototype,"open");s([l.n({type:String})],r.prototype,"color");exports.LuzmoColorLoupe=r;
|
package/lib/color-menu/index.cjs
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@luzmo/icons"),h=require("../base-BCmA9Wxv.cjs"),g=require("../sized-mixin-BSYHt8nT.cjs"),n=require("lit"),z=require("../state-DReJ3hB6.cjs"),s=require("../query-BL-TJj7K.cjs");require("../divider/index.cjs");require("../popover/index.cjs");require("../swatch/index.cjs");require("../color-area/index.cjs");require("../color-field/index.cjs");require("../color-handle/index.cjs");require("../color-slider/index.cjs");const a=require("../index-DCKCHDTt.cjs"),v='@charset "UTF-8";:host{width:var(--luzmo-color-menu-width, var(--color-menu-width))}.hue-opacity-text-swatches-container{display:flex;gap:var(--luzmo-color-menu-color-controls-vertical-gap, var(--color-menu-color-controls-vertical-gap));flex-direction:column;padding:var(--luzmo-color-menu-hue-opacity-text-swatches-vertical-padding, var(--color-menu-hue-opacity-text-swatches-vertical-padding)) var(--luzmo-color-menu-hue-opacity-text-swatches-horizontal-padding, var(--color-menu-hue-opacity-text-swatches-horizontal-padding))}.swatch-sliders-container{display:flex;gap:var(--luzmo-color-menu-swatch-to-sliders-space, var(--color-menu-swatch-to-sliders-space))}.swatch-example-container{display:flex;align-items:center}.field-container{display:flex;align-items:center;gap:var(--luzmo-color-menu-format-field-to-format-space, var(--color-menu-format-field-to-format-space))}.format-container{text-transform:uppercase;position:relative;background:none;border:none;outline:none;height:var(--luzmo-color-menu-format-height, var(--color-menu-format-height));cursor:pointer;font-size:var(--luzmo-color-menu-format-font-size, var(--color-menu-format-font-size));display:flex;align-items:center;color:var(--luzmo-color-menu-format-font-color, var(--color-menu-format-font-color));gap:var(--luzmo-color-menu-format-name-to-icon, var(--color-menu-format-name-to-icon-space));padding:0 var(--luzmo-color-menu-format-horizontal-padding, var(--color-menu-format-horizontal-padding))}.format-container:hover{color:var(--luzmo-color-menu-format-font-color-hover, var(--color-menu-format-font-color-hover))}.format-container:focus-visible{outline:none}.format-container:focus-visible:after{content:"";width:100%;height:100%;position:absolute;box-sizing:border-box;left:0;top:0;border:var(--luzmo-color-menu-format-indicator-width, var(--luzmo-indicator-width)) solid var(--luzmo-color-menu-format-indicator-color, var(--luzmo-indicator-color));border-radius:var(--luzmo-color-menu-format-label-indicator-border-radius, var(--luzmo-border-radius-s))}.format-container:focus-visible,.format-container:active{color:var(--luzmo-color-menu-format-font-color-down, var(--color-menu-format-font-color-down))}.format-container .format-label{-webkit-user-select:none;user-select:none}.format-container .angle-icon{display:flex;align-items:center;height:calc(var(--color-menu-format-font-size) / 1.5)}.slider-container{display:flex;flex-direction:column;justify-content:center;gap:var(--luzmo-color-menu-slider-gap, var(--color-menu-slider-gap))}luzmo-color-area{width:100%;height:var(--luzmo-color-menu-height, var(--color-menu-height))}luzmo-color-slider{width:100%}luzmo-divider{margin:var(--luzmo-spacing-5) à}.swatches-container{display:grid;grid-template-columns:repeat(6,1fr);gap:var(--luzmo-color-menu-swatches-gap, var(--color-menu-swatches-gap))}.swatches-container luzmo-swatch{cursor:pointer}.swatches-container .swatch-choice{display:flex;align-items:center;justify-content:center}:host{--luzmo-text-field-icon-size-valid: 0px;--luzmo-text-field-icon-spacing-inline-end-valid: 1px;--luzmo-text-field-text-align: center}:host{--color-menu-width: 290px;--luzmo-text-field-width: 220px;--luzmo-color-slider-control-track-width: 8px;--color-menu-height: 140px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-5 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-5);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-5);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height);--color-menu-format-font-size: var(--luzmo-font-size-s);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-2);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-3);--color-menu-format-font-color: var(--luzmo-font-color);--color-menu-format-font-color-hover: var(--luzmo-font-color-hover);--color-menu-format-font-color-down: var(--luzmo-font-color-down);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host .swatches-container{--luzmo-swatch-size: 22px}:host([size=s]){--color-menu-width: 260px;--luzmo-text-field-width: 200px;--luzmo-color-slider-control-track-width: 8px;--color-menu-hue-opacity-text-swatches-horizontal-padding: var( --luzmo-spacing-5 );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-4 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-4);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-4);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height-s);--color-menu-format-font-size: var(--luzmo-font-size-xs);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-2);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-2);--color-menu-swatches-gap: var(--luzmo-spacing-3)}:host([size=s]) .swatches-container{--luzmo-swatch-size: 20px}:host([size=l]){--color-menu-width: 350px;--luzmo-text-field-width: 240px;--luzmo-color-slider-control-track-width: 16px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-5 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-5);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-5);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-format-height: var(--luzmo-component-height-l);--color-menu-format-font-size: var(--luzmo-font-size);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-3);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-4);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host([size=l]) .swatches-container{--luzmo-swatch-size: 24px}:host([size=l]) .swatch-example-container{--luzmo-swatch-size: 56px}:host([size=xl]){--color-menu-width: 380px;--luzmo-text-field-width: 280px;--luzmo-color-slider-control-track-width: 16px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-hue-opacity-text-swatches-vertical-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-color-controls-vertical-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-swatch-to-sliders-space: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height-xl);--color-menu-format-font-size: var(--luzmo-font-size-l);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-3);--color-menu-format-field-to-format-space: var(--luzmo-spacing-3);--color-menu-format-horizontal-padding: var(--luzmo-spacing-4);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host([size=xl]) .swatches-container{--luzmo-swatch-size: 26px}:host([size=xl]) .swatch-example-container{--luzmo-swatch-size: 64px}';var f=Object.defineProperty,l=(p,o,t,e)=>{for(var i=void 0,m=p.length-1,d;m>=0;m--)(d=p[m])&&(i=d(o,t,i)||i);return i&&f(o,t,i),i};const u=class u extends g.SizedMixin(h.LuzmoElement){constructor(){super(...arguments),this.color="rgb(255, 0, 0)",this.noAlphaChannel=!1,this._alpha=1,this._rgbColor="rgb(255, 0, 0)",this._rgbaColor="rgb(255, 0, 0, 1)",this._previousColor="rgb(255, 0, 0)"}setColor(o){var e;const t=new a.TinyColor((e=o==null?void 0:o.target)==null?void 0:e.color);this._format=t.format==="name"?"rgb":t.format,this._rgbaColor=t.toRgbString(),this._alpha=this.noAlphaChannel?1:t.getAlpha(),this._rgbColor=t.setAlpha(1).toRgbString(),this.hueSliderElement.color=this._rgbColor,this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this.colorFieldElement.value=this.formatTextField(t),this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleAreaChange(o){o.stopPropagation(),o.preventDefault(),this._rgbColor=this.areaElement.color;const t=new a.TinyColor(this._rgbColor);this._rgbaColor=t.setAlpha(this._alpha).toRgbString(),this.colorFieldElement.value=this._rgbaColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.colorFieldElement.value=this.formatTextField(t),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleHueSliderChange(o){o.stopPropagation(),o.preventDefault();const t=new a.TinyColor(this._rgbColor).toHsl();t.h=this.hueSliderElement.value;const e=new a.TinyColor(t);this._rgbColor=e.toRgbString(),this._rgbaColor=e.setAlpha(this._alpha).toRgbString(),this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.colorFieldElement.value=this.formatTextField(e),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleOpacitySliderChange(o){o.stopPropagation(),o.preventDefault(),this._alpha=this.opacitySliderElement.sliderHandlePosition/100;const t=new a.TinyColor(this._rgbColor).setAlpha(this._alpha);this._rgbaColor=t.toRgbString(),this.colorFieldElement.value=this.formatTextField(t),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleFieldChange(o){if(o.stopPropagation(),o.preventDefault(),this.colorFieldElement.checkValidity()){const t=new a.TinyColor(this.colorFieldElement.value);this._format=t.format,this._rgbaColor=t.toRgbString(),this._alpha=t.getAlpha(),this._rgbColor=t.setAlpha(1).toRgbString(),this.noAlphaChannel&&(this._rgbaColor=this._rgbColor,this._alpha=1),this.hueSliderElement.color=this._rgbColor,this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}}formatTextField(o){return this._format==="hsl"?o.toHslString():this._format==="hex"?this.noAlphaChannel?o.toHexString():o.toHex8String():(this._format==="name"&&(this._format="rgb"),o.toRgbString())}cycleFormat(){const o=["rgb","hsl","hex"];this._format=o[(o.indexOf(this._format)+1)%o.length];const t=new a.TinyColor(this.color),e=this.formatTextField(t);this.colorFieldElement.value=e}updated(o){if(o.has("color")&&this.color!==this._previousColor){this._previousColor=this.color;const t=new a.TinyColor(this.color);this._alpha=t.getAlpha(),this._rgbColor=t.setAlpha(1).toRgbString(),this._rgbaColor=t.setAlpha(this._alpha).toRgbString(),this.areaElement.color=this._rgbColor,this.hueSliderElement.color=this._rgbColor,this.colorFieldElement.value=this._rgbaColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this._format="rgb"}o.has("noAlphaChannel")&&!this.noAlphaChannel&&(this.opacitySliderElement.color=this._rgbaColor)}renderOpacitySlider(){return n.html`
|
|
19
|
-
<luzmo-color-slider
|
|
20
|
-
id="luzmo-opacity-slider"
|
|
21
|
-
mode="opacity"
|
|
22
|
-
@input=${this.handleOpacitySliderChange}
|
|
23
|
-
>
|
|
24
|
-
</luzmo-color-slider>
|
|
25
|
-
`}render(){var o;return n.html`
|
|
26
|
-
<div>
|
|
27
|
-
<luzmo-color-area
|
|
28
|
-
.size=${this.size}
|
|
29
|
-
@input=${this.handleAreaChange}
|
|
30
|
-
></luzmo-color-area>
|
|
31
|
-
<div class="hue-opacity-text-swatches-container">
|
|
32
|
-
<div class="swatch-sliders-container">
|
|
33
|
-
<div class="swatch-example-container">
|
|
34
|
-
<luzmo-swatch
|
|
35
|
-
rounding="full"
|
|
36
|
-
.size=${this.noAlphaChannel&&["s","m"].includes(this.size)?"s":"l"}
|
|
37
|
-
readonly
|
|
38
|
-
></luzmo-swatch>
|
|
39
|
-
</div>
|
|
40
|
-
<div class="slider-container" style="flex-grow: 1;">
|
|
41
|
-
<luzmo-color-slider
|
|
42
|
-
id="luzmo-hue-slider"
|
|
43
|
-
@input=${this.handleHueSliderChange}
|
|
44
|
-
>
|
|
45
|
-
</luzmo-color-slider>
|
|
46
|
-
${this.noAlphaChannel?"":this.renderOpacitySlider()}
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="field-container">
|
|
50
|
-
<luzmo-color-field
|
|
51
|
-
.size=${this.size}
|
|
52
|
-
@input=${this.handleFieldChange}
|
|
53
|
-
>
|
|
54
|
-
</luzmo-color-field>
|
|
55
|
-
<button
|
|
56
|
-
class="format-container"
|
|
57
|
-
aria-label="Color format"
|
|
58
|
-
@click=${this.cycleFormat}
|
|
59
|
-
tabindex="0"
|
|
60
|
-
>
|
|
61
|
-
<div class="format-label">${this._format}</div>
|
|
62
|
-
<div class="change-format-icon">
|
|
63
|
-
<div class="angle-icon">${c.luzmoIcon(c.luzmoAngleUp)}</div>
|
|
64
|
-
<div class="angle-icon">${c.luzmoIcon(c.luzmoAngleDown)}</div>
|
|
65
|
-
</div>
|
|
66
|
-
</button>
|
|
67
|
-
</div>
|
|
68
|
-
${((o=this.swatches)==null?void 0:o.length)>0?n.html`
|
|
69
|
-
<luzmo-divider></luzmo-divider>
|
|
70
|
-
<div class="swatches-container">
|
|
71
|
-
${this.swatches.map(t=>n.html`
|
|
72
|
-
<div class="swatch-choice">
|
|
73
|
-
<luzmo-swatch
|
|
74
|
-
@click=${this.setColor}
|
|
75
|
-
.color=${t}
|
|
76
|
-
.size=${this.size}
|
|
77
|
-
readonly
|
|
78
|
-
>
|
|
79
|
-
</luzmo-swatch>
|
|
80
|
-
</div>
|
|
81
|
-
`)}
|
|
82
|
-
</div>
|
|
83
|
-
`:""}
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
`}};u.styles=n.unsafeCSS(v);let r=u;l([h.n({type:String,reflect:!0})],r.prototype,"color");l([h.n({type:Boolean,reflect:!0,attribute:"no-alpha-channel"})],r.prototype,"noAlphaChannel");l([h.n({type:Array,reflect:!0})],r.prototype,"swatches");l([s.e("luzmo-color-area")],r.prototype,"areaElement");l([s.e("#luzmo-hue-slider")],r.prototype,"hueSliderElement");l([s.e("#luzmo-opacity-slider")],r.prototype,"opacitySliderElement");l([s.e("luzmo-color-field")],r.prototype,"colorFieldElement");l([s.e("luzmo-swatch")],r.prototype,"swatchElement");l([z.r()],r.prototype,"_format");customElements.get("luzmo-color-menu")||customElements.define("luzmo-color-menu",r);exports.LuzmoColorMenu=r;
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../base-BCmA9Wxv.cjs"),c=require("../sized-mixin-BSYHt8nT.cjs"),s=require("lit"),d=require("../state-DReJ3hB6.cjs"),h=require("../query-BL-TJj7K.cjs");require("../overlay/index.cjs");const m=require("../slottable-request-event-BfUUt1Mh.cjs");require("../popover/index.cjs");require("../swatch/index.cjs");require("../color-menu/index.cjs");const v="luzmo-popover{margin-left:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap));margin-right:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap))}luzmo-swatch{cursor:pointer}:host{--luzmo-popover-content-area-spacing-vertical: 0;--color-picker-popover-horizontal-gap: var(--luzmo-spacing-4)}:host([size=s]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-3)}:host([size=l]),:host([size=xl]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-5)}";var g=Object.defineProperty,t=(p,r,n,z)=>{for(var l=void 0,i=p.length-1,u;i>=0;i--)(u=p[i])&&(l=u(r,n,l)||l);return l&&g(r,n,l),l};const a=class a extends c.SizedMixin(o.LuzmoElement){constructor(){super(...arguments),this.color="rgb(255, 0, 0)",this.open=!1,this.disabled=!1,this.placement="left-start",this.rounding="full",this.swatches=[],this.noAlphaChannel=!1,this._renderMenu=!1}overlayCloseEvent(r){this.open=!1}overlayOpenEvent(r){this.open=!0}handleColorChange(r){this.color=this.menuElement.color,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}firstUpdated(r){this.overlayElement.addEventListener("slottable-request",n=>{this._renderMenu=n.data!==m.removeSlottableRequest})}updated(r){r.has("open")&&this.open===!0&&(this._renderMenu=!0)}renderColorMenu(){return s.html`
|
|
19
|
-
<luzmo-color-menu
|
|
20
|
-
.size=${this.size}
|
|
21
|
-
.color=${this.color}
|
|
22
|
-
.noAlphaChannel=${this.noAlphaChannel}
|
|
23
|
-
.swatches=${this.swatches}
|
|
24
|
-
@change=${this.handleColorChange}
|
|
25
|
-
></luzmo-color-menu>
|
|
26
|
-
`}render(){return s.html`
|
|
27
|
-
<luzmo-swatch
|
|
28
|
-
id="trigger"
|
|
29
|
-
.shape=${this.shape}
|
|
30
|
-
.rounding=${this.rounding}
|
|
31
|
-
.size=${this.size}
|
|
32
|
-
.color=${this.color}
|
|
33
|
-
.selected=${this.open&&!this.disabled}
|
|
34
|
-
?disabled=${this.disabled}
|
|
35
|
-
@luzmo-closed=${this.overlayCloseEvent}
|
|
36
|
-
@luzmo-opened=${this.overlayOpenEvent}
|
|
37
|
-
></luzmo-swatch>
|
|
38
|
-
<luzmo-overlay
|
|
39
|
-
trigger=${this.disabled?"":"trigger@click"}
|
|
40
|
-
type="auto"
|
|
41
|
-
.placement=${this.placement}
|
|
42
|
-
type="page"
|
|
43
|
-
>
|
|
44
|
-
<luzmo-popover style="position:relative">
|
|
45
|
-
${this._renderMenu?this.renderColorMenu():s.html``}
|
|
46
|
-
</luzmo-popover>
|
|
47
|
-
</luzmo-overlay>
|
|
48
|
-
`}};a.styles=s.unsafeCSS(v);let e=a;t([o.n({type:String,reflect:!0})],e.prototype,"color");t([o.n({type:Boolean,reflect:!0})],e.prototype,"open");t([o.n({type:Boolean,reflect:!0})],e.prototype,"disabled");t([o.n({type:String,reflect:!0})],e.prototype,"placement");t([o.n({type:String,reflect:!0})],e.prototype,"rounding");t([o.n({type:String,reflect:!0})],e.prototype,"shape");t([o.n({type:Array,reflect:!0})],e.prototype,"swatches");t([o.n({type:Boolean,reflect:!0,attribute:"no-alpha-channel"})],e.prototype,"noAlphaChannel");t([h.e("luzmo-color-menu")],e.prototype,"menuElement");t([h.e("luzmo-overlay")],e.prototype,"overlayElement");t([d.r()],e.prototype,"_renderMenu");customElements.get("luzmo-color-picker")||customElements.define("luzmo-color-picker",e);exports.LuzmoColorPicker=e;
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lit"),l=require("../base-BCmA9Wxv.cjs"),b=require("../query-BL-TJj7K.cjs"),d=require("../if-defined-Cv6xanXh.cjs"),m=require("../style-map-BjBGQ_u3.cjs");require("../color-handle/index.cjs");const g=require("../focusable-Dv_6CFaY.cjs"),v=require("../color-DphK4hwx.cjs"),p=require("../streaming-listener-Bw4jE33f.cjs"),h=require("../index-DCKCHDTt.cjs"),f='.opacity-checkerboard{position:absolute;block-size:100%;inline-size:100%;background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}:host{--luzmo-color-slider-gradient-fallback: rgb(255 0 0) 0%, rgb(255 255 0) 17%, rgb(0 255 0) 33%, rgb(0 255 255) 50%, rgb(0 0 255) 67%, rgb(255 0 255) 83%, rgb(255 0 0) 100%;touch-action:none}:host([vertical]) .handle{inset-block-start:unset;inset-block-end:0}:host([vertical]) .slider{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){width:100%;height:100%}@media (forced-colors: active){:host{--highcontrast-color-slider-border-color: CanvasText;--highcontrast-color-slider-border-color-disabled: GrayText;--highcontrast-color-slider-background-color-disabled: Canvas;forced-color-adjust:none}}:host{--luzmo-color-handle-hitarea-border-radius: var( --luzmo-color-slider-handle-hitarea-border-radius, 0px );min-inline-size:var(--luzmo-color-slider-minimum-length, 80px);inline-size:var(--luzmo-color-slider-length, 192px);block-size:var(--luzmo-color-slider-control-track-width, 24px);-webkit-user-select:none;user-select:none;cursor:default;display:block;position:relative}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([disabled]) .gradient{display:none}:host([vertical]){min-block-size:var(--luzmo-color-slider-vertical-minimum-height, var(--luzmo-color-slider-minimum-length, 80px));block-size:var(--luzmo-color-slider-vertical-height, var(--luzmo-color-slider-length, 192px));min-inline-size:0;inline-size:var(--luzmo-color-slider-vertical-control-track-width, var(--luzmo-color-slider-control-track-height, 24px));display:inline-block}:host([vertical]) .handle{inset-inline-start:50%}.handle{inset-block-start:50%;inset-inline-start:0}.checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color, var(--luzmo-color-slider-border-color, var(--luzmo-border-color)) )}.checkerboard:before{content:"";z-index:1;box-shadow:inset 0 0 0 var(--luzmo-color-slider-border-width, var(--luzmo-border-width)) var(--luzmo-color-slider-border-color-local);border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s));position:absolute;top:0;right:0;bottom:0;left:0}:host([disabled]) .checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color-disabled, var(--luzmo-color-slider-border-color-disabled, var(--luzmo-dimmed-color)) );background:var(--highcontrast-color-slider-background-color-disabled, var(--luzmo-color-slider-background-color-disabled, var(--luzmo-dimmed-color)))}.checkerboard,.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s))}.gradient:dir(rtl),:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}';var y=Object.defineProperty,z=Object.getOwnPropertyDescriptor,i=(c,e,t,o)=>{for(var s=o>1?void 0:o?z(e,t):e,a=c.length-1,n;a>=0;a--)(n=c[a])&&(s=(o?n(e,t,s):n(s))||s);return o&&s&&y(e,t,s),s};class r extends g.Focusable{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.label="hue",this.vertical=!1,this.languageResolver=new p.LanguageResolutionController(this),this.colorController=new v.ColorController(this,{applyColorToState:()=>{if(this.mode==="opacity"){const e=new h.TinyColor(this.colorController.color);this.sliderHandlePosition=100*e.getAlpha()}else this.sliderHandlePosition=100*(this.colorController.hue/360)},extractColorFromState:e=>this.mode==="opacity"?{...e.getColor("hsl"),a:this.value}:{...e.getColor("hsl"),h:this.value},maintains:"saturation"}),this.sliderHandlePosition=0,this.step=1,this.isLTR=!0,this._altered=0,this._pointerDown=!1}static get styles(){return[u.unsafeCSS(f)]}get value(){return this.mode==="opacity"?this.colorController.opacity:this.colorController.hue}set value(e){this.mode==="opacity"?this.colorController.opacity=e:this.colorController.hue=e}get color(){return this.colorController.color}set color(e){this.colorController.color=e}get altered(){return this._altered}set altered(e){this._altered=e,this.step=Math.max(1,this.altered*10)}get focusElement(){return this.input}handleKeydown(e){const{key:t}=e;this.focused=!0,this.altered=[e.shiftKey,e.ctrlKey,e.altKey].filter(n=>!!n).length;let o=0;switch(t){case"ArrowUp":{o=this.step;break}case"ArrowDown":{o=-this.step;break}case"ArrowLeft":{o=this.step*(this.isLTR?-1:1);break}case"ArrowRight":{o=this.step*(this.isLTR?1:-1);break}default:return}e.preventDefault();const a=100/(this.mode==="opacity"?100:360);this.sliderHandlePosition=Math.min(100,Math.max(0,this.sliderHandlePosition+o*a)),this.value=this.mode==="opacity"?Math.min(1,Math.max(0,this.value+o/100)):Math.min(360,Math.max(0,this.value+o)),this.colorController.applyColorFromState(),o!==0&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleInput(e){const{valueAsNumber:t}=e.target;this.value=t,this.sliderHandlePosition=100*(this.mode==="opacity"?this.value:this.value/360),this.colorController.applyColorFromState()}handleChange(e){this.handleInput(e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}focus(e={}){super.focus(e),this.forwardFocus()}forwardFocus(){this.input.focus()}handleFocus(){this.focused=!0}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1)}handlePointerdown(e){if(e.button!==0){e.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),e.target.setPointerCapture(e.pointerId),e.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(e){this.sliderHandlePosition=this.calculateHandlePosition(e),this.value=(this.mode==="opacity"?1:360)*(this.sliderHandlePosition/100),this.colorController.applyColorFromState(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(e){this._pointerDown=!1,e.target.releasePointerCapture(e.pointerId),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor(),this.focus(),e.pointerType==="mouse"&&(this.focused=!1)}calculateHandlePosition(e){if(!this.boundingClientRect)return this.sliderHandlePosition;const t=this.boundingClientRect,o=this.vertical?t.top:t.left,s=this.vertical?e.clientY:e.clientX,a=this.vertical?t.height:t.width,n=Math.max(0,Math.min(1,(s-o)/a));return this.vertical||!this.isLTR?100-100*n:100*n}handleGradientPointerdown(e){e.button===0&&(e.stopPropagation(),e.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",e)),this.handlePointermove(e))}get handlePositionStyles(){return`${this.vertical?"inset-block-end":"inset-inline-start"}: ${this.sliderHandlePosition}%`}get getColorSliderStyle(){const e=this.vertical?"top":"right";if(this.mode==="opacity"){const t=new h.TinyColor(this.colorController.color).setAlpha(1).toRgbString();return{background:`linear-gradient(to ${e}, transparent, ${t})`}}return{background:`linear-gradient(to ${e}, var(--luzmo-color-slider-gradient, var(--luzmo-color-slider-gradient-fallback)))`}}render(){return u.html`
|
|
19
|
-
<div
|
|
20
|
-
class="opacity-checkerboard checkerboard"
|
|
21
|
-
role="presentation"
|
|
22
|
-
@pointerdown=${this.handleGradientPointerdown}
|
|
23
|
-
>
|
|
24
|
-
<div
|
|
25
|
-
class="gradient"
|
|
26
|
-
role="presentation"
|
|
27
|
-
style=${m.o(this.getColorSliderStyle)}
|
|
28
|
-
>
|
|
29
|
-
<slot name="gradient"></slot>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
<luzmo-color-handle
|
|
33
|
-
tabindex=${d.o(this.focused?void 0:"0")}
|
|
34
|
-
@focus=${this.forwardFocus}
|
|
35
|
-
?focused=${this.focused}
|
|
36
|
-
class="handle"
|
|
37
|
-
color=${this.mode==="opacity"?this.color:"hsl("+this.value+", 100%, 50%)"}
|
|
38
|
-
?disabled=${this.disabled}
|
|
39
|
-
style=${this.handlePositionStyles}
|
|
40
|
-
${p.streamingListener({start:["pointerdown",this.handlePointerdown],streamInside:["pointermove",this.handlePointermove],end:[["pointerup","pointercancel","pointerleave"],this.handlePointerup]})}
|
|
41
|
-
></luzmo-color-handle>
|
|
42
|
-
<input
|
|
43
|
-
type="range"
|
|
44
|
-
class="slider"
|
|
45
|
-
min="0"
|
|
46
|
-
max=${this.mode==="opacity"?"100":"360"}
|
|
47
|
-
aria-orientation=${d.o(this.vertical?"vertical":void 0)}
|
|
48
|
-
orient=${d.o(this.vertical?"vertical":void 0)}
|
|
49
|
-
step=${this.step}
|
|
50
|
-
aria-label=${this.label}
|
|
51
|
-
.value=${String(this.mode==="opacity"?this.value*100:this.value)}
|
|
52
|
-
aria-valuetext=${`${new Intl.NumberFormat(this.languageResolver.language,{maximumFractionDigits:0,minimumIntegerDigits:1,style:"unit",unit:this.mode==="opacity"?"percent":"degree",unitDisplay:"narrow"}).format(this.mode==="opacity"?this.value*100:this.value)}`}
|
|
53
|
-
@input=${this.handleInput}
|
|
54
|
-
@change=${this.handleChange}
|
|
55
|
-
@keydown=${this.handleKeydown}
|
|
56
|
-
/>
|
|
57
|
-
`}firstUpdated(e){super.firstUpdated(e),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur)}updated(e){e.has("mode")&&(this.handle.style.insetInlineStart="",this.handle.style.insetBlockEnd="",this.mode==="opacity"&&(this.colorController.color=new h.TinyColor(this.colorController.color).toRgbString(),this.handle.style.insetInlineStart=100*this.colorController.opacity+"%"))}}i([l.n({type:String,reflect:!0})],r.prototype,"dir",2);i([l.n({type:String,reflect:!0})],r.prototype,"mode",2);i([l.n({type:Boolean,reflect:!0})],r.prototype,"disabled",2);i([l.n({type:Boolean,reflect:!0})],r.prototype,"focused",2);i([b.e(".handle")],r.prototype,"handle",2);i([l.n({type:String})],r.prototype,"label",2);i([l.n({type:Boolean,reflect:!0})],r.prototype,"vertical",2);i([l.n({type:Number})],r.prototype,"value",1);i([l.n({type:Number,reflect:!0})],r.prototype,"sliderHandlePosition",2);i([l.n({type:String})],r.prototype,"color",1);i([l.n({type:Number})],r.prototype,"step",2);i([l.n({type:Boolean,attribute:"is-ltr"})],r.prototype,"isLTR",2);i([b.e("input")],r.prototype,"input",2);customElements.get("luzmo-color-slider")||customElements.define("luzmo-color-slider",r);exports.LuzmoColorSlider=r;
|
package/lib/divider/index.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../base-BCmA9Wxv.cjs"),c=require("../sized-mixin-BSYHt8nT.cjs"),n=require("lit"),f=require("../divider.module-CXMNveQc.cjs");var p=Object.defineProperty,d=(a,e,l,v)=>{for(var t=void 0,i=a.length-1,u;i>=0;i--)(u=a[i])&&(t=u(e,l,t)||t);return t&&p(e,l,t),t};const o=class o extends c.SizedMixin(s.LuzmoElement,{validSizes:["s","m","l"],noDefaultSize:!0}){constructor(){super(...arguments),this.vertical=!1}render(){return n.html``}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","separator")}updated(e){super.updated(e),e.has("vertical")&&(this.vertical?this.setAttribute("aria-orientation","vertical"):this.removeAttribute("aria-orientation"))}};o.styles=[n.unsafeCSS(f.styles)];let r=o;d([s.n({type:Boolean,reflect:!0})],r.prototype,"vertical");d([s.n({type:String,reflect:!0,attribute:"static-color"})],r.prototype,"staticColor");customElements.get("luzmo-divider")||customElements.define("luzmo-divider",r);exports.Divider=r;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
"use strict";const l=require("./base-BCmA9Wxv.cjs"),d=require("lit"),u=require("./manage-help-text-iOk-zmy8.cjs"),p='.luzmo-FieldGroup--toplabel{flex-direction:column}.luzmo-FieldGroup--sidelabel{flex-direction:row}.group{flex-flow:column wrap;display:flex}:host([vertical]) .group{flex-direction:column}:host([horizontal]) .group{flex-direction:row}:host([horizontal]) .group slot:not([name])::slotted(:not(:last-child)){margin-inline-end:var(--field-group-margin)}:host([horizontal]) .group .luzmo-HelpText{flex-basis:100%}:host{--field-group-margin: 16px;--field-group-readonly-delimiter: ","}:host([horizontal][dir=rtl]) slot:not([name])::slotted(*:not(:last-child)),:host([dir=rtl]:not([vertical])) slot:not([name])::slotted(*:not(:last-child)){margin:0 0 0 var(--field-group-margin)}:host([horizontal][dir=ltr]) slot:not([name])::slotted(*:not(:last-child)),:host([dir=ltr]:not([vertical])) slot:not([name])::slotted(*:not(:last-child)){margin:0 var(--field-group-margin) 0 0}';var h=Object.defineProperty,r=(i,t,n,c)=>{for(var e=void 0,a=i.length-1,s;a>=0;a--)(s=i[a])&&(e=s(t,n,e)||e);return e&&h(t,n,e),e};class o extends u.ManageHelpText(l.LuzmoElement,{mode:"external"}){constructor(){super(...arguments),this.horizontal=!1,this.invalid=!1,this.label="",this.vertical=!1}static get styles(){return[d.unsafeCSS(p)]}handleSlotchange(){}render(){return d.html`
|
|
19
|
-
<div class="group" role="presentation">
|
|
20
|
-
<slot @slotchange=${this.handleSlotchange}></slot>
|
|
21
|
-
</div>
|
|
22
|
-
${this.renderHelpText(this.invalid)}
|
|
23
|
-
`}firstUpdated(t){super.firstUpdated(t),this.hasAttribute("role")||this.setAttribute("role","group")}updated(t){super.updated(t),t.has("label")&&(this.label?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label"))}}r([l.n({type:Boolean,reflect:!0})],o.prototype,"horizontal");r([l.n({type:Boolean,reflect:!0})],o.prototype,"invalid");r([l.n()],o.prototype,"label");r([l.n({type:Boolean,reflect:!0})],o.prototype,"vertical");exports.LuzmoFieldGroup=o;
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
"use strict";const n=require("./base-BCmA9Wxv.cjs"),b=require("./condition-attribute-with-id-DrQYZzFS.cjs"),h=require("./random-id-CqvckpWe.cjs"),g=require("./element-resolution-BvRLGqIU.cjs"),c=require("./sized-mixin-BSYHt8nT.cjs"),s=require("lit"),m=require("./query-BL-TJj7K.cjs"),u=":host{box-sizing:border-box;min-block-size:var(--luzmo-field-label-min-height, var(--field-label-min-height));padding-block:var(--luzmo-field-label-padding-block, var(--luzmo-field-label-top-to-text, var(--field-label-top-to-text)) var(--luzmo-field-label-bottom-to-text, var(--field-label-bottom-to-text)));padding-inline:0;padding-inline:var(--luzmo-field-label-padding-inline, 0);margin-block:0;margin-block:var(--luzmo-field-label-margin-block, var(--luzmo-field-label-margin-block-start, 0) var(--luzmo-field-label-margin-block-end, 0));margin-inline:0;margin-inline:var(--luzmo-field-label-margin-inline, var(--luzmo-field-label-margin-inline-start, 0) var(--luzmo-field-label-margin-inline-end, 0));font-size:var(--luzmo-field-label-font-size, var(--field-label-font-size));font-weight:var(--luzmo-field-label-font-weight, var(--field-label-font-weight));line-height:var(--luzmo-field-label-line-height, var(--field-label-line-height));-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;color:var(--luzmo-field-label-color, var(--field-label-color));display:block;font-family:var(--luzmo-field-label-font-family, var(--luzmo-font-family))}:host(:lang(ja)),:host(:lang(ko)),:host(:lang(zh)){--luzmo-field-label-line-height: var( --luzmo-field-label-line-height-cjk, var(--field-label-line-height-cjk) )}:host([disabled]),:host([disabled]) .required-icon{--luzmo-field-label-color: var( --highcontrast-field-label-disabled-content-color, var( --luzmo-disabled-content-color, var(--field-label-disabled-content-color) ) )}.required-icon{display:inline-block;margin-block:0;margin-inline:var(--luzmo-field-label-text-to-asterisk, var(--field-label-text-to-asterisk)) 0;vertical-align:initial;vertical-align:var(--luzmo-field-label-asterisk-vertical-align, baseline)}:host([side-aligned=start]),:host([side-aligned=end]){vertical-align:top;margin-block-start:0;margin-block-end:0;margin-inline-end:var(--luzmo-field-label-side-padding-right, var(--field-label-side-padding-right));display:inline-flex;align-items:center;font-size:var(--luzmo-field-label-side-aligned-font-size, var(--field-label-side-aligned-font-size));block-size:var(--luzmo-field-label-side-aligned-height, var(--field-label-side-aligned-height))}:host([side-aligned=end]){text-align:end}@media (forced-colors: active){:host{--highcontrast-field-label-disabled-content-color: GrayText}}:host{--field-label-color: var(--luzmo-font-color);--field-label-font-weight: var(--luzmo-font-weight);--field-label-line-height: var(--luzmo-line-height);--field-label-line-height-cjk: 1.5;--field-label-disabled-content-color: var(--luzmo-font-color-disabled)}:host{--field-label-min-height: var(--luzmo-component-height-xs);--field-label-side-aligned-height: var(--luzmo-component-height);--field-label-top-to-text: calc(var(--luzmo-spacing-2));--field-label-bottom-to-text: var(--luzmo-spacing-2);--field-label-side-aligned-font-size: var(--luzmo-font-size);--field-label-font-size: var(--luzmo-font-size-s);--field-label-side-padding-right: var(--luzmo-spacing-4);--field-label-text-to-asterisk: 0px}:host([size=s]){--field-label-min-height: var(--luzmo-component-height-xxs);--field-label-side-aligned-height: var(--luzmo-component-height-s);--field-label-top-to-text: calc(var(--luzmo-spacing-1));--field-label-bottom-to-text: var(--luzmo-spacing-1);--field-label-side-aligned-font-size: var(--luzmo-font-size-s);--field-label-font-size: var(--luzmo-font-size-xs);--field-label-side-padding-right: var(--luzmo-spacing-3);--field-label-text-to-asterisk: 0px}:host([size=l]){--field-label-min-height: var(--luzmo-component-height-xs);--field-label-side-aligned-height: var(--luzmo-component-height-l);--field-label-top-to-text: var(--luzmo-spacing-3);--field-label-bottom-to-text: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--field-label-side-aligned-font-size: var(--luzmo-font-size-l);--field-label-font-size: var(--luzmo-font-size);--field-label-side-padding-right: var(--luzmo-spacing-4);--field-label-text-to-asterisk: var(--luzmo-spacing-1)}:host([size=xl]){--field-label-min-height: var(--luzmo-component-height-s);--field-label-side-aligned-height: var(--luzmo-component-height-xl);--field-label-top-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--field-label-bottom-to-text: var(--luzmo-spacing-3);--field-label-side-aligned-font-size: var(--luzmo-font-size-xl);--field-label-font-size: var(--luzmo-font-size-l);--field-label-side-padding-right: var(--luzmo-spacing-4);--field-label-text-to-asterisk: var(--luzmo-spacing-1)}label{display:inline-block}";var z=Object.defineProperty,r=(d,e,t,l)=>{for(var i=void 0,a=d.length-1,f;a>=0;a--)(f=d[a])&&(i=f(e,t,i)||i);return i&&z(e,t,i),i};const v=()=>s.html`
|
|
19
|
-
<div class="icon-container required-icon">*</div>
|
|
20
|
-
`;class o extends c.SizedMixin(n.LuzmoElement,{noDefaultSize:!0}){constructor(){super(...arguments),this.disabled=!1,this.id="",this.for="",this.required=!1,this.resolvedElement=new g.ElementResolutionController(this)}static get styles(){return[s.unsafeCSS(u)]}handleClick(e){if(!this.target||this.disabled||e.defaultPrevented)return;this.target.focus();const t=this.getRootNode(),l=this.target,i=l.getRootNode(),a=i.host;i===t&&l.forceFocusVisible?l.forceFocusVisible():a&&a.forceFocusVisible&&a.forceFocusVisible()}applyTargetLabel(e){if(this.target=e||this.target,this.target){const t=this.target.applyFocusElementLabel,l=this.target.focusElement||this.target,i=l.getRootNode();t!==void 0?t(this.labelText,this):i===this.getRootNode()?(e?b.conditionAttributeWithId:b.conditionAttributeWithoutId)(l,"aria-labelledby",[this.id]):e?l.setAttribute("aria-label",this.labelText):l.removeAttribute("aria-label")}}async manageTarget(){this.applyTargetLabel();const e=this.resolvedElement.element;if(!e){this.target=e;return}e.localName.search("-")>0&&await customElements.whenDefined(e.localName),e.updateComplete!==void 0&&await e.updateComplete,this.applyTargetLabel(e)}get labelText(){const e=this.slotEl.assignedNodes({flatten:!0});return e.length===0?"":e.map(l=>(l.textContent||"").trim()).join(" ")}render(){return s.html`
|
|
21
|
-
<label>
|
|
22
|
-
<slot></slot>
|
|
23
|
-
${this.required?s.html` ${v()} `:s.nothing}
|
|
24
|
-
</label>
|
|
25
|
-
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",this.handleClick)}willUpdate(e){this.hasAttribute("id")||this.setAttribute("id",`${this.tagName.toLowerCase()}-${h.randomID()}`),e.has("for")&&(this.resolvedElement.selector=this.for?`#${this.for}`:""),(e.has("id")||e.has(g.elementResolverUpdatedSymbol))&&this.manageTarget()}}r([n.n({type:Boolean,reflect:!0})],o.prototype,"disabled");r([n.n({type:String})],o.prototype,"id");r([n.n({type:String})],o.prototype,"for");r([n.n({type:Boolean,reflect:!0})],o.prototype,"required");r([m.e("slot")],o.prototype,"slotEl");r([n.n({type:String,reflect:!0,attribute:"side-aligned"})],o.prototype,"sideAligned");exports.FieldLabel=o;
|