@proximus/lavender-color-option 2.0.0-alpha.7 → 2.0.0-alpha.73
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/dist/ColorOption.d.ts +0 -1
- package/dist/index.es.js +26 -27
- package/package.json +2 -2
package/dist/ColorOption.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export declare class ColorOption extends PxElement<HTMLDivElement> {
|
|
|
4
4
|
static nativeName: string;
|
|
5
5
|
private template;
|
|
6
6
|
constructor();
|
|
7
|
-
connectedCallback(): void;
|
|
8
7
|
static get observedAttributes(): string[];
|
|
9
8
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
10
9
|
updateSize(attrName: string, oldValue: string, newValue: string, attrValues: string[]): void;
|
package/dist/index.es.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { PxElement as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { PxElement as a, checkName as p, log as b } from "@proximus/lavender-common";
|
|
2
|
+
const u = ':host{display:inline-block;line-height:0}:host *{box-sizing:border-box}.color-option{display:inline-block;width:32px;height:32px!important;border-radius:var(--px-radius-pill);background-color:var(--color-option-device-color);border:var(--px-size-border-m) var(--px-color-border-main-default) solid}.color-option[unavailable]{position:relative}.color-option[unavailable]:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-45deg);width:44px;height:var(--px-size-border-m);background-color:var(--px-color-border-neutral-default)}.color-option--size-small{width:16px;height:16px!important;border-width:var(--px-size-border-s)}.color-option--size-small[unavailable]:before{width:22px;height:var(--px-size-border-s)}', n = new CSSStyleSheet();
|
|
3
|
+
n.replaceSync(u);
|
|
4
|
+
const h = ["", "default", "small"], l = class l extends a {
|
|
5
5
|
template() {
|
|
6
6
|
return `
|
|
7
7
|
<slot></slot>
|
|
8
8
|
`;
|
|
9
9
|
}
|
|
10
10
|
constructor() {
|
|
11
|
-
super(
|
|
12
|
-
const e = document.createElement(
|
|
11
|
+
super(n);
|
|
12
|
+
const e = document.createElement("div");
|
|
13
13
|
e.classList.add("color-option"), e.innerHTML = this.template(), this.shadowRoot.appendChild(e);
|
|
14
14
|
}
|
|
15
|
-
connectedCallback() {
|
|
16
|
-
super.connectedCallback();
|
|
17
|
-
}
|
|
18
15
|
static get observedAttributes() {
|
|
19
16
|
return [...super.observedAttributes, "size", "device-color", "unavailable"];
|
|
20
17
|
}
|
|
@@ -22,7 +19,7 @@ const u = ["", "default", "small"], s = class s extends n {
|
|
|
22
19
|
if (o !== t)
|
|
23
20
|
switch (e) {
|
|
24
21
|
case "size":
|
|
25
|
-
this.updateSize(e, o, t,
|
|
22
|
+
this.updateSize(e, o, t, h);
|
|
26
23
|
break;
|
|
27
24
|
case "device-color":
|
|
28
25
|
this.updateDeviceColor(e, o, t);
|
|
@@ -37,7 +34,9 @@ const u = ["", "default", "small"], s = class s extends n {
|
|
|
37
34
|
}
|
|
38
35
|
updateSize(e, o, t, d) {
|
|
39
36
|
if (!p(d, t)) {
|
|
40
|
-
|
|
37
|
+
b(
|
|
38
|
+
`${t} is not an allowed ${e} value for ${this.tagName.toLowerCase()}`
|
|
39
|
+
);
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
42
|
o !== null && o !== "" && o !== "default" && this.$el.classList.toggle(`color-option--size-${o}`), t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`color-option--size-${t}`);
|
|
@@ -64,24 +63,24 @@ const u = ["", "default", "small"], s = class s extends n {
|
|
|
64
63
|
e ? this.setAttribute("unavailable", "") : this.removeAttribute("unavailable");
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
|
-
|
|
68
|
-
let
|
|
69
|
-
customElements.get("px-color-option") || customElements.define("px-color-option",
|
|
70
|
-
const
|
|
71
|
-
c.replaceSync(
|
|
72
|
-
const
|
|
66
|
+
l.nativeName = "div";
|
|
67
|
+
let r = l;
|
|
68
|
+
customElements.get("px-color-option") || customElements.define("px-color-option", r);
|
|
69
|
+
const v = ":host{display:inline-block;line-height:0}:host *{box-sizing:border-box}.color-option-link{display:inline-block;text-decoration:none;padding:var(--px-padding-2xs-mobile);border-radius:var(--px-radius-pill);--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition)}.color-option-link[selected]{box-shadow:inset 0 0 0 var(--px-size-border-m) var(--px-color-border-brand-default)}.color-option-link:hover{box-shadow:inset 0 0 0 var(--px-size-border-s) var(--px-color-border-neutral-default)}.color-option-link:focus-visible{outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}@media only screen and (min-width: 48em){.color-option-link{padding:var(--px-padding-2xs-tablet)}.color-option-link:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){.color-option-link{padding:var(--px-padding-2xs-laptop)}.color-option-link:focus-visible{outline-offset:var(--px-focus-offset-laptop);outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){.color-option-link{padding:var(--px-padding-2xs-desktop)}.color-option-link:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", c = new CSSStyleSheet();
|
|
70
|
+
c.replaceSync(v);
|
|
71
|
+
const f = "px.lavender.color-option-link.click", i = class i extends a {
|
|
73
72
|
template() {
|
|
74
73
|
return `
|
|
75
|
-
<px-color-option
|
|
74
|
+
<px-color-option><slot></slot></px-color-option>
|
|
76
75
|
`;
|
|
77
76
|
}
|
|
78
77
|
constructor() {
|
|
79
78
|
super(c);
|
|
80
|
-
const e = document.createElement(
|
|
79
|
+
const e = document.createElement(i.nativeName);
|
|
81
80
|
e.classList.add("color-option-link"), e.innerHTML = this.template(), this.shadowRoot.appendChild(e);
|
|
82
81
|
}
|
|
83
82
|
connectedCallback() {
|
|
84
|
-
|
|
83
|
+
this.addEventListener("click", (e) => {
|
|
85
84
|
e.preventDefault(), this.clickColorOptionLink();
|
|
86
85
|
});
|
|
87
86
|
}
|
|
@@ -112,7 +111,7 @@ const v = "px.lavender.color-option-link.click", l = class l extends n {
|
|
|
112
111
|
}
|
|
113
112
|
clickColorOptionLink() {
|
|
114
113
|
this.dispatchEvent(
|
|
115
|
-
new CustomEvent(
|
|
114
|
+
new CustomEvent(f, {
|
|
116
115
|
bubbles: !0,
|
|
117
116
|
composed: !0
|
|
118
117
|
})
|
|
@@ -140,11 +139,11 @@ const v = "px.lavender.color-option-link.click", l = class l extends n {
|
|
|
140
139
|
e ? this.setAttribute("selected", "") : this.removeAttribute("selected");
|
|
141
140
|
}
|
|
142
141
|
};
|
|
143
|
-
|
|
144
|
-
let
|
|
145
|
-
customElements.get("px-color-option-link") || customElements.define("px-color-option-link",
|
|
142
|
+
i.nativeName = "a";
|
|
143
|
+
let s = i;
|
|
144
|
+
customElements.get("px-color-option-link") || customElements.define("px-color-option-link", s);
|
|
146
145
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
r as ColorOption,
|
|
147
|
+
s as ColorOptionLink,
|
|
148
|
+
h as colorOptionSizeValues
|
|
150
149
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-color-option",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.73",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
|
|
15
15
|
"test": "vitest run --coverage",
|
|
16
|
-
"wc-manifest": "cem analyze --globs \"src/*\" --config
|
|
16
|
+
"wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|