@luzmo/lucero 1.0.1-alpha.14 → 1.0.1-alpha.16
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/index.cjs +183 -6
- package/components/accordion/index.js +136 -88
- package/components/action-bar/index.cjs +85 -4
- package/components/action-bar/index.js +72 -50
- package/components/action-button/index.cjs +205 -3
- package/components/action-button/index.js +167 -93
- package/components/action-group/index.cjs +7 -1
- package/components/action-group/index.js +12 -8
- package/components/action-group-DHp8RHDf.js +392 -0
- package/components/action-group-MPf19RPV.cjs +391 -0
- package/components/action-menu/index.cjs +91 -11
- package/components/action-menu/index.js +66 -47
- package/components/avatar/index.cjs +63 -3
- package/components/avatar/index.js +54 -42
- package/components/base-COw9n7UR.cjs +119 -0
- package/components/base-DmeVy0cq.js +120 -0
- package/components/button/index.cjs +134 -2
- package/components/button/index.js +106 -72
- package/components/button-base-7Ak55xFd.cjs +206 -0
- package/components/button-base-C3kf6BTK.js +207 -0
- package/components/button-group/index.cjs +45 -1
- package/components/button-group/index.js +37 -25
- package/components/calendar/index.cjs +632 -1
- package/components/calendar/index.js +637 -7
- package/components/checkbox/index.cjs +111 -4
- package/components/checkbox/index.js +98 -53
- package/components/checkbox-mixin-8cL-vfDy.js +84 -0
- package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
- package/components/clear-button-Co6oKSgl.js +59 -0
- package/components/clear-button-X_HDY2eH.cjs +58 -0
- package/components/close-button-DPBK6Kpu.cjs +59 -0
- package/components/close-button-Miw9ZjoJ.js +60 -0
- package/components/color-area/index.cjs +440 -13
- package/components/color-area/index.js +322 -187
- package/components/color-controller-BjDZaxhX.js +491 -0
- package/components/color-controller-C3c_vb2P.cjs +490 -0
- package/components/color-field/index.cjs +95 -2
- package/components/color-field/index.js +77 -41
- package/components/color-handle/index.cjs +64 -3
- package/components/color-handle/index.js +58 -37
- package/components/color-loupe/index.cjs +7 -1
- package/components/color-loupe/index.js +12 -8
- package/components/color-loupe-BQqNR8YD.cjs +88 -0
- package/components/color-loupe-B_DDFv8l.js +89 -0
- package/components/color-menu/index.cjs +217 -12
- package/components/color-menu/index.js +187 -93
- package/components/color-palette/index.cjs +89 -1
- package/components/color-palette/index.js +78 -51
- package/components/color-palette-group/index.cjs +259 -3
- package/components/color-palette-group/index.js +193 -105
- package/components/color-picker/index.cjs +114 -6
- package/components/color-picker/index.js +92 -72
- package/components/color-slider/index.cjs +585 -1
- package/components/color-slider/index.js +590 -7
- package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
- package/components/date-time-picker/index.cjs +1357 -31
- package/components/date-time-picker/index.js +951 -637
- package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
- package/components/divider/index.cjs +54 -1
- package/components/divider/index.js +49 -30
- package/components/divider.module-Cm5LcDRV.cjs +20 -0
- package/components/divider.module-DauH6k2_.js +21 -0
- package/components/element-resolution-DCsrhGZO.cjs +112 -0
- package/components/element-resolution-nMlmW4Jy.js +113 -0
- package/components/field-group/index.cjs +7 -1
- package/components/field-group/index.js +12 -8
- package/components/field-group-DNmY8W9v.cjs +86 -0
- package/components/field-group-DVdAWCQF.js +87 -0
- package/components/field-label/index.cjs +7 -1
- package/components/field-label/index.js +12 -8
- package/components/field-label-CKH9EXpR.cjs +156 -0
- package/components/field-label-Dpsecoc6.js +157 -0
- package/components/focus-group-BqDAk9Is.js +337 -0
- package/components/focus-group-DFzOlalL.cjs +336 -0
- package/components/focus-visible-B-B8-P9R.cjs +104 -0
- package/components/focus-visible-BUPRWlsh.js +105 -0
- package/components/focusable-BPrTcZPd.cjs +262 -0
- package/components/focusable-ChCLg1k4.js +263 -0
- package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
- package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
- package/components/icon/index.cjs +90 -1
- package/components/icon/index.js +74 -46
- package/components/index.cjs +174 -1
- package/components/index.js +174 -172
- package/components/infield-button/index.cjs +46 -2
- package/components/infield-button/index.js +41 -30
- package/components/label/index.cjs +37 -1
- package/components/label/index.js +36 -24
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
- package/components/language-resolution-iN9EImbb.cjs +57 -0
- package/components/like-anchor-D62faRNG.cjs +79 -0
- package/components/like-anchor-v3cJ9RWM.js +80 -0
- package/components/manage-help-text-BYx84zZR.cjs +125 -0
- package/components/manage-help-text-DOuMTGht.js +126 -0
- package/components/menu/index.cjs +1297 -29
- package/components/menu/index.js +954 -499
- package/components/multi-language-field/index.cjs +132 -2
- package/components/multi-language-field/index.js +118 -88
- package/components/number-field/index.cjs +613 -10
- package/components/number-field/index.js +442 -243
- package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
- package/components/observe-slot-presence-DcMdoumP.js +79 -0
- package/components/observe-slot-text-CSofZeeF.cjs +104 -0
- package/components/observe-slot-text-CjnkkBPn.js +105 -0
- package/components/options/index.cjs +693 -60
- package/components/options/index.js +519 -953
- package/components/overlay/index.cjs +367 -21
- package/components/overlay/index.js +273 -189
- package/components/overlay-CN8ISP1F.js +2485 -0
- package/components/overlay-LViy9VWM.cjs +2484 -0
- package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
- package/components/pending-state-e4RbXe9u.cjs +75 -0
- package/components/picker/index.cjs +9 -1
- package/components/picker/index.js +15 -11
- package/components/picker-DNde3awt.cjs +672 -0
- package/components/picker-PfUAF05y.js +673 -0
- package/components/picker-button/index.cjs +56 -4
- package/components/picker-button/index.js +45 -34
- package/components/platform-CxDar3Dn.cjs +68 -0
- package/components/platform-Cxn0WbyT.js +69 -0
- package/components/popover/index.cjs +7 -1
- package/components/popover/index.js +12 -8
- package/components/popover-BkbYhl3i.js +74 -0
- package/components/popover-BkgUf0kL.cjs +74 -0
- package/components/progress-circle/index.cjs +7 -1
- package/components/progress-circle/index.js +12 -8
- package/components/progress-circle-Hu_ivPHf.js +133 -0
- package/components/progress-circle-_Etqsj9f.cjs +132 -0
- package/components/radio/index.cjs +244 -2
- package/components/radio/index.js +192 -110
- package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
- package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
- package/components/roving-tabindex-AsmAh2In.cjs +95 -0
- package/components/roving-tabindex-DPF9NmrH.js +96 -0
- package/components/search/index.cjs +115 -8
- package/components/search/index.js +96 -66
- package/components/select/index.cjs +720 -51
- package/components/select/index.js +563 -347
- package/components/sized-mixin-DmkrNdWB.js +80 -0
- package/components/sized-mixin-UaTVa-AE.cjs +79 -0
- package/components/slider/index.cjs +119 -1
- package/components/slider/index.js +100 -1113
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
- package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
- package/components/strategies-DlMlaSJR.cjs +317 -0
- package/components/strategies-DlPQoTFE.js +318 -0
- package/components/streaming-listener-D4sHaMub.cjs +145 -0
- package/components/streaming-listener-cAz5zJyk.js +146 -0
- package/components/swatch/index.cjs +436 -7
- package/components/swatch/index.js +350 -205
- package/components/switch/index.cjs +61 -2
- package/components/switch/index.js +51 -34
- package/components/tabs/index.cjs +693 -26
- package/components/tabs/index.js +521 -388
- package/components/tags/index.cjs +201 -4
- package/components/tags/index.js +152 -87
- package/components/text-field/index.cjs +49 -3
- package/components/text-field/index.js +44 -30
- package/components/text-field-11tcnftU.cjs +338 -0
- package/components/text-field-Chi9J2Cz.js +339 -0
- package/components/text-field.module-CMBS0jSL.js +21 -0
- package/components/text-field.module-DIJdV_sA.cjs +20 -0
- package/components/toast/index.cjs +177 -12
- package/components/toast/index.js +145 -73
- package/components/tooltip/index.cjs +221 -6
- package/components/tooltip/index.js +156 -109
- package/components/unit-input/index.cjs +232 -8
- package/components/unit-input/index.js +201 -108
- package/components/utils.cjs +25 -1
- package/components/utils.js +22 -22
- package/package.json +1 -1
- 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-BjTwmyRF.cjs +0 -22
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- 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-BDN0dBtS.cjs +0 -27
- 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-B0uX6Zso.js +0 -3230
- package/components/color-controller-CoUL5f9K.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- 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/focusable-selectors-BgFlyFcY.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- 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-CaH1si5b.cjs +0 -26
- package/components/picker-BfBP7XJN.js +0 -461
- package/components/picker-xIphqE6d.cjs +0 -123
- package/components/platform-BM-uMWpX.js +0 -69
- 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/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/random-id-CqvckpWe.cjs +0 -18
- 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/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- 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-CeG75PPO.cjs +0 -85
- package/components/text-field-DCl-AFM-.js +0 -314
- package/components/text-field.module-C2KVUJcX.js +0 -21
- package/components/text-field.module-DXhFA9G-.cjs +0 -18
- package/components/when-CDZyJPvd.cjs +0 -22
|
@@ -15,86 +15,178 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const initializeGlobalLuzmoCSSVariables = () => {
|
|
19
|
+
if (typeof document !== "undefined" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
20
|
+
const styleElement = document.createElement("style");
|
|
21
|
+
styleElement.setAttribute("data-luzmo-vars", "");
|
|
22
|
+
styleElement.textContent = `html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}`;
|
|
23
|
+
document.head.appendChild(styleElement);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
initializeGlobalLuzmoCSSVariables();
|
|
27
|
+
import { TinyColor } from "@ctrl/tinycolor";
|
|
28
|
+
import { luzmoIcon, luzmoAngleUp, luzmoAngleDown } from "@luzmo/icons";
|
|
29
|
+
import { unsafeCSS, html } from "lit";
|
|
30
|
+
import { property, query, state } from "lit/decorators.js";
|
|
31
|
+
import { F as Focusable } from "../focusable-ChCLg1k4.js";
|
|
32
|
+
import { S as SizedMixin } from "../sized-mixin-DmkrNdWB.js";
|
|
24
33
|
import "../color-area/index.js";
|
|
25
34
|
import "../color-field/index.js";
|
|
26
35
|
import "../color-handle/index.js";
|
|
27
|
-
import
|
|
36
|
+
import "../color-slider/index.js";
|
|
28
37
|
import "../divider/index.js";
|
|
29
38
|
import "../popover/index.js";
|
|
30
39
|
import "../swatch/index.js";
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
const styles = '@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}';
|
|
41
|
+
var __defProp = Object.defineProperty;
|
|
42
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
43
|
+
var result = void 0;
|
|
44
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
45
|
+
if (decorator = decorators[i])
|
|
46
|
+
result = decorator(target, key, result) || result;
|
|
47
|
+
if (result) __defProp(target, key, result);
|
|
48
|
+
return result;
|
|
36
49
|
};
|
|
37
|
-
|
|
38
|
-
const C = '@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}';
|
|
39
|
-
var y = Object.defineProperty, t = (i, r, o, e) => {
|
|
40
|
-
for (var c = void 0, m = i.length - 1, d; m >= 0; m--)
|
|
41
|
-
(d = i[m]) && (c = d(r, o, c) || c);
|
|
42
|
-
return c && y(r, o, c), c;
|
|
43
|
-
};
|
|
44
|
-
const u = class u extends w(x) {
|
|
50
|
+
const _LuzmoColorMenu = class _LuzmoColorMenu extends SizedMixin(Focusable) {
|
|
45
51
|
constructor() {
|
|
46
|
-
super(...arguments)
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.color = "rgb(255, 0, 0)";
|
|
54
|
+
this.noAlphaChannel = false;
|
|
55
|
+
this._alpha = 1;
|
|
56
|
+
this._rgbColor = "rgb(255, 0, 0)";
|
|
57
|
+
this._rgbaColor = "rgb(255, 0, 0, 1)";
|
|
58
|
+
this._previousColor = "rgb(255, 0, 0)";
|
|
47
59
|
}
|
|
48
|
-
setColor(
|
|
49
|
-
var
|
|
50
|
-
const
|
|
51
|
-
this._format =
|
|
60
|
+
setColor(event) {
|
|
61
|
+
var _a;
|
|
62
|
+
const color = new TinyColor((_a = event == null ? void 0 : event.target) == null ? void 0 : _a.color);
|
|
63
|
+
this._format = color.format === "name" ? "rgb" : color.format;
|
|
64
|
+
this._rgbaColor = color.toRgbString();
|
|
65
|
+
this._alpha = this.noAlphaChannel ? 1 : color.getAlpha();
|
|
66
|
+
this._rgbColor = color.setAlpha(1).toRgbString();
|
|
67
|
+
this.hueSliderElement.color = this._rgbColor;
|
|
68
|
+
this.areaElement.color = this._rgbColor;
|
|
69
|
+
if (!this.noAlphaChannel) {
|
|
70
|
+
this.opacitySliderElement.color = this._rgbaColor;
|
|
71
|
+
}
|
|
72
|
+
this.swatchElement.color = this._rgbaColor;
|
|
73
|
+
this.colorFieldElement.value = this.formatTextField(color);
|
|
74
|
+
this._previousColor = this._rgbaColor;
|
|
75
|
+
this.color = this._rgbaColor;
|
|
76
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.color }));
|
|
52
77
|
}
|
|
53
|
-
handleAreaChange(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.
|
|
78
|
+
handleAreaChange(event) {
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
this._rgbColor = this.areaElement.color;
|
|
82
|
+
const newColor = new TinyColor(this._rgbColor);
|
|
83
|
+
this._rgbaColor = newColor.setAlpha(this._alpha).toRgbString();
|
|
84
|
+
this.colorFieldElement.value = this._rgbaColor;
|
|
85
|
+
if (!this.noAlphaChannel) {
|
|
86
|
+
this.opacitySliderElement.color = this._rgbaColor;
|
|
87
|
+
}
|
|
88
|
+
this.colorFieldElement.value = this.formatTextField(newColor);
|
|
89
|
+
this.swatchElement.color = this._rgbaColor;
|
|
90
|
+
this._previousColor = this._rgbaColor;
|
|
91
|
+
this.color = this._rgbaColor;
|
|
92
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.color }));
|
|
57
93
|
}
|
|
58
94
|
get focusElement() {
|
|
59
95
|
return this.areaElement || this.colorFieldElement || this;
|
|
60
96
|
}
|
|
61
|
-
handleHueSliderChange(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
97
|
+
handleHueSliderChange(event) {
|
|
98
|
+
event.stopPropagation();
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
const color = new TinyColor(this._rgbColor).toHsl();
|
|
101
|
+
color.h = this.hueSliderElement.value;
|
|
102
|
+
const newColor = new TinyColor(color);
|
|
103
|
+
this._rgbColor = newColor.toRgbString();
|
|
104
|
+
this._rgbaColor = newColor.setAlpha(this._alpha).toRgbString();
|
|
105
|
+
this.areaElement.color = `hsla(${color.h}, ${color.s * 100}%, ${color.l * 100}%, ${color.a})`;
|
|
106
|
+
if (!this.noAlphaChannel) {
|
|
107
|
+
this.opacitySliderElement.color = this._rgbaColor;
|
|
108
|
+
}
|
|
109
|
+
this.colorFieldElement.value = this.formatTextField(newColor);
|
|
110
|
+
this.swatchElement.color = this._rgbaColor;
|
|
111
|
+
this._previousColor = this._rgbaColor;
|
|
112
|
+
this.color = this._rgbaColor;
|
|
113
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.color }));
|
|
67
114
|
}
|
|
68
|
-
handleOpacitySliderChange(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.
|
|
115
|
+
handleOpacitySliderChange(event) {
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
this._alpha = this.opacitySliderElement.sliderHandlePosition / 100;
|
|
119
|
+
const newColor = new TinyColor(this._rgbColor).setAlpha(this._alpha);
|
|
120
|
+
this._rgbaColor = newColor.toRgbString();
|
|
121
|
+
this.colorFieldElement.value = this.formatTextField(newColor);
|
|
122
|
+
this.swatchElement.color = this._rgbaColor;
|
|
123
|
+
this._previousColor = this._rgbaColor;
|
|
124
|
+
this.color = this._rgbaColor;
|
|
125
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.color }));
|
|
72
126
|
}
|
|
73
|
-
handleFieldChange(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
127
|
+
handleFieldChange(event) {
|
|
128
|
+
event.stopPropagation();
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
if (this.colorFieldElement.checkValidity()) {
|
|
131
|
+
const color = new TinyColor(this.colorFieldElement.value);
|
|
132
|
+
this._format = color.format;
|
|
133
|
+
this._rgbaColor = color.toRgbString();
|
|
134
|
+
this._alpha = color.getAlpha();
|
|
135
|
+
this._rgbColor = color.setAlpha(1).toRgbString();
|
|
136
|
+
if (this.noAlphaChannel) {
|
|
137
|
+
this._rgbaColor = this._rgbColor;
|
|
138
|
+
this._alpha = 1;
|
|
139
|
+
}
|
|
140
|
+
this.hueSliderElement.color = this._rgbColor;
|
|
141
|
+
this.areaElement.color = this._rgbColor;
|
|
142
|
+
if (!this.noAlphaChannel) {
|
|
143
|
+
this.opacitySliderElement.color = this._rgbaColor;
|
|
144
|
+
}
|
|
145
|
+
this.swatchElement.color = this._rgbaColor;
|
|
146
|
+
this._previousColor = this._rgbaColor;
|
|
147
|
+
this.color = this._rgbaColor;
|
|
148
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.color }));
|
|
77
149
|
}
|
|
78
150
|
}
|
|
79
|
-
formatTextField(
|
|
80
|
-
|
|
151
|
+
formatTextField(tinyColor) {
|
|
152
|
+
if (this._format === "hsl") {
|
|
153
|
+
return tinyColor.toHslString();
|
|
154
|
+
} else if (this._format === "hex") {
|
|
155
|
+
return this.noAlphaChannel ? tinyColor.toHexString() : tinyColor.toHex8String();
|
|
156
|
+
} else if (this._format === "name") {
|
|
157
|
+
this._format = "rgb";
|
|
158
|
+
}
|
|
159
|
+
return tinyColor.toRgbString();
|
|
81
160
|
}
|
|
82
161
|
cycleFormat() {
|
|
83
|
-
const
|
|
84
|
-
this._format =
|
|
85
|
-
const
|
|
86
|
-
|
|
162
|
+
const formats = ["rgb", "hsl", "hex"];
|
|
163
|
+
this._format = formats[(formats.indexOf(this._format) + 1) % formats.length];
|
|
164
|
+
const color = new TinyColor(this.color);
|
|
165
|
+
const colorString = this.formatTextField(color);
|
|
166
|
+
this.colorFieldElement.value = colorString;
|
|
87
167
|
}
|
|
88
|
-
updated(
|
|
89
|
-
if (
|
|
168
|
+
updated(changedProperties) {
|
|
169
|
+
if (changedProperties.has("color") && this.color !== this._previousColor) {
|
|
90
170
|
this._previousColor = this.color;
|
|
91
|
-
const
|
|
92
|
-
this._alpha =
|
|
171
|
+
const color = new TinyColor(this.color);
|
|
172
|
+
this._alpha = color.getAlpha();
|
|
173
|
+
this._rgbColor = color.setAlpha(1).toRgbString();
|
|
174
|
+
this._rgbaColor = color.setAlpha(this._alpha).toRgbString();
|
|
175
|
+
this.areaElement.color = this._rgbColor;
|
|
176
|
+
this.hueSliderElement.color = this._rgbColor;
|
|
177
|
+
this.colorFieldElement.value = this._rgbaColor;
|
|
178
|
+
if (!this.noAlphaChannel) {
|
|
179
|
+
this.opacitySliderElement.color = this._rgbaColor;
|
|
180
|
+
}
|
|
181
|
+
this.swatchElement.color = this._rgbaColor;
|
|
182
|
+
this._format = "rgb";
|
|
183
|
+
}
|
|
184
|
+
if (changedProperties.has("noAlphaChannel") && !this.noAlphaChannel) {
|
|
185
|
+
this.opacitySliderElement.color = this._rgbaColor;
|
|
93
186
|
}
|
|
94
|
-
r.has("noAlphaChannel") && !this.noAlphaChannel && (this.opacitySliderElement.color = this._rgbaColor);
|
|
95
187
|
}
|
|
96
188
|
renderOpacitySlider() {
|
|
97
|
-
return
|
|
189
|
+
return html`
|
|
98
190
|
<luzmo-color-slider
|
|
99
191
|
id="luzmo-opacity-slider"
|
|
100
192
|
mode="opacity"
|
|
@@ -104,8 +196,8 @@ const u = class u extends w(x) {
|
|
|
104
196
|
`;
|
|
105
197
|
}
|
|
106
198
|
render() {
|
|
107
|
-
var
|
|
108
|
-
return
|
|
199
|
+
var _a;
|
|
200
|
+
return html`
|
|
109
201
|
<div id="color-menu" tabindex="0">
|
|
110
202
|
<luzmo-color-area
|
|
111
203
|
.size=${this.size}
|
|
@@ -143,20 +235,20 @@ const u = class u extends w(x) {
|
|
|
143
235
|
>
|
|
144
236
|
<div class="format-label">${this._format}</div>
|
|
145
237
|
<div class="change-format-icon">
|
|
146
|
-
<div class="angle-icon">${
|
|
147
|
-
<div class="angle-icon">${
|
|
238
|
+
<div class="angle-icon">${luzmoIcon(luzmoAngleUp)}</div>
|
|
239
|
+
<div class="angle-icon">${luzmoIcon(luzmoAngleDown)}</div>
|
|
148
240
|
</div>
|
|
149
241
|
</button>
|
|
150
242
|
</div>
|
|
151
|
-
${((
|
|
243
|
+
${((_a = this.swatches) == null ? void 0 : _a.length) > 0 ? html`
|
|
152
244
|
<luzmo-divider></luzmo-divider>
|
|
153
245
|
<div class="swatches-container">
|
|
154
246
|
${this.swatches.map(
|
|
155
|
-
(
|
|
247
|
+
(color) => html`
|
|
156
248
|
<div class="swatch-choice">
|
|
157
249
|
<luzmo-swatch
|
|
158
250
|
@click=${this.setColor}
|
|
159
|
-
.color=${
|
|
251
|
+
.color=${color}
|
|
160
252
|
.size=${this.size}
|
|
161
253
|
readonly
|
|
162
254
|
>
|
|
@@ -171,36 +263,38 @@ const u = class u extends w(x) {
|
|
|
171
263
|
`;
|
|
172
264
|
}
|
|
173
265
|
};
|
|
174
|
-
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
],
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
],
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
],
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
],
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
],
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
],
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
],
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
],
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
],
|
|
203
|
-
customElements.get("luzmo-color-menu")
|
|
266
|
+
_LuzmoColorMenu.styles = unsafeCSS(styles);
|
|
267
|
+
let LuzmoColorMenu = _LuzmoColorMenu;
|
|
268
|
+
__decorateClass([
|
|
269
|
+
property({ type: String, reflect: true })
|
|
270
|
+
], LuzmoColorMenu.prototype, "color");
|
|
271
|
+
__decorateClass([
|
|
272
|
+
property({ type: Boolean, reflect: true, attribute: "no-alpha-channel" })
|
|
273
|
+
], LuzmoColorMenu.prototype, "noAlphaChannel");
|
|
274
|
+
__decorateClass([
|
|
275
|
+
property({ type: Array, reflect: true })
|
|
276
|
+
], LuzmoColorMenu.prototype, "swatches");
|
|
277
|
+
__decorateClass([
|
|
278
|
+
query("luzmo-color-area")
|
|
279
|
+
], LuzmoColorMenu.prototype, "areaElement");
|
|
280
|
+
__decorateClass([
|
|
281
|
+
query("#luzmo-hue-slider")
|
|
282
|
+
], LuzmoColorMenu.prototype, "hueSliderElement");
|
|
283
|
+
__decorateClass([
|
|
284
|
+
query("#luzmo-opacity-slider")
|
|
285
|
+
], LuzmoColorMenu.prototype, "opacitySliderElement");
|
|
286
|
+
__decorateClass([
|
|
287
|
+
query("luzmo-color-field")
|
|
288
|
+
], LuzmoColorMenu.prototype, "colorFieldElement");
|
|
289
|
+
__decorateClass([
|
|
290
|
+
query("luzmo-swatch")
|
|
291
|
+
], LuzmoColorMenu.prototype, "swatchElement");
|
|
292
|
+
__decorateClass([
|
|
293
|
+
state()
|
|
294
|
+
], LuzmoColorMenu.prototype, "_format");
|
|
295
|
+
if (!customElements.get("luzmo-color-menu")) {
|
|
296
|
+
customElements.define("luzmo-color-menu", LuzmoColorMenu);
|
|
297
|
+
}
|
|
204
298
|
export {
|
|
205
|
-
|
|
299
|
+
LuzmoColorMenu
|
|
206
300
|
};
|
|
@@ -15,4 +15,92 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
"use strict";
|
|
18
|
+
"use strict";
|
|
19
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
20
|
+
const lit = require("lit");
|
|
21
|
+
const decorators_js = require("lit/decorators.js");
|
|
22
|
+
const focusable = require("../focusable-BPrTcZPd.cjs");
|
|
23
|
+
const sizedMixin = require("../sized-mixin-UaTVa-AE.cjs");
|
|
24
|
+
const styles = ":host{box-sizing:border-box}:host([focused]),:host(:focus-visible){outline:none}:host([focused]) #palette,:host(:focus-visible) #palette{border:var(--luzmo-color-palette-focus-indicator-width, var(--color-palette-focus-indicator-width)) solid var(--luzmo-color-palette-focus-indicator-color, var(--color-palette-focus-indicator-color))!important}:host([disabled]){pointer-events:none;cursor:not-allowed}:host([disabled]) #palette{opacity:var(--luzmo-color-palette-disabled-opacity, .3);border-color:transparent!important;background-color:var(--luzmo-color-palette-disabled-background-color, var(--color-palette-disabled-background-color))!important}:host([selected]) #palette{border-color:var(--luzmo-color-palette-selected-border-color, var(--color-palette-selected-border-color));background-color:var(--luzmo-color-palette-selected-background-color, var(--color-palette-selected-background-color))}:host:hover #palette{border-color:var(--luzmo-color-palette-hover-border-color, var(--color-palette-hover-border-color))}#palette{box-sizing:border-box;height:100%;width:fit-content;padding:var(--luzmo-color-palette-padding, var(--color-palette-padding));border:var(--luzmo-color-palette-border-width, var(--color-palette-border-width)) solid transparent;cursor:pointer;border-radius:var(--luzmo-color-palette-border-radius, var(--color-palette-border-radius));display:flex}#palette>div{box-sizing:border-box;border:var(--luzmo-color-palette-color-border-width, var(--color-palette-color-border-width)) solid var(--luzmo-color-palette-color-border-color, var(--color-palette-color-border-color));height:var(--luzmo-color-palette-color-height, var(--color-palette-color-height));width:var(--luzmo-color-palette-color-width, var(--color-palette-color-width))}#palette:hover{background-color:var(--luzmo-color-palette-hover-background-color, var(--color-palette-hover-background-color))}#palette:focus-visible{outline:none}:host(:not([reverse]):not([horizontal])) #palette{flex-direction:column}:host(:not([reverse]):not([horizontal])) #palette>div:not(:first-child){border-top:0}:host(:not([reverse]):not([horizontal])) #palette>div:first-child{border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host(:not([reverse]):not([horizontal])) #palette>div:last-child{border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([reverse]:not([horizontal])) #palette{flex-direction:column-reverse}:host([reverse]:not([horizontal])) #palette>div:not(:first-child){border-bottom:0}:host([reverse]:not([horizontal])) #palette>div:first-child{border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([reverse]:not([horizontal])) #palette>div:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal]:not([reverse])) #palette{flex-direction:row}:host([horizontal]:not([reverse])) #palette>div:not(:first-child){border-left:0}:host([horizontal]:not([reverse])) #palette>div:first-child{border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal]:not([reverse])) #palette>div:last-child{border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal][reverse]) #palette{flex-direction:row-reverse}:host([horizontal][reverse]) #palette>div:not(:first-child){border-right:0}:host([horizontal][reverse]) #palette>div:first-child{border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal][reverse]) #palette>div:last-child{border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host{--color-palette-padding: var(--luzmo-spacing-1);--color-palette-background-color: transparent;--color-palette-hover-background-color: var( --luzmo-background-color-highlight );--color-palette-selected-border-color: var(--luzmo-border-color-down);--color-palette-selected-background-color: var( --luzmo-background-color-highlight-hover );--color-palette-disabled-background-color: transparent;--color-palette-border-width: var(--luzmo-border-width);--color-palette-hover-border-color: var(--luzmo-border-color);--color-palette-focus-indicator-width: var(--luzmo-indicator-width);--color-palette-focus-indicator-color: var(--luzmo-indicator-color);--color-palette-color-width: var(--luzmo-spacing-5);--color-palette-color-height: 1.25rem;--color-palette-color-border-radius: var(--luzmo-border-radius);--color-palette-color-border-width: var(--luzmo-border-width);--color-palette-color-border-color: var(--luzmo-border-color);--color-palette-border-radius: calc( var(--color-palette-color-border-radius) + var(--color-palette-padding) )}:host([horizontal]){--color-palette-color-height: var(--luzmo-spacing-5);--color-palette-color-width: 1.25rem}:host([size=s]){--color-palette-color-width: .75rem;--color-palette-color-height: var(--luzmo-spacing-5);--color-palette-padding: var(--luzmo-spacing-1);--color-palette-color-border-radius: var(--luzmo-border-radius-s)}:host([size=s][horizontal]){--color-palette-color-height: .75rem;--color-palette-color-width: var(--luzmo-spacing-5)}:host([size=l]){--color-palette-color-width: 1.25rem;--color-palette-color-height: 1.5rem;--color-palette-padding: var(--luzmo-spacing-2);--color-palette-color-border-radius: var(--luzmo-border-radius-l)}:host([size=l][horizontal]){--color-palette-color-height: 1.25rem;--color-palette-color-width: 1.5rem}:host([size=xl]){--color-palette-color-width: 1.5rem;--color-palette-color-height: 1.75rem;--color-palette-padding: var(--luzmo-spacing-2);--color-palette-color-border-radius: var(--luzmo-border-radius-xl)}:host([size=xl][horizontal]){--color-palette-color-height: 1.5rem;--color-palette-color-width: 1.75rem}";
|
|
25
|
+
var __defProp = Object.defineProperty;
|
|
26
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
27
|
+
var result = void 0;
|
|
28
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
29
|
+
if (decorator = decorators[i])
|
|
30
|
+
result = decorator(target, key, result) || result;
|
|
31
|
+
if (result) __defProp(target, key, result);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
const _LuzmoColorPalette = class _LuzmoColorPalette extends sizedMixin.SizedMixin(focusable.Focusable, {
|
|
35
|
+
validSizes: ["s", "m", "l", "xl"],
|
|
36
|
+
noDefaultSize: true
|
|
37
|
+
}) {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.disabled = false;
|
|
41
|
+
this.focused = false;
|
|
42
|
+
this.selected = false;
|
|
43
|
+
this.active = false;
|
|
44
|
+
this.reverse = false;
|
|
45
|
+
this.horizontal = false;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
get focusElement() {
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
var _a;
|
|
55
|
+
const renderColors = (_a = this.colors) == null ? void 0 : _a.map((color) => {
|
|
56
|
+
return lit.html`<div class="color" style="background-color: ${color}"></div>`;
|
|
57
|
+
});
|
|
58
|
+
return lit.html` <div id="palette">${renderColors}</div> `;
|
|
59
|
+
}
|
|
60
|
+
firstUpdated(changedProperties) {
|
|
61
|
+
super.firstUpdated(changedProperties);
|
|
62
|
+
}
|
|
63
|
+
updated(changes) {
|
|
64
|
+
super.updated(changes);
|
|
65
|
+
if (changes.has("selected")) {
|
|
66
|
+
this.setAttribute("tabindex", this.selected ? "0" : "-1");
|
|
67
|
+
}
|
|
68
|
+
if (changes.has("disabled")) {
|
|
69
|
+
if (this.disabled) {
|
|
70
|
+
this.setAttribute("aria-disabled", "true");
|
|
71
|
+
} else {
|
|
72
|
+
this.removeAttribute("aria-disabled");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
_LuzmoColorPalette.styles = lit.unsafeCSS(styles);
|
|
78
|
+
let LuzmoColorPalette = _LuzmoColorPalette;
|
|
79
|
+
__decorateClass([
|
|
80
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
81
|
+
], LuzmoColorPalette.prototype, "disabled");
|
|
82
|
+
__decorateClass([
|
|
83
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
84
|
+
], LuzmoColorPalette.prototype, "focused");
|
|
85
|
+
__decorateClass([
|
|
86
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
87
|
+
], LuzmoColorPalette.prototype, "selected");
|
|
88
|
+
__decorateClass([
|
|
89
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
90
|
+
], LuzmoColorPalette.prototype, "active");
|
|
91
|
+
__decorateClass([
|
|
92
|
+
decorators_js.property({ type: String, reflect: true })
|
|
93
|
+
], LuzmoColorPalette.prototype, "value");
|
|
94
|
+
__decorateClass([
|
|
95
|
+
decorators_js.property({ type: Array, reflect: true })
|
|
96
|
+
], LuzmoColorPalette.prototype, "colors");
|
|
97
|
+
__decorateClass([
|
|
98
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
99
|
+
], LuzmoColorPalette.prototype, "reverse");
|
|
100
|
+
__decorateClass([
|
|
101
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
102
|
+
], LuzmoColorPalette.prototype, "horizontal");
|
|
103
|
+
if (!customElements.get("luzmo-color-palette")) {
|
|
104
|
+
customElements.define("luzmo-color-palette", LuzmoColorPalette);
|
|
105
|
+
}
|
|
106
|
+
exports.LuzmoColorPalette = LuzmoColorPalette;
|