@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,39 +15,60 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import { L as $ } from "../language-resolution-8yZa5r_P.js";
|
|
25
|
-
import { s as k } from "../streaming-listener-CP-JE6Fa.js";
|
|
26
|
-
const g = () => {
|
|
27
|
-
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
28
|
-
const u = document.createElement("style");
|
|
29
|
-
u.setAttribute("data-luzmo-vars", ""), u.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}', document.head.appendChild(u);
|
|
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);
|
|
30
24
|
}
|
|
31
25
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
initializeGlobalLuzmoCSSVariables();
|
|
27
|
+
import { unsafeCSS, html } from "lit";
|
|
28
|
+
import { property, query } from "lit/decorators.js";
|
|
29
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
30
|
+
import "../color-handle/index.js";
|
|
31
|
+
import { a as LuzmoElement } from "../base-DmeVy0cq.js";
|
|
32
|
+
import { j as isAndroid, c as isIOS } from "../platform-Cxn0WbyT.js";
|
|
33
|
+
import { C as ColorController } from "../color-controller-BjDZaxhX.js";
|
|
34
|
+
import { L as LanguageResolutionController } from "../language-resolution-BSGJAWiQ.js";
|
|
35
|
+
import { s as streamingListener } from "../streaming-listener-cAz5zJyk.js";
|
|
36
|
+
const styles = "@media (forced-colors: active){:host{--highcontrast-color-area-border-color-disabled: GrayText;--highcontrast-color-area-border-color: Canvas;--highcontrast-color-area-fill-color-disabled: Canvas}.gradient,:host([disabled]){forced-color-adjust:none}}:host{cursor:default;-webkit-user-select:none;user-select:none;min-inline-size:var(--luzmo-color-area-min-width, 64px);min-block-size:var(--luzmo-color-area-min-height, 64px);inline-size:var(--luzmo-color-area-width, 192px);block-size:var(--luzmo-color-area-height, 192px);box-sizing:border-box;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color, var(--luzmo-color-area-border-color, var(--luzmo-border-color)));display:inline-block;position:relative}:host([focused]){z-index:1}:host([disabled]){pointer-events:none;background:var(--highcontrast-color-area-fill-color-disabled, var(--luzmo-color-area-disabled-background-color, var(--luzmo-dimmed-color)));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color-disabled)}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width, 192px) - var(--luzmo-border-width)));inset-block-start:0}.handle:dir(rtl),:host([dir=rtl]) .handle{inset-inline-end:0}.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s))}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--luzmo-color-area-default-width))}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}";
|
|
37
|
+
var __defProp = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
40
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
41
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
42
|
+
if (decorator = decorators[i])
|
|
43
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
44
|
+
if (kind && result) __defProp(target, key, result);
|
|
45
|
+
return result;
|
|
38
46
|
};
|
|
39
|
-
class
|
|
47
|
+
class LuzmoColorArea extends LuzmoElement {
|
|
40
48
|
constructor() {
|
|
41
|
-
super(...arguments)
|
|
49
|
+
super(...arguments);
|
|
50
|
+
this.disabled = false;
|
|
51
|
+
this.focused = false;
|
|
52
|
+
this.labelX = "saturation";
|
|
53
|
+
this.labelY = "luminosity";
|
|
54
|
+
this.isLTR = true;
|
|
55
|
+
this.languageResolver = new LanguageResolutionController(this);
|
|
56
|
+
this.colorController = new ColorController(this, { manageAs: "hsv" });
|
|
57
|
+
this.activeAxis = "x";
|
|
58
|
+
this.step = 0.01;
|
|
59
|
+
this.altered = 0;
|
|
60
|
+
this.activeKeys = /* @__PURE__ */ new Set();
|
|
61
|
+
this._valueChanged = false;
|
|
62
|
+
this._pointerDown = false;
|
|
42
63
|
}
|
|
43
64
|
static get styles() {
|
|
44
|
-
return [
|
|
65
|
+
return [unsafeCSS(styles)];
|
|
45
66
|
}
|
|
46
67
|
get hue() {
|
|
47
68
|
return this.colorController.hue;
|
|
48
69
|
}
|
|
49
|
-
set hue(
|
|
50
|
-
this.colorController.hue =
|
|
70
|
+
set hue(value) {
|
|
71
|
+
this.colorController.hue = value;
|
|
51
72
|
}
|
|
52
73
|
get value() {
|
|
53
74
|
return this.colorController.colorValue;
|
|
@@ -55,184 +76,275 @@ class l extends z {
|
|
|
55
76
|
get color() {
|
|
56
77
|
return this.colorController.colorValue;
|
|
57
78
|
}
|
|
58
|
-
set color(
|
|
59
|
-
this.colorController.color =
|
|
79
|
+
set color(color) {
|
|
80
|
+
this.colorController.color = color;
|
|
60
81
|
}
|
|
61
82
|
get x() {
|
|
62
83
|
return this.colorController.color.hsv.s / 100;
|
|
63
84
|
}
|
|
64
|
-
set x(
|
|
65
|
-
if (
|
|
85
|
+
set x(x) {
|
|
86
|
+
if (x === this.x) {
|
|
66
87
|
return;
|
|
67
|
-
|
|
68
|
-
|
|
88
|
+
}
|
|
89
|
+
const oldValue = this.x;
|
|
90
|
+
if (this.inputX) {
|
|
91
|
+
this.inputX.value = x.toString();
|
|
92
|
+
this.colorController.color.set("s", this.inputX.valueAsNumber * 100);
|
|
93
|
+
} else {
|
|
94
|
+
this.colorController.color.set("s", x * 100);
|
|
95
|
+
}
|
|
96
|
+
this.requestUpdate("x", oldValue);
|
|
69
97
|
}
|
|
70
98
|
get y() {
|
|
71
99
|
return this.colorController.color.hsv.v / 100;
|
|
72
100
|
}
|
|
73
|
-
set y(
|
|
74
|
-
if (
|
|
101
|
+
set y(y) {
|
|
102
|
+
if (y === this.y) {
|
|
75
103
|
return;
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
}
|
|
105
|
+
const oldValue = this.y;
|
|
106
|
+
if (this.inputY) {
|
|
107
|
+
this.inputY.value = y.toString();
|
|
108
|
+
this.colorController.color.set("v", this.inputY.valueAsNumber * 100);
|
|
109
|
+
}
|
|
110
|
+
this.requestUpdate("y", oldValue);
|
|
78
111
|
}
|
|
79
|
-
focus(
|
|
80
|
-
super.focus(
|
|
112
|
+
focus(focusOptions = {}) {
|
|
113
|
+
super.focus(focusOptions);
|
|
114
|
+
this.forwardFocus();
|
|
81
115
|
}
|
|
82
116
|
forwardFocus() {
|
|
83
|
-
this.activeAxis === "x"
|
|
117
|
+
if (this.activeAxis === "x") {
|
|
118
|
+
this.inputX.focus();
|
|
119
|
+
} else {
|
|
120
|
+
this.inputY.focus();
|
|
121
|
+
}
|
|
84
122
|
}
|
|
85
123
|
handleFocus() {
|
|
86
|
-
this.focused =
|
|
124
|
+
this.focused = true;
|
|
125
|
+
this._valueChanged = false;
|
|
87
126
|
}
|
|
88
127
|
handleBlur() {
|
|
89
|
-
|
|
128
|
+
if (this._pointerDown) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.altered = 0;
|
|
132
|
+
this.focused = false;
|
|
133
|
+
this._valueChanged = false;
|
|
90
134
|
}
|
|
91
|
-
handleKeydown(
|
|
92
|
-
const { code
|
|
93
|
-
this.focused =
|
|
94
|
-
|
|
95
|
-
|
|
135
|
+
handleKeydown(event) {
|
|
136
|
+
const { code } = event;
|
|
137
|
+
this.focused = true;
|
|
138
|
+
this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(
|
|
139
|
+
(key) => !!key
|
|
140
|
+
).length;
|
|
141
|
+
const isArrowKey = code.search("Arrow") === 0 || code.search("Page") === 0 || code.search("Home") === 0 || code.search("End") === 0;
|
|
142
|
+
if (isArrowKey) {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
this.activeKeys.add(code);
|
|
145
|
+
this.handleKeypress();
|
|
146
|
+
}
|
|
96
147
|
}
|
|
97
148
|
handleKeypress() {
|
|
98
|
-
let
|
|
99
|
-
|
|
100
|
-
this.
|
|
101
|
-
|
|
149
|
+
let deltaX = 0;
|
|
150
|
+
let deltaY = 0;
|
|
151
|
+
const step = Math.max(this.step, this.altered * 5 * this.step);
|
|
152
|
+
this.activeKeys.forEach((code) => {
|
|
153
|
+
switch (code) {
|
|
102
154
|
case "ArrowUp": {
|
|
103
|
-
|
|
155
|
+
deltaY = step;
|
|
104
156
|
break;
|
|
105
157
|
}
|
|
106
158
|
case "ArrowDown": {
|
|
107
|
-
|
|
159
|
+
deltaY = step * -1;
|
|
108
160
|
break;
|
|
109
161
|
}
|
|
110
162
|
case "ArrowLeft": {
|
|
111
|
-
|
|
163
|
+
deltaX = this.step * (this.isLTR ? -1 : 1);
|
|
112
164
|
break;
|
|
113
165
|
}
|
|
114
166
|
case "ArrowRight": {
|
|
115
|
-
|
|
167
|
+
deltaX = this.step * (this.isLTR ? 1 : -1);
|
|
116
168
|
break;
|
|
117
169
|
}
|
|
118
170
|
case "PageUp": {
|
|
119
|
-
|
|
171
|
+
deltaY = step * 10;
|
|
120
172
|
break;
|
|
121
173
|
}
|
|
122
174
|
case "PageDown": {
|
|
123
|
-
|
|
175
|
+
deltaY = step * -10;
|
|
124
176
|
break;
|
|
125
177
|
}
|
|
126
178
|
case "Home": {
|
|
127
|
-
|
|
179
|
+
deltaX = step * (this.isLTR ? -10 : 10);
|
|
128
180
|
break;
|
|
129
181
|
}
|
|
130
182
|
case "End": {
|
|
131
|
-
|
|
183
|
+
deltaX = step * (this.isLTR ? 10 : -10);
|
|
132
184
|
break;
|
|
133
185
|
}
|
|
134
186
|
}
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
187
|
+
});
|
|
188
|
+
if (deltaX !== 0) {
|
|
189
|
+
this.activeAxis = "x";
|
|
190
|
+
this.inputX.focus();
|
|
191
|
+
} else if (deltaY !== 0) {
|
|
192
|
+
this.activeAxis = "y";
|
|
193
|
+
this.inputY.focus();
|
|
194
|
+
}
|
|
195
|
+
this.x = Math.min(1, Math.max(this.x + deltaX, 0));
|
|
196
|
+
this.y = Math.min(1, Math.max(this.y + deltaY, 0));
|
|
197
|
+
this.colorController.savePreviousColor();
|
|
198
|
+
if (deltaX !== 0 || deltaY !== 0) {
|
|
199
|
+
this._valueChanged = true;
|
|
200
|
+
this.dispatchEvent(
|
|
201
|
+
new Event("input", {
|
|
202
|
+
bubbles: true,
|
|
203
|
+
composed: true
|
|
204
|
+
})
|
|
205
|
+
);
|
|
206
|
+
const applyDefault = this.dispatchEvent(
|
|
207
|
+
new Event("change", {
|
|
208
|
+
bubbles: true,
|
|
209
|
+
composed: true,
|
|
210
|
+
cancelable: true
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
if (!applyDefault) {
|
|
214
|
+
this.colorController.restorePreviousColor();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
147
217
|
}
|
|
148
|
-
handleKeyup(
|
|
149
|
-
|
|
150
|
-
const { code
|
|
151
|
-
this.activeKeys.delete(
|
|
218
|
+
handleKeyup(event) {
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
const { code } = event;
|
|
221
|
+
this.activeKeys.delete(code);
|
|
152
222
|
}
|
|
153
|
-
handleInput(
|
|
154
|
-
const { valueAsNumber
|
|
155
|
-
this[
|
|
223
|
+
handleInput(event) {
|
|
224
|
+
const { valueAsNumber, name } = event.target;
|
|
225
|
+
this[name] = valueAsNumber;
|
|
156
226
|
}
|
|
157
|
-
handleChange(
|
|
158
|
-
this.handleInput(
|
|
227
|
+
handleChange(event) {
|
|
228
|
+
this.handleInput(event);
|
|
229
|
+
this.dispatchEvent(
|
|
159
230
|
new Event("change", {
|
|
160
|
-
bubbles:
|
|
161
|
-
composed:
|
|
162
|
-
cancelable:
|
|
231
|
+
bubbles: true,
|
|
232
|
+
composed: true,
|
|
233
|
+
cancelable: true
|
|
163
234
|
})
|
|
164
235
|
);
|
|
165
236
|
}
|
|
166
|
-
handlePointerdown(
|
|
167
|
-
if (
|
|
168
|
-
|
|
237
|
+
handlePointerdown(event) {
|
|
238
|
+
if (event.button !== 0) {
|
|
239
|
+
event.preventDefault();
|
|
169
240
|
return;
|
|
170
241
|
}
|
|
171
|
-
this._pointerDown =
|
|
242
|
+
this._pointerDown = true;
|
|
243
|
+
this.colorController.savePreviousColor();
|
|
244
|
+
this.boundingClientRect = this.getBoundingClientRect();
|
|
245
|
+
event.target.setPointerCapture(event.pointerId);
|
|
246
|
+
if (event.pointerType === "mouse") {
|
|
247
|
+
this.focused = true;
|
|
248
|
+
}
|
|
172
249
|
}
|
|
173
|
-
handlePointermove(
|
|
174
|
-
const [
|
|
175
|
-
this._valueChanged =
|
|
250
|
+
handlePointermove(event) {
|
|
251
|
+
const [x, y] = this.calculateHandlePosition(event);
|
|
252
|
+
this._valueChanged = false;
|
|
253
|
+
this.x = x;
|
|
254
|
+
this.y = y;
|
|
255
|
+
this.dispatchEvent(
|
|
176
256
|
new Event("input", {
|
|
177
|
-
bubbles:
|
|
178
|
-
composed:
|
|
179
|
-
cancelable:
|
|
257
|
+
bubbles: true,
|
|
258
|
+
composed: true,
|
|
259
|
+
cancelable: true
|
|
180
260
|
})
|
|
181
261
|
);
|
|
182
262
|
}
|
|
183
|
-
handlePointerup(
|
|
184
|
-
|
|
185
|
-
|
|
263
|
+
handlePointerup(event) {
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
this._pointerDown = false;
|
|
266
|
+
event.target.releasePointerCapture(event.pointerId);
|
|
267
|
+
const applyDefault = this.dispatchEvent(
|
|
186
268
|
new Event("change", {
|
|
187
|
-
bubbles:
|
|
188
|
-
composed:
|
|
189
|
-
cancelable:
|
|
269
|
+
bubbles: true,
|
|
270
|
+
composed: true,
|
|
271
|
+
cancelable: true
|
|
190
272
|
})
|
|
191
273
|
);
|
|
192
|
-
this.inputX.focus()
|
|
274
|
+
this.inputX.focus();
|
|
275
|
+
if (event.pointerType === "mouse") {
|
|
276
|
+
this.focused = false;
|
|
277
|
+
}
|
|
278
|
+
if (!applyDefault) {
|
|
279
|
+
this.colorController.restorePreviousColor();
|
|
280
|
+
}
|
|
193
281
|
}
|
|
194
282
|
/**
|
|
195
283
|
* Returns the value under the cursor
|
|
196
284
|
* @param: PointerEvent on slider
|
|
197
285
|
* @return: Slider value that correlates to the position under the pointer
|
|
198
286
|
*/
|
|
199
|
-
calculateHandlePosition(
|
|
200
|
-
if (!this.boundingClientRect)
|
|
287
|
+
calculateHandlePosition(event) {
|
|
288
|
+
if (!this.boundingClientRect) {
|
|
201
289
|
return [this.x, this.y];
|
|
202
|
-
|
|
203
|
-
|
|
290
|
+
}
|
|
291
|
+
const rect = this.boundingClientRect;
|
|
292
|
+
const minOffsetX = rect.left;
|
|
293
|
+
const minOffsetY = rect.top;
|
|
294
|
+
const offsetX = event.clientX;
|
|
295
|
+
const offsetY = event.clientY;
|
|
296
|
+
const width = rect.width;
|
|
297
|
+
const height = rect.height;
|
|
298
|
+
const percentX = Math.max(0, Math.min(1, (offsetX - minOffsetX) / width));
|
|
299
|
+
const percentY = Math.max(0, Math.min(1, (offsetY - minOffsetY) / height));
|
|
300
|
+
return [this.isLTR ? percentX : 1 - percentX, 1 - percentY];
|
|
204
301
|
}
|
|
205
|
-
handleAreaPointerdown(
|
|
206
|
-
|
|
302
|
+
handleAreaPointerdown(event) {
|
|
303
|
+
if (event.button !== 0) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
event.stopPropagation();
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
this.handle.dispatchEvent(new PointerEvent("pointerdown", event));
|
|
309
|
+
this.handlePointermove(event);
|
|
207
310
|
}
|
|
208
311
|
render() {
|
|
209
|
-
const { width
|
|
312
|
+
const { width = 0, height = 0 } = this.boundingClientRect || {};
|
|
313
|
+
const isMobile = isAndroid() || isIOS();
|
|
314
|
+
const defaultAriaLabel = "Color Picker";
|
|
315
|
+
const ariaLabel = defaultAriaLabel;
|
|
316
|
+
const ariaRoleDescription = ifDefined(isMobile ? void 0 : "2d slider");
|
|
317
|
+
const ariaLabelX = this.labelX;
|
|
318
|
+
const ariaLabelY = this.labelY;
|
|
319
|
+
const ariaValueX = new Intl.NumberFormat(this.languageResolver.language, {
|
|
210
320
|
style: "percent",
|
|
211
321
|
unitDisplay: "narrow"
|
|
212
|
-
}).format(this.x)
|
|
322
|
+
}).format(this.x);
|
|
323
|
+
const ariaValueY = new Intl.NumberFormat(this.languageResolver.language, {
|
|
213
324
|
style: "percent",
|
|
214
325
|
unitDisplay: "narrow"
|
|
215
|
-
}).format(this.y)
|
|
326
|
+
}).format(this.y);
|
|
327
|
+
const style = {
|
|
216
328
|
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%);`
|
|
217
329
|
};
|
|
218
|
-
return
|
|
330
|
+
return html`
|
|
219
331
|
<div
|
|
220
332
|
@pointerdown=${this.handleAreaPointerdown}
|
|
221
333
|
class="gradient"
|
|
222
|
-
style="background: ${
|
|
334
|
+
style="background: ${style.background}"
|
|
223
335
|
>
|
|
224
336
|
<slot name="gradient"></slot>
|
|
225
337
|
</div>
|
|
226
338
|
|
|
227
339
|
<luzmo-color-handle
|
|
228
|
-
tabindex=${
|
|
340
|
+
tabindex=${ifDefined(this.focused ? void 0 : "0")}
|
|
229
341
|
@focus=${this.forwardFocus}
|
|
230
342
|
?focused=${this.focused}
|
|
231
343
|
class="handle"
|
|
232
344
|
color=${this.colorController.getHslString()}
|
|
233
345
|
?disabled=${this.disabled}
|
|
234
|
-
style=${`transform: translate(${(this.isLTR ? this.x : 1 - this.x) *
|
|
235
|
-
${
|
|
346
|
+
style=${`transform: translate(${(this.isLTR ? this.x : 1 - this.x) * width}px, ${height - this.y * height}px);`}
|
|
347
|
+
${streamingListener({
|
|
236
348
|
start: ["pointerdown", this.handlePointerdown],
|
|
237
349
|
streamInside: ["pointermove", this.handlePointermove],
|
|
238
350
|
end: [
|
|
@@ -244,17 +356,17 @@ class l extends z {
|
|
|
244
356
|
|
|
245
357
|
<fieldset
|
|
246
358
|
class="fieldset"
|
|
247
|
-
aria-label=${
|
|
359
|
+
aria-label=${ifDefined(isMobile ? ariaLabel : void 0)}
|
|
248
360
|
>
|
|
249
361
|
<div role="presentation">
|
|
250
362
|
<input
|
|
251
363
|
type="range"
|
|
252
364
|
class="slider"
|
|
253
365
|
name="x"
|
|
254
|
-
aria-label=${
|
|
255
|
-
aria-roledescription=${
|
|
366
|
+
aria-label=${isMobile ? ariaLabelX : `${ariaLabelX} ${ariaLabel}`}
|
|
367
|
+
aria-roledescription=${ariaRoleDescription}
|
|
256
368
|
aria-orientation="horizontal"
|
|
257
|
-
aria-valuetext=${
|
|
369
|
+
aria-valuetext=${isMobile ? ariaValueX : `${ariaValueX}, ${ariaLabelX}${this._valueChanged ? "" : `, ${ariaValueY}, ${ariaLabelY}`}`}
|
|
258
370
|
min="0"
|
|
259
371
|
max="1"
|
|
260
372
|
step=${this.step}
|
|
@@ -269,10 +381,10 @@ class l extends z {
|
|
|
269
381
|
type="range"
|
|
270
382
|
class="slider"
|
|
271
383
|
name="y"
|
|
272
|
-
aria-label=${
|
|
273
|
-
aria-roledescription=${
|
|
384
|
+
aria-label=${isMobile ? ariaLabelY : `${ariaLabelY} ${ariaLabel}`}
|
|
385
|
+
aria-roledescription=${ariaRoleDescription}
|
|
274
386
|
aria-orientation="vertical"
|
|
275
|
-
aria-valuetext=${
|
|
387
|
+
aria-valuetext=${isMobile ? ariaValueY : `${ariaValueY}, ${ariaLabelY}${this._valueChanged ? "" : `, ${ariaValueX}, ${ariaLabelX}`}`}
|
|
276
388
|
orient="vertical"
|
|
277
389
|
min="0"
|
|
278
390
|
max="1"
|
|
@@ -286,8 +398,13 @@ class l extends z {
|
|
|
286
398
|
</fieldset>
|
|
287
399
|
`;
|
|
288
400
|
}
|
|
289
|
-
firstUpdated(
|
|
290
|
-
super.firstUpdated(
|
|
401
|
+
firstUpdated(changed) {
|
|
402
|
+
super.firstUpdated(changed);
|
|
403
|
+
this.boundingClientRect = this.getBoundingClientRect();
|
|
404
|
+
this.addEventListener("focus", this.handleFocus);
|
|
405
|
+
this.addEventListener("blur", this.handleBlur);
|
|
406
|
+
this.addEventListener("keyup", this.handleKeyup);
|
|
407
|
+
this.addEventListener("keydown", this.handleKeydown);
|
|
291
408
|
}
|
|
292
409
|
/**
|
|
293
410
|
* Overrides the `updated` method to handle changes in property values.
|
|
@@ -301,81 +418,99 @@ class l extends z {
|
|
|
301
418
|
* the `input[type="range"]` elements in shadow roots to prevent multiple
|
|
302
419
|
* tab stops within the Color Area for certain browser settings (e.g., Webkit).
|
|
303
420
|
*/
|
|
304
|
-
updated(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
421
|
+
updated(changed) {
|
|
422
|
+
super.updated(changed);
|
|
423
|
+
if (this.x !== this.inputX.valueAsNumber) {
|
|
424
|
+
this.colorController.color.set("s", this.inputX.valueAsNumber * 100);
|
|
425
|
+
}
|
|
426
|
+
if (this.y !== this.inputY.valueAsNumber) {
|
|
427
|
+
this.colorController.color.set(
|
|
428
|
+
"v",
|
|
429
|
+
(1 - this.inputY.valueAsNumber) * 100
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
if (changed.has("focused") && this.focused) {
|
|
433
|
+
const parentX = this.inputX.parentElement;
|
|
434
|
+
const parentY = this.inputY.parentElement;
|
|
435
|
+
if (!parentX.shadowRoot && !parentY.shadowRoot) {
|
|
436
|
+
parentX.attachShadow({ mode: "open" });
|
|
437
|
+
parentY.attachShadow({ mode: "open" });
|
|
438
|
+
const slot = '<div tabindex="-1"><slot></slot></div>';
|
|
439
|
+
parentX.shadowRoot.innerHTML = slot;
|
|
440
|
+
parentY.shadowRoot.innerHTML = slot;
|
|
314
441
|
}
|
|
315
442
|
}
|
|
316
443
|
}
|
|
317
444
|
connectedCallback() {
|
|
318
|
-
var
|
|
319
|
-
super.connectedCallback()
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
445
|
+
var _a;
|
|
446
|
+
super.connectedCallback();
|
|
447
|
+
if (!this.observer && window.ResizeObserver) {
|
|
448
|
+
this.observer = new window.ResizeObserver((entries) => {
|
|
449
|
+
for (const entry of entries) {
|
|
450
|
+
this.boundingClientRect = entry.contentRect;
|
|
451
|
+
}
|
|
452
|
+
this.requestUpdate();
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
(_a = this.observer) == null ? void 0 : _a.observe(this);
|
|
324
456
|
}
|
|
325
457
|
disconnectedCallback() {
|
|
326
|
-
var
|
|
327
|
-
(
|
|
458
|
+
var _a;
|
|
459
|
+
(_a = this.observer) == null ? void 0 : _a.unobserve(this);
|
|
460
|
+
super.disconnectedCallback();
|
|
328
461
|
}
|
|
329
462
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
],
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
],
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
],
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
],
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
],
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
],
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
],
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
],
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
],
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
],
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
],
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
],
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
],
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
],
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
],
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
],
|
|
378
|
-
customElements.get("luzmo-color-area")
|
|
463
|
+
__decorateClass([
|
|
464
|
+
property({ type: String, reflect: true })
|
|
465
|
+
], LuzmoColorArea.prototype, "dir", 2);
|
|
466
|
+
__decorateClass([
|
|
467
|
+
property({ type: Boolean, reflect: true })
|
|
468
|
+
], LuzmoColorArea.prototype, "disabled", 2);
|
|
469
|
+
__decorateClass([
|
|
470
|
+
property({ type: Boolean, reflect: true })
|
|
471
|
+
], LuzmoColorArea.prototype, "focused", 2);
|
|
472
|
+
__decorateClass([
|
|
473
|
+
property({ type: String, attribute: "label-x" })
|
|
474
|
+
], LuzmoColorArea.prototype, "labelX", 2);
|
|
475
|
+
__decorateClass([
|
|
476
|
+
property({ type: String, attribute: "label-y" })
|
|
477
|
+
], LuzmoColorArea.prototype, "labelY", 2);
|
|
478
|
+
__decorateClass([
|
|
479
|
+
property({ type: Boolean, attribute: "is-ltr" })
|
|
480
|
+
], LuzmoColorArea.prototype, "isLTR", 2);
|
|
481
|
+
__decorateClass([
|
|
482
|
+
query(".handle")
|
|
483
|
+
], LuzmoColorArea.prototype, "handle", 2);
|
|
484
|
+
__decorateClass([
|
|
485
|
+
property({ type: Number })
|
|
486
|
+
], LuzmoColorArea.prototype, "hue", 1);
|
|
487
|
+
__decorateClass([
|
|
488
|
+
property({ type: String })
|
|
489
|
+
], LuzmoColorArea.prototype, "value", 1);
|
|
490
|
+
__decorateClass([
|
|
491
|
+
property({ type: String })
|
|
492
|
+
], LuzmoColorArea.prototype, "color", 1);
|
|
493
|
+
__decorateClass([
|
|
494
|
+
property({ attribute: false })
|
|
495
|
+
], LuzmoColorArea.prototype, "activeAxis", 2);
|
|
496
|
+
__decorateClass([
|
|
497
|
+
property({ type: Number })
|
|
498
|
+
], LuzmoColorArea.prototype, "x", 1);
|
|
499
|
+
__decorateClass([
|
|
500
|
+
property({ type: Number })
|
|
501
|
+
], LuzmoColorArea.prototype, "y", 1);
|
|
502
|
+
__decorateClass([
|
|
503
|
+
property({ type: Number })
|
|
504
|
+
], LuzmoColorArea.prototype, "step", 2);
|
|
505
|
+
__decorateClass([
|
|
506
|
+
query('[name="x"]')
|
|
507
|
+
], LuzmoColorArea.prototype, "inputX", 2);
|
|
508
|
+
__decorateClass([
|
|
509
|
+
query('[name="y"]')
|
|
510
|
+
], LuzmoColorArea.prototype, "inputY", 2);
|
|
511
|
+
if (!customElements.get("luzmo-color-area")) {
|
|
512
|
+
customElements.define("luzmo-color-area", LuzmoColorArea);
|
|
513
|
+
}
|
|
379
514
|
export {
|
|
380
|
-
|
|
515
|
+
LuzmoColorArea
|
|
381
516
|
};
|