@proximus/lavender-breadcrumb 1.0.0-alpha.1
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/index.js +96 -0
- package/package.json +46 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { PxElement as o } from "@proximus/lavender-common";
|
|
2
|
+
const b = `:host{display:block}:host *{box-sizing:border-box}.breadcrumb{font-family:var(--px-font-family);line-height:var(--px-line-height-s);font-size:var(--px-text-size-label-s-mobile);font-weight:400;color:var(--px-text-color-body-neutral-strong-default);display:flex;flex-wrap:wrap;align-items:center;list-style:none;margin:calc(var(--px-spacing-after-element-s-mobile) * -1) 0 0 0;padding:0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-after-element-s-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){display:flex;align-items:center;margin-right:var(--px-spacing-inside-section-xs-mobile)}.breadcrumb ::slotted(px-breadcrumb-item):after{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.90255 3.61987C5.6515 3.8749 5.6515 4.2884 5.90255 4.54343L9.30512 8.00002L5.90255 11.4566C5.6515 11.7116 5.6515 12.1251 5.90255 12.3802C6.1536 12.6352 6.56063 12.6352 6.81169 12.3802L10.6688 8.4618C10.9199 8.20677 10.9199 7.79327 10.6688 7.53823L6.81169 3.61987C6.56063 3.36483 6.1536 3.36483 5.90255 3.61987Z' fill='%23252525'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.90255 3.61987C5.6515 3.8749 5.6515 4.2884 5.90255 4.54343L9.30512 8.00002L5.90255 11.4566C5.6515 11.7116 5.6515 12.1251 5.90255 12.3802C6.1536 12.6352 6.56063 12.6352 6.81169 12.3802L10.6688 8.4618C10.9199 8.20677 10.9199 7.79327 10.6688 7.53823L6.81169 3.61987C6.56063 3.36483 6.1536 3.36483 5.90255 3.61987Z' fill='%23252525'/%3E%3C/svg%3E");background-color:currentColor;color:var(--px-icon-color-content-neutral-strong-default);margin-left:var(--px-spacing-inside-section-xs-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:last-child):after{content:none}@media only screen and (min-width: 768px){.breadcrumb{font-size:var(--px-text-size-label-s-tablet);margin:calc(var(--px-spacing-after-element-s-tablet) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-after-element-s-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-inside-section-xs-tablet)}.breadcrumb ::slotted(px-breadcrumb-item):after{margin-left:var(--px-spacing-inside-section-xs-tablet)}}@media only screen and (min-width: 1025px){.breadcrumb{font-size:var(--px-text-size-label-s-desktop);margin:calc(var(--px-spacing-after-element-s-desktop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-after-element-s-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-inside-section-xs-desktop)}.breadcrumb ::slotted(px-breadcrumb-item):after{margin-left:var(--px-spacing-inside-section-xs-desktop)}}:host([inverted]) .breadcrumb{color:var(--px-text-color-body-neutral-strong-inverted)}:host([inverted]) .breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{color:var(--px-icon-color-content-neutral-strong-inverted)}`, d = new CSSStyleSheet();
|
|
3
|
+
d.replaceSync(b);
|
|
4
|
+
const n = class n extends o {
|
|
5
|
+
template() {
|
|
6
|
+
return `
|
|
7
|
+
<nav class="breadcrumb" aria-label="${this.ariaLabel || "Breadcrumb"}" role="list">
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</nav
|
|
10
|
+
`;
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
super(d), this.shadowRoot.innerHTML = this.template();
|
|
14
|
+
}
|
|
15
|
+
static get observedAttributes() {
|
|
16
|
+
return [...super.observedAttributes, "inverted", "aria-label"];
|
|
17
|
+
}
|
|
18
|
+
attributeChangedCallback(e, i, r) {
|
|
19
|
+
if (i !== r)
|
|
20
|
+
switch (e) {
|
|
21
|
+
case "aria-label":
|
|
22
|
+
this.$el.setAttribute("aria-label", this.ariaLabel);
|
|
23
|
+
break;
|
|
24
|
+
case "inverted":
|
|
25
|
+
for (let t = 0; t < this.$children.length; t++)
|
|
26
|
+
this.$children[t].hasAttribute("inverted") || this.$children[t].toggleAttribute("inverted");
|
|
27
|
+
break;
|
|
28
|
+
default:
|
|
29
|
+
super.attributeChangedCallback(e, i, r);
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
get $children() {
|
|
34
|
+
return this.querySelectorAll("px-breadcrumb > *");
|
|
35
|
+
}
|
|
36
|
+
get inverted() {
|
|
37
|
+
return this.hasAttribute("inverted");
|
|
38
|
+
}
|
|
39
|
+
set inverted(e) {
|
|
40
|
+
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
41
|
+
}
|
|
42
|
+
get ariaLabel() {
|
|
43
|
+
return this.getAttribute("aria-label");
|
|
44
|
+
}
|
|
45
|
+
set ariaLabel(e) {
|
|
46
|
+
e ? this.setAttribute("aria-label", e) : this.removeAttribute("aria-label");
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
n.nativeName = "nav";
|
|
50
|
+
let a = n;
|
|
51
|
+
customElements.define("px-breadcrumb", a);
|
|
52
|
+
const l = class l extends o {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(), this.template = () => '<div role="listitem"><slot></slot></div>', this.shadowRoot && (this.shadowRoot.innerHTML = this.template());
|
|
55
|
+
}
|
|
56
|
+
static get observedAttributes() {
|
|
57
|
+
return [...super.observedAttributes, "inverted"];
|
|
58
|
+
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
super.connectedCallback(), this.$icon && this.$icon.setAttribute("size", "s"), this.$link && this.$link.setAttribute("font-size", "body-s"), this.$link || this.$el.setAttribute("aria-current", "page");
|
|
61
|
+
}
|
|
62
|
+
attributeChangedCallback(e, i, r) {
|
|
63
|
+
if (i !== r)
|
|
64
|
+
switch (e) {
|
|
65
|
+
case "inverted":
|
|
66
|
+
for (let t = 0; t < this.$children.length; t++)
|
|
67
|
+
this.$children[t].hasAttribute("inverted") || this.$children[t].toggleAttribute("inverted");
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
super.attributeChangedCallback(e, i, r);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
get $link() {
|
|
75
|
+
return this.querySelector("px-a");
|
|
76
|
+
}
|
|
77
|
+
get $icon() {
|
|
78
|
+
return this.querySelector("px-icon");
|
|
79
|
+
}
|
|
80
|
+
get $children() {
|
|
81
|
+
return this.querySelectorAll("px-breadcrumb-item > *");
|
|
82
|
+
}
|
|
83
|
+
get inverted() {
|
|
84
|
+
return this.hasAttribute("inverted");
|
|
85
|
+
}
|
|
86
|
+
set inverted(e) {
|
|
87
|
+
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
l.nativeName = "div";
|
|
91
|
+
let s = l;
|
|
92
|
+
customElements.define("px-breadcrumb-item", s);
|
|
93
|
+
export {
|
|
94
|
+
a as Breadcrumb,
|
|
95
|
+
s as BreadcrumbItem
|
|
96
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-breadcrumb",
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"development": "./src/index.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./src/*.css": {
|
|
13
|
+
"development": "src/*.css"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc; vite build",
|
|
22
|
+
"test": "vitest run --coverage"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"lerna": {
|
|
28
|
+
"command": {
|
|
29
|
+
"publish": {
|
|
30
|
+
"assets": [
|
|
31
|
+
"CHANGELOG.md",
|
|
32
|
+
"package.json",
|
|
33
|
+
"dist/*.js",
|
|
34
|
+
"dist/*.cjs",
|
|
35
|
+
"dist/css/**/*.css",
|
|
36
|
+
"dist/js/**/*.js",
|
|
37
|
+
"dist/*.svg",
|
|
38
|
+
"dist/*.ttf",
|
|
39
|
+
"dist/glyphmap.json",
|
|
40
|
+
"dist/*.d.ts"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "9ec13b55f232d1814ad7d493303ea35d20641d02"
|
|
46
|
+
}
|