@proximus/lavender-breadcrumb 2.0.0-alpha.22 → 2.0.0-alpha.221

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.
@@ -1,8 +1,9 @@
1
1
  import { PxElement } from '@proximus/lavender-common';
2
2
  import type { Icon } from '@proximus/lavender-icon';
3
+ export declare const BREADCRUMB_ITEM_CONNECTED_EVENT = "px-breadcrumb-item-connected";
3
4
  export declare class BreadcrumbItem extends PxElement<HTMLElement> {
5
+ protected static readonly template: HTMLTemplateElement;
4
6
  static nativeName: string;
5
- private template;
6
7
  constructor();
7
8
  static get observedAttributes(): string[];
8
9
  connectedCallback(): void;
@@ -1,6 +1,7 @@
1
1
  import { WithExtraAttributes } from '@proximus/lavender-common';
2
2
  export declare class Breadcrumb extends WithExtraAttributes {
3
- private template;
3
+ #private;
4
+ protected static readonly template: HTMLTemplateElement;
4
5
  constructor();
5
6
  connectedCallback(): void;
6
7
  static get observedAttributes(): string[];
@@ -9,6 +10,6 @@ export declare class Breadcrumb extends WithExtraAttributes {
9
10
  get $children(): NodeListOf<Element>;
10
11
  get inverted(): boolean;
11
12
  set inverted(value: boolean);
12
- get ariaLabel(): string;
13
- set ariaLabel(value: string);
13
+ get ariaLabel(): string | null;
14
+ set ariaLabel(value: string | null);
14
15
  }
@@ -0,0 +1,220 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/Breadcrumb-item.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "variable",
11
+ "name": "BREADCRUMB_ITEM_CONNECTED_EVENT",
12
+ "type": {
13
+ "text": "string"
14
+ },
15
+ "default": "'px-breadcrumb-item-connected'"
16
+ },
17
+ {
18
+ "kind": "class",
19
+ "description": "",
20
+ "name": "BreadcrumbItem",
21
+ "members": [
22
+ {
23
+ "kind": "field",
24
+ "name": "template",
25
+ "privacy": "protected",
26
+ "static": true,
27
+ "readonly": true
28
+ },
29
+ {
30
+ "kind": "field",
31
+ "name": "nativeName",
32
+ "type": {
33
+ "text": "string"
34
+ },
35
+ "static": true,
36
+ "default": "'div'"
37
+ },
38
+ {
39
+ "kind": "field",
40
+ "name": "$link",
41
+ "readonly": true
42
+ },
43
+ {
44
+ "kind": "field",
45
+ "name": "$icon",
46
+ "readonly": true
47
+ },
48
+ {
49
+ "kind": "field",
50
+ "name": "$children",
51
+ "readonly": true
52
+ },
53
+ {
54
+ "kind": "field",
55
+ "name": "inverted",
56
+ "type": {
57
+ "text": "boolean"
58
+ }
59
+ }
60
+ ],
61
+ "events": [
62
+ {
63
+ "name": "BREADCRUMB_ITEM_CONNECTED_EVENT",
64
+ "type": {
65
+ "text": "CustomEvent"
66
+ }
67
+ }
68
+ ],
69
+ "attributes": [
70
+ {
71
+ "name": "inverted"
72
+ }
73
+ ],
74
+ "superclass": {
75
+ "name": "PxElement",
76
+ "package": "@proximus/lavender-common"
77
+ },
78
+ "tagName": "px-breadcrumb-item",
79
+ "customElement": true
80
+ }
81
+ ],
82
+ "exports": [
83
+ {
84
+ "kind": "js",
85
+ "name": "BREADCRUMB_ITEM_CONNECTED_EVENT",
86
+ "declaration": {
87
+ "name": "BREADCRUMB_ITEM_CONNECTED_EVENT",
88
+ "module": "src/Breadcrumb-item.ts"
89
+ }
90
+ },
91
+ {
92
+ "kind": "js",
93
+ "name": "BreadcrumbItem",
94
+ "declaration": {
95
+ "name": "BreadcrumbItem",
96
+ "module": "src/Breadcrumb-item.ts"
97
+ }
98
+ },
99
+ {
100
+ "kind": "custom-element-definition",
101
+ "name": "px-breadcrumb-item",
102
+ "declaration": {
103
+ "name": "BreadcrumbItem",
104
+ "module": "src/Breadcrumb-item.ts"
105
+ }
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "kind": "javascript-module",
111
+ "path": "src/Breadcrumb.ts",
112
+ "declarations": [
113
+ {
114
+ "kind": "class",
115
+ "description": "",
116
+ "name": "Breadcrumb",
117
+ "members": [
118
+ {
119
+ "kind": "field",
120
+ "name": "template",
121
+ "privacy": "protected",
122
+ "static": true,
123
+ "readonly": true
124
+ },
125
+ {
126
+ "kind": "method",
127
+ "name": "#applyInverted",
128
+ "privacy": "private"
129
+ },
130
+ {
131
+ "kind": "field",
132
+ "name": "$el",
133
+ "readonly": true
134
+ },
135
+ {
136
+ "kind": "field",
137
+ "name": "$children",
138
+ "readonly": true
139
+ },
140
+ {
141
+ "kind": "field",
142
+ "name": "inverted"
143
+ },
144
+ {
145
+ "kind": "field",
146
+ "name": "ariaLabel"
147
+ }
148
+ ],
149
+ "attributes": [
150
+ {
151
+ "name": "inverted"
152
+ },
153
+ {
154
+ "name": "aria-label"
155
+ }
156
+ ],
157
+ "superclass": {
158
+ "name": "WithExtraAttributes",
159
+ "package": "@proximus/lavender-common"
160
+ },
161
+ "tagName": "px-breadcrumb",
162
+ "customElement": true
163
+ }
164
+ ],
165
+ "exports": [
166
+ {
167
+ "kind": "js",
168
+ "name": "Breadcrumb",
169
+ "declaration": {
170
+ "name": "Breadcrumb",
171
+ "module": "src/Breadcrumb.ts"
172
+ }
173
+ },
174
+ {
175
+ "kind": "custom-element-definition",
176
+ "name": "px-breadcrumb",
177
+ "declaration": {
178
+ "name": "Breadcrumb",
179
+ "module": "src/Breadcrumb.ts"
180
+ }
181
+ }
182
+ ]
183
+ },
184
+ {
185
+ "kind": "javascript-module",
186
+ "path": "src/breadcrumb-item.css",
187
+ "declarations": [],
188
+ "exports": []
189
+ },
190
+ {
191
+ "kind": "javascript-module",
192
+ "path": "src/breadcrumb.css",
193
+ "declarations": [],
194
+ "exports": []
195
+ },
196
+ {
197
+ "kind": "javascript-module",
198
+ "path": "src/index.ts",
199
+ "declarations": [],
200
+ "exports": [
201
+ {
202
+ "kind": "js",
203
+ "name": "*",
204
+ "declaration": {
205
+ "name": "*",
206
+ "module": "src/Breadcrumb"
207
+ }
208
+ },
209
+ {
210
+ "kind": "js",
211
+ "name": "*",
212
+ "declaration": {
213
+ "name": "*",
214
+ "module": "src/Breadcrumb-item"
215
+ }
216
+ }
217
+ ]
218
+ }
219
+ ]
220
+ }
package/dist/index.es.js CHANGED
@@ -1,104 +1,108 @@
1
- import { WithExtraAttributes as o, PxElement as c } from "@proximus/lavender-common";
2
- const d = `:host{display:block}:host *{box-sizing:border-box}.breadcrumb{font-family:var(--px-font-family);color:var(--px-color-text-neutral-default);margin:calc(var(--px-spacing-s-mobile) * -1) 0 0 0;padding:0}.breadcrumb div[role=list]{display:flex;flex-wrap:wrap;align-items:center}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){display:flex;align-items:center;margin-right:var(--px-spacing-xs-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{display:inline-block;content:"";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-color-icon-neutral-default);margin-left:var(--px-spacing-xs-mobile)}@media only screen and (min-width: 48em){.breadcrumb{margin:calc(var(--px-spacing-s-tablet) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-tablet)}}@media only screen and (min-width: 64.0625em){.breadcrumb{margin:calc(var(--px-spacing-s-laptop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-laptop)}}@media only screen and (min-width: 90.0625em){.breadcrumb{margin:calc(var(--px-spacing-s-desktop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-desktop)}}:host([inverted]) .breadcrumb{color:var(--px-color-text-neutral-inverted)}:host([inverted]) .breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{color:var(--px-color-icon-neutral-inverted)}`, n = new CSSStyleSheet();
3
- n.replaceSync(d);
4
- class b extends o {
5
- template() {
6
- return `
7
- <nav class="breadcrumb">
8
- <div role="list">
9
- <slot></slot>
10
- </div>
11
- </nav>
12
- `;
13
- }
14
- constructor() {
15
- super(n), this.shadowRoot.innerHTML = this.template();
16
- }
17
- connectedCallback() {
18
- this.ariaLabel || (this.ariaLabel = "Breadcrumb");
19
- }
20
- static get observedAttributes() {
21
- return [...super.observedAttributes, "inverted", "aria-label"];
22
- }
23
- attributeChangedCallback(e, r, i) {
24
- if (r !== i)
25
- switch (e) {
26
- case "aria-label":
27
- this.$el.setAttribute("aria-label", this.ariaLabel);
28
- break;
29
- case "inverted":
30
- for (let t = 0; t < this.$children.length; t++)
31
- this.$children[t].hasAttribute("inverted") || this.$children[t].toggleAttribute("inverted");
32
- break;
33
- default:
34
- super.attributeChangedCallback(e, r, i);
35
- break;
36
- }
37
- }
38
- get $el() {
39
- return this.shadowRoot.querySelector(".breadcrumb");
40
- }
41
- get $children() {
42
- return this.querySelectorAll("px-breadcrumb > *");
43
- }
44
- get inverted() {
45
- return this.hasAttribute("inverted");
46
- }
47
- set inverted(e) {
48
- e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
49
- }
50
- get ariaLabel() {
51
- return this.getAttribute("aria-label");
52
- }
53
- set ariaLabel(e) {
54
- e ? this.setAttribute("aria-label", e) : this.removeAttribute("aria-label");
55
- }
56
- }
57
- customElements.get("px-breadcrumb") || customElements.define("px-breadcrumb", b);
58
- const m = ":host{display:block}:host *{box-sizing:border-box}.breadcrumb-item{display:flex}:host:has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item{color:var(--px-color-icon-accent-default)}:host:has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item:hover{color:var(--px-color-text-state-hover-default)}:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{line-height:var(--px-font-line-height-s);font-size:var(--px-text-size-link-s-mobile)}@media only screen and (min-width: 48em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-tablet)}}@media only screen and (min-width: 64.0625em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-laptop)}}@media only screen and (min-width: 90.0625em){:host:not(:has(px-a[variant=icon-link][color=inherit])) .breadcrumb-item{font-size:var(--px-text-size-link-s-desktop)}}:host([inverted]):has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item{color:var(--px-color-icon-accent-inverted)}:host([inverted]):has(px-a[variant=icon-link][color=inherit]) .breadcrumb-item:hover{color:var(--px-color-text-state-hover-inverted)}", l = new CSSStyleSheet();
59
- l.replaceSync(m);
60
- const s = class s extends c {
61
- constructor() {
62
- super(l), this.template = () => '<div class="breadcrumb-item" role="listitem"><slot></slot></div>', this.shadowRoot && (this.shadowRoot.innerHTML = this.template());
63
- }
64
- static get observedAttributes() {
65
- return [...super.observedAttributes, "inverted"];
66
- }
67
- connectedCallback() {
68
- this.$icon && this.$icon.setAttribute("size", "s"), this.$link || this.$el.setAttribute("aria-current", "page");
69
- }
70
- attributeChangedCallback(e, r, i) {
71
- if (r !== i)
72
- switch (e) {
73
- case "inverted":
74
- for (let t = 0; t < this.$children.length; t++)
75
- this.$children[t].hasAttribute("inverted") || this.$children[t].toggleAttribute("inverted");
76
- break;
77
- default:
78
- super.attributeChangedCallback(e, r, i);
79
- break;
80
- }
81
- }
82
- get $link() {
83
- return this.querySelector("px-a");
84
- }
85
- get $icon() {
86
- return this.querySelector("px-icon");
87
- }
88
- get $children() {
89
- return this.querySelectorAll("px-breadcrumb-item > *");
90
- }
91
- get inverted() {
92
- return this.hasAttribute("inverted");
93
- }
94
- set inverted(e) {
95
- e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
96
- }
1
+ import { PxElement as e, WithExtraAttributes as t, booleanPropertyToAttributeSetter as n, createTemplate as r, propertyToAttributeSetter as i, renderTemplate as a } from "@proximus/lavender-common";
2
+ //#region src/breadcrumb.css?inline
3
+ var o = ":host{display:block}:host *{box-sizing:border-box}.breadcrumb{font-family:var(--px-font-family);color:var(--px-color-text-neutral-default);margin:calc(var(--px-spacing-s-mobile) * -1) 0 0 0;padding:0}.breadcrumb div[role=list]{flex-wrap:wrap;align-items:center;display:flex}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-mobile)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-mobile);align-items:center;display:flex}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{content:\"\";width:16px;height:16px;color:var(--px-color-icon-neutral-default);margin-left:var(--px-spacing-xs-mobile);background-color:currentColor;display:inline-block;-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\");-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}@media screen and (width>=48rem){.breadcrumb{margin:calc(var(--px-spacing-s-tablet) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-tablet)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-tablet)}}@media screen and (width>=64.0625rem){.breadcrumb{margin:calc(var(--px-spacing-s-laptop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-laptop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-laptop)}}@media screen and (width>=90.0625rem){.breadcrumb{margin:calc(var(--px-spacing-s-desktop) * -1) 0 0 0}.breadcrumb ::slotted(px-breadcrumb-item){margin-top:var(--px-spacing-s-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)){margin-right:var(--px-spacing-xs-desktop)}.breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{margin-left:var(--px-spacing-xs-desktop)}}:host([inverted]) .breadcrumb{color:var(--px-color-text-neutral-inverted)}:host([inverted]) .breadcrumb ::slotted(px-breadcrumb-item:not(:last-child)):after{color:var(--px-color-icon-neutral-inverted)}", s = ":host{display:block}:host *{box-sizing:border-box}.breadcrumb-item{line-height:var(--px-line-height-ratio-l);font-size:var(--px-text-size-label-m-mobile);display:flex}:host ::slotted(px-a[variant=icon-link][color=inherit]){color:var(--px-color-icon-accent-default)}:host ::slotted(px-a[variant=icon-link][color=inherit]):hover{color:var(--px-color-icon-accent-default)}@media screen and (width>=48rem){.breadcrumb-item{font-size:var(--px-text-size-label-m-tablet)}}@media screen and (width>=64.0625rem){.breadcrumb-item{font-size:var(--px-text-size-label-m-laptop)}}@media screen and (width>=90.0625rem){.breadcrumb-item{font-size:var(--px-text-size-label-m-desktop)}}:host([inverted]) ::slotted(px-a[variant=icon-link][color=inherit]){color:var(--px-color-icon-accent-inverted)}:host([inverted]) ::slotted(px-a[variant=icon-link][color=inherit]):hover{color:var(--px-color-icon-accent-inverted)}", c = new CSSStyleSheet();
4
+ c.replaceSync(s);
5
+ var l = "px-breadcrumb-item-connected", u = class t extends e {
6
+ static {
7
+ this.template = r("<div class=\"breadcrumb-item\" role=\"listitem\"><slot></slot></div>");
8
+ }
9
+ static {
10
+ this.nativeName = "div";
11
+ }
12
+ constructor() {
13
+ super(c), this.shadowRoot && a(this.shadowRoot, t.template);
14
+ }
15
+ static get observedAttributes() {
16
+ return [...super.observedAttributes, "inverted"];
17
+ }
18
+ connectedCallback() {
19
+ this.$icon && this.$icon.setAttribute("size", "s"), this.$link || this.$el.setAttribute("aria-current", "page"), this.dispatchEvent(new CustomEvent(l, {
20
+ bubbles: !0,
21
+ composed: !0
22
+ }));
23
+ }
24
+ attributeChangedCallback(e, t, n) {
25
+ if (t !== n) switch (e) {
26
+ case "inverted":
27
+ for (let e = 0; e < this.$children.length; e++) this.$children[e].hasAttribute("inverted") || this.$children[e].toggleAttribute("inverted");
28
+ break;
29
+ default: super.attributeChangedCallback(e, t, n);
30
+ }
31
+ }
32
+ get $link() {
33
+ return this.querySelector("px-a");
34
+ }
35
+ get $icon() {
36
+ return this.querySelector("px-icon");
37
+ }
38
+ get $children() {
39
+ return this.querySelectorAll("px-breadcrumb-item > *");
40
+ }
41
+ get inverted() {
42
+ return this.hasAttribute("inverted");
43
+ }
44
+ set inverted(e) {
45
+ e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
46
+ }
97
47
  };
98
- s.nativeName = "div";
99
- let a = s;
100
- customElements.get("px-breadcrumb-item") || customElements.define("px-breadcrumb-item", a);
101
- export {
102
- b as Breadcrumb,
103
- a as BreadcrumbItem
48
+ customElements.get("px-breadcrumb-item") || customElements.define("px-breadcrumb-item", u);
49
+ //#endregion
50
+ //#region src/Breadcrumb.ts
51
+ var d = new CSSStyleSheet();
52
+ d.replaceSync(o);
53
+ var f = class e extends t {
54
+ static {
55
+ this.template = r("<nav class=\"breadcrumb\"><div role=\"list\"><slot></slot></div></nav>");
56
+ }
57
+ constructor() {
58
+ super(d), a(this.shadowRoot, e.template);
59
+ }
60
+ connectedCallback() {
61
+ this.ariaLabel ||= "Breadcrumb", this.addEventListener(l, () => {
62
+ this.#e();
63
+ }), this.#e();
64
+ }
65
+ #e() {
66
+ let e = this.hasAttribute("inverted");
67
+ for (let t = 0; t < this.$children.length; t++) this.$children[t].toggleAttribute("inverted", e);
68
+ }
69
+ static get observedAttributes() {
70
+ return [
71
+ ...super.observedAttributes,
72
+ "inverted",
73
+ "aria-label"
74
+ ];
75
+ }
76
+ attributeChangedCallback(e, t, n) {
77
+ if (t !== n) switch (e) {
78
+ case "aria-label":
79
+ i(this.$el, "aria-label", this.ariaLabel);
80
+ break;
81
+ case "inverted":
82
+ this.isConnected && this.#e();
83
+ break;
84
+ default: super.attributeChangedCallback(e, t, n);
85
+ }
86
+ }
87
+ get $el() {
88
+ return this.shadowRoot.querySelector(".breadcrumb");
89
+ }
90
+ get $children() {
91
+ return this.querySelectorAll("px-breadcrumb > *");
92
+ }
93
+ get inverted() {
94
+ return this.hasAttribute("inverted");
95
+ }
96
+ set inverted(e) {
97
+ n(this, "inverted", e);
98
+ }
99
+ get ariaLabel() {
100
+ return this.getAttribute("aria-label");
101
+ }
102
+ set ariaLabel(e) {
103
+ i(this, "aria-label", e);
104
+ }
104
105
  };
106
+ customElements.get("px-breadcrumb") || customElements.define("px-breadcrumb", f);
107
+ //#endregion
108
+ export { l as BREADCRUMB_ITEM_CONNECTED_EVENT, f as Breadcrumb, u as BreadcrumbItem };
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
3
+ "version": 1.1,
4
+ "properties": [],
5
+ "pseudoElements": []
6
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
3
+ "version": 1.1,
4
+ "tags": [
5
+ {
6
+ "name": "px-breadcrumb-item",
7
+ "description": "\n---\n\n\n### **Events:**\n - **BREADCRUMB_ITEM_CONNECTED_EVENT**",
8
+ "attributes": [{ "name": "inverted", "values": [] }],
9
+ "references": []
10
+ },
11
+ {
12
+ "name": "px-breadcrumb",
13
+ "description": "\n---\n",
14
+ "attributes": [
15
+ { "name": "inverted", "values": [] },
16
+ { "name": "aria-label", "values": [] }
17
+ ],
18
+ "references": []
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
+ "name": "@proximus/lavender-breadcrumb",
4
+ "version": "2.0.0-alpha.221",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "px-breadcrumb-item",
11
+ "description": "\n\n---\n\n\n### **Events:**\n - **BREADCRUMB_ITEM_CONNECTED_EVENT**",
12
+ "doc-url": "",
13
+ "attributes": [{ "name": "inverted", "value": { "type": "string" } }],
14
+ "events": [
15
+ { "name": "BREADCRUMB_ITEM_CONNECTED_EVENT", "type": "CustomEvent" }
16
+ ],
17
+ "js": {
18
+ "properties": [
19
+ { "name": "$link" },
20
+ { "name": "$icon" },
21
+ { "name": "$children" },
22
+ { "name": "inverted", "type": "boolean" }
23
+ ],
24
+ "events": [
25
+ {
26
+ "name": "BREADCRUMB_ITEM_CONNECTED_EVENT",
27
+ "type": "CustomEvent"
28
+ }
29
+ ]
30
+ }
31
+ },
32
+ {
33
+ "name": "px-breadcrumb",
34
+ "description": "\n\n---\n",
35
+ "doc-url": "",
36
+ "attributes": [
37
+ { "name": "inverted", "value": { "type": "string" } },
38
+ { "name": "aria-label", "value": { "type": "string" } }
39
+ ],
40
+ "events": [],
41
+ "js": {
42
+ "properties": [
43
+ { "name": "$el" },
44
+ { "name": "$children" },
45
+ { "name": "inverted" },
46
+ { "name": "ariaLabel" }
47
+ ],
48
+ "events": []
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ "css": {
54
+ "properties": [],
55
+ "pseudo-elements": []
56
+ }
57
+ }
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-breadcrumb",
3
- "version": "2.0.0-alpha.22",
3
+ "version": "2.0.0-alpha.221",
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 ../custom-elements-manifest.config.js --outdir dist"
16
+ "wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"