@proximus/lavender-tag 2.0.0-alpha.15 → 2.0.0-alpha.151
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/Tag.d.ts +7 -4
- package/dist/index.es.js +26 -19
- package/package.json +2 -2
package/dist/Tag.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PxElement } from '@proximus/lavender-common';
|
|
2
2
|
import { type ButtonIcon } from '@proximus/lavender-button-icon';
|
|
3
3
|
import '@proximus/lavender-button-icon';
|
|
4
|
+
export declare const tagSizeValues: string[];
|
|
4
5
|
export declare class Tag extends PxElement<HTMLDivElement> {
|
|
5
6
|
static nativeName: string;
|
|
6
7
|
private template;
|
|
@@ -10,8 +11,10 @@ export declare class Tag extends PxElement<HTMLDivElement> {
|
|
|
10
11
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
11
12
|
get $iconSlot(): HTMLSlotElement;
|
|
12
13
|
get $btnIcon(): ButtonIcon;
|
|
13
|
-
get
|
|
14
|
-
set
|
|
15
|
-
get
|
|
16
|
-
set
|
|
14
|
+
get size(): string;
|
|
15
|
+
set size(value: string);
|
|
16
|
+
get dismissible(): boolean;
|
|
17
|
+
set dismissible(value: boolean);
|
|
18
|
+
get inverted(): boolean;
|
|
19
|
+
set inverted(value: boolean);
|
|
17
20
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { PxElement as
|
|
1
|
+
import { PxElement as d } from "@proximus/lavender-common";
|
|
2
2
|
import "@proximus/lavender-button-icon";
|
|
3
|
-
const n =
|
|
3
|
+
const n = ':host:has(.tag){display:inline-block}.tag{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;font-family:var(--px-font-family);font-size:var(--px-text-size-label-m-mobile);line-height:var(--px-line-height-ratio-l);font-weight:var(--px-font-weight-body);gap:var(--px-spacing-xs-mobile);background-color:var(--px-color-background-container-default-default);color:var(--px-color-text-neutral-default);padding:var(--px-padding-2xs-mobile) var(--px-padding-xs-mobile);border:var(--px-size-border-s) solid transparent;border-radius:var(--px-radius-main)}.tag,.tag *{box-sizing:border-box}:host([disabled]) .tag{background-color:var(--px-color-background-state-disabled-default);color:var(--px-color-text-state-disabled-default)}:host([size="s"]) .tag{padding:var(--px-padding-2xs-mobile) var(--px-padding-xs-mobile)}:host([size="m"]) .tag{padding:var(--px-padding-xs-mobile) var(--px-padding-s-mobile)}:host([inverted]) .tag{background-color:var(--px-color-background-container-default-inverted);color:var(--px-color-text-neutral-inverted)}:host([inverted]):host([disabled]) .tag{background-color:var(--px-color-background-state-disabled-inverted);color:var(--px-color-text-state-disabled-inverted)}@media screen and (min-width: 48rem){.tag{font-size:var(--px-text-size-label-m-tablet);gap:var(--px-spacing-xs-tablet);padding:var(--px-padding-2xs-tablet) var(--px-padding-xs-tablet)}:host([size="s"]) .tag{padding:var(--px-padding-2xs-tablet) var(--px-padding-xs-tablet)}:host([size="m"]) .tag{padding:var(--px-padding-xs-tablet) var(--px-padding-s-tablet)}}@media screen and (min-width: 64.0625rem){.tag{font-size:var(--px-text-size-label-m-laptop);gap:var(--px-spacing-xs-laptop);padding:var(--px-padding-2xs-laptop) var(--px-padding-xs-laptop)}:host([size="s"]) .tag{padding:var(--px-padding-2xs-laptop) var(--px-padding-xs-laptop)}:host([size="m"]) .tag{padding:var(--px-padding-xs-laptop) var(--px-padding-s-laptop)}}@media screen and (min-width: 90.0625rem){.tag{font-size:var(--px-text-size-label-m-desktop);gap:var(--px-spacing-xs-desktop);padding:var(--px-padding-2xs-desktop) var(--px-padding-xs-desktop)}:host([size="s"]) .tag{padding:var(--px-padding-2xs-desktop) var(--px-padding-xs-desktop)}:host([size="m"]) .tag{padding:var(--px-padding-xs-desktop) var(--px-padding-s-desktop)}}', e = new CSSStyleSheet();
|
|
4
4
|
e.replaceSync(n);
|
|
5
|
-
const s = class
|
|
5
|
+
const l = ["", "s", "m"], a = class a extends d {
|
|
6
6
|
template() {
|
|
7
7
|
return `
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
<div class="tag">
|
|
9
|
+
<slot name="before"></slot>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
<slot name="after"></slot>
|
|
12
|
+
</div>
|
|
13
13
|
`;
|
|
14
14
|
}
|
|
15
15
|
constructor() {
|
|
@@ -19,16 +19,16 @@ const s = class s extends o {
|
|
|
19
19
|
this.$iconSlot && (this.$iconSlot.setAttribute("size", "xs"), this.$iconSlot.setAttribute("color", "inherit")), this.$btnIcon && (this.$btnIcon.getAttribute("variant") !== "secondary" && this.$btnIcon.setAttribute("variant", "secondary"), this.$btnIcon.getAttribute("size") !== "small" && this.$btnIcon.setAttribute("size", "small"));
|
|
20
20
|
}
|
|
21
21
|
static get observedAttributes() {
|
|
22
|
-
return ["dismissible", "inverted", "disabled"];
|
|
22
|
+
return ["dismissible", "inverted", "disabled", "size"];
|
|
23
23
|
}
|
|
24
|
-
attributeChangedCallback(t,
|
|
25
|
-
if (
|
|
24
|
+
attributeChangedCallback(t, s, r) {
|
|
25
|
+
if (s !== r)
|
|
26
26
|
switch (t) {
|
|
27
27
|
case "inverted":
|
|
28
28
|
this.hasAttribute("dismissible") && this.$btnIcon.toggleAttribute("inverted");
|
|
29
29
|
break;
|
|
30
30
|
default:
|
|
31
|
-
super.attributeChangedCallback(t,
|
|
31
|
+
super.attributeChangedCallback(t, s, r);
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -38,22 +38,29 @@ const s = class s extends o {
|
|
|
38
38
|
get $btnIcon() {
|
|
39
39
|
return this.querySelector("px-button-icon");
|
|
40
40
|
}
|
|
41
|
+
get size() {
|
|
42
|
+
return this.getAttribute("size") || "";
|
|
43
|
+
}
|
|
44
|
+
set size(t) {
|
|
45
|
+
this.setAttribute("size", t);
|
|
46
|
+
}
|
|
41
47
|
get dismissible() {
|
|
42
|
-
return this.
|
|
48
|
+
return this.hasAttribute("dismissible");
|
|
43
49
|
}
|
|
44
50
|
set dismissible(t) {
|
|
45
|
-
this.setAttribute("dismissible",
|
|
51
|
+
t ? this.setAttribute("dismissible", "") : this.removeAttribute("dismissible");
|
|
46
52
|
}
|
|
47
53
|
get inverted() {
|
|
48
|
-
return this.
|
|
54
|
+
return this.hasAttribute("inverted");
|
|
49
55
|
}
|
|
50
56
|
set inverted(t) {
|
|
51
|
-
this.setAttribute("inverted",
|
|
57
|
+
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
52
58
|
}
|
|
53
59
|
};
|
|
54
|
-
|
|
55
|
-
let i =
|
|
60
|
+
a.nativeName = "div";
|
|
61
|
+
let i = a;
|
|
56
62
|
customElements.get("px-tag") || customElements.define("px-tag", i);
|
|
57
63
|
export {
|
|
58
|
-
i as Tag
|
|
64
|
+
i as Tag,
|
|
65
|
+
l as tagSizeValues
|
|
59
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-tag",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.151",
|
|
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"
|