@luzmo/lucero 1.0.1-alpha.9 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -9
- package/components/accordion/index.cjs +1 -26
- package/components/accordion/index.js +8 -164
- package/components/accordion-BHBIfsLU.cjs +43 -0
- package/components/accordion-DC7cjb1c.js +152 -0
- package/components/action-bar/index.cjs +1 -22
- package/components/action-bar/index.js +8 -90
- package/components/action-bar-BMHZ4e_p.cjs +39 -0
- package/components/action-bar-CmLjsljR.js +92 -0
- package/components/action-button/index.cjs +1 -7
- package/components/action-button/index.js +8 -144
- package/components/action-button-B4_UEJle.js +121 -0
- package/components/action-button-G0PWSrZo.cjs +24 -0
- package/components/action-group/index.cjs +1 -1
- package/components/action-group/index.js +11 -12
- package/components/action-group-CH8FTW0i.cjs +20 -0
- package/components/action-group-DYKpp-mz.js +211 -0
- package/components/action-menu/index.cjs +1 -39
- package/components/action-menu/index.js +8 -109
- package/components/action-menu-CJyB0mmO.cjs +56 -0
- package/components/action-menu-FiS1vhW7.js +105 -0
- package/components/avatar/avatar.d.ts +5 -0
- package/components/avatar/index.cjs +1 -7
- package/components/avatar/index.js +8 -64
- package/components/avatar-CyY_ZSD0.js +65 -0
- package/components/avatar-PulwjkMI.cjs +24 -0
- package/components/badge/badge.d.ts +35 -0
- package/components/{random-id-CqvckpWe.cjs → badge/index.cjs} +1 -1
- package/components/badge/index.d.ts +8 -0
- package/components/badge/index.js +25 -0
- package/components/badge-D1Ry32wi.cjs +23 -0
- package/components/badge-D6p2hPj8.js +94 -0
- package/components/button/button-base.d.ts +16 -0
- package/components/button/button.d.ts +38 -2
- package/components/button/index.cjs +1 -3
- package/components/button/index.js +9 -110
- package/components/button-CRNRP8P0.js +115 -0
- package/components/button-D3ZTogni.cjs +20 -0
- package/components/button-base-BYV3Lp3P.cjs +25 -0
- package/components/button-base-SHgEJgk2.js +123 -0
- package/components/button-group/index.cjs +1 -1
- package/components/button-group/index.js +8 -42
- package/components/button-group-CJVpgiLq.js +46 -0
- package/components/button-group-rEK_YaF3.cjs +18 -0
- package/components/calendar/calendar.d.ts +67 -0
- package/components/calendar/index.cjs +1 -1
- package/components/calendar/index.d.ts +1 -0
- package/components/calendar/index.js +8 -11
- package/components/calendar-CKr5T_zV.js +619 -0
- package/components/calendar-WRhzTEyZ.cjs +142 -0
- package/components/chat-message/chat-message.d.ts +139 -0
- package/components/{random-id-ByCz1xaq.js → chat-message/index.cjs} +1 -9
- package/components/chat-message/index.d.ts +8 -0
- package/components/chat-message/index.js +25 -0
- package/components/chat-message-CNE-mGuP.cjs +149 -0
- package/components/chat-message-DJgocVNj.js +2295 -0
- package/components/chat-message-group/chat-message-group.d.ts +50 -0
- package/components/{when-CDZyJPvd.cjs → chat-message-group/index.cjs} +1 -5
- package/components/chat-message-group/index.d.ts +7 -0
- package/components/chat-message-group/index.js +25 -0
- package/components/chat-message-group-B4U2MzHx.js +100 -0
- package/components/chat-message-group-COmhCN-R.cjs +24 -0
- package/components/checkbox/checkbox.d.ts +7 -0
- package/components/checkbox/index.cjs +1 -8
- package/components/checkbox/index.js +8 -79
- package/components/checkbox-CPS-tR_i.js +89 -0
- package/components/checkbox-DFwDrIdY.cjs +25 -0
- package/components/checkbox-mixin-C5sLMo5L.js +67 -0
- package/components/{checkbox-mixin-BDN0dBtS.cjs → checkbox-mixin-D4HeLrMj.cjs} +3 -3
- package/components/chunk-D-qHiVGv.cjs +18 -0
- package/components/close-button-BeXYep8K.js +42 -0
- package/components/close-button-BzapEpcF.cjs +18 -0
- package/components/color-area/index.cjs +1 -63
- package/components/color-area/index.js +8 -364
- package/components/color-area-DA3ps2-c.cjs +80 -0
- package/components/color-area-DViRjuKo.js +300 -0
- package/components/color-controller-DueaXfnX.cjs +18 -0
- package/components/color-controller-G2_v2xSl.js +247 -0
- package/components/color-field/color-field.d.ts +1 -0
- package/components/color-field/index.cjs +1 -6
- package/components/color-field/index.js +8 -68
- package/components/color-field-CxdIoSq6.js +75 -0
- package/components/color-field-D7_7z2A2.cjs +23 -0
- package/components/color-handle/index.cjs +1 -7
- package/components/color-handle/index.js +8 -56
- package/components/color-handle-BOusOFFx.js +62 -0
- package/components/color-handle-Cka48yPY.cjs +24 -0
- package/components/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.js +11 -12
- package/components/color-loupe-DMk8uWZW.cjs +56 -0
- package/components/color-loupe-bEzi2P0y.js +76 -0
- package/components/color-menu/index.cjs +1 -69
- package/components/color-menu/index.js +8 -189
- package/components/color-menu-DwbTxeqv.cjs +89 -0
- package/components/color-menu-Lxc9PTzl.js +183 -0
- package/components/color-palette/index.cjs +1 -1
- package/components/color-palette/index.js +8 -71
- package/components/color-palette-349EkPMg.cjs +18 -0
- package/components/color-palette-BAdaNySC.js +80 -0
- package/components/color-palette-group/index.cjs +1 -11
- package/components/color-palette-group/index.js +8 -188
- package/components/color-palette-group-BvP09zmT.cjs +28 -0
- package/components/color-palette-group-D8Mavsd2.js +163 -0
- package/components/color-picker/color-picker.d.ts +3 -3
- package/components/color-picker/index.cjs +1 -31
- package/components/color-picker/index.js +8 -128
- package/components/color-picker-CSWiU-X5.cjs +48 -0
- package/components/color-picker-DqjfTvYf.js +126 -0
- package/components/color-slider/index.cjs +1 -1
- package/components/color-slider/index.js +8 -11
- package/components/color-slider-DxjJ72ue.cjs +57 -0
- package/components/color-slider-ihAIFt5p.js +421 -0
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → condition-attribute-with-id-DauPaLSS.cjs} +1 -14
- package/components/{query-assigned-nodes-C76XVPWY.js → condition-attribute-with-id-Duo51HZ7.js} +10 -18
- package/components/date-range-picker/date-range-picker.d.ts +184 -0
- package/components/{if-defined-C9YGdo33.cjs → date-range-picker/index.cjs} +1 -5
- package/components/date-range-picker/index.d.ts +8 -0
- package/components/date-range-picker/index.js +25 -0
- package/components/date-range-picker/types.d.ts +16 -0
- package/components/date-range-picker-BdRQep--.js +626 -0
- package/components/date-range-picker-CgitOe0i.cjs +187 -0
- package/components/date-time-picker/date-time-picker.d.ts +3 -3
- package/components/date-time-picker/index.cjs +1 -88
- package/components/date-time-picker/index.d.ts +1 -0
- package/components/date-time-picker/index.js +8 -1109
- package/components/date-time-picker/{types.d.ts → shared/types.d.ts} +1 -1
- package/components/date-time-picker-Bz8XwSOR.cjs +105 -0
- package/components/date-time-picker-Ct_ln8Ot.js +470 -0
- package/components/decorate-B2wePfNm.cjs +18 -0
- package/components/decorate-aGxJUVxg.js +91 -0
- package/components/{condition-attribute-with-id-DrQYZzFS.cjs → dependency-manger-CHy9t__e.cjs} +1 -1
- package/components/dependency-manger-DMrulWcJ.js +40 -0
- package/components/divider/index.cjs +1 -1
- package/components/divider/index.js +8 -44
- package/components/divider-Dn8XqbB6.cjs +18 -0
- package/components/divider-cU0lVwOp.js +59 -0
- package/components/divider.module-C65RfSUa.js +21 -0
- package/components/divider.module-CL60P_z8.cjs +18 -0
- package/components/element-resolution-Bs1x89vU.js +80 -0
- package/components/element-resolution-C0aiOB0Y.cjs +18 -0
- package/components/field-group/index.cjs +1 -1
- package/components/field-group/index.js +11 -12
- package/components/field-group-C7ROsWq3.js +57 -0
- package/components/field-group-OcI5Lgu7.cjs +23 -0
- package/components/field-label/index.cjs +1 -1
- package/components/field-label/index.js +11 -12
- package/components/field-label-BCl6R1uO.cjs +25 -0
- package/components/field-label-CtGCEmdp.js +87 -0
- package/components/focus-group-BshI1RpM.js +164 -0
- package/components/focus-group-SF8Kj7iB.cjs +18 -0
- package/components/focus-visible-B0NNezGc.cjs +18 -0
- package/components/focus-visible-CrooVCUu.js +58 -0
- package/components/focusable-BmS8IzhH.js +117 -0
- package/components/focusable-CupEoHmn.cjs +18 -0
- package/components/{base-BjTwmyRF.cjs → focusable-selectors-5n5liBn0.cjs} +1 -5
- package/components/{focusable-selectors-BgFlyFcY.cjs → focusable-selectors-Bg60_Kra.js} +13 -1
- package/components/{state-Deh-vKYE.js → get-label-from-slot-5vVnfSgN.js} +7 -11
- package/components/get-label-from-slot-LO_DZP60.cjs +18 -0
- package/components/icon/index.cjs +1 -1
- package/components/icon/index.js +8 -71
- package/components/icon-B7hKwn_q.cjs +18 -0
- package/components/icon-CwBAE1eU.js +59 -0
- package/components/index.cjs +1 -1
- package/components/index.js +78 -176
- package/components/infield-button/index.cjs +1 -5
- package/components/infield-button/index.js +8 -47
- package/components/infield-button-B2z0dLzq.js +54 -0
- package/components/infield-button-BVKotWqr.cjs +22 -0
- package/components/label/index.cjs +1 -1
- package/components/label/index.js +8 -34
- package/components/label-ClJE2esm.js +41 -0
- package/components/label-CqolZbJo.cjs +18 -0
- package/components/language-resolution-BYemISJC.cjs +18 -0
- package/components/language-resolution-BpfGTC29.js +43 -0
- package/components/like-anchor-BZJXts_H.cjs +32 -0
- package/components/like-anchor-DeOXX-MX.js +46 -0
- package/components/manage-help-text-CF0xBh0F.js +81 -0
- package/components/manage-help-text-D9VbYRf_.cjs +30 -0
- package/components/menu/index.cjs +1 -66
- package/components/menu/index.js +8 -879
- package/components/menu/menu-item.d.ts +8 -1
- package/components/menu/menu.d.ts +1 -0
- package/components/menu--ukVtSq7.js +749 -0
- package/components/menu-DAA51y45.cjs +108 -0
- package/components/multi-language-field/index.cjs +1 -22
- package/components/multi-language-field/index.js +8 -131
- package/components/multi-language-field/multi-language-field.d.ts +1 -0
- package/components/multi-language-field-BzY75rOY.js +122 -0
- package/components/multi-language-field-DmoMyCBH.cjs +40 -0
- package/components/number-field/index.cjs +1 -40
- package/components/number-field/index.js +8 -453
- package/components/number-field/number-field.d.ts +145 -0
- package/components/number-field-B4RSFeTR.cjs +57 -0
- package/components/number-field-C66dTUMM.js +402 -0
- package/components/observe-slot-presence-BCqd3VSd.js +55 -0
- package/components/observe-slot-presence-Dx8hzNzK.cjs +18 -0
- package/components/observe-slot-text-BhTcGuHY.cjs +18 -0
- package/components/observe-slot-text-Ddf1OC6F.js +71 -0
- package/components/options/index.cjs +1 -84
- package/components/options/index.js +8 -1160
- package/components/options/option.d.ts +16 -0
- package/components/options/options.d.ts +44 -4
- package/components/options-BPNAm4MW.cjs +101 -0
- package/components/options-Dz-ejkxF.js +484 -0
- package/components/overlay/index.cjs +1 -56
- package/components/overlay/index.js +10 -329
- package/components/overlay/overlay.d.ts +12 -1
- package/components/overlay/virtual-trigger.d.ts +3 -2
- package/components/overlay-8tN0KPbR.js +1115 -0
- package/components/overlay-CMd2Dnpv.cjs +73 -0
- package/components/overlay-CwR_36OV.js +227 -0
- package/components/overlay-DdrfkOry.cjs +47 -0
- package/components/pending-state-DFcNf5rd.js +50 -0
- package/components/{pending-state-CaH1si5b.cjs → pending-state-DIeF18qg.cjs} +4 -3
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +11 -15
- package/components/picker/picker.d.ts +1 -0
- package/components/picker-C4RVOxLq.cjs +123 -0
- package/components/picker-agQW7YNo.js +394 -0
- package/components/picker-button/index.cjs +1 -20
- package/components/picker-button/index.js +8 -70
- package/components/picker-button-BLbeT3Yu.js +72 -0
- package/components/picker-button-D34YXyXp.cjs +37 -0
- package/components/platform-B7Sk7Qon.cjs +18 -0
- package/components/{platform-BM-uMWpX.js → platform-D4V_cOJF.js} +29 -38
- package/components/popover/index.cjs +1 -1
- package/components/popover/index.js +11 -12
- package/components/popover-DyC9xGhX.js +58 -0
- package/components/popover-dgL04x6P.cjs +30 -0
- package/components/progress-bar/index.cjs +18 -0
- package/components/progress-bar/index.d.ts +7 -0
- package/components/progress-bar/index.js +25 -0
- package/components/progress-bar/progress-bar.d.ts +34 -0
- package/components/progress-bar-BR28tISC.cjs +31 -0
- package/components/progress-bar-DHgFRml1.js +119 -0
- package/components/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.js +11 -12
- package/components/progress-circle-Cg_ua9Ff.js +78 -0
- package/components/progress-circle-DuzwUiGN.cjs +33 -0
- package/components/progress-steps/index.cjs +18 -0
- package/components/progress-steps/index.d.ts +8 -0
- package/components/progress-steps/index.js +25 -0
- package/components/progress-steps/progress-steps.d.ts +148 -0
- package/components/progress-steps/types.d.ts +32 -0
- package/components/progress-steps-Da8aZWx3.js +262 -0
- package/components/progress-steps-WriXaZpE.cjs +96 -0
- package/components/prompt-box/controllers/attachments-controller.d.ts +35 -0
- package/components/prompt-box/controllers/recording-controller.d.ts +23 -0
- package/components/prompt-box/controllers/rich-input-controller.d.ts +89 -0
- package/components/prompt-box/controllers/trigger-menu-controller.d.ts +107 -0
- package/components/prompt-box/index.cjs +18 -0
- package/components/prompt-box/index.d.ts +9 -0
- package/components/prompt-box/index.js +25 -0
- package/components/prompt-box/keyboard-focus-tracker.d.ts +3 -0
- package/components/prompt-box/prompt-box-templates.d.ts +10 -0
- package/components/prompt-box/prompt-box.d.ts +194 -0
- package/components/prompt-box/range-from-point.d.ts +21 -0
- package/components/prompt-box/selection-utils.d.ts +39 -0
- package/components/prompt-box/slot-state-sync.d.ts +10 -0
- package/components/prompt-box/types.d.ts +112 -0
- package/components/prompt-box-BEloQP-R.js +1506 -0
- package/components/prompt-box-DV8Smf3Q.cjs +282 -0
- package/components/radio/index.cjs +1 -5
- package/components/radio/index.js +8 -174
- package/components/radio-BzEPGUmQ.js +141 -0
- package/components/radio-d-2GUbYE.cjs +22 -0
- package/components/{if-defined-DOaE2coe.js → random-id-B51lUxUB.cjs} +1 -10
- package/components/{when-CDK1Tt5Y.js → random-id-Dd4boCPV.js} +5 -10
- package/components/{focusable-selectors-B4YgbghQ.js → rolldown-runtime-CAFD8bLK.js} +10 -13
- package/components/roving-tabindex-B7x5ePUB.cjs +18 -0
- package/components/roving-tabindex-BP6mQbXf.js +62 -0
- package/components/{directive-oAbCiebi.js → scaled-indicator-BcO2BOsf.js} +24 -26
- package/components/scaled-indicator-p8-3k2cJ.cjs +26 -0
- package/components/search/index.cjs +1 -28
- package/components/search/index.js +8 -114
- package/components/search-CmLfd2dF.js +94 -0
- package/components/search-DRTD4xsE.cjs +45 -0
- package/components/segments-factory-CHo9oQw7.cjs +18 -0
- package/components/segments-factory-D0IveW-q.js +417 -0
- package/components/select/index.cjs +1 -140
- package/components/select/index.js +8 -602
- package/components/select/select.d.ts +26 -17
- package/components/select--vrG59GQ.cjs +158 -0
- package/components/select-DPeI0jP9.js +518 -0
- package/components/{language-resolution-8yZa5r_P.js → sized-mixin-DaBoZkVS.js} +38 -35
- package/components/sized-mixin-StFA4y0J.cjs +18 -0
- package/components/skeleton-loader/index.cjs +18 -0
- package/components/skeleton-loader/index.d.ts +7 -0
- package/components/skeleton-loader/index.js +25 -0
- package/components/skeleton-loader/skeleton-loader.d.ts +22 -0
- package/components/skeleton-loader-B8NgELvX.cjs +18 -0
- package/components/skeleton-loader-C1XG3m_u.js +46 -0
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +8 -1141
- package/components/slider/slider.d.ts +2 -0
- package/components/slider-3QBnq0S8.js +96 -0
- package/components/slider-uXRKcOz5.cjs +18 -0
- package/components/slottable-request-event-DZ2Z_BLk.js +29 -0
- package/components/{base-D76d76ww.js → slottable-request-event-gAcEQan2.cjs} +1 -9
- package/components/status-light/index.cjs +18 -0
- package/components/status-light/index.d.ts +8 -0
- package/components/status-light/index.js +25 -0
- package/components/status-light/status-light.d.ts +26 -0
- package/components/status-light-Bf8jGu4G.js +85 -0
- package/components/status-light-CBaAFRUc.cjs +21 -0
- package/components/strategies-DhxJGIZT.js +137 -0
- package/components/strategies-kuvLVIKO.cjs +18 -0
- package/components/streaming-listener-2NcP7ys7.js +77 -0
- package/components/streaming-listener-BnDW38lt.cjs +18 -0
- package/components/suggestion/index.cjs +18 -0
- package/components/suggestion/index.d.ts +8 -0
- package/components/suggestion/index.js +25 -0
- package/components/suggestion/suggestion.d.ts +45 -0
- package/components/suggestion-CEJiW_7y.cjs +23 -0
- package/components/suggestion-DK5gxxDI.js +76 -0
- package/components/swatch/index.cjs +1 -32
- package/components/swatch/index.js +8 -325
- package/components/swatch-BLuV-hlF.js +271 -0
- package/components/swatch-G70JUe6I.cjs +49 -0
- package/components/switch/index.cjs +1 -5
- package/components/switch/index.js +8 -56
- package/components/switch-BdE-hI69.js +60 -0
- package/components/switch-KzkrF-ob.cjs +22 -0
- package/components/tabs/index.cjs +1 -76
- package/components/tabs/index.js +8 -619
- package/components/tabs/tabs.d.ts +3 -9
- package/components/tabs-BfTgzdid.cjs +76 -0
- package/components/tabs-BthdwrmW.js +434 -0
- package/components/tags/index.cjs +1 -15
- package/components/tags/index.d.ts +1 -0
- package/components/tags/index.js +8 -156
- package/components/tags/tag.d.ts +28 -0
- package/components/tags/tags.d.ts +3 -1
- package/components/tags-B89eYzsB.js +203 -0
- package/components/tags-OBPAvjdV.cjs +47 -0
- package/components/text-field/index.cjs +1 -4
- package/components/text-field/index.js +9 -45
- package/components/text-field/text-field.d.ts +27 -0
- package/components/text-field-A4Obzs4l.cjs +21 -0
- package/components/text-field-BoGAvXvh.js +44 -0
- package/components/text-field-Cs8HYRYL.js +256 -0
- package/components/text-field-FJr8ZUhI.cjs +81 -0
- package/components/text-field.module-Btsve-VN.js +21 -0
- package/components/text-field.module-D5oDP7MB.cjs +18 -0
- package/components/toast/index.cjs +1 -34
- package/components/toast/index.js +8 -136
- package/components/toast-CJSQUzoW.cjs +51 -0
- package/components/toast-DKwphMrp.js +133 -0
- package/components/tooltip/index.cjs +1 -28
- package/components/tooltip/index.js +8 -205
- package/components/tooltip/tooltip.d.ts +12 -1
- package/components/tooltip-C3O4AQ1l.js +192 -0
- package/components/tooltip-DY1trLtg.cjs +45 -0
- package/components/top-nav/index.cjs +18 -0
- package/components/top-nav/index.d.ts +10 -0
- package/components/top-nav/index.js +25 -0
- package/components/top-nav/top-nav-item.d.ts +26 -0
- package/components/top-nav/top-nav.d.ts +45 -0
- package/components/top-nav-DVQ5ASMa.js +203 -0
- package/components/top-nav-DlTojz8S.cjs +45 -0
- package/components/utils.cjs +1 -1
- package/components/utils.js +8 -25
- package/components/voice-recorder-477xPHRU.js +134 -0
- package/components/voice-recorder-BUtmSvPO.cjs +18 -0
- package/custom-elements.json +1 -1
- package/index.d.ts +11 -1
- package/package.json +134 -5
- package/utils/button-interaction-controllers/interaction-controller.d.ts +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/scaled-indicator.d.ts +8 -0
- package/utils/voice-recorder.d.ts +121 -0
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-DQcRdcUa.js +0 -53
- package/components/clear-button-OFUFFe7G.cjs +0 -18
- package/components/close-button-Cbnb7XXj.cjs +0 -18
- package/components/close-button-CqHYZhum.js +0 -51
- package/components/color-controller-DTp1juRz.js +0 -3198
- package/components/color-controller-_ZwyhvaU.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/dependency-manger-CEXvGQUV.js +0 -54
- package/components/directive-C7oCP5Bh.cjs +0 -22
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cl54m8Yh.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/index-Wq3qZJGh.cjs +0 -113
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-4nDFv1Lq.js +0 -229
- package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-DTX7ggyF.js +0 -61
- package/components/picker-BfBP7XJN.js +0 -461
- package/components/picker-xIphqE6d.cjs +0 -123
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/slottable-request-event-DggLA4Rx.js +0 -31
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-BTkr42k4.cjs +0 -85
- package/components/text-field-ol9Ed5lQ.js +0 -314
- package/components/text-field.module-ColtFhf_.js +0 -21
- package/components/text-field.module-p_VF2tC_.cjs +0 -18
- package/components/unit-input/index.cjs +0 -43
- package/components/unit-input/index.d.ts +0 -7
- package/components/unit-input/index.js +0 -183
- package/components/unit-input/unit-input.d.ts +0 -33
- /package/components/date-time-picker/{helpers.d.ts → shared/helpers.d.ts} +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date/day-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date/month-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date/year-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/date-time-segments.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/editable-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/literal-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/clear-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/decrement-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/increment-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/input-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/modifiers/segments-modifier.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/segments-factory.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/segments-formatter.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/day-period-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/hour-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/millisecond-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/minute-segment.d.ts +0 -0
- /package/components/date-time-picker/{segments → shared/segments}/time/second-segment.d.ts +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { n as e, t } from "./decorate-aGxJUVxg.js";
|
|
19
|
+
import { a as n, t as r } from "./platform-D4V_cOJF.js";
|
|
20
|
+
import { t as i } from "./language-resolution-BpfGTC29.js";
|
|
21
|
+
import "./color-handle-BOusOFFx.js";
|
|
22
|
+
import { t as a } from "./color-controller-G2_v2xSl.js";
|
|
23
|
+
import { t as o } from "./streaming-listener-2NcP7ys7.js";
|
|
24
|
+
import { html as s, unsafeCSS as c } from "lit";
|
|
25
|
+
import { property as l, query as u } from "lit/decorators.js";
|
|
26
|
+
import { ifDefined as d } from "lit/directives/if-defined.js";
|
|
27
|
+
//#region src/components/color-area/color-area.module.scss?inline
|
|
28
|
+
var f = "@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));display:inline-block;position:relative;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)))!important}: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)!important}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width,192px) - var(--luzmo-border-width)));inset-block-start:0}:host([dir=rtl]) .handle{inset-inline-end:0}.handle:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){inset-inline-end:0}.gradient{border-radius:var(--luzmo-color-area-border-radius,var(--luzmo-border-radius-s));block-size:100%;inline-size:100%}.slider{opacity:0;z-index:0;pointer-events:none;block-size:100%;inline-size:100%;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), 0)}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}", p = class extends e {
|
|
29
|
+
constructor(...e) {
|
|
30
|
+
super(...e), this.disabled = !1, this.focused = !1, this.labelX = "saturation", this.labelY = "luminosity", this.isLTR = !0, this.languageResolver = new i(this), this.colorController = new a(this, { manageAs: "hsv" }), this.activeAxis = "x", this.step = .01, this.altered = 0, this.activeKeys = /* @__PURE__ */ new Set(), this._valueChanged = !1, this._pointerDown = !1;
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [c(f)];
|
|
34
|
+
}
|
|
35
|
+
get hue() {
|
|
36
|
+
return this.colorController.hue;
|
|
37
|
+
}
|
|
38
|
+
set hue(e) {
|
|
39
|
+
this.colorController.hue = e;
|
|
40
|
+
}
|
|
41
|
+
get value() {
|
|
42
|
+
return this.colorController.colorValue;
|
|
43
|
+
}
|
|
44
|
+
get color() {
|
|
45
|
+
return this.colorController.colorValue;
|
|
46
|
+
}
|
|
47
|
+
set color(e) {
|
|
48
|
+
this.colorController.color = e;
|
|
49
|
+
}
|
|
50
|
+
get x() {
|
|
51
|
+
return this.colorController.color.hsv.s / 100;
|
|
52
|
+
}
|
|
53
|
+
set x(e) {
|
|
54
|
+
if (e === this.x) return;
|
|
55
|
+
let t = this.x;
|
|
56
|
+
this.inputX ? (this.inputX.value = e.toString(), this.colorController.color.set("s", this.inputX.valueAsNumber * 100)) : this.colorController.color.set("s", e * 100), this.requestUpdate("x", t);
|
|
57
|
+
}
|
|
58
|
+
get y() {
|
|
59
|
+
return this.colorController.color.hsv.v / 100;
|
|
60
|
+
}
|
|
61
|
+
set y(e) {
|
|
62
|
+
if (e === this.y) return;
|
|
63
|
+
let t = this.y;
|
|
64
|
+
this.inputY && (this.inputY.value = e.toString(), this.colorController.color.set("v", this.inputY.valueAsNumber * 100)), this.requestUpdate("y", t);
|
|
65
|
+
}
|
|
66
|
+
focus(e = {}) {
|
|
67
|
+
super.focus(e), this.forwardFocus();
|
|
68
|
+
}
|
|
69
|
+
forwardFocus() {
|
|
70
|
+
this.activeAxis === "x" ? this.inputX.focus() : this.inputY.focus();
|
|
71
|
+
}
|
|
72
|
+
handleFocus() {
|
|
73
|
+
this.focused = !0, this._valueChanged = !1;
|
|
74
|
+
}
|
|
75
|
+
handleBlur() {
|
|
76
|
+
this._pointerDown || (this.altered = 0, this.focused = !1, this._valueChanged = !1);
|
|
77
|
+
}
|
|
78
|
+
handleKeydown(e) {
|
|
79
|
+
let { code: t } = e;
|
|
80
|
+
this.focused = !0, this.altered = [
|
|
81
|
+
e.shiftKey,
|
|
82
|
+
e.ctrlKey,
|
|
83
|
+
e.altKey
|
|
84
|
+
].filter((e) => !!e).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());
|
|
85
|
+
}
|
|
86
|
+
handleKeypress() {
|
|
87
|
+
let e = 0, t = 0, n = Math.max(this.step, this.altered * 5 * this.step);
|
|
88
|
+
this.activeKeys.forEach((r) => {
|
|
89
|
+
switch (r) {
|
|
90
|
+
case "ArrowUp":
|
|
91
|
+
t = n;
|
|
92
|
+
break;
|
|
93
|
+
case "ArrowDown":
|
|
94
|
+
t = n * -1;
|
|
95
|
+
break;
|
|
96
|
+
case "ArrowLeft":
|
|
97
|
+
e = this.step * (this.isLTR ? -1 : 1);
|
|
98
|
+
break;
|
|
99
|
+
case "ArrowRight":
|
|
100
|
+
e = this.step * (this.isLTR ? 1 : -1);
|
|
101
|
+
break;
|
|
102
|
+
case "PageUp":
|
|
103
|
+
t = n * 10;
|
|
104
|
+
break;
|
|
105
|
+
case "PageDown":
|
|
106
|
+
t = n * -10;
|
|
107
|
+
break;
|
|
108
|
+
case "Home":
|
|
109
|
+
e = n * (this.isLTR ? -10 : 10);
|
|
110
|
+
break;
|
|
111
|
+
case "End":
|
|
112
|
+
e = n * (this.isLTR ? 10 : -10);
|
|
113
|
+
break;
|
|
114
|
+
/* c8 ignore next 2 */
|
|
115
|
+
default: break;
|
|
116
|
+
}
|
|
117
|
+
}), e === 0 ? t !== 0 && (this.activeAxis = "y", this.inputY.focus()) : (this.activeAxis = "x", this.inputX.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(), (e !== 0 || t !== 0) && (this._valueChanged = !0, this.dispatchEvent(new Event("input", {
|
|
118
|
+
bubbles: !0,
|
|
119
|
+
composed: !0
|
|
120
|
+
})), this.dispatchEvent(new Event("change", {
|
|
121
|
+
bubbles: !0,
|
|
122
|
+
composed: !0,
|
|
123
|
+
cancelable: !0
|
|
124
|
+
})) || this.colorController.restorePreviousColor());
|
|
125
|
+
}
|
|
126
|
+
handleKeyup(e) {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
let { code: t } = e;
|
|
129
|
+
this.activeKeys.delete(t);
|
|
130
|
+
}
|
|
131
|
+
handleInput(e) {
|
|
132
|
+
let { valueAsNumber: t, name: n } = e.target;
|
|
133
|
+
this[n] = t;
|
|
134
|
+
}
|
|
135
|
+
handleChange(e) {
|
|
136
|
+
this.handleInput(e), this.dispatchEvent(new Event("change", {
|
|
137
|
+
bubbles: !0,
|
|
138
|
+
composed: !0,
|
|
139
|
+
cancelable: !0
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
handlePointerdown(e) {
|
|
143
|
+
if (e.button !== 0) {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this._pointerDown = !0, this.colorController.savePreviousColor(), this.boundingClientRect = this.getBoundingClientRect(), e.target.setPointerCapture(e.pointerId), e.pointerType === "mouse" && (this.focused = !0);
|
|
148
|
+
}
|
|
149
|
+
handlePointermove(e) {
|
|
150
|
+
let [t, n] = this.calculateHandlePosition(e);
|
|
151
|
+
this._valueChanged = !1, this.x = t, this.y = n, this.dispatchEvent(new Event("input", {
|
|
152
|
+
bubbles: !0,
|
|
153
|
+
composed: !0,
|
|
154
|
+
cancelable: !0
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
handlePointerup(e) {
|
|
158
|
+
e.preventDefault(), this._pointerDown = !1, e.target.releasePointerCapture(e.pointerId);
|
|
159
|
+
let t = this.dispatchEvent(new Event("change", {
|
|
160
|
+
bubbles: !0,
|
|
161
|
+
composed: !0,
|
|
162
|
+
cancelable: !0
|
|
163
|
+
}));
|
|
164
|
+
this.inputX.focus(), e.pointerType === "mouse" && (this.focused = !1), t || this.colorController.restorePreviousColor();
|
|
165
|
+
}
|
|
166
|
+
calculateHandlePosition(e) {
|
|
167
|
+
/* c8 ignore next 3 */
|
|
168
|
+
if (!this.boundingClientRect) return [this.x, this.y];
|
|
169
|
+
let t = this.boundingClientRect, n = t.left, r = t.top, i = e.clientX, a = e.clientY, o = t.width, s = t.height, c = Math.max(0, Math.min(1, (i - n) / o)), l = Math.max(0, Math.min(1, (a - r) / s));
|
|
170
|
+
return [this.isLTR ? c : 1 - c, 1 - l];
|
|
171
|
+
}
|
|
172
|
+
handleAreaPointerdown(e) {
|
|
173
|
+
e.button === 0 && (e.stopPropagation(), e.preventDefault(), this.handle.dispatchEvent(new PointerEvent("pointerdown", e)), this.handlePointermove(e));
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
let { width: e = 0, height: t = 0 } = this.boundingClientRect || {}, i = r() || n(), a = "Color Picker", c = d(i ? void 0 : "2d slider"), l = this.labelX, u = this.labelY, f = new Intl.NumberFormat(this.languageResolver.language, {
|
|
177
|
+
style: "percent",
|
|
178
|
+
unitDisplay: "narrow"
|
|
179
|
+
}).format(this.x), p = new Intl.NumberFormat(this.languageResolver.language, {
|
|
180
|
+
style: "percent",
|
|
181
|
+
unitDisplay: "narrow"
|
|
182
|
+
}).format(this.y), m = { background: `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%);` };
|
|
183
|
+
return s`
|
|
184
|
+
<div
|
|
185
|
+
@pointerdown=${this.handleAreaPointerdown}
|
|
186
|
+
class="gradient"
|
|
187
|
+
style="background: ${m.background}"
|
|
188
|
+
>
|
|
189
|
+
<slot name="gradient"></slot>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<luzmo-color-handle
|
|
193
|
+
tabindex=${d(this.focused ? void 0 : "0")}
|
|
194
|
+
@focus=${this.forwardFocus}
|
|
195
|
+
?focused=${this.focused}
|
|
196
|
+
class="handle"
|
|
197
|
+
color=${this.colorController.getHslString()}
|
|
198
|
+
?disabled=${this.disabled}
|
|
199
|
+
style=${`transform: translate(${(this.isLTR ? this.x : 1 - this.x) * e}px, ${t - this.y * t}px);`}
|
|
200
|
+
${o({
|
|
201
|
+
start: ["pointerdown", this.handlePointerdown],
|
|
202
|
+
streamInside: ["pointermove", this.handlePointermove],
|
|
203
|
+
end: [[
|
|
204
|
+
"pointerup",
|
|
205
|
+
"pointercancel",
|
|
206
|
+
"pointerleave"
|
|
207
|
+
], this.handlePointerup]
|
|
208
|
+
})}
|
|
209
|
+
></luzmo-color-handle>
|
|
210
|
+
|
|
211
|
+
<fieldset
|
|
212
|
+
class="fieldset"
|
|
213
|
+
aria-label=${d(i ? a : void 0)}
|
|
214
|
+
>
|
|
215
|
+
<div role="presentation">
|
|
216
|
+
<input
|
|
217
|
+
type="range"
|
|
218
|
+
class="slider"
|
|
219
|
+
name="x"
|
|
220
|
+
aria-label=${i ? l : `${l} ${a}`}
|
|
221
|
+
aria-roledescription=${c}
|
|
222
|
+
aria-orientation="horizontal"
|
|
223
|
+
aria-valuetext=${i ? f : `${f}, ${l}${this._valueChanged ? "" : `, ${p}, ${u}`}`}
|
|
224
|
+
min="0"
|
|
225
|
+
max="1"
|
|
226
|
+
step=${this.step}
|
|
227
|
+
tabindex="-1"
|
|
228
|
+
.value=${String(this.x)}
|
|
229
|
+
@input=${this.handleInput}
|
|
230
|
+
@change=${this.handleChange}
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
<div role="presentation">
|
|
234
|
+
<input
|
|
235
|
+
type="range"
|
|
236
|
+
class="slider"
|
|
237
|
+
name="y"
|
|
238
|
+
aria-label=${i ? u : `${u} ${a}`}
|
|
239
|
+
aria-roledescription=${c}
|
|
240
|
+
aria-orientation="vertical"
|
|
241
|
+
aria-valuetext=${i ? p : `${p}, ${u}${this._valueChanged ? "" : `, ${f}, ${l}`}`}
|
|
242
|
+
orient="vertical"
|
|
243
|
+
min="0"
|
|
244
|
+
max="1"
|
|
245
|
+
step=${this.step}
|
|
246
|
+
tabindex="-1"
|
|
247
|
+
.value=${String(this.y)}
|
|
248
|
+
@input=${this.handleInput}
|
|
249
|
+
@change=${this.handleChange}
|
|
250
|
+
/>
|
|
251
|
+
</div>
|
|
252
|
+
</fieldset>
|
|
253
|
+
`;
|
|
254
|
+
}
|
|
255
|
+
firstUpdated(e) {
|
|
256
|
+
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);
|
|
257
|
+
}
|
|
258
|
+
updated(e) {
|
|
259
|
+
if (super.updated(e), this.x !== this.inputX.valueAsNumber && this.colorController.color.set("s", this.inputX.valueAsNumber * 100), this.y !== this.inputY.valueAsNumber && this.colorController.color.set("v", (1 - this.inputY.valueAsNumber) * 100), e.has("focused") && this.focused) {
|
|
260
|
+
let e = this.inputX.parentElement, t = this.inputY.parentElement;
|
|
261
|
+
if (!e.shadowRoot && !t.shadowRoot) {
|
|
262
|
+
e.attachShadow({ mode: "open" }), t.attachShadow({ mode: "open" });
|
|
263
|
+
let n = "<div tabindex=\"-1\"><slot></slot></div>";
|
|
264
|
+
e.shadowRoot.innerHTML = n, t.shadowRoot.innerHTML = n;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
connectedCallback() {
|
|
269
|
+
super.connectedCallback(), !this.observer && window.ResizeObserver && (this.observer = new window.ResizeObserver((e) => {
|
|
270
|
+
for (let t of e) this.boundingClientRect = t.contentRect;
|
|
271
|
+
this.requestUpdate();
|
|
272
|
+
})), this.observer?.observe(this);
|
|
273
|
+
}
|
|
274
|
+
disconnectedCallback() {
|
|
275
|
+
this.observer?.unobserve(this), super.disconnectedCallback();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/components/color-area/index.ts
|
|
280
|
+
t([l({
|
|
281
|
+
type: String,
|
|
282
|
+
reflect: !0
|
|
283
|
+
})], p.prototype, "dir", void 0), t([l({
|
|
284
|
+
type: Boolean,
|
|
285
|
+
reflect: !0
|
|
286
|
+
})], p.prototype, "disabled", void 0), t([l({
|
|
287
|
+
type: Boolean,
|
|
288
|
+
reflect: !0
|
|
289
|
+
})], p.prototype, "focused", void 0), t([l({
|
|
290
|
+
type: String,
|
|
291
|
+
attribute: "label-x"
|
|
292
|
+
})], p.prototype, "labelX", void 0), t([l({
|
|
293
|
+
type: String,
|
|
294
|
+
attribute: "label-y"
|
|
295
|
+
})], p.prototype, "labelY", void 0), t([l({
|
|
296
|
+
type: Boolean,
|
|
297
|
+
attribute: "is-ltr"
|
|
298
|
+
})], p.prototype, "isLTR", void 0), t([u(".handle")], p.prototype, "handle", void 0), t([l({ type: Number })], p.prototype, "hue", null), t([l({ type: String })], p.prototype, "value", null), t([l({ type: String })], p.prototype, "color", null), t([l({ attribute: !1 })], p.prototype, "activeAxis", void 0), t([l({ type: Number })], p.prototype, "x", null), t([l({ type: Number })], p.prototype, "y", null), t([l({ type: Number })], p.prototype, "step", void 0), t([u("[name=\"x\"]")], p.prototype, "inputX", void 0), t([u("[name=\"y\"]")], p.prototype, "inputY", void 0), customElements.get("luzmo-color-area") || customElements.define("luzmo-color-area", p);
|
|
299
|
+
//#endregion
|
|
300
|
+
export { p as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
const e=require(`./chunk-D-qHiVGv.cjs`);let t=require(`colorjs.io`);t=e.n(t,1);var n=class{get color(){return this._color}validateColorString(e){let t={spaceId:null,coords:[0,0,0],isValid:!1,alpha:1},n=[/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d*\.?\d+)\s*\)/i,/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i,/^rgba\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(0|0?\.\d+|1)\s*$/i,/^rgb\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*$/i,/^rgba\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(\d*\.?\d+)\s*\)$/i,/^rgb\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*\)$/i,/rgb\(\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*\)/i,/rgba\(\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(\d*\.?\d+)\s*\)/i],r=[/hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,/hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,/^hsla\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,/^hsl\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,/^hsla\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,/^hsl\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i],i=[/hsva\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,/hsv\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,/^hsva\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,/^hsv\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,/^hsva\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,/^hsv\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i],a=[/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})?$/,/^#([A-Fa-f0-9]{3})([A-Fa-f0-9]{1})?$/],o=n.find(t=>t.test(e))?.exec(e),s=r.find(t=>t.test(e))?.exec(e),c=i.find(t=>t.test(e))?.exec(e),l=a.find(t=>t.test(e))?.exec(e);if(o){let[,e,n,r,i]=o.filter(e=>typeof e==`string`),a=i===void 0?1:Number(i),s=e=>e.includes(`%`)?Number(e.replace(`%`,``))/100:Number(e)/255,c=s(e),l=s(n),u=s(r);t.spaceId=`srgb`,t.coords=[c,l,u],t.alpha=a,t.isValid=c>=0&&c<=1&&l>=0&&l<=1&&u>=0&&u<=1&&a>=0&&a<=1}else if(s){let[,e,n,r,i]=s,[a,o,c,l]=[e,n,r,i===void 0?`1`:i].map(e=>Number(e.replaceAll(/[^\d.]/g,``)));t.spaceId=`hsl`,t.coords=[a,o,c],t.alpha=l,t.isValid=a>=0&&a<=360&&o>=0&&o<=100&&c>=0&&c<=100&&l>=0&&l<=1}else if(c){let[,e,n,r,i]=c,[a,o,s,l]=[e,n,r,i===void 0?`1`:i].map(e=>Number(e.replaceAll(/[^\d.]/g,``)));t.spaceId=`hsv`,t.coords=[a,o,s],t.alpha=l,t.isValid=a>=0&&a<=360&&o>=0&&o<=100&&s>=0&&s<=100&&l>=0&&l<=1}else if(l){let[,e,n]=l,r=e=>(e.length===1&&(e+=e),Number.parseInt(e,16)/255),i,a,o;e.length===3?(i=r(e.slice(0,1)),a=r(e.slice(1,2)),o=r(e.slice(2,3))):(i=r(e.slice(0,2)),a=r(e.slice(2,4)),o=r(e.slice(4,6)));let s=n?r(n):1;t.spaceId=`srgb`,t.coords=[i,a,o],t.alpha=s,t.isValid=i>=0&&i<=1&&a>=0&&a<=1&&o>=0&&o<=1&&s>=0&&s<=1}return t}get colorOrigin(){return this._colorOrigin}set colorOrigin(e){this._colorOrigin=e}set color(e){this._colorOrigin=e;let n;if(typeof e==`string`){let r=this.validateColorString(e);if(r.isValid){let[e,i,a]=r.coords;n=new t.default(`${r.spaceId}`,[e,i,a],r.alpha)}else try{t.default.parse(e)}catch{try{n=new t.default(`#${e}`)}catch{return}}}else if(e instanceof t.default)n=e;else if(!Array.isArray(e)){let{h:r,s:i,l:a,v:o,r:s,g:c,b:l,a:u}=e;if(r!==void 0&&i!==void 0){let e=a??o;n=new t.default(a===void 0?`hsv`:`hsl`,[Number.parseFloat(r),typeof i==`string`?Number.parseFloat(i):i*100,typeof e==`string`?Number.parseFloat(e):e*100],Number.parseFloat(u||`1`))}else s!==void 0&&c!==void 0&&l!==void 0&&(n=new t.default(`srgb`,[Number.parseFloat(s)/255,Number.parseFloat(c)/255,Number.parseFloat(l)/255],Number.parseFloat(u||`1`)))}n||=new t.default(e),this._color=this.manageAs?n.to(this.manageAs):n,this.host.requestUpdate()}get colorValue(){let e;if(typeof this._colorOrigin==`string`)switch(e=this._colorOrigin.startsWith(`#`)?`hex string`:this._colorOrigin.startsWith(`rgb`)?`rgb`:this._colorOrigin.startsWith(`hsl`)?`hsl`:this._colorOrigin.startsWith(`hsv`)?`hsv`:`hex`,e){case`hsv`:{let e=this._colorOrigin[3]===`a`,{h:t,s:n,v:r}=this._color.to(`hsv`).hsv,i=this._color.alpha;return`hsv${e?`a`:``}(${Math.round(t)}, ${Math.round(n)}%, ${Math.round(r)}%${e?`, ${i}`:``})`}case`hsl`:{let e=this._colorOrigin[3]===`a`,{h:t,s:n,l:r}=this._color.to(`hsl`).hsl,i=this._color.alpha;return`hsl${e?`a`:``}(${Math.round(t)}, ${Math.round(n)}%, ${Math.round(r)}%${e?`, ${i}`:``})`}case`hex string`:{let{r:e,g:t,b:n}=this._color.to(`srgb`).srgb,r=this._colorOrigin.length===5||this._colorOrigin.length===9,i=this._color.alpha,a=Math.round(e*255).toString(16),o=Math.round(t*255).toString(16),s=Math.round(n*255).toString(16),c=Math.round(i*255).toString(16);return`#${a.padStart(2,`0`)}${o.padStart(2,`0`)}${s.padStart(2,`0`)}${r?c.padStart(2,`0`):``}`}case`hex`:{let{r:e,g:t,b:n}=this._color.to(`srgb`).srgb,r=this._colorOrigin.length===4||this._colorOrigin.length===8,i=this._color.alpha,a=Math.round(e*255).toString(16),o=Math.round(t*255).toString(16),s=Math.round(n*255).toString(16),c=Math.round(i*255).toString(16);return`${a.padStart(2,`0`)}${o.padStart(2,`0`)}${s.padStart(2,`0`)}${r?c.padStart(2,`0`):``}`}default:{let{r:e,g:t,b:n}=this._color.to(`srgb`).srgb,r=this._colorOrigin[3]===`a`,i=this._color.alpha;return this._colorOrigin.search(`%`)>-1?`rgb${r?`a`:``}(${Math.round(e*100)}%, ${Math.round(t*100)}%, ${Math.round(n*100)}%${r?`,${Math.round(i*100)}%`:``})`:`rgb${r?`a`:``}(${Math.round(e*255)}, ${Math.round(t*255)}, ${Math.round(n*255)}${r?`, ${i}`:``})`}}if(this._colorOrigin)try{({spaceId:e}=new t.default(this._colorOrigin))}catch{let{h:t,s:n,l:r,v:i,r:a,g:o,b:s}=this._colorOrigin;t!==void 0&&n!==void 0&&r!==void 0?e=`hsl`:t!==void 0&&n!==void 0&&i!==void 0?e=`hsv`:a!==void 0&&o!==void 0&&s!==void 0&&(e=`srgb`)}else ({spaceId:e}=this.color);switch(e){case`hsv`:{let{h:e,s:t,v:n}=this._color.to(`hsv`).hsv;return{h:e,s:t/100,v:n/100,a:this._color.alpha}}case`hsl`:{let{h:e,s:t,l:n}=this._color.to(`hsl`).hsl;return{h:e,s:t/100,l:n/100,a:this._color.alpha}}case`srgb`:{let{r:e,g:t,b:n}=this._color.to(`srgb`).srgb;return this._colorOrigin&&typeof this._colorOrigin.r==`string`&&this._colorOrigin.r.search(`%`)?{r:`${Math.round(e*255)}%`,g:`${Math.round(t*255)}%`,b:`${Math.round(n*255)}%`,a:this._color.alpha}:{r:Math.round(e*255),g:Math.round(t*255),b:Math.round(n*255),a:this._color.alpha}}}return this._color}get hue(){return Number(this._color.to(`hsl`).hsl.h)}set hue(e){this._color.set(`h`,e),this.host.requestUpdate()}constructor(e,{manageAs:n}={}){this._color=new t.default(`hsv`,[0,100,100],1),this.host=e,this.manageAs=n}getColor(e){if(typeof e==`string`&&![`srgb`,`hsva`,`hsv`,`hsl`,`hsla`].includes(e))throw Error(`not a valid format`);return this._color.to(e)}getHslString(){return this._color.to(`hsl`).toString()}savePreviousColor(){this._previousColor=this._color.clone()}restorePreviousColor(){this._color=this._previousColor}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import e from "colorjs.io";
|
|
19
|
+
//#region src/utils/reactive-controllers/color-controller.ts
|
|
20
|
+
var t = class {
|
|
21
|
+
get color() {
|
|
22
|
+
return this._color;
|
|
23
|
+
}
|
|
24
|
+
validateColorString(e) {
|
|
25
|
+
let t = {
|
|
26
|
+
spaceId: null,
|
|
27
|
+
coords: [
|
|
28
|
+
0,
|
|
29
|
+
0,
|
|
30
|
+
0
|
|
31
|
+
],
|
|
32
|
+
isValid: !1,
|
|
33
|
+
alpha: 1
|
|
34
|
+
}, n = [
|
|
35
|
+
/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d*\.?\d+)\s*\)/i,
|
|
36
|
+
/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i,
|
|
37
|
+
/^rgba\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(0|0?\.\d+|1)\s*$/i,
|
|
38
|
+
/^rgb\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*$/i,
|
|
39
|
+
/^rgba\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(\d*\.?\d+)\s*\)$/i,
|
|
40
|
+
/^rgb\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*\)$/i,
|
|
41
|
+
/rgb\(\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*\)/i,
|
|
42
|
+
/rgba\(\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(\d*\.?\d+)\s*\)/i
|
|
43
|
+
], r = [
|
|
44
|
+
/hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,
|
|
45
|
+
/hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,
|
|
46
|
+
/^hsla\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,
|
|
47
|
+
/^hsl\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,
|
|
48
|
+
/^hsla\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,
|
|
49
|
+
/^hsl\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i
|
|
50
|
+
], i = [
|
|
51
|
+
/hsva\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,
|
|
52
|
+
/hsv\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,
|
|
53
|
+
/^hsva\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,
|
|
54
|
+
/^hsv\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,
|
|
55
|
+
/^hsva\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,
|
|
56
|
+
/^hsv\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i
|
|
57
|
+
], a = [/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})?$/, /^#([A-Fa-f0-9]{3})([A-Fa-f0-9]{1})?$/], o = n.find((t) => t.test(e))?.exec(e), s = r.find((t) => t.test(e))?.exec(e), c = i.find((t) => t.test(e))?.exec(e), l = a.find((t) => t.test(e))?.exec(e);
|
|
58
|
+
if (o) {
|
|
59
|
+
let [, e, n, r, i] = o.filter((e) => typeof e == "string"), a = i === void 0 ? 1 : Number(i), s = (e) => e.includes("%") ? Number(e.replace("%", "")) / 100 : Number(e) / 255, c = s(e), l = s(n), u = s(r);
|
|
60
|
+
t.spaceId = "srgb", t.coords = [
|
|
61
|
+
c,
|
|
62
|
+
l,
|
|
63
|
+
u
|
|
64
|
+
], t.alpha = a, t.isValid = c >= 0 && c <= 1 && l >= 0 && l <= 1 && u >= 0 && u <= 1 && a >= 0 && a <= 1;
|
|
65
|
+
} else if (s) {
|
|
66
|
+
let [, e, n, r, i] = s, [a, o, c, l] = [
|
|
67
|
+
e,
|
|
68
|
+
n,
|
|
69
|
+
r,
|
|
70
|
+
i === void 0 ? "1" : i
|
|
71
|
+
].map((e) => Number(e.replaceAll(/[^\d.]/g, "")));
|
|
72
|
+
t.spaceId = "hsl", t.coords = [
|
|
73
|
+
a,
|
|
74
|
+
o,
|
|
75
|
+
c
|
|
76
|
+
], t.alpha = l, t.isValid = a >= 0 && a <= 360 && o >= 0 && o <= 100 && c >= 0 && c <= 100 && l >= 0 && l <= 1;
|
|
77
|
+
} else if (c) {
|
|
78
|
+
let [, e, n, r, i] = c, [a, o, s, l] = [
|
|
79
|
+
e,
|
|
80
|
+
n,
|
|
81
|
+
r,
|
|
82
|
+
i === void 0 ? "1" : i
|
|
83
|
+
].map((e) => Number(e.replaceAll(/[^\d.]/g, "")));
|
|
84
|
+
t.spaceId = "hsv", t.coords = [
|
|
85
|
+
a,
|
|
86
|
+
o,
|
|
87
|
+
s
|
|
88
|
+
], t.alpha = l, t.isValid = a >= 0 && a <= 360 && o >= 0 && o <= 100 && s >= 0 && s <= 100 && l >= 0 && l <= 1;
|
|
89
|
+
} else if (l) {
|
|
90
|
+
let [, e, n] = l, r = (e) => (e.length === 1 && (e += e), Number.parseInt(e, 16) / 255), i, a, o;
|
|
91
|
+
e.length === 3 ? (i = r(e.slice(0, 1)), a = r(e.slice(1, 2)), o = r(e.slice(2, 3))) : (i = r(e.slice(0, 2)), a = r(e.slice(2, 4)), o = r(e.slice(4, 6)));
|
|
92
|
+
let s = n ? r(n) : 1;
|
|
93
|
+
t.spaceId = "srgb", t.coords = [
|
|
94
|
+
i,
|
|
95
|
+
a,
|
|
96
|
+
o
|
|
97
|
+
], t.alpha = s, t.isValid = i >= 0 && i <= 1 && a >= 0 && a <= 1 && o >= 0 && o <= 1 && s >= 0 && s <= 1;
|
|
98
|
+
}
|
|
99
|
+
return t;
|
|
100
|
+
}
|
|
101
|
+
get colorOrigin() {
|
|
102
|
+
return this._colorOrigin;
|
|
103
|
+
}
|
|
104
|
+
set colorOrigin(e) {
|
|
105
|
+
this._colorOrigin = e;
|
|
106
|
+
}
|
|
107
|
+
set color(t) {
|
|
108
|
+
this._colorOrigin = t;
|
|
109
|
+
let n;
|
|
110
|
+
if (typeof t == "string") {
|
|
111
|
+
let r = this.validateColorString(t);
|
|
112
|
+
if (r.isValid) {
|
|
113
|
+
let [t, i, a] = r.coords;
|
|
114
|
+
n = new e(`${r.spaceId}`, [
|
|
115
|
+
t,
|
|
116
|
+
i,
|
|
117
|
+
a
|
|
118
|
+
], r.alpha);
|
|
119
|
+
} else try {
|
|
120
|
+
e.parse(t);
|
|
121
|
+
} catch {
|
|
122
|
+
try {
|
|
123
|
+
n = new e(`#${t}`);
|
|
124
|
+
} catch {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
} else if (t instanceof e) n = t;
|
|
129
|
+
else if (!Array.isArray(t)) {
|
|
130
|
+
let { h: r, s: i, l: a, v: o, r: s, g: c, b: l, a: u } = t;
|
|
131
|
+
if (r !== void 0 && i !== void 0) {
|
|
132
|
+
let t = a ?? o;
|
|
133
|
+
n = new e(a === void 0 ? "hsv" : "hsl", [
|
|
134
|
+
Number.parseFloat(r),
|
|
135
|
+
typeof i == "string" ? Number.parseFloat(i) : i * 100,
|
|
136
|
+
typeof t == "string" ? Number.parseFloat(t) : t * 100
|
|
137
|
+
], Number.parseFloat(u || "1"));
|
|
138
|
+
} else s !== void 0 && c !== void 0 && l !== void 0 && (n = new e("srgb", [
|
|
139
|
+
Number.parseFloat(s) / 255,
|
|
140
|
+
Number.parseFloat(c) / 255,
|
|
141
|
+
Number.parseFloat(l) / 255
|
|
142
|
+
], Number.parseFloat(u || "1")));
|
|
143
|
+
}
|
|
144
|
+
n ||= new e(t), this._color = this.manageAs ? n.to(this.manageAs) : n, this.host.requestUpdate();
|
|
145
|
+
}
|
|
146
|
+
get colorValue() {
|
|
147
|
+
let t;
|
|
148
|
+
if (typeof this._colorOrigin == "string") switch (t = this._colorOrigin.startsWith("#") ? "hex string" : this._colorOrigin.startsWith("rgb") ? "rgb" : this._colorOrigin.startsWith("hsl") ? "hsl" : this._colorOrigin.startsWith("hsv") ? "hsv" : "hex", t) {
|
|
149
|
+
case "hsv": {
|
|
150
|
+
let e = this._colorOrigin[3] === "a", { h: t, s: n, v: r } = this._color.to("hsv").hsv, i = this._color.alpha;
|
|
151
|
+
return `hsv${e ? "a" : ""}(${Math.round(t)}, ${Math.round(n)}%, ${Math.round(r)}%${e ? `, ${i}` : ""})`;
|
|
152
|
+
}
|
|
153
|
+
case "hsl": {
|
|
154
|
+
let e = this._colorOrigin[3] === "a", { h: t, s: n, l: r } = this._color.to("hsl").hsl, i = this._color.alpha;
|
|
155
|
+
return `hsl${e ? "a" : ""}(${Math.round(t)}, ${Math.round(n)}%, ${Math.round(r)}%${e ? `, ${i}` : ""})`;
|
|
156
|
+
}
|
|
157
|
+
case "hex string": {
|
|
158
|
+
let { r: e, g: t, b: n } = this._color.to("srgb").srgb, r = this._colorOrigin.length === 5 || this._colorOrigin.length === 9, i = this._color.alpha, a = Math.round(e * 255).toString(16), o = Math.round(t * 255).toString(16), s = Math.round(n * 255).toString(16), c = Math.round(i * 255).toString(16);
|
|
159
|
+
return `#${a.padStart(2, "0")}${o.padStart(2, "0")}${s.padStart(2, "0")}${r ? c.padStart(2, "0") : ""}`;
|
|
160
|
+
}
|
|
161
|
+
case "hex": {
|
|
162
|
+
let { r: e, g: t, b: n } = this._color.to("srgb").srgb, r = this._colorOrigin.length === 4 || this._colorOrigin.length === 8, i = this._color.alpha, a = Math.round(e * 255).toString(16), o = Math.round(t * 255).toString(16), s = Math.round(n * 255).toString(16), c = Math.round(i * 255).toString(16);
|
|
163
|
+
return `${a.padStart(2, "0")}${o.padStart(2, "0")}${s.padStart(2, "0")}${r ? c.padStart(2, "0") : ""}`;
|
|
164
|
+
}
|
|
165
|
+
default: {
|
|
166
|
+
let { r: e, g: t, b: n } = this._color.to("srgb").srgb, r = this._colorOrigin[3] === "a", i = this._color.alpha;
|
|
167
|
+
return this._colorOrigin.search("%") > -1 ? `rgb${r ? "a" : ""}(${Math.round(e * 100)}%, ${Math.round(t * 100)}%, ${Math.round(n * 100)}%${r ? `,${Math.round(i * 100)}%` : ""})` : `rgb${r ? "a" : ""}(${Math.round(e * 255)}, ${Math.round(t * 255)}, ${Math.round(n * 255)}${r ? `, ${i}` : ""})`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (this._colorOrigin) try {
|
|
171
|
+
({spaceId: t} = new e(this._colorOrigin));
|
|
172
|
+
} catch {
|
|
173
|
+
let { h: e, s: n, l: r, v: i, r: a, g: o, b: s } = this._colorOrigin;
|
|
174
|
+
e !== void 0 && n !== void 0 && r !== void 0 ? t = "hsl" : e !== void 0 && n !== void 0 && i !== void 0 ? t = "hsv" : a !== void 0 && o !== void 0 && s !== void 0 && (t = "srgb");
|
|
175
|
+
}
|
|
176
|
+
else ({spaceId: t} = this.color);
|
|
177
|
+
switch (t) {
|
|
178
|
+
case "hsv": {
|
|
179
|
+
let { h: e, s: t, v: n } = this._color.to("hsv").hsv;
|
|
180
|
+
return {
|
|
181
|
+
h: e,
|
|
182
|
+
s: t / 100,
|
|
183
|
+
v: n / 100,
|
|
184
|
+
a: this._color.alpha
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
case "hsl": {
|
|
188
|
+
let { h: e, s: t, l: n } = this._color.to("hsl").hsl;
|
|
189
|
+
return {
|
|
190
|
+
h: e,
|
|
191
|
+
s: t / 100,
|
|
192
|
+
l: n / 100,
|
|
193
|
+
a: this._color.alpha
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case "srgb": {
|
|
197
|
+
let { r: e, g: t, b: n } = this._color.to("srgb").srgb;
|
|
198
|
+
return this._colorOrigin && typeof this._colorOrigin.r == "string" && this._colorOrigin.r.search("%") ? {
|
|
199
|
+
r: `${Math.round(e * 255)}%`,
|
|
200
|
+
g: `${Math.round(t * 255)}%`,
|
|
201
|
+
b: `${Math.round(n * 255)}%`,
|
|
202
|
+
a: this._color.alpha
|
|
203
|
+
} : {
|
|
204
|
+
r: Math.round(e * 255),
|
|
205
|
+
g: Math.round(t * 255),
|
|
206
|
+
b: Math.round(n * 255),
|
|
207
|
+
a: this._color.alpha
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return this._color;
|
|
212
|
+
}
|
|
213
|
+
get hue() {
|
|
214
|
+
return Number(this._color.to("hsl").hsl.h);
|
|
215
|
+
}
|
|
216
|
+
set hue(e) {
|
|
217
|
+
this._color.set("h", e), this.host.requestUpdate();
|
|
218
|
+
}
|
|
219
|
+
constructor(t, { manageAs: n } = {}) {
|
|
220
|
+
this._color = new e("hsv", [
|
|
221
|
+
0,
|
|
222
|
+
100,
|
|
223
|
+
100
|
|
224
|
+
], 1), this.host = t, this.manageAs = n;
|
|
225
|
+
}
|
|
226
|
+
getColor(e) {
|
|
227
|
+
if (typeof e == "string" && ![
|
|
228
|
+
"srgb",
|
|
229
|
+
"hsva",
|
|
230
|
+
"hsv",
|
|
231
|
+
"hsl",
|
|
232
|
+
"hsla"
|
|
233
|
+
].includes(e)) throw Error("not a valid format");
|
|
234
|
+
return this._color.to(e);
|
|
235
|
+
}
|
|
236
|
+
getHslString() {
|
|
237
|
+
return this._color.to("hsl").toString();
|
|
238
|
+
}
|
|
239
|
+
savePreviousColor() {
|
|
240
|
+
this._previousColor = this._color.clone();
|
|
241
|
+
}
|
|
242
|
+
restorePreviousColor() {
|
|
243
|
+
this._color = this._previousColor;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
export { t };
|
|
@@ -20,6 +20,7 @@ export declare class LuzmoColorField extends LuzmoTextFieldBase {
|
|
|
20
20
|
set value(value: string);
|
|
21
21
|
get value(): string;
|
|
22
22
|
protected _value: string;
|
|
23
|
+
protected updated(changedProperties: Map<string, any>): void;
|
|
23
24
|
private renderColorHandle;
|
|
24
25
|
getColorValue(): string;
|
|
25
26
|
protected render(): TemplateResult;
|
|
@@ -15,9 +15,4 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
<luzmo-color-handle
|
|
20
|
-
size="m"
|
|
21
|
-
color=${this.colorController.getColor("srgb").toString()}
|
|
22
|
-
></luzmo-color-handle>
|
|
23
|
-
`:t.x``}getColorValue(){return this.valid?this.colorController.getColor("srgb").toString():""}render(){return this.viewColor&&Promise.resolve().then(()=>require("../color-handle/index.cjs")),t.x` ${super.render()} ${this.renderColorHandle()} `}checkValidity(){let e=super.checkValidity();if(this.value){const l=this.colorController.validateColorString(this.value);this.valid=e=l.isValid&&(!this.noAlphaChannel||l.alpha===1),this.invalid=!e,this.valid&&(this.colorController.color=this.value)}else this.valid=this.invalid=!1;return e}}a([t.n({type:Boolean,attribute:"view-color"})],r.prototype,"viewColor");a([t.n({type:Boolean,attribute:"no-alpha-channel"})],r.prototype,"noAlphaChannel");customElements.get("luzmo-color-field")||customElements.define("luzmo-color-field",r);exports.LuzmoColorField=r;
|
|
18
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../color-field-D7_7z2A2.cjs`);exports.LuzmoColorField=e.t;
|