@luzmo/lucero 1.0.1-alpha.3 → 1.0.1-alpha.30
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 +6 -6
- package/components/accordion/index.js +13 -12
- package/components/action-bar/index.cjs +4 -4
- package/components/action-bar/index.js +11 -9
- package/components/action-button/index.cjs +3 -3
- package/components/action-button/index.js +6 -5
- package/components/action-group/index.cjs +1 -1
- package/components/action-group/index.js +1 -1
- package/components/{action-group-DBImibFn.js → action-group-Bwt9w8Vh.js} +10 -9
- package/components/action-group-D917z7XF.cjs +20 -0
- package/components/action-menu/index.cjs +9 -9
- package/components/action-menu/index.js +9 -9
- package/components/avatar/index.cjs +3 -3
- package/components/avatar/index.js +6 -6
- package/components/base-5nDSSNeT.cjs +18 -0
- package/components/base-CdYjmV_8.js +96 -0
- package/components/button/button-base.d.ts +16 -0
- package/components/button/button.d.ts +38 -2
- package/components/button/index.cjs +2 -2
- package/components/button/index.js +34 -29
- package/components/{button-base-DbkDzb71.js → button-base-B5uul3tZ.js} +54 -39
- package/components/button-base-C7or8-FB.cjs +25 -0
- package/components/button-group/index.cjs +1 -1
- package/components/button-group/index.js +10 -8
- package/components/calendar/index.cjs +96 -1
- package/components/calendar/index.js +538 -6
- package/components/checkbox/index.cjs +4 -4
- package/components/checkbox/index.js +6 -4
- package/components/{checkbox-mixin-Do7EgtpQ.js → checkbox-mixin-DUbGDm7f.js} +9 -9
- package/components/{checkbox-mixin-BDN0dBtS.cjs → checkbox-mixin-DhN8CIXY.cjs} +3 -3
- package/components/{clear-button-DoeRUWQ3.js → clear-button-BFtJVPzm.js} +14 -13
- package/components/clear-button-_a8GjtJC.cjs +18 -0
- package/components/{close-button-BWXdHSx3.js → close-button-D9qjjy2w.js} +13 -12
- package/components/close-button-TZ08VFmi.cjs +18 -0
- package/components/color-area/index.cjs +5 -5
- package/components/color-area/index.js +11 -10
- package/components/color-controller-7sNUf7SP.js +386 -0
- package/components/color-controller-ChN-A9Ft.cjs +18 -0
- package/components/color-field/color-field.d.ts +8 -0
- package/components/color-field/index.cjs +4 -4
- package/components/color-field/index.js +37 -24
- package/components/color-handle/index.cjs +2 -2
- package/components/color-handle/index.js +7 -5
- package/components/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.js +1 -1
- package/components/color-loupe-CIEFp7ln.cjs +56 -0
- package/components/{color-loupe-CmMsXbjT.js → color-loupe-CLPX6xVb.js} +6 -4
- package/components/color-menu/index.cjs +8 -8
- package/components/color-menu/index.js +45 -45
- package/components/color-palette/color-palette.d.ts +38 -3
- package/components/color-palette/index.cjs +1 -1
- package/components/color-palette/index.js +53 -39
- package/components/color-palette-group/color-palette-group.d.ts +79 -0
- package/components/color-palette-group/index.cjs +28 -0
- package/components/color-palette-group/index.d.ts +7 -0
- package/components/color-palette-group/index.js +206 -0
- package/components/color-picker/color-picker.d.ts +31 -2
- package/components/color-picker/index.cjs +6 -5
- package/components/color-picker/index.js +15 -11
- package/components/color-slider/index.cjs +40 -1
- package/components/color-slider/index.js +452 -6
- package/components/date-time-picker/index.cjs +16 -16
- package/components/date-time-picker/index.js +104 -105
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-CO-VPlqq.js} +4 -4
- package/components/{dependency-manger-C5HCkMMB.cjs → dependency-manger-uthev62E.cjs} +1 -1
- package/components/divider/index.cjs +1 -1
- package/components/divider/index.js +10 -8
- package/components/field-group/index.cjs +1 -1
- package/components/field-group/index.js +1 -1
- package/components/field-group-BYHNJmv0.cjs +23 -0
- package/components/{field-group-DXfBWrkO.js → field-group-CHmw159R.js} +7 -5
- package/components/field-label/index.cjs +1 -1
- package/components/field-label/index.js +1 -1
- package/components/{field-label-CZ2zzChK.js → field-label-Cy3xMWZ-.js} +9 -8
- package/components/field-label-DZoeqJJX.cjs +25 -0
- package/components/{focus-visible-DBlJGoEW.js → focus-visible-BvScGDCE.js} +20 -20
- package/components/focus-visible-D4BXb5RB.cjs +18 -0
- package/components/{focusable-BxtpnzWp.js → focusable-BjvsvVam.js} +3 -2
- package/components/focusable-CbVKgGfS.cjs +18 -0
- package/components/icon/index.cjs +1 -1
- package/components/icon/index.js +22 -20
- package/components/index.cjs +1 -1
- package/components/index.js +139 -137
- package/components/infield-button/index.cjs +2 -2
- package/components/infield-button/index.js +4 -3
- package/components/label/index.cjs +1 -1
- package/components/label/index.js +6 -4
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-B-wjV5bb.js} +9 -8
- package/components/{directive-C7oCP5Bh.cjs → language-resolution-EUER43cg.cjs} +1 -5
- package/components/like-anchor-B2EqJPdw.cjs +32 -0
- package/components/{like-anchor-Bvn_vLQ8.js → like-anchor-CgqCU210.js} +23 -22
- package/components/{manage-help-text-DhgARkZX.cjs → manage-help-text-Bat9yGvF.cjs} +3 -3
- package/components/{manage-help-text-syYnjKGL.js → manage-help-text-C9sCHK3R.js} +8 -8
- package/components/menu/index.cjs +38 -13
- package/components/menu/index.js +137 -104
- package/components/menu/menu-item.d.ts +8 -1
- package/components/multi-language-field/index.cjs +2 -2
- package/components/multi-language-field/index.js +8 -6
- package/components/number-field/index.cjs +6 -6
- package/components/number-field/index.js +33 -34
- package/components/observe-slot-presence-CNltc0C0.cjs +18 -0
- package/components/{observe-slot-presence-CmVi0zTc.js → observe-slot-presence-DFi6GE3H.js} +1 -1
- package/components/observe-slot-text-CBMHpuIK.cjs +18 -0
- package/components/{observe-slot-text-BPfIQQtz.js → observe-slot-text-DorVpCL4.js} +14 -15
- package/components/options/index.cjs +26 -58
- package/components/options/index.js +205 -849
- package/components/overlay/index.cjs +6 -6
- package/components/overlay/index.js +30 -31
- package/components/overlay-DpWon1Rp.js +1736 -0
- package/components/overlay-nUwFClQq.cjs +47 -0
- package/components/{pending-state-CaH1si5b.cjs → pending-state-DQctFHI8.cjs} +2 -2
- package/components/{pending-state-DTX7ggyF.js → pending-state-Dx1u3EXA.js} +2 -2
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +2 -2
- package/components/{picker-BmoXv1jt.js → picker-Cm6_didQ.js} +44 -44
- package/components/picker-DxYgh4LR.cjs +123 -0
- package/components/picker-button/index.cjs +4 -4
- package/components/picker-button/index.js +7 -6
- package/components/{platform-BiXhwqk3.cjs → platform-BJnOJJag.cjs} +1 -1
- package/components/{platform-BM-uMWpX.js → platform-CqwNrovd.js} +12 -12
- package/components/popover/index.cjs +1 -1
- package/components/popover/index.js +1 -1
- package/components/popover-lcZnODPK.cjs +30 -0
- package/components/{popover-DjX0aAnY.js → popover-ucIgjbQs.js} +8 -7
- package/components/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.js +1 -1
- package/components/{progress-circle-DXH9z8-6.js → progress-circle-D5J0ZwY0.js} +8 -7
- package/components/progress-circle-DgMbqrzG.cjs +33 -0
- package/components/radio/index.cjs +2 -2
- package/components/radio/index.js +11 -10
- package/components/search/index.cjs +6 -6
- package/components/search/index.js +5 -5
- package/components/select/index.cjs +43 -43
- package/components/select/index.js +106 -91
- package/components/select/select.d.ts +1 -1
- package/components/{base-BjTwmyRF.cjs → sized-mixin-DcvJLFeo.cjs} +1 -5
- package/components/{sized-mixin-D4ACoVUr.js → sized-mixin-cJbo3PKR.js} +5 -5
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +48 -1101
- package/components/{strategies-9indNIEb.js → strategies-Bk97oVn1.js} +15 -50
- package/components/strategies-CNgBb6dM.cjs +18 -0
- package/components/{streaming-listener-CP-JE6Fa.js → streaming-listener-BlWm-XZU.js} +5 -6
- package/components/streaming-listener-D9Wc7skA.cjs +18 -0
- package/components/swatch/index.cjs +7 -7
- package/components/swatch/index.js +17 -16
- package/components/switch/index.cjs +2 -2
- package/components/switch/index.js +5 -4
- package/components/tabs/index.cjs +16 -24
- package/components/tabs/index.js +93 -161
- package/components/tags/index.cjs +4 -4
- package/components/tags/index.js +14 -13
- package/components/text-field/index.cjs +3 -3
- package/components/text-field/index.js +12 -10
- package/components/text-field/text-field.d.ts +1 -0
- package/components/{text-field-BIADXoLC.js → text-field-BTEpwGFu.js} +73 -99
- package/components/text-field-JMrsh-zo.cjs +81 -0
- package/components/{text-field.module-ColtFhf_.js → text-field.module-C2KVUJcX.js} +1 -1
- package/components/{text-field.module-p_VF2tC_.cjs → text-field.module-DXhFA9G-.cjs} +1 -1
- package/components/toast/index.cjs +11 -11
- package/components/toast/index.js +10 -8
- package/components/tooltip/index.cjs +4 -4
- package/components/tooltip/index.js +60 -36
- package/components/tooltip/tooltip.d.ts +12 -1
- package/components/unit-input/index.cjs +6 -6
- package/components/unit-input/index.js +10 -9
- package/components/utils.cjs +1 -1
- package/components/utils.js +6 -6
- package/custom-elements.json +1 -1
- package/index.d.ts +1 -0
- package/package.json +67 -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-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-Qi1pMA5S.cjs +0 -18
- package/components/close-button-BFMBEw3q.cjs +0 -18
- package/components/color-controller-DTp1juRz.js +0 -3198
- package/components/color-controller-_ZwyhvaU.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/directive-oAbCiebi.js +0 -44
- package/components/field-group-DkGst3r5.cjs +0 -23
- 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-visible-B0P9aY_G.cjs +0 -18
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-A-yOTB_d.js +0 -1490
- package/components/index-BLWuwZXx.cjs +0 -113
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-HjQa8tew.js +0 -1174
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-DbwDQtuO.js +0 -229
- package/components/luzmo-icons-DletXGWU.cjs +0 -29
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- 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/picker-DWsBWdPN.cjs +0 -123
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- 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/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-D5d_Gt0t.cjs +0 -85
- package/components/when-CDK1Tt5Y.js +0 -28
- package/components/when-CDZyJPvd.cjs +0 -22
|
@@ -15,61 +15,75 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import { unsafeCSS as m, html as p } from "lit";
|
|
19
|
+
import { property as e } from "lit/decorators.js";
|
|
20
|
+
import { F as b } from "../focusable-BjvsvVam.js";
|
|
21
|
+
import { S as z } from "../sized-mixin-cJbo3PKR.js";
|
|
21
22
|
const n = () => {
|
|
22
23
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const t = document.createElement("style");
|
|
25
|
+
t.setAttribute("data-luzmo-vars", ""), t.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(t);
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
n();
|
|
28
|
-
const h = ":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
|
|
29
|
-
var
|
|
30
|
-
for (var
|
|
31
|
-
(u =
|
|
32
|
-
return
|
|
29
|
+
const h = ":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}";
|
|
30
|
+
var v = Object.defineProperty, l = (t, r, c, s) => {
|
|
31
|
+
for (var a = void 0, d = t.length - 1, u; d >= 0; d--)
|
|
32
|
+
(u = t[d]) && (a = u(r, c, a) || a);
|
|
33
|
+
return a && v(r, c, a), a;
|
|
33
34
|
};
|
|
34
|
-
const
|
|
35
|
+
const i = class i extends z(b, {
|
|
35
36
|
validSizes: ["s", "m", "l", "xl"],
|
|
36
37
|
noDefaultSize: !0
|
|
37
38
|
}) {
|
|
38
39
|
constructor() {
|
|
39
|
-
super(...arguments), this.disabled = !1, this.focused = !1, this.active = !1, this.
|
|
40
|
+
super(...arguments), this.disabled = !1, this.focused = !1, this.selected = !1, this.active = !1, this.reverse = !1, this.horizontal = !1;
|
|
40
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
41
45
|
get focusElement() {
|
|
42
|
-
return this
|
|
43
|
-
}
|
|
44
|
-
handlePointerdown(o) {
|
|
45
|
-
o.pointerType === "touch" && (this.active = !0), this.setPointerCapture(o.pointerId);
|
|
46
|
-
}
|
|
47
|
-
handlePointerup(o) {
|
|
48
|
-
this.active = !1, this.releasePointerCapture(o.pointerId);
|
|
46
|
+
return this;
|
|
49
47
|
}
|
|
50
48
|
render() {
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
var c;
|
|
50
|
+
const r = (c = this.colors) == null ? void 0 : c.map((s) => p`<div class="color" style="background-color: ${s}"></div>`);
|
|
51
|
+
return p` <div id="palette">${r}</div> `;
|
|
52
|
+
}
|
|
53
|
+
firstUpdated(r) {
|
|
54
|
+
super.firstUpdated(r);
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
super.
|
|
56
|
+
updated(r) {
|
|
57
|
+
super.updated(r), r.has("selected") && this.setAttribute("tabindex", this.selected ? "0" : "-1"), r.has("disabled") && (this.disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"));
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
],
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
],
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
],
|
|
72
|
-
|
|
60
|
+
i.styles = m(h);
|
|
61
|
+
let o = i;
|
|
62
|
+
l([
|
|
63
|
+
e({ type: Boolean, reflect: !0 })
|
|
64
|
+
], o.prototype, "disabled");
|
|
65
|
+
l([
|
|
66
|
+
e({ type: Boolean, reflect: !0 })
|
|
67
|
+
], o.prototype, "focused");
|
|
68
|
+
l([
|
|
69
|
+
e({ type: Boolean, reflect: !0 })
|
|
70
|
+
], o.prototype, "selected");
|
|
71
|
+
l([
|
|
72
|
+
e({ type: Boolean, reflect: !0 })
|
|
73
|
+
], o.prototype, "active");
|
|
74
|
+
l([
|
|
75
|
+
e({ type: String, reflect: !0 })
|
|
76
|
+
], o.prototype, "value");
|
|
77
|
+
l([
|
|
78
|
+
e({ type: Array, reflect: !0 })
|
|
79
|
+
], o.prototype, "colors");
|
|
80
|
+
l([
|
|
81
|
+
e({ type: Boolean, reflect: !0 })
|
|
82
|
+
], o.prototype, "reverse");
|
|
83
|
+
l([
|
|
84
|
+
e({ type: Boolean, reflect: !0 })
|
|
85
|
+
], o.prototype, "horizontal");
|
|
86
|
+
customElements.get("luzmo-color-palette") || customElements.define("luzmo-color-palette", o);
|
|
73
87
|
export {
|
|
74
|
-
|
|
88
|
+
o as LuzmoColorPalette
|
|
75
89
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { LuzmoElement } from '../../utils/base';
|
|
3
|
+
import { RovingTabindexController } from '../../utils/reactive-controllers/roving-tabindex';
|
|
4
|
+
import { LuzmoColorPalette } from '../color-palette';
|
|
5
|
+
declare const LuzmoColorPaletteGroup_base: typeof LuzmoElement & {
|
|
6
|
+
new (...args: any[]): import("../..").SizedElementInterface;
|
|
7
|
+
prototype: import("../..").SizedElementInterface;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @element luzmo-color-palette-group
|
|
11
|
+
* @slot - the luzmo-color-palette elements that make up the group
|
|
12
|
+
*
|
|
13
|
+
* @fires change - Announces the color palette value has been changed by user
|
|
14
|
+
*/
|
|
15
|
+
export declare class LuzmoColorPaletteGroup extends LuzmoColorPaletteGroup_base {
|
|
16
|
+
/**
|
|
17
|
+
* The styles of the color palette
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
static get styles(): CSSResultArray;
|
|
21
|
+
/**
|
|
22
|
+
* Set the color palette group to a disabled state
|
|
23
|
+
*/
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Set the color palette group to a horizontal state
|
|
27
|
+
*/
|
|
28
|
+
horizontal: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The color palette elements in the group
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
set palettes(palettes: LuzmoColorPalette[]);
|
|
34
|
+
/**
|
|
35
|
+
* The color palette elements in the group
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
get palettes(): LuzmoColorPalette[];
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
_palettes: LuzmoColorPalette[];
|
|
43
|
+
constructor();
|
|
44
|
+
rovingTabindexController: RovingTabindexController<LuzmoColorPalette>;
|
|
45
|
+
/**
|
|
46
|
+
* The aria-label of the color palette group
|
|
47
|
+
*/
|
|
48
|
+
label: string;
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
private _selected?;
|
|
53
|
+
/**
|
|
54
|
+
* The selected color palette value
|
|
55
|
+
*/
|
|
56
|
+
get selected(): string | undefined;
|
|
57
|
+
set selected(selected: string);
|
|
58
|
+
slotElement: HTMLSlotElement;
|
|
59
|
+
private dispatchChange;
|
|
60
|
+
private setSelected;
|
|
61
|
+
focus(options?: FocusOptions): void;
|
|
62
|
+
private deselectSelectedPalettes;
|
|
63
|
+
private _handleClick;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
private _onKeyDown;
|
|
68
|
+
private applySelects;
|
|
69
|
+
private manageSelects;
|
|
70
|
+
protected render(): TemplateResult;
|
|
71
|
+
protected firstUpdated(changes: PropertyValues): void;
|
|
72
|
+
protected updated(changes: PropertyValues): void;
|
|
73
|
+
private manageChildren;
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
private manageColorPalettes;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lit"),d=require("@lit-labs/observers/mutation-controller.js"),o=require("lit/decorators.js"),p=require("lit/directives/if-defined.js"),h=require("../base-5nDSSNeT.cjs"),g=require("../roving-tabindex-By_fCy_e.cjs"),m=require("../sized-mixin-DcvJLFeo.cjs"),f=".color-palette-group{column-gap:var(--luzmo-color-palette-group-column-gap, var(--color-palette-group-column-gap));row-gap:var(--luzmo-color-palette-group-row-gap, var(--color-palette-group-row-gap));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:1}:host{--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}:host([size=s]){--color-palette-group-column-gap: var(--luzmo-spacing-2);--color-palette-group-row-gap: var(--luzmo-spacing-2)}:host,:host([size=l]),:host([size=xl]){--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}";var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,i=(n,e,t,s)=>{for(var r=s>1?void 0:s?v(e,t):e,l=n.length-1,u;l>=0;l--)(u=n[l])&&(r=(s?u(e,t,r):u(r))||r);return s&&r&&b(e,t,r),r};class a extends m.SizedMixin(h.LuzmoElement,{validSizes:["s","m","l","xl"],noDefaultSize:!0}){constructor(){super(),this.disabled=!1,this.horizontal=!1,this._palettes=[],this.rovingTabindexController=new g.RovingTabindexController(this,{focusInIndex:e=>e.findIndex(t=>this.selected?!t.disabled&&t.value===this.selected:!t.disabled),elements:()=>this.palettes,isFocusableElement:e=>!e.disabled}),this.label="",this._onKeyDown=e=>{if(e.code==="Enter"||e.code==="Space"){e.preventDefault();const t=e.target;if(t.value===void 0)return;this.deselectSelectedPalettes(),t.selected=!0,t.tabIndex=0,t.setAttribute("aria-checked","true"),this.setSelected(t.value,!0)}},this.manageColorPalettes=()=>{if(!this.slotElement)return;const t=this.slotElement.assignedElements({flatten:!0}).reduce((s,r)=>{if(r.matches("luzmo-color-palette"))s.push(r);else{const l=[...r.querySelectorAll(":scope > luzmo-color-palette")];s.push(...l)}return s},[]);this.palettes=t,this.manageChildren(),this.manageSelects()},new d.MutationController(this,{config:{childList:!0,subtree:!0},callback:()=>{this.manageColorPalettes()},skipInitial:!0})}static get styles(){return[c.unsafeCSS(f)]}set palettes(e){e!==this.palettes&&(this._palettes=e,this.rovingTabindexController.clearElementCache())}get palettes(){return this._palettes}get selected(){return this._selected}set selected(e){this.requestUpdate("selected",this._selected),this._selected=e,this.updateComplete.then(()=>{this.applySelects(),this.manageChildren()})}dispatchChange(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||(this.setSelected(e),this.palettes.map(s=>{s.selected=!!(s.value&&this.selected===s.value)}))}setSelected(e,t){if(e===this.selected)return;const s=this.selected;this.requestUpdate("selected",s),this._selected=e,t&&this.dispatchChange(s)}focus(e){this.rovingTabindexController.focus(e)}deselectSelectedPalettes(){this.palettes.forEach(e=>{e.selected&&(e.selected=!1,e.tabIndex=-1,e.setAttribute("aria-checked","false"))})}_handleClick(e){const t=e.target;t.value!==void 0&&(this.deselectSelectedPalettes(),t.selected=!0,t.tabIndex=0,t.setAttribute("aria-checked","true"),this.setSelected(t.value,!0))}async applySelects(){await this.manageSelects()}async manageSelects(){if(this.palettes.length===0)return;const e=this.palettes;this.setAttribute("role","radiogroup");const t=[],s=e.map(async l=>{await l.updateComplete,l.setAttribute("role","radio"),l.setAttribute("aria-checked",l.selected?"true":"false"),l.selected&&t.push(l)});await Promise.all(s);const r=t.map(l=>l.value).find(Boolean);this.setSelected(r)}render(){return c.html`
|
|
19
|
+
<div
|
|
20
|
+
class="color-palette-group"
|
|
21
|
+
aria-label=${p.ifDefined(this.label??void 0)}
|
|
22
|
+
role="radiogroup"
|
|
23
|
+
@keydown=${this._onKeyDown}
|
|
24
|
+
@slotchange=${this.manageColorPalettes}
|
|
25
|
+
>
|
|
26
|
+
<slot role="presentation"></slot>
|
|
27
|
+
</div>
|
|
28
|
+
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",this._handleClick)}updated(e){super.updated(e),e.has("horizontal")&&this.palettes.forEach(s=>{s.horizontal=this.horizontal}),this.manageSelects(),this.manageChildren(),e.has("size")&&this.manageChildren(e),e.has("label")&&(this.label||e.get("label")!==void 0)&&(this.label.length>0?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label"))}manageChildren(e){this.palettes.forEach(t=>{t.setAttribute("aria-label",`color palette: ${t.value}`),t.selected=!!(t.value&&this.selected===t.value),this.size&&(this.size!=="m"||(e==null?void 0:e.get("size"))!==void 0)&&(t.size=this.size),this.disabled&&(t.disabled=!0),t.horizontal=this.horizontal})}}i([o.property({type:Boolean,reflect:!0})],a.prototype,"disabled",2);i([o.property({type:Boolean,reflect:!0})],a.prototype,"horizontal",2);i([o.property({type:String})],a.prototype,"label",2);i([o.property({type:String})],a.prototype,"selected",1);i([o.query("slot")],a.prototype,"slotElement",2);customElements.get("luzmo-color-palette-group")||customElements.define("luzmo-color-palette-group",a);exports.LuzmoColorPaletteGroup=a;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { unsafeCSS as d, html as m } from "lit";
|
|
19
|
+
import { MutationController as p } from "@lit-labs/observers/mutation-controller.js";
|
|
20
|
+
import { property as u, query as h } from "lit/decorators.js";
|
|
21
|
+
import { ifDefined as z } from "lit/directives/if-defined.js";
|
|
22
|
+
import { a as f } from "../base-CdYjmV_8.js";
|
|
23
|
+
import { R as g } from "../roving-tabindex-DOg4z6ZU.js";
|
|
24
|
+
import { S as b } from "../sized-mixin-cJbo3PKR.js";
|
|
25
|
+
const n = () => {
|
|
26
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
27
|
+
const s = document.createElement("style");
|
|
28
|
+
s.setAttribute("data-luzmo-vars", ""), s.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(s);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
n();
|
|
32
|
+
const v = ".color-palette-group{column-gap:var(--luzmo-color-palette-group-column-gap, var(--color-palette-group-column-gap));row-gap:var(--luzmo-color-palette-group-row-gap, var(--color-palette-group-row-gap));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:1}:host{--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}:host([size=s]){--color-palette-group-column-gap: var(--luzmo-spacing-2);--color-palette-group-row-gap: var(--luzmo-spacing-2)}:host,:host([size=l]),:host([size=xl]){--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}";
|
|
33
|
+
var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (s, e, o, t) => {
|
|
34
|
+
for (var r = t > 1 ? void 0 : t ? y(e, o) : e, l = s.length - 1, c; l >= 0; l--)
|
|
35
|
+
(c = s[l]) && (r = (t ? c(e, o, r) : c(r)) || r);
|
|
36
|
+
return t && r && x(e, o, r), r;
|
|
37
|
+
};
|
|
38
|
+
class a extends b(f, {
|
|
39
|
+
validSizes: ["s", "m", "l", "xl"],
|
|
40
|
+
noDefaultSize: !0
|
|
41
|
+
}) {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(), this.disabled = !1, this.horizontal = !1, this._palettes = [], this.rovingTabindexController = new g(
|
|
44
|
+
this,
|
|
45
|
+
{
|
|
46
|
+
focusInIndex: (e) => e.findIndex(
|
|
47
|
+
(o) => this.selected ? !o.disabled && o.value === this.selected : !o.disabled
|
|
48
|
+
),
|
|
49
|
+
elements: () => this.palettes,
|
|
50
|
+
isFocusableElement: (e) => !e.disabled
|
|
51
|
+
}
|
|
52
|
+
), this.label = "", this._onKeyDown = (e) => {
|
|
53
|
+
if (e.code === "Enter" || e.code === "Space") {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
const o = e.target;
|
|
56
|
+
if (o.value === void 0)
|
|
57
|
+
return;
|
|
58
|
+
this.deselectSelectedPalettes(), o.selected = !0, o.tabIndex = 0, o.setAttribute("aria-checked", "true"), this.setSelected(o.value, !0);
|
|
59
|
+
}
|
|
60
|
+
}, this.manageColorPalettes = () => {
|
|
61
|
+
if (!this.slotElement)
|
|
62
|
+
return;
|
|
63
|
+
const o = this.slotElement.assignedElements({
|
|
64
|
+
flatten: !0
|
|
65
|
+
}).reduce((t, r) => {
|
|
66
|
+
if (r.matches("luzmo-color-palette"))
|
|
67
|
+
t.push(r);
|
|
68
|
+
else {
|
|
69
|
+
const l = [
|
|
70
|
+
...r.querySelectorAll(":scope > luzmo-color-palette")
|
|
71
|
+
];
|
|
72
|
+
t.push(...l);
|
|
73
|
+
}
|
|
74
|
+
return t;
|
|
75
|
+
}, []);
|
|
76
|
+
this.palettes = o, this.manageChildren(), this.manageSelects();
|
|
77
|
+
}, new p(this, {
|
|
78
|
+
config: {
|
|
79
|
+
childList: !0,
|
|
80
|
+
subtree: !0
|
|
81
|
+
},
|
|
82
|
+
callback: () => {
|
|
83
|
+
this.manageColorPalettes();
|
|
84
|
+
},
|
|
85
|
+
skipInitial: !0
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The styles of the color palette
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
static get styles() {
|
|
93
|
+
return [d(v)];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The color palette elements in the group
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
set palettes(e) {
|
|
100
|
+
e !== this.palettes && (this._palettes = e, this.rovingTabindexController.clearElementCache());
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The color palette elements in the group
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
get palettes() {
|
|
107
|
+
return this._palettes;
|
|
108
|
+
}
|
|
109
|
+
get selected() {
|
|
110
|
+
return this._selected;
|
|
111
|
+
}
|
|
112
|
+
set selected(e) {
|
|
113
|
+
this.requestUpdate("selected", this._selected), this._selected = e, this.updateComplete.then(() => {
|
|
114
|
+
this.applySelects(), this.manageChildren();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
dispatchChange(e) {
|
|
118
|
+
this.dispatchEvent(
|
|
119
|
+
new Event("change", {
|
|
120
|
+
bubbles: !0,
|
|
121
|
+
composed: !0,
|
|
122
|
+
cancelable: !0
|
|
123
|
+
})
|
|
124
|
+
) || (this.setSelected(e), this.palettes.map((t) => {
|
|
125
|
+
t.selected = !!(t.value && this.selected === t.value);
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
setSelected(e, o) {
|
|
129
|
+
if (e === this.selected)
|
|
130
|
+
return;
|
|
131
|
+
const t = this.selected;
|
|
132
|
+
this.requestUpdate("selected", t), this._selected = e, o && this.dispatchChange(t);
|
|
133
|
+
}
|
|
134
|
+
focus(e) {
|
|
135
|
+
this.rovingTabindexController.focus(e);
|
|
136
|
+
}
|
|
137
|
+
deselectSelectedPalettes() {
|
|
138
|
+
this.palettes.forEach((e) => {
|
|
139
|
+
e.selected && (e.selected = !1, e.tabIndex = -1, e.setAttribute("aria-checked", "false"));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
_handleClick(e) {
|
|
143
|
+
const o = e.target;
|
|
144
|
+
o.value !== void 0 && (this.deselectSelectedPalettes(), o.selected = !0, o.tabIndex = 0, o.setAttribute("aria-checked", "true"), this.setSelected(o.value, !0));
|
|
145
|
+
}
|
|
146
|
+
async applySelects() {
|
|
147
|
+
await this.manageSelects();
|
|
148
|
+
}
|
|
149
|
+
async manageSelects() {
|
|
150
|
+
if (this.palettes.length === 0)
|
|
151
|
+
return;
|
|
152
|
+
const e = this.palettes;
|
|
153
|
+
this.setAttribute("role", "radiogroup");
|
|
154
|
+
const o = [], t = e.map(async (l) => {
|
|
155
|
+
await l.updateComplete, l.setAttribute("role", "radio"), l.setAttribute("aria-checked", l.selected ? "true" : "false"), l.selected && o.push(l);
|
|
156
|
+
});
|
|
157
|
+
await Promise.all(t);
|
|
158
|
+
const r = o.map((l) => l.value).find(Boolean);
|
|
159
|
+
this.setSelected(r);
|
|
160
|
+
}
|
|
161
|
+
render() {
|
|
162
|
+
return m`
|
|
163
|
+
<div
|
|
164
|
+
class="color-palette-group"
|
|
165
|
+
aria-label=${z(this.label ?? void 0)}
|
|
166
|
+
role="radiogroup"
|
|
167
|
+
@keydown=${this._onKeyDown}
|
|
168
|
+
@slotchange=${this.manageColorPalettes}
|
|
169
|
+
>
|
|
170
|
+
<slot role="presentation"></slot>
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
firstUpdated(e) {
|
|
175
|
+
super.firstUpdated(e), this.addEventListener("click", this._handleClick);
|
|
176
|
+
}
|
|
177
|
+
updated(e) {
|
|
178
|
+
super.updated(e), e.has("horizontal") && this.palettes.forEach((t) => {
|
|
179
|
+
t.horizontal = this.horizontal;
|
|
180
|
+
}), this.manageSelects(), this.manageChildren(), e.has("size") && this.manageChildren(e), e.has("label") && (this.label || e.get("label") !== void 0) && (this.label.length > 0 ? this.setAttribute("aria-label", this.label) : this.removeAttribute("aria-label"));
|
|
181
|
+
}
|
|
182
|
+
manageChildren(e) {
|
|
183
|
+
this.palettes.forEach((o) => {
|
|
184
|
+
o.setAttribute("aria-label", `color palette: ${o.value}`), o.selected = !!(o.value && this.selected === o.value), this.size && (this.size !== "m" || (e == null ? void 0 : e.get("size")) !== void 0) && (o.size = this.size), this.disabled && (o.disabled = !0), o.horizontal = this.horizontal;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
i([
|
|
189
|
+
u({ type: Boolean, reflect: !0 })
|
|
190
|
+
], a.prototype, "disabled", 2);
|
|
191
|
+
i([
|
|
192
|
+
u({ type: Boolean, reflect: !0 })
|
|
193
|
+
], a.prototype, "horizontal", 2);
|
|
194
|
+
i([
|
|
195
|
+
u({ type: String })
|
|
196
|
+
], a.prototype, "label", 2);
|
|
197
|
+
i([
|
|
198
|
+
u({ type: String })
|
|
199
|
+
], a.prototype, "selected", 1);
|
|
200
|
+
i([
|
|
201
|
+
h("slot")
|
|
202
|
+
], a.prototype, "slotElement", 2);
|
|
203
|
+
customElements.get("luzmo-color-palette-group") || customElements.define("luzmo-color-palette-group", a);
|
|
204
|
+
export {
|
|
205
|
+
a as LuzmoColorPaletteGroup
|
|
206
|
+
};
|
|
@@ -3,6 +3,7 @@ import { LuzmoElement } from '../../utils/base';
|
|
|
3
3
|
import { ColorValue } from '../../utils/reactive-controllers/color';
|
|
4
4
|
import '../color-menu';
|
|
5
5
|
import '../overlay';
|
|
6
|
+
import { Placement } from '../overlay/overlay-types';
|
|
6
7
|
import '../popover';
|
|
7
8
|
import '../swatch';
|
|
8
9
|
import { SwatchRounding, SwatchShape } from './../swatch/swatch';
|
|
@@ -17,13 +18,41 @@ declare const LuzmoColorPicker_base: typeof LuzmoElement & {
|
|
|
17
18
|
*/
|
|
18
19
|
export declare class LuzmoColorPicker extends LuzmoColorPicker_base {
|
|
19
20
|
static styles: import("lit").CSSResult;
|
|
21
|
+
/**
|
|
22
|
+
* The color of the color picker.
|
|
23
|
+
*/
|
|
20
24
|
color?: ColorValue;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the color picker is open.
|
|
27
|
+
*/
|
|
21
28
|
open: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the color picker is disabled.
|
|
31
|
+
*/
|
|
22
32
|
disabled: boolean;
|
|
23
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Whether the color picker is read only.
|
|
35
|
+
*/
|
|
36
|
+
readOnly: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The placement of the color picker.
|
|
39
|
+
*/
|
|
40
|
+
placement: Placement;
|
|
41
|
+
/**
|
|
42
|
+
* The rounding of the color picker.
|
|
43
|
+
*/
|
|
24
44
|
rounding?: SwatchRounding;
|
|
25
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The shape of the color picker.
|
|
47
|
+
*/
|
|
48
|
+
shape?: SwatchShape;
|
|
49
|
+
/**
|
|
50
|
+
* The swatches of the color picker.
|
|
51
|
+
*/
|
|
26
52
|
swatches: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether the color picker has an alpha channel.
|
|
55
|
+
*/
|
|
27
56
|
noAlphaChannel: boolean;
|
|
28
57
|
private menuElement;
|
|
29
58
|
private overlayElement;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
18
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lit"),t=require("lit/decorators.js"),h=require("../base-5nDSSNeT.cjs"),c=require("../sized-mixin-DcvJLFeo.cjs");require("../color-menu/index.cjs");require("../overlay/index.cjs");const d=require("../slottable-request-event-BfUUt1Mh.cjs");require("../popover/index.cjs");require("../swatch/index.cjs");const y="luzmo-popover{margin-left:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap));margin-right:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap))}luzmo-swatch{cursor:pointer}:host([read-only]) luzmo-swatch{cursor:default;pointer-events:none}:host{--luzmo-popover-content-area-spacing-vertical: 0;--color-picker-popover-horizontal-gap: var(--luzmo-spacing-4)}:host([size=s]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-3)}:host([size=l]),:host([size=xl]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-5)}";var m=Object.defineProperty,r=(i,o,a,v)=>{for(var l=void 0,s=i.length-1,u;s>=0;s--)(u=i[s])&&(l=u(o,a,l)||l);return l&&m(o,a,l),l};const p=class p extends c.SizedMixin(h.LuzmoElement){constructor(){super(...arguments),this.color="rgb(255, 0, 0)",this.open=!1,this.disabled=!1,this.readOnly=!1,this.placement="left-start",this.rounding="full",this.swatches=[],this.noAlphaChannel=!1,this._renderMenu=!1}overlayCloseEvent(){this.open=!1}overlayOpenEvent(){this.open=!0}handleColorChange(){const o=this.menuElement.color;this.color=typeof o=="string"?o:String(o),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}firstUpdated(){this.overlayElement.addEventListener("slottable-request",o=>{this._renderMenu=o.data!==d.removeSlottableRequest})}updated(o){o.has("open")&&this.open===!0&&(this._renderMenu=!0)}renderColorMenu(){return n.html`
|
|
19
19
|
<luzmo-color-menu
|
|
20
20
|
.size=${this.size}
|
|
21
21
|
.color=${this.color}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
.swatches=${this.swatches}
|
|
24
24
|
@change=${this.handleColorChange}
|
|
25
25
|
></luzmo-color-menu>
|
|
26
|
-
`}render(){return
|
|
26
|
+
`}render(){return n.html`
|
|
27
27
|
<luzmo-swatch
|
|
28
28
|
id="trigger"
|
|
29
29
|
.shape=${this.shape}
|
|
@@ -32,16 +32,17 @@
|
|
|
32
32
|
.color=${this.color}
|
|
33
33
|
.selected=${this.open&&!this.disabled}
|
|
34
34
|
?disabled=${this.disabled}
|
|
35
|
+
?read-only=${this.readOnly}
|
|
35
36
|
@luzmo-closed=${this.overlayCloseEvent}
|
|
36
37
|
@luzmo-opened=${this.overlayOpenEvent}
|
|
37
38
|
></luzmo-swatch>
|
|
38
39
|
<luzmo-overlay
|
|
39
|
-
trigger=${this.disabled?"":"trigger@click"}
|
|
40
|
+
trigger=${this.disabled||this.readOnly?"":"trigger@click"}
|
|
40
41
|
.placement=${this.placement}
|
|
41
42
|
type="auto"
|
|
42
43
|
>
|
|
43
44
|
<luzmo-popover style="position:relative">
|
|
44
|
-
${this._renderMenu?this.renderColorMenu():
|
|
45
|
+
${this._renderMenu?this.renderColorMenu():n.html``}
|
|
45
46
|
</luzmo-popover>
|
|
46
47
|
</luzmo-overlay>
|
|
47
|
-
`}};
|
|
48
|
+
`}};p.styles=n.unsafeCSS(y);let e=p;r([t.property({type:String,reflect:!0})],e.prototype,"color");r([t.property({type:Boolean,reflect:!0})],e.prototype,"open");r([t.property({type:Boolean,reflect:!0})],e.prototype,"disabled");r([t.property({type:Boolean,reflect:!0,attribute:"read-only"})],e.prototype,"readOnly");r([t.property({type:String,reflect:!0})],e.prototype,"placement");r([t.property({type:String,reflect:!0})],e.prototype,"rounding");r([t.property({type:String,reflect:!0})],e.prototype,"shape");r([t.property({type:Array,reflect:!0})],e.prototype,"swatches");r([t.property({type:Boolean,reflect:!0,attribute:"no-alpha-channel"})],e.prototype,"noAlphaChannel");r([t.query("luzmo-color-menu")],e.prototype,"menuElement");r([t.query("luzmo-overlay")],e.prototype,"overlayElement");r([t.state()],e.prototype,"_renderMenu");customElements.get("luzmo-color-picker")||customElements.define("luzmo-color-picker",e);exports.LuzmoColorPicker=e;
|