@proximus/lavender-tile 2.0.0-alpha.21 → 2.0.0-alpha.210

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.es.js CHANGED
@@ -1,922 +1,804 @@
1
- import { VerticallyExtendedElement as D, checkName as q, log as v, PxElement as k, WithExtraAttributes as p } from "@proximus/lavender-common";
1
+ import { PxElement as e, VerticallyExtendedElement as t, WithExtraAttributes as n, booleanPropertyToAttributeSetter as r, checkName as i, createTemplate as a, log as o, propertyToAttributeSetter as s, renderTemplate as c } from "@proximus/lavender-common";
2
2
  import "@proximus/lavender-layout";
3
- import { checkboxStateValues as P } from "@proximus/lavender-checkbox";
4
- import { stateValues as z } from "@proximus/lavender-radio-group";
5
- function l(o) {
6
- o.hasAttribute("width") || o.setAttribute("width", "s"), o.setAttribute("border-radius", "pill");
3
+ import { checkboxStateValues as l } from "@proximus/lavender-checkbox";
4
+ import { stateValues as u } from "@proximus/lavender-radio-group";
5
+ //#region src/Common.ts
6
+ function d(e) {
7
+ e.hasAttribute("width") || e.setAttribute("width", "s"), e.setAttribute("border-radius", "pill");
7
8
  }
8
- function h(o, t, e, i = []) {
9
- e ? (o.setAttribute("inverted", ""), i.forEach((s) => s.setAttribute("inverted", "")), t.forEach((s) => {
10
- s.hasAttribute("inverted") || s.setAttribute("inverted", "");
11
- })) : (o.removeAttribute("inverted"), i.forEach((s) => s.removeAttribute("inverted")), t.forEach((s) => {
12
- s.hasAttribute("inverted") && s.removeAttribute("inverted");
13
- }));
9
+ function f(e, t, n, r = []) {
10
+ n ? (e.setAttribute("inverted", ""), r.forEach((e) => e.setAttribute("inverted", "")), t.forEach((e) => {
11
+ e.hasAttribute("inverted") || e.setAttribute("inverted", "");
12
+ })) : (e.removeAttribute("inverted"), r.forEach((e) => e.removeAttribute("inverted")), t.forEach((e) => {
13
+ e.hasAttribute("inverted") && e.removeAttribute("inverted");
14
+ }));
14
15
  }
15
- function x(o, t, e, i = [], s = {}) {
16
- e ? (o.setAttribute("disabled", ""), i.forEach((r) => r.setAttribute("disabled", "")), t.forEach((r) => {
17
- r.hasAttribute("disabled") || r.setAttribute("disabled", "");
18
- }), s.ariaEl && s.setAria && s.ariaEl.setAttribute("aria-disabled", "true"), s.ariaEl && s.setTabIndex && (s.ariaEl.tabIndex = -1)) : (o.removeAttribute("disabled"), i.forEach((r) => r.removeAttribute("disabled")), t.forEach((r) => {
19
- r.hasAttribute("disabled") && r.removeAttribute("disabled");
20
- }), s.ariaEl && s.setAria && s.ariaEl.setAttribute("aria-disabled", "false"), s.ariaEl && s.setTabIndex && (s.ariaEl.tabIndex = 0));
16
+ function p(e, t, n, r = [], i = {}) {
17
+ n ? (e.setAttribute("disabled", ""), r.forEach((e) => e.setAttribute("disabled", "")), t.forEach((e) => {
18
+ e.hasAttribute("disabled") || e.setAttribute("disabled", "");
19
+ }), i.ariaEl && i.setAria && i.ariaEl.setAttribute("aria-disabled", "true"), i.ariaEl && i.setTabIndex && (i.ariaEl.tabIndex = -1)) : (e.removeAttribute("disabled"), r.forEach((e) => e.removeAttribute("disabled")), t.forEach((e) => {
20
+ e.hasAttribute("disabled") && e.removeAttribute("disabled");
21
+ }), i.ariaEl && i.setAria && i.ariaEl.setAttribute("aria-disabled", "false"), i.ariaEl && i.setTabIndex && (i.ariaEl.tabIndex = 0));
21
22
  }
22
- const I = '.tile{display:flex;flex-direction:column;padding:var(--px-padding-s-mobile);text-align:left;font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-neutral-default);border-radius:var(--px-radius-main);background:var( --tile-background-color-default, var(--px-color-background-container-light-default) )}.tile ::slotted([slot="label"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-title)}.tile ::slotted([slot="prefix"]){font-size:var(--px-text-size-label-m-mobile);margin-bottom:var(--px-spacing-default-mobile)}.tile ::slotted([slot="suffix"]){margin-left:auto;margin-bottom:var(--px-spacing-default-mobile)}.tile ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-mobile)}:host([hoverable]:hover:not([disabled])) .tile{background-color:var(--px-color-background-state-hover-bordered-default)}:host([hoverable][disabled]) .tile{color:var(--px-color-text-state-disabled-default)}:host([disabled]) .tile{background-color:var(--px-color-background-state-disabled-default)}@media only screen and (min-width: 48em){.tile{padding:var(--px-padding-s-tablet)}.tile ::slotted([slot="label"]){font-size:var(--px-text-size-label-m-tablet)}.tile ::slotted([slot="prefix"]){font-size:var(--px-text-size-label-m-tablet)}.tile ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-tablet)}}@media only screen and (min-width: 64.0625em){.tile{padding:var(--px-padding-s-laptop)}.tile ::slotted([slot="label"]){font-size:var(--px-text-size-label-m-laptop)}.tile ::slotted([slot="prefix"]){font-size:var(--px-text-size-label-m-laptop)}.tile ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-laptop)}}:host([inverted]) .tile{color:var(--px-color-text-neutral-inverted);background:var( --tile-background-color-inverted, var(--px-color-background-container-light-inverted) )}:host([inverted]):host([hoverable]:hover:not([disabled])) .tile{background-color:var( --px-color-background-state-hover-bordered-inverted )}:host([inverted]):host([hoverable][disabled]) .tile{color:var(--px-color-text-state-disabled-inverted)}:host([inverted]):host([disabled]) .tile{background-color:var(--px-color-background-state-disabled-inverted)}', a = ':host{display:block;outline:none}:host .tile,:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch{border-radius:var(--px-radius-main);--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition)}:host .tile,:host .tile *,:host .tile-link,:host .tile-link *,:host .tile-button,:host .tile-button *,:host .tile-checkbox,:host .tile-checkbox *,:host .tile-radio,:host .tile-radio *,:host .tile-switch,:host .tile-switch *{box-sizing:border-box}:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch{display:block;cursor:pointer;width:100%;border:var(--px-size-border-m) solid transparent;outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile)}:host .tile-checkbox,:host .tile-radio,:host .tile-switch{border:var(--px-size-border-m) solid var(--px-color-border-neutral-default)}:host:host(:not([disabled])):host(:hover) .tile-link,:host:host(:not([disabled])):host(:hover) .tile-button,:host:host(:not([disabled])):host(:hover) .tile-checkbox,:host:host(:not([disabled])):host(:hover) .tile-radio,:host:host(:not([disabled])):host(:hover) .tile-switch{border-color:var(--px-color-border-state-hover-default)}:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host:host(:not([disabled])) .tile-link:focus-visible,:host:host(:not([disabled])) .tile-button:focus-visible{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host:host([checked]) .tile-checkbox,:host:host([checked]) .tile-radio,:host:host([checked]) .tile-switch{border-color:var(--px-color-border-state-active-default)}:host:host([disabled]) .tile-link,:host:host([disabled]) .tile-button,:host:host([disabled]) .tile-checkbox,:host:host([disabled]) .tile-radio,:host:host([disabled]) .tile-switch{cursor:default;pointer-events:none}:host:host([disabled]) .tile-checkbox,:host:host([disabled]) .tile-radio,:host:host([disabled]) .tile-switch{border-color:transparent}:host:host([state="error"]) .tile-checkbox,:host:host([state="error"]) .tile-radio,:host:host([state="error"]) .tile-switch{border-color:var(--px-color-border-purpose-error-default)}:host:host([state="error"]):hover:not([disabled]) .tile-checkbox,:host:host([state="error"]):hover:not([disabled]) .tile-radio,:host:host([state="error"]):hover:not([disabled]) .tile-switch{border-color:var(--px-color-border-state-hover-default)}@media only screen and (min-width: 768px){:scope:host .tile-link,:scope:host .tile-button,:scope:host .tile-checkbox,:scope:host .tile-radio,:scope:host .tile-switch{outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])) .tile-link:focus-visible,:scope:host:host(:not([disabled])) .tile-button:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}@media only screen and (min-width: 1025px){:scope:host .tile-link,:scope:host .tile-button,:scope:host .tile-checkbox,:scope:host .tile-radio,:scope:host .tile-switch{outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])) .tile-link:focus-visible,:scope:host:host(:not([disabled])) .tile-button:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .tile-link,:host([inverted]) .tile-button,:host([inverted]) .tile-checkbox,:host([inverted]) .tile-radio,:host([inverted]) .tile-switch{outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .tile-checkbox,:host([inverted]) .tile-radio,:host([inverted]) .tile-switch{border-color:var(--px-color-border-neutral-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .tile-link,:host([inverted]):host(:not([disabled])):host(:hover) .tile-button,:host([inverted]):host(:not([disabled])):host(:hover) .tile-checkbox,:host([inverted]):host(:not([disabled])):host(:hover) .tile-radio,:host([inverted]):host(:not([disabled])):host(:hover) .tile-switch{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]):host([checked]) .tile-checkbox,:host([inverted]):host([checked]) .tile-radio,:host([inverted]):host([checked]) .tile-switch{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([state="error"]) .tile-checkbox,:host([inverted]):host([state="error"]) .tile-radio,:host([inverted]):host([state="error"]) .tile-switch{border-color:var(--px-color-border-purpose-error-inverted)}:host([inverted]):host([state="error"]):host(:hover:not([disabled])) .tile-checkbox,:host([inverted]):host([state="error"]):host(:hover:not([disabled])) .tile-radio,:host([inverted]):host([state="error"]):host(:hover:not([disabled])) .tile-switch{border-color:var(--px-color-border-state-hover-inverted)}', g = new CSSStyleSheet();
23
- g.replaceSync(I);
24
- const m = new CSSStyleSheet();
25
- m.replaceSync(a);
26
- const L = [
27
- "",
28
- "default",
29
- "container-light",
30
- "container-default"
31
- ], c = class c extends D {
32
- template() {
33
- return `
34
- <px-hstack gap="s" align-items="center" class="tile__header">
35
- <slot name="prefix"></slot>
36
- <slot name="suffix"></slot>
37
- </px-hstack>
38
- <px-vstack gap="2xs" class="tile__content">
39
- <slot name="label"></slot>
40
- <slot name="description"></slot>
41
- </px-vstack>
42
- `;
43
- }
44
- constructor() {
45
- super(m, g);
46
- const t = document.createElement(c.nativeName);
47
- t.classList.add("tile"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
48
- }
49
- connectedCallback() {
50
- if (super.connectedCallback(), this.$slotPrefix) {
51
- const t = this.querySelector('px-img[slot="prefix"]');
52
- t && l(t);
53
- }
54
- }
55
- static get observedAttributes() {
56
- return [
57
- ...super.observedAttributes,
58
- "center-prefix",
59
- "center-content",
60
- "background-color",
61
- "inverted",
62
- "disabled"
63
- ];
64
- }
65
- attributeChangedCallback(t, e, i) {
66
- if (super.attributeChangedCallback(t, e, i), e !== i)
67
- switch (t) {
68
- case "center-prefix":
69
- this.updateCenterPrefix();
70
- break;
71
- case "center-content":
72
- this.updateCenterContent();
73
- break;
74
- case "background-color":
75
- this.updateBackgroundColor(
76
- e,
77
- i,
78
- L
79
- );
80
- break;
81
- default:
82
- super.attributeChangedCallback(t, e, i);
83
- break;
84
- }
85
- }
86
- updateCenterPrefix() {
87
- this.centerPrefix ? this.$tileHeader.setAttribute("justify-content", "center") : this.$tileHeader.setAttribute("justify-content", "flex-start");
88
- }
89
- updateCenterContent() {
90
- this.centerContent ? this.$tileContent.style.textAlign = "center" : this.$tileContent.style.textAlign = "left";
91
- }
92
- updateBackgroundColor(t, e, i) {
93
- if (!q(i, e)) {
94
- v(
95
- `${e} is not an allowed background-color value for ${this.tagName.toLowerCase()}`
96
- );
97
- return;
98
- }
99
- const s = (r) => {
100
- r !== null && r !== "" && r !== "default" && (this.$el.style.setProperty(
101
- "--tile-background-color-default",
102
- `var(--px-color-background-${r}-default)`
103
- ), this.$el.style.setProperty(
104
- "--tile-background-color-inverted",
105
- `var(--px-color-background-${r}-inverted)`
106
- ));
107
- };
108
- s(t), s(e);
109
- }
110
- get $tileHeader() {
111
- return this.shadowRoot.querySelector(".tile__header");
112
- }
113
- get $tileContent() {
114
- return this.shadowRoot.querySelector(".tile__content");
115
- }
116
- get $children() {
117
- return this.querySelectorAll("px-tile > *");
118
- }
119
- get $slotPrefix() {
120
- return this.querySelector('[slot="prefix"]');
121
- }
122
- get $slotSuffix() {
123
- return this.querySelector('[slot="suffix"]');
124
- }
125
- get centerPrefix() {
126
- return this.hasAttribute("center-prefix");
127
- }
128
- set centerPrefix(t) {
129
- t ? this.setAttribute("center-prefix", "") : this.removeAttribute("center-prefix");
130
- }
131
- get centerContent() {
132
- return this.hasAttribute("center-content");
133
- }
134
- set centerContent(t) {
135
- t ? this.setAttribute("center-content", "") : this.removeAttribute("center-content");
136
- }
137
- get backgroundColor() {
138
- return this.getAttribute("background-color");
139
- }
140
- set backgroundColor(t) {
141
- t ? this.setAttribute("background-color", t) : this.removeAttribute("background-color");
142
- }
143
- get inverted() {
144
- return this.hasAttribute("inverted");
145
- }
146
- set inverted(t) {
147
- t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
148
- }
149
- get disabled() {
150
- return this.hasAttribute("disabled");
151
- }
152
- set disabled(t) {
153
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
154
- }
23
+ //#endregion
24
+ //#region src/tile.css?inline
25
+ var m = ":host{display:block}.tile,.tile *{box-sizing:border-box}.tile{height:100%;padding:var(--px-padding-s-mobile);text-align:left;font-family:var(--px-font-family);color:var(--px-color-text-neutral-default);border-radius:var(--px-radius-main);background:var(--tile-background-color-default,var(--px-color-background-container-light-default));flex-direction:column;display:flex}.tile ::slotted([slot=prefix]){font-size:var(--px-text-size-label-m-mobile);margin-bottom:var(--px-spacing-xs-mobile)}.tile ::slotted([slot=suffix]){margin-left:auto;margin-bottom:var(--px-spacing-xs-mobile)}.tile ::slotted([slot=label]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-title);line-height:var(--px-line-height-ratio-l)}.tile ::slotted([slot=description]){font-size:var(--px-text-size-label-m-mobile);line-height:var(--px-line-height-ratio-l)}:host([visual=none]) .tile{flex-direction:row-reverse;align-items:flex-start}:host([visual=none]) .tile .tile__content{flex-grow:1}:host([hoverable]:hover:not([disabled])) .tile{background-color:var(--px-color-background-state-hover-bordered-default)}:host([hoverable][disabled]) .tile{color:var(--px-color-text-state-disabled-default)}:host([disabled]) .tile{background-color:var(--px-color-background-state-disabled-default)}@media screen and (width>=48rem){.tile{padding:var(--px-padding-s-tablet)}.tile ::slotted([slot=prefix]){font-size:var(--px-text-size-label-m-tablet);margin-bottom:var(--px-spacing-xs-tablet)}.tile ::slotted([slot=suffix]){margin-bottom:var(--px-spacing-xs-tablet)}.tile ::slotted([slot=label]),.tile ::slotted([slot=description]){font-size:var(--px-text-size-label-m-tablet)}}@media screen and (width>=64.0625rem){.tile{padding:var(--px-padding-s-laptop)}.tile ::slotted([slot=prefix]){font-size:var(--px-text-size-label-m-laptop);margin-bottom:var(--px-spacing-xs-laptop)}.tile ::slotted([slot=suffix]){margin-bottom:var(--px-spacing-xs-laptop)}.tile ::slotted([slot=label]),.tile ::slotted([slot=description]){font-size:var(--px-text-size-label-m-laptop)}}@media screen and (width>=90.0625rem){.tile{padding:var(--px-padding-s-desktop)}.tile ::slotted([slot=prefix]){font-size:var(--px-text-size-label-m-desktop);margin-bottom:var(--px-spacing-xs-desktop)}.tile ::slotted([slot=suffix]){margin-bottom:var(--px-spacing-xs-desktop)}.tile ::slotted([slot=label]),.tile ::slotted([slot=description]){font-size:var(--px-text-size-label-m-desktop)}}:host([inverted]) .tile{color:var(--px-color-text-neutral-inverted);background:var(--tile-background-color-inverted,var(--px-color-background-container-light-inverted))}:host([inverted]):host([hoverable]:hover:not([disabled])) .tile{background-color:var(--px-color-background-state-hover-bordered-inverted)}:host([inverted]):host([hoverable][disabled]) .tile{color:var(--px-color-text-state-disabled-inverted)}:host([inverted]):host([disabled]) .tile{background-color:var(--px-color-background-state-disabled-inverted)}", h = new CSSStyleSheet();
26
+ h.replaceSync(m);
27
+ var g = [
28
+ "",
29
+ "default",
30
+ "container-light",
31
+ "container-default"
32
+ ], _ = class e extends t {
33
+ static {
34
+ this.template = a("<div class=\"tile\"><px-hstack gap=\"s\" align-items=\"center\" class=\"tile__header\"><slot name=\"prefix\"></slot><slot name=\"suffix\"></slot></px-hstack><px-vstack gap=\"none\" class=\"tile__content\"><slot name=\"label\"></slot><slot name=\"description\"></slot></px-vstack></div>");
35
+ }
36
+ static {
37
+ this.nativeName = "div";
38
+ }
39
+ constructor() {
40
+ super(h), c(this.shadowRoot, e.template);
41
+ }
42
+ connectedCallback() {
43
+ if (super.connectedCallback(), this.$slotPrefix) {
44
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
45
+ e && d(e);
46
+ }
47
+ }
48
+ static get observedAttributes() {
49
+ return [
50
+ ...super.observedAttributes,
51
+ "center-prefix",
52
+ "center-content",
53
+ "background-color",
54
+ "inverted",
55
+ "disabled",
56
+ "visual"
57
+ ];
58
+ }
59
+ attributeChangedCallback(e, t, n) {
60
+ if (super.attributeChangedCallback(e, t, n), t !== n) switch (e) {
61
+ case "center-prefix":
62
+ this.updateCenterPrefix();
63
+ break;
64
+ case "center-content":
65
+ this.updateCenterContent();
66
+ break;
67
+ case "background-color":
68
+ this.updateBackgroundColor(t, n, g);
69
+ break;
70
+ default: super.attributeChangedCallback(e, t, n);
71
+ }
72
+ }
73
+ updateCenterPrefix() {
74
+ this.centerPrefix ? this.$tileHeader.setAttribute("justify-content", "center") : this.$tileHeader.setAttribute("justify-content", "flex-start");
75
+ }
76
+ updateCenterContent() {
77
+ this.centerContent ? this.$tileContent.style.textAlign = "center" : this.$tileContent.style.textAlign = "left";
78
+ }
79
+ updateBackgroundColor(e, t, n) {
80
+ if (!i(n, t)) {
81
+ o(`"${t}" is not a valid background-color value for ${this.tagName.toLowerCase()}. Allowed values are: "${n.join("\", \"")}".`);
82
+ return;
83
+ }
84
+ let r = (e) => {
85
+ e !== null && e !== "" && e !== "default" && (this.$el.style.setProperty("--tile-background-color-default", `var(--px-color-background-${e}-default)`), this.$el.style.setProperty("--tile-background-color-inverted", `var(--px-color-background-${e}-inverted)`));
86
+ };
87
+ r(e), r(t);
88
+ }
89
+ get $tileHeader() {
90
+ return this.shadowRoot.querySelector(".tile__header");
91
+ }
92
+ get $tileContent() {
93
+ return this.shadowRoot.querySelector(".tile__content");
94
+ }
95
+ get $children() {
96
+ return this.querySelectorAll("px-tile > *");
97
+ }
98
+ get $slotPrefix() {
99
+ return this.querySelector("[slot=\"prefix\"]");
100
+ }
101
+ get $slotSuffix() {
102
+ return this.querySelector("[slot=\"suffix\"]");
103
+ }
104
+ get centerPrefix() {
105
+ return this.hasAttribute("center-prefix");
106
+ }
107
+ set centerPrefix(e) {
108
+ this._updateBooleanAttribute("center-prefix", e);
109
+ }
110
+ get centerContent() {
111
+ return this.hasAttribute("center-content");
112
+ }
113
+ set centerContent(e) {
114
+ this._updateBooleanAttribute("center-content", e);
115
+ }
116
+ get backgroundColor() {
117
+ return this.getAttribute("background-color");
118
+ }
119
+ set backgroundColor(e) {
120
+ this._updateAttribute("background-color", e);
121
+ }
122
+ get inverted() {
123
+ return this.hasAttribute("inverted");
124
+ }
125
+ set inverted(e) {
126
+ this._updateBooleanAttribute("inverted", e);
127
+ }
128
+ get disabled() {
129
+ return this.hasAttribute("disabled");
130
+ }
131
+ set disabled(e) {
132
+ this._updateBooleanAttribute("disabled", e);
133
+ }
134
+ get visual() {
135
+ return this.getAttribute("visual");
136
+ }
137
+ set visual(e) {
138
+ this._updateAttribute("visual", e);
139
+ }
155
140
  };
156
- c.nativeName = "div";
157
- let b = c;
158
- customElements.get("px-tile") || customElements.define("px-tile", b);
159
- const R = ".tile-button{padding:0;background:none;font-size:var(--px-text-size-body-m-mobile)}@media only screen and (min-width: 48em){.tile-button{font-size:var(--px-text-size-body-m-tablet)}}@media only screen and (min-width: 64.0625em){.tile-button{font-size:var(--px-text-size-body-m-laptop)}}", A = new CSSStyleSheet();
160
- A.replaceSync(R);
161
- const $ = new CSSStyleSheet();
162
- $.replaceSync(a);
163
- const n = class n extends k {
164
- template() {
165
- return `
166
- <px-tile hoverable>
167
- <slot name="prefix" slot="prefix"></slot>
168
- <slot name="suffix" slot="suffix"></slot>
169
- <slot name="label" slot="label"></slot>
170
- <slot name="description" slot="description"></slot>
171
- </px-tile>
172
- `;
173
- }
174
- constructor() {
175
- super($, A);
176
- const t = document.createElement(n.nativeName);
177
- t.classList.add("tile-button"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
178
- }
179
- connectedCallback() {
180
- if (this.$slotPrefix) {
181
- const t = this.querySelector('px-img[slot="prefix"]');
182
- t && l(t);
183
- }
184
- this.backgroundColor || (this.backgroundColor = "container-default");
185
- }
186
- static get observedAttributes() {
187
- return [
188
- ...super.observedAttributes,
189
- "center-prefix",
190
- "center-content",
191
- "background-color",
192
- "inverted",
193
- "disabled"
194
- ];
195
- }
196
- attributeChangedCallback(t, e, i) {
197
- if (e !== i)
198
- switch (t) {
199
- case "center-prefix":
200
- case "center-content":
201
- this.$tile.setAttribute(t, "");
202
- break;
203
- case "background-color":
204
- this.$tile.setAttribute(t, this.getAttribute(t) || "");
205
- break;
206
- case "inverted":
207
- h(this.$tile, this.$children, this.inverted);
208
- break;
209
- case "disabled":
210
- x(this.$tile, this.$children, this.disabled, [], {
211
- ariaEl: this.$el,
212
- setAria: !0,
213
- setTabIndex: !0
214
- });
215
- break;
216
- default:
217
- super.attributeChangedCallback(t, e, i);
218
- break;
219
- }
220
- }
221
- get $tile() {
222
- return this.shadowRoot.querySelector("px-tile");
223
- }
224
- get $slotPrefix() {
225
- return this.querySelector('[slot="prefix"]');
226
- }
227
- get $children() {
228
- return this.querySelectorAll("px-tile-button > *");
229
- }
230
- get centerPrefix() {
231
- return this.hasAttribute("center-prefix");
232
- }
233
- set centerPrefix(t) {
234
- t ? this.setAttribute("center-prefix", "") : this.removeAttribute("center-prefix");
235
- }
236
- get centerContent() {
237
- return this.hasAttribute("center-content");
238
- }
239
- set centerContent(t) {
240
- t ? this.setAttribute("center-content", "") : this.removeAttribute("center-content");
241
- }
242
- get backgroundColor() {
243
- return this.getAttribute("background-color");
244
- }
245
- set backgroundColor(t) {
246
- this.setAttribute("background-color", t);
247
- }
248
- get inverted() {
249
- return this.hasAttribute("inverted");
250
- }
251
- set inverted(t) {
252
- t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
253
- }
254
- get disabled() {
255
- return this.hasAttribute("disabled");
256
- }
257
- set disabled(t) {
258
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
259
- }
141
+ customElements.get("px-tile") || customElements.define("px-tile", _);
142
+ //#endregion
143
+ //#region src/tile-button.css?inline
144
+ var v = ":host(:not([disabled])):host(:active){padding:0}:host(:not([disabled])):host(:active) .tile-button{border-width:var(--px-size-border-m);border-color:var(--px-color-border-state-active-default)}.tile-button{font-size:var(--px-text-size-body-m-mobile);background:0 0;padding:0}@media screen and (width>=48rem){.tile-button{font-size:var(--px-text-size-body-m-tablet)}}@media screen and (width>=64.0625rem){.tile-button{font-size:var(--px-text-size-body-m-laptop)}}@media screen and (width>=90.0625rem){.tile-button{font-size:var(--px-text-size-body-m-desktop)}}:host([inverted]):host(:not([disabled])):host(:active) .tile-button{border-color:var(--px-color-border-state-active-inverted)}", y = ":host{padding:calc(var(--px-size-border-m) - var(--px-size-border-s));outline:none;display:block}:is(:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch),:is(:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch) *{box-sizing:border-box}:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch{border-radius:var(--px-radius-main);height:100%}:is(:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch) px-tile{height:100%}:host .tile-link,:host .tile-button,:host .tile-checkbox,:host .tile-radio,:host .tile-switch{cursor:pointer;border:var(--px-size-border-s) solid transparent;outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile);border:var(--px-size-border-s) solid var(--px-color-border-main-default);width:100%;display:block}:host:host(:not([disabled])):host(:hover) .tile-link,:host:host(:not([disabled])):host(:hover) .tile-button,:host:host(:not([disabled])):host(:hover) .tile-checkbox,:host:host(:not([disabled])):host(:hover) .tile-radio,:host:host(:not([disabled])):host(:hover) .tile-switch{border-color:var(--px-color-border-state-hover-default)}:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:is(:host:host(:not([disabled])) .tile-link,:host:host(:not([disabled])) .tile-button):focus-visible{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host:host([checked]){padding:0}:host:host([checked]) .tile-checkbox,:host:host([checked]) .tile-radio,:host:host([checked]) .tile-switch{border-width:var(--px-size-border-m);border-color:var(--px-color-border-state-active-default)}:host:host([disabled]) .tile-link,:host:host([disabled]) .tile-button,:host:host([disabled]) .tile-checkbox,:host:host([disabled]) .tile-radio,:host:host([disabled]) .tile-switch{cursor:default;pointer-events:none}:host:host([disabled]) .tile-checkbox,:host:host([disabled]) .tile-radio,:host:host([disabled]) .tile-switch{border-color:#0000}:host:host([state=error]) .tile-checkbox,:host:host([state=error]) .tile-radio,:host:host([state=error]) .tile-switch{border-color:var(--px-color-border-purpose-error-default)}:host:host([state=error]):hover:not([disabled]) .tile-checkbox,:host:host([state=error]):hover:not([disabled]) .tile-radio,:host:host([state=error]):hover:not([disabled]) .tile-switch{border-color:var(--px-color-border-state-hover-default)}@media screen and (width>=48rem){:scope:host .tile-link,:scope:host .tile-button,:scope:host .tile-checkbox,:scope:host .tile-radio,:scope:host .tile-switch{outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}:is(:scope:host:host(:not([disabled])) .tile-link,:scope:host:host(:not([disabled])) .tile-button):focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}@media screen and (width>=64.0625rem){:scope:host .tile-link,:scope:host .tile-button,:scope:host .tile-checkbox,:scope:host .tile-radio,:scope:host .tile-switch{outline-width:var(--px-focus-outline-laptop)}:scope:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}:is(:scope:host:host(:not([disabled])) .tile-link,:scope:host:host(:not([disabled])) .tile-button):focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}@media screen and (width>=90.0625rem){:scope:host .tile-link,:scope:host .tile-button,:scope:host .tile-checkbox,:scope:host .tile-radio,:scope:host .tile-switch{outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])):host(:focus-visible) .tile-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .tile-switch{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}:is(:scope:host:host(:not([disabled])) .tile-link,:scope:host:host(:not([disabled])) .tile-button):focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .tile-link,:host([inverted]) .tile-button,:host([inverted]) .tile-checkbox,:host([inverted]) .tile-radio,:host([inverted]) .tile-switch{outline-color:var(--px-color-border-focus-outline-inverted);border-color:var(--px-color-border-main-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .tile-link,:host([inverted]):host(:not([disabled])):host(:hover) .tile-button,:host([inverted]):host(:not([disabled])):host(:hover) .tile-checkbox,:host([inverted]):host(:not([disabled])):host(:hover) .tile-radio,:host([inverted]):host(:not([disabled])):host(:hover) .tile-switch{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]):host(:not([disabled])):host(:active) .tile-link,:host([inverted]):host(:not([disabled])):host(:active) .tile-button{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([checked]) .tile-checkbox,:host([inverted]):host([checked]) .tile-radio,:host([inverted]):host([checked]) .tile-switch{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([state=error]) .tile-checkbox,:host([inverted]):host([state=error]) .tile-radio,:host([inverted]):host([state=error]) .tile-switch{border-color:var(--px-color-border-purpose-error-inverted)}:host([inverted]):host([state=error]):host(:hover:not([disabled])) .tile-checkbox,:host([inverted]):host([state=error]):host(:hover:not([disabled])) .tile-radio,:host([inverted]):host([state=error]):host(:hover:not([disabled])) .tile-switch{border-color:var(--px-color-border-state-hover-inverted)}", b = new CSSStyleSheet();
145
+ b.replaceSync(v);
146
+ var x = new CSSStyleSheet();
147
+ x.replaceSync(y);
148
+ var S = class t extends e {
149
+ static {
150
+ this.template = a("<button class=\"tile-button\"><px-tile hoverable><slot name=\"prefix\" slot=\"prefix\"></slot><slot name=\"suffix\" slot=\"suffix\"></slot><slot name=\"label\" slot=\"label\"></slot><slot name=\"description\" slot=\"description\"></slot></px-tile></button>");
151
+ }
152
+ static {
153
+ this.nativeName = "button";
154
+ }
155
+ static {
156
+ this.accessorExclusions = ["disabled"];
157
+ }
158
+ constructor() {
159
+ super(x, b), c(this.shadowRoot, t.template);
160
+ }
161
+ connectedCallback() {
162
+ if (this.$slotPrefix) {
163
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
164
+ e && d(e);
165
+ }
166
+ this.backgroundColor ||= "container-default";
167
+ }
168
+ static get observedAttributes() {
169
+ return [
170
+ ...super.observedAttributes,
171
+ "center-prefix",
172
+ "center-content",
173
+ "background-color",
174
+ "inverted",
175
+ "disabled",
176
+ "visual"
177
+ ];
178
+ }
179
+ attributeChangedCallback(e, t, n) {
180
+ if (t !== n) switch (e) {
181
+ case "center-prefix":
182
+ case "center-content":
183
+ this.$tile.setAttribute(e, "");
184
+ break;
185
+ case "background-color":
186
+ case "visual":
187
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
188
+ break;
189
+ case "inverted":
190
+ f(this.$tile, this.$children, this.inverted);
191
+ break;
192
+ case "disabled":
193
+ p(this.$tile, this.$children, this.disabled, [], {
194
+ ariaEl: this.$el,
195
+ setAria: !0,
196
+ setTabIndex: !0
197
+ });
198
+ break;
199
+ default: super.attributeChangedCallback(e, t, n);
200
+ }
201
+ }
202
+ get $tile() {
203
+ return this.shadowRoot.querySelector("px-tile");
204
+ }
205
+ get $slotPrefix() {
206
+ return this.querySelector("[slot=\"prefix\"]");
207
+ }
208
+ get $children() {
209
+ return this.querySelectorAll("px-tile-button > *");
210
+ }
211
+ get centerPrefix() {
212
+ return this.hasAttribute("center-prefix");
213
+ }
214
+ set centerPrefix(e) {
215
+ this._updateBooleanAttribute("center-prefix", e);
216
+ }
217
+ get centerContent() {
218
+ return this.hasAttribute("center-content");
219
+ }
220
+ set centerContent(e) {
221
+ this._updateBooleanAttribute("center-content", e);
222
+ }
223
+ get backgroundColor() {
224
+ return this.getAttribute("background-color");
225
+ }
226
+ set backgroundColor(e) {
227
+ this._updateAttribute("background-color", e);
228
+ }
229
+ get inverted() {
230
+ return this.hasAttribute("inverted");
231
+ }
232
+ set inverted(e) {
233
+ this._updateBooleanAttribute("inverted", e);
234
+ }
235
+ get disabled() {
236
+ return this.hasAttribute("disabled");
237
+ }
238
+ set disabled(e) {
239
+ this._updateBooleanAttribute("disabled", e);
240
+ }
241
+ get visual() {
242
+ return this.getAttribute("visual");
243
+ }
244
+ set visual(e) {
245
+ this._updateAttribute("visual", e);
246
+ }
260
247
  };
261
- n.nativeName = "button", n.accessorExclusions = ["disabled"];
262
- let u = n;
263
- customElements.get("px-tile-button") || customElements.define("px-tile-button", u);
264
- const C = new CSSStyleSheet();
265
- C.replaceSync(a);
266
- class H extends p {
267
- template() {
268
- return `
269
- <div class="tile-checkbox">
270
- <px-tile hoverable>
271
- <slot name="prefix" slot="prefix"></slot>
272
- <px-checkbox slot="suffix" inert></px-checkbox>
273
- <slot name="label" slot="label"></slot>
274
- <slot name="description" slot="description"></slot>
275
- </px-tile>
276
- </div>
277
- `;
278
- }
279
- constructor() {
280
- var t;
281
- super(C), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
282
- }
283
- connectedCallback() {
284
- if (this.tabIndex = 0, this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.$slotPrefix) {
285
- const t = this.querySelector('px-img[slot="prefix"]');
286
- t && l(t);
287
- }
288
- this.addEventListener("mouseover", () => {
289
- this.$checkbox.setAttribute("hover", "");
290
- }), this.addEventListener("mouseout", () => {
291
- this.$checkbox.removeAttribute("hover");
292
- }), this.addEventListener("keypress", (t) => {
293
- switch (t.stopPropagation(), t.preventDefault(), t.code) {
294
- case "Space":
295
- this.click();
296
- break;
297
- }
298
- }), this.addEventListener("click", (t) => {
299
- this.checked = !this.checked, t.stopPropagation(), t.preventDefault();
300
- }), this.hasAttribute("checked") && (this.checked = !0);
301
- }
302
- static get observedAttributes() {
303
- return [
304
- "center-content",
305
- "background-color",
306
- "inverted",
307
- "name",
308
- "value",
309
- "state",
310
- "checked",
311
- "disabled"
312
- ];
313
- }
314
- attributeChangedCallback(t, e, i) {
315
- if (e !== i)
316
- switch (t) {
317
- case "center-content":
318
- case "background-color":
319
- this.$tile.setAttribute(t, this.getAttribute(t) || "");
320
- break;
321
- case "inverted":
322
- h(this, this.$children, this.inverted, [
323
- this.$tile,
324
- this.$checkbox
325
- ]);
326
- break;
327
- case "name":
328
- case "value":
329
- this.$checkbox && this.$checkbox.setAttribute(t, i);
330
- break;
331
- case "state":
332
- if (this.$checkbox)
333
- if (this.checkName(P, i))
334
- this.$checkbox.setAttribute("state", i);
335
- else {
336
- v(
337
- `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
338
- );
339
- return;
340
- }
341
- break;
342
- case "disabled":
343
- this.handleDisabledAttributeChange(i !== null);
344
- break;
345
- case "checked":
346
- this.handleCheckedAttributeChange(i);
347
- break;
348
- }
349
- }
350
- handleDisabledAttributeChange(t) {
351
- t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$tile.disabled = !0, this.$checkbox.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$tile.disabled = !1, this.$checkbox.removeAttribute("disabled"));
352
- }
353
- handleCheckedAttributeChange(t) {
354
- var e;
355
- (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.checked = !1, this.$checkbox && this.$checkbox.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.checked = !0, this.$checkbox && this.$checkbox.setAttribute("checked", ""), this.dispatchEvent(
356
- new Event("change", {
357
- bubbles: !0,
358
- composed: !0
359
- // Allow the event to pass through shadow DOM boundaries
360
- })
361
- ));
362
- }
363
- // Form-associated callbacks
364
- static get formAssociated() {
365
- return !0;
366
- }
367
- // Set default behavior when the element is attached to a form
368
- formResetCallback() {
369
- this.checked = !1;
370
- }
371
- formStateRestoreCallback(t) {
372
- this.checked = t;
373
- }
374
- formData() {
375
- if (this.name) {
376
- const t = new FormData(), e = this.getAttribute("name");
377
- return e && (this.checked ? t.set(e, this.value) : t.delete(e)), t;
378
- }
379
- }
380
- get $tile() {
381
- return this.shadowRoot.querySelector("px-tile");
382
- }
383
- get $el() {
384
- return this.shadowRoot.querySelector(".tile-checkbox");
385
- }
386
- get $checkbox() {
387
- return this.shadowRoot.querySelector("px-checkbox");
388
- }
389
- get $slotPrefix() {
390
- return this.querySelector('[slot="prefix"]');
391
- }
392
- get $children() {
393
- return this.querySelectorAll("px-tile-checkbox > *");
394
- }
395
- get centerContent() {
396
- return this.hasAttribute("center-content");
397
- }
398
- set centerContent(t) {
399
- t ? this.setAttribute("center-content", "") : this.removeAttribute("center-content");
400
- }
401
- get backgroundColor() {
402
- return this.getAttribute("background-color");
403
- }
404
- set backgroundColor(t) {
405
- this.setAttribute("background-color", t);
406
- }
407
- get inverted() {
408
- return this.hasAttribute("inverted");
409
- }
410
- set inverted(t) {
411
- t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
412
- }
413
- get checked() {
414
- return this.hasAttribute("checked");
415
- }
416
- set checked(t) {
417
- t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
418
- }
419
- get name() {
420
- return this.getAttribute("name");
421
- }
422
- set name(t) {
423
- t ? this.setAttribute("name", t) : this.removeAttribute("name");
424
- }
425
- get state() {
426
- return this.getAttribute("state");
427
- }
428
- set state(t) {
429
- t ? this.setAttribute("state", t) : this.removeAttribute("state");
430
- }
431
- get disabled() {
432
- return this.hasAttribute("disabled");
433
- }
434
- set disabled(t) {
435
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
436
- }
437
- get value() {
438
- return this.getAttribute("value");
439
- }
440
- set value(t) {
441
- t ? this.setAttribute("value", t) : this.removeAttribute("value");
442
- }
443
- }
444
- customElements.get("px-tile-checkbox") || customElements.define("px-tile-checkbox", H);
445
- const S = new CSSStyleSheet();
446
- S.replaceSync(a);
447
- class B extends p {
448
- template() {
449
- return `
450
- <div class="tile-radio">
451
- <px-tile hoverable>
452
- <slot name="prefix" slot="prefix"></slot>
453
- <px-radio slot="suffix" inert></px-radio>
454
- <slot name="label" slot="label"></slot>
455
- <slot name="description" slot="description"></slot>
456
- </px-tile>
457
- </div>
458
- `;
459
- }
460
- constructor() {
461
- var t;
462
- super(S), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
463
- }
464
- connectedCallback() {
465
- var t;
466
- if (this.role = "radio", this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.firstElementChild) === this ? 0 : -1, this.$slotPrefix) {
467
- const e = this.querySelector('px-img[slot="prefix"]');
468
- e && l(e);
469
- }
470
- this.addEventListener("mouseover", () => {
471
- this.$radio.setAttribute("hover", "");
472
- }), this.addEventListener("mouseout", () => {
473
- this.$radio.removeAttribute("hover");
474
- }), this.addEventListener("keypress", (e) => {
475
- switch (e.stopPropagation(), e.preventDefault(), e.code) {
476
- case "Space":
477
- this.click();
478
- break;
479
- }
480
- }), this.addEventListener("click", (e) => {
481
- this.checked || (this.checked = !0), e.stopPropagation(), e.preventDefault();
482
- }), this.hasAttribute("checked") && (this.checked = !0);
483
- }
484
- static get observedAttributes() {
485
- return [
486
- "center-content",
487
- "background-color",
488
- "inverted",
489
- "name",
490
- "value",
491
- "state",
492
- "checked",
493
- "disabled"
494
- ];
495
- }
496
- attributeChangedCallback(t, e, i) {
497
- if (e !== i)
498
- switch (t) {
499
- case "center-content":
500
- case "background-color":
501
- this.$tile.setAttribute(t, this.getAttribute(t) || "");
502
- break;
503
- case "inverted":
504
- h(this, this.$children, this.inverted, [
505
- this.$tile,
506
- this.$radio
507
- ]);
508
- break;
509
- case "name":
510
- case "value":
511
- this.$radio && this.$radio.setAttribute(t, i);
512
- break;
513
- case "state":
514
- if (this.$radio)
515
- if (this.checkName(z, i))
516
- this.$radio.setAttribute("state", i);
517
- else {
518
- v(
519
- `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
520
- );
521
- return;
522
- }
523
- break;
524
- case "disabled":
525
- this.handleDisabledAttributeChange(i !== null);
526
- break;
527
- case "checked":
528
- this.handleCheckedAttributeChange(i);
529
- break;
530
- }
531
- }
532
- handleDisabledAttributeChange(t) {
533
- t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$tile.disabled = !0, this.$radio.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$tile.disabled = !1, this.$radio.removeAttribute("disabled"));
534
- }
535
- handleCheckedAttributeChange(t) {
536
- var e;
537
- (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.tabIndex = -1, this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.tabIndex = 0, this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
538
- new Event("change", {
539
- bubbles: !0,
540
- composed: !0
541
- // Allow the event to pass through shadow DOM boundaries
542
- })
543
- ));
544
- }
545
- // Form-associated callbacks
546
- static get formAssociated() {
547
- return !0;
548
- }
549
- // Set default behavior when the element is attached to a form
550
- formResetCallback() {
551
- this.checked = !1;
552
- }
553
- formStateRestoreCallback(t) {
554
- this.checked = t;
555
- }
556
- formData() {
557
- if (this.name) {
558
- const t = new FormData(), e = this.getAttribute("name");
559
- return e && (this.checked ? t.set(e, this.$radio.value) : t.delete(e)), t;
560
- }
561
- }
562
- get $tile() {
563
- return this.shadowRoot.querySelector("px-tile");
564
- }
565
- get $el() {
566
- return this.shadowRoot.querySelector(".tile-radio");
567
- }
568
- get $radio() {
569
- return this.shadowRoot.querySelector("px-radio");
570
- }
571
- get $slotPrefix() {
572
- return this.querySelector('[slot="prefix"]');
573
- }
574
- get $children() {
575
- return this.querySelectorAll("px-tile-radio > *");
576
- }
577
- get centerContent() {
578
- return this.hasAttribute("center-content");
579
- }
580
- set centerContent(t) {
581
- t ? this.setAttribute("center-content", "") : this.removeAttribute("center-content");
582
- }
583
- get backgroundColor() {
584
- return this.getAttribute("background-color");
585
- }
586
- set backgroundColor(t) {
587
- t ? this.setAttribute("background-color", t) : this.removeAttribute("background-color");
588
- }
589
- get inverted() {
590
- return this.hasAttribute("inverted");
591
- }
592
- set inverted(t) {
593
- t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
594
- }
595
- get checked() {
596
- return this.hasAttribute("checked");
597
- }
598
- set checked(t) {
599
- t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
600
- }
601
- get name() {
602
- return this.getAttribute("name");
603
- }
604
- set name(t) {
605
- t ? this.setAttribute("name", t) : this.removeAttribute("name");
606
- }
607
- get state() {
608
- return this.getAttribute("state");
609
- }
610
- set state(t) {
611
- t ? this.setAttribute("state", t) : this.removeAttribute("state");
612
- }
613
- get disabled() {
614
- return this.hasAttribute("disabled");
615
- }
616
- set disabled(t) {
617
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
618
- }
619
- get value() {
620
- return this.getAttribute("value");
621
- }
622
- set value(t) {
623
- t ? this.setAttribute("value", t) : this.removeAttribute("value");
624
- }
625
- }
626
- customElements.get("px-tile-radio") || customElements.define("px-tile-radio", B);
627
- const T = ".tile-link{text-decoration:none}.tile-link px-icon{color:var(--px-color-icon-brand-default)}.tile-link[aria-disabled=true] px-icon{color:var(--px-color-icon-state-disabled-default)}:host([inverted]) .tile-link px-icon{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .tile-link[aria-disabled=true] px-icon{color:var(--px-color-icon-state-disabled-inverted)}", w = new CSSStyleSheet();
628
- w.replaceSync(T);
629
- const y = new CSSStyleSheet();
630
- y.replaceSync(a);
631
- const d = class d extends k {
632
- template() {
633
- return `
634
- <px-tile hoverable>
635
- <slot name="prefix" slot="prefix"></slot>
636
- <px-icon
637
- name="chevron_right"
638
- slot="suffix"
639
- from="lavender"
640
- size="s"
641
- color="inherit"
642
- ></px-icon>
643
- <slot name="label" slot="label"></slot>
644
- <slot name="description" slot="description"></slot>
645
- </px-tile>
646
- `;
647
- }
648
- constructor() {
649
- super(y, w);
650
- const t = document.createElement(d.nativeName);
651
- t.classList.add("tile-link"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
652
- }
653
- connectedCallback() {
654
- if (this.$slotPrefix) {
655
- const e = this.querySelector('px-img[slot="prefix"]');
656
- e && l(e);
657
- }
658
- this.backgroundColor || (this.backgroundColor = "container-default"), this.hasAttribute("target") && this.getAttribute("target") === "_blank" && (this.$pxIcon.setAttribute("name", "target_blank"), this.$pxIcon.setAttribute(
659
- "aria-label",
660
- this.targetBlankAriaLabel ? this.targetBlankAriaLabel : "Opens in a new tab"
661
- ));
662
- }
663
- static get observedAttributes() {
664
- return [
665
- ...super.observedAttributes,
666
- "center-content",
667
- "background-color",
668
- "inverted",
669
- "disabled",
670
- "target-blank-aria-label"
671
- ];
672
- }
673
- attributeChangedCallback(t, e, i) {
674
- if (e !== i)
675
- switch (t) {
676
- case "center-content":
677
- this.$tile.setAttribute(t, "");
678
- break;
679
- case "background-color":
680
- this.$tile.setAttribute(t, this.getAttribute(t) || "");
681
- break;
682
- case "inverted":
683
- h(this.$tile, this.$children, this.inverted, [
684
- this.$pxIcon
685
- ]);
686
- break;
687
- case "disabled":
688
- x(this.$tile, this.$children, this.disabled, [], {
689
- ariaEl: this.$el,
690
- setAria: !0,
691
- setTabIndex: !0
692
- });
693
- break;
694
- case "target-blank-aria-label":
695
- this.$pxIcon && this.$pxIcon.setAttribute(
696
- "aria-label",
697
- this.targetBlankAriaLabel || "Opens in a new tab"
698
- );
699
- break;
700
- default:
701
- super.attributeChangedCallback(t, e, i);
702
- break;
703
- }
704
- }
705
- get $tile() {
706
- return this.shadowRoot.querySelector("px-tile");
707
- }
708
- get $slotPrefix() {
709
- return this.querySelector('[slot="prefix"]');
710
- }
711
- get $children() {
712
- return this.querySelectorAll("px-tile-link > *");
713
- }
714
- get $pxIcon() {
715
- return this.shadowRoot.querySelector('px-icon[slot="suffix"]');
716
- }
717
- get centerContent() {
718
- return this.hasAttribute("center-content");
719
- }
720
- set centerContent(t) {
721
- t ? this.setAttribute("center-content", "") : this.removeAttribute("center-content");
722
- }
723
- get backgroundColor() {
724
- return this.getAttribute("background-color");
725
- }
726
- set backgroundColor(t) {
727
- this.setAttribute("background-color", t);
728
- }
729
- get inverted() {
730
- return this.hasAttribute("inverted");
731
- }
732
- set inverted(t) {
733
- t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
734
- }
735
- get disabled() {
736
- return this.hasAttribute("disabled");
737
- }
738
- set disabled(t) {
739
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
740
- }
741
- get targetBlankAriaLabel() {
742
- return this.getAttribute("target-blank-aria-label");
743
- }
744
- set targetBlankAriaLabel(t) {
745
- this.setAttribute("target-blank-aria-label", t);
746
- }
248
+ customElements.get("px-tile-button") || customElements.define("px-tile-button", S);
249
+ //#endregion
250
+ //#region src/TileCheckbox.ts
251
+ var C = new CSSStyleSheet();
252
+ C.replaceSync(y);
253
+ var w = class e extends n {
254
+ static {
255
+ this.template = a("<div class=\"tile-checkbox\"><px-tile hoverable><slot name=\"prefix\" slot=\"prefix\"></slot><px-checkbox slot=\"suffix\" inert></px-checkbox><slot name=\"label\" slot=\"label\"></slot><slot name=\"description\" slot=\"description\"></slot></px-tile></div>");
256
+ }
257
+ constructor() {
258
+ super(C), c(this.shadowRoot, e.template), this.internals = this.attachInternals?.();
259
+ }
260
+ connectedCallback() {
261
+ if (this.tabIndex = 0, this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.$slotPrefix) {
262
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
263
+ e && d(e);
264
+ }
265
+ this.addEventListener("mouseover", () => {
266
+ this.$checkbox.setAttribute("hover", "");
267
+ }), this.addEventListener("mouseout", () => {
268
+ this.$checkbox.removeAttribute("hover");
269
+ }), this.addEventListener("keypress", (e) => {
270
+ e.stopPropagation(), e.preventDefault(), e.code === "Space" && this.click();
271
+ }), this.addEventListener("click", (e) => {
272
+ this.checked = !this.checked, e.stopPropagation(), e.preventDefault();
273
+ }), this.hasAttribute("checked") && (this.checked = !0);
274
+ }
275
+ static get observedAttributes() {
276
+ return [
277
+ "background-color",
278
+ "inverted",
279
+ "visual",
280
+ "name",
281
+ "value",
282
+ "state",
283
+ "checked",
284
+ "disabled"
285
+ ];
286
+ }
287
+ attributeChangedCallback(e, t, n) {
288
+ if (t !== n) switch (e) {
289
+ case "background-color":
290
+ case "visual":
291
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
292
+ break;
293
+ case "inverted":
294
+ f(this, this.$children, this.inverted, [this.$tile, this.$checkbox]);
295
+ break;
296
+ case "name":
297
+ case "value":
298
+ this.$checkbox && this.$checkbox.setAttribute(e, n);
299
+ break;
300
+ case "state":
301
+ if (this.$checkbox) {
302
+ if (this.checkName(l, n)) this.$checkbox.setAttribute("state", n);
303
+ else {
304
+ o(`"${n}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${l.join("\", \"")}".`);
305
+ return;
306
+ }
307
+ }
308
+ break;
309
+ case "disabled":
310
+ this.handleDisabledAttributeChange(n !== null);
311
+ break;
312
+ case "checked": this.handleCheckedAttributeChange(n);
313
+ }
314
+ }
315
+ handleDisabledAttributeChange(e) {
316
+ e ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$tile.disabled = !0, this.$checkbox.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$tile.disabled = !1, this.$checkbox.removeAttribute("disabled"));
317
+ }
318
+ handleCheckedAttributeChange(e) {
319
+ this.internals?.setFormValue(this.formData()), e === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.checked = !1, this.$checkbox && this.$checkbox.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.checked = !0, this.$checkbox && this.$checkbox.setAttribute("checked", ""), this.dispatchEvent(new Event("change", {
320
+ bubbles: !0,
321
+ composed: !0
322
+ })));
323
+ }
324
+ static get formAssociated() {
325
+ return !0;
326
+ }
327
+ formResetCallback() {
328
+ this.checked = !1;
329
+ }
330
+ formStateRestoreCallback(e) {
331
+ this.checked = e;
332
+ }
333
+ formData() {
334
+ let e = new FormData();
335
+ if (this.name) {
336
+ let t = this.getAttribute("name");
337
+ t && (this.checked ? e.set(t, this.value ?? "") : e.delete(t));
338
+ }
339
+ return e;
340
+ }
341
+ get $tile() {
342
+ return this.shadowRoot.querySelector("px-tile");
343
+ }
344
+ get $el() {
345
+ return this.shadowRoot.querySelector(".tile-checkbox");
346
+ }
347
+ get $checkbox() {
348
+ return this.shadowRoot.querySelector("px-checkbox");
349
+ }
350
+ get $slotPrefix() {
351
+ return this.querySelector("[slot=\"prefix\"]");
352
+ }
353
+ get $children() {
354
+ return this.querySelectorAll("px-tile-checkbox > *");
355
+ }
356
+ get backgroundColor() {
357
+ return this.getAttribute("background-color");
358
+ }
359
+ set backgroundColor(e) {
360
+ s(this, "background-color", e);
361
+ }
362
+ get visual() {
363
+ return this.getAttribute("visual");
364
+ }
365
+ set visual(e) {
366
+ s(this, "visual", e);
367
+ }
368
+ get inverted() {
369
+ return this.hasAttribute("inverted");
370
+ }
371
+ set inverted(e) {
372
+ r(this, "inverted", e);
373
+ }
374
+ get checked() {
375
+ return this.hasAttribute("checked");
376
+ }
377
+ set checked(e) {
378
+ r(this, "checked", e);
379
+ }
380
+ get name() {
381
+ return this.getAttribute("name");
382
+ }
383
+ set name(e) {
384
+ s(this, "name", e);
385
+ }
386
+ get state() {
387
+ return this.getAttribute("state");
388
+ }
389
+ set state(e) {
390
+ s(this, "state", e);
391
+ }
392
+ get disabled() {
393
+ return this.hasAttribute("disabled");
394
+ }
395
+ set disabled(e) {
396
+ r(this, "disabled", e);
397
+ }
398
+ get value() {
399
+ return this.getAttribute("value");
400
+ }
401
+ set value(e) {
402
+ s(this, "value", e);
403
+ }
747
404
  };
748
- d.nativeName = "a";
749
- let f = d;
750
- customElements.get("px-tile-link") || customElements.define("px-tile-link", f);
751
- const E = new CSSStyleSheet();
752
- E.replaceSync(a);
753
- class F extends p {
754
- template() {
755
- return `
756
- <div class="tile-switch">
757
- <px-tile hoverable>
758
- <slot name="prefix" slot="prefix"></slot>
759
- <px-switch slot="suffix" inert></px-switch>
760
- <slot name="label" slot="label"></slot>
761
- <slot name="description" slot="description"></slot>
762
- </px-tile>
763
- </div>
764
- `;
765
- }
766
- constructor() {
767
- var t;
768
- super(E), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
769
- }
770
- connectedCallback() {
771
- if (this.tabIndex = 0, this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.$slotPrefix) {
772
- const t = this.querySelector('px-img[slot="prefix"]');
773
- t && l(t);
774
- }
775
- this.addEventListener("mouseover", () => {
776
- this.$switch.setAttribute("hover", "");
777
- }), this.addEventListener("mouseout", () => {
778
- this.$switch.removeAttribute("hover");
779
- }), this.addEventListener("keypress", (t) => {
780
- switch (t.stopPropagation(), t.preventDefault(), t.code) {
781
- case "Space":
782
- this.click();
783
- break;
784
- }
785
- }), this.addEventListener("click", (t) => {
786
- this.checked = !this.checked, t.stopPropagation(), t.preventDefault();
787
- }), this.hasAttribute("checked") && (this.checked = !0);
788
- }
789
- static get observedAttributes() {
790
- return [
791
- "center-content",
792
- "background-color",
793
- "inverted",
794
- "name",
795
- "value",
796
- "checked",
797
- "disabled"
798
- ];
799
- }
800
- attributeChangedCallback(t, e, i) {
801
- if (e !== i)
802
- switch (t) {
803
- case "center-content":
804
- case "background-color":
805
- this.$tile.setAttribute(t, this.getAttribute(t) || "");
806
- break;
807
- case "inverted":
808
- h(this, this.$children, this.inverted, [
809
- this.$tile,
810
- this.$switch
811
- ]);
812
- break;
813
- case "name":
814
- case "value":
815
- this.$switch && this.$switch.setAttribute(t, i);
816
- break;
817
- case "disabled":
818
- this.handleDisabledAttributeChange(i !== null);
819
- break;
820
- case "checked":
821
- this.handleCheckedAttributeChange(i);
822
- break;
823
- }
824
- }
825
- handleDisabledAttributeChange(t) {
826
- t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$tile.disabled = !0, this.$switch.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$tile.disabled = !1, this.$switch.removeAttribute("disabled"));
827
- }
828
- handleCheckedAttributeChange(t) {
829
- var e;
830
- (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.checked = !1, this.$switch && this.$switch.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.checked = !0, this.$switch && this.$switch.setAttribute("checked", ""), this.dispatchEvent(
831
- new Event("change", {
832
- bubbles: !0,
833
- composed: !0
834
- // Allow the event to pass through shadow DOM boundaries
835
- })
836
- ));
837
- }
838
- // Form-associated callbacks
839
- static get formAssociated() {
840
- return !0;
841
- }
842
- // Set default behavior when the element is attached to a form
843
- formResetCallback() {
844
- this.checked = !1;
845
- }
846
- formStateRestoreCallback(t) {
847
- this.checked = t;
848
- }
849
- formData() {
850
- if (this.name) {
851
- const t = new FormData(), e = this.getAttribute("name");
852
- return e && (this.checked ? t.set(e, this.$switch.value) : t.delete(e)), t;
853
- }
854
- }
855
- get $tile() {
856
- return this.shadowRoot.querySelector("px-tile");
857
- }
858
- get $el() {
859
- return this.shadowRoot.querySelector(".tile-switch");
860
- }
861
- get $switch() {
862
- return this.shadowRoot.querySelector("px-switch");
863
- }
864
- get $slotPrefix() {
865
- return this.querySelector('[slot="prefix"]');
866
- }
867
- get $children() {
868
- return this.querySelectorAll("px-tile-switch > *");
869
- }
870
- get centerContent() {
871
- return this.hasAttribute("center-content");
872
- }
873
- set centerContent(t) {
874
- t ? this.setAttribute("center-content", "") : this.removeAttribute("center-content");
875
- }
876
- get backgroundColor() {
877
- return this.getAttribute("background-color");
878
- }
879
- set backgroundColor(t) {
880
- t ? this.setAttribute("background-color", t) : this.removeAttribute("background-color");
881
- }
882
- get inverted() {
883
- return this.hasAttribute("inverted");
884
- }
885
- set inverted(t) {
886
- t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
887
- }
888
- get checked() {
889
- return this.hasAttribute("checked");
890
- }
891
- set checked(t) {
892
- t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
893
- }
894
- get name() {
895
- return this.getAttribute("name");
896
- }
897
- set name(t) {
898
- t ? this.setAttribute("name", t) : this.removeAttribute("name");
899
- }
900
- get disabled() {
901
- return this.hasAttribute("disabled");
902
- }
903
- set disabled(t) {
904
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
905
- }
906
- get value() {
907
- return this.getAttribute("value");
908
- }
909
- set value(t) {
910
- t ? this.setAttribute("value", t) : this.removeAttribute("value");
911
- }
912
- }
913
- customElements.get("px-tile-switch") || customElements.define("px-tile-switch", F);
914
- export {
915
- b as Tile,
916
- u as TileButton,
917
- H as TileCheckbox,
918
- f as TileLink,
919
- B as TileRadio,
920
- F as TileSwitch,
921
- L as tileBackgroundColorValues
405
+ customElements.get("px-tile-checkbox") || customElements.define("px-tile-checkbox", w);
406
+ //#endregion
407
+ //#region src/TileRadio.ts
408
+ var T = new CSSStyleSheet();
409
+ T.replaceSync(y);
410
+ var E = class e extends n {
411
+ static {
412
+ this.template = a("<div class=\"tile-radio\"><px-tile hoverable><slot name=\"prefix\" slot=\"prefix\"></slot><px-radio slot=\"suffix\" inert></px-radio><slot name=\"label\" slot=\"label\"></slot><slot name=\"description\" slot=\"description\"></slot></px-tile></div>");
413
+ }
414
+ constructor() {
415
+ super(T), c(this.shadowRoot, e.template), this.internals = this.attachInternals?.();
416
+ }
417
+ connectedCallback() {
418
+ if (this.role = "radio", this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.tabIndex = this.parentElement?.querySelector("px-tile-radio") === this ? 0 : -1, this.$slotPrefix) {
419
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
420
+ e && d(e);
421
+ }
422
+ this.addEventListener("mouseover", () => {
423
+ this.$radio.setAttribute("hover", "");
424
+ }), this.addEventListener("mouseout", () => {
425
+ this.$radio.removeAttribute("hover");
426
+ }), this.addEventListener("keypress", (e) => {
427
+ e.stopPropagation(), e.preventDefault(), e.code === "Space" && this.click();
428
+ }), this.addEventListener("click", (e) => {
429
+ this.checked ||= !0, e.stopPropagation(), e.preventDefault();
430
+ }), this.hasAttribute("checked") && (this.checked = !0);
431
+ }
432
+ static get observedAttributes() {
433
+ return [
434
+ "background-color",
435
+ "inverted",
436
+ "visual",
437
+ "name",
438
+ "value",
439
+ "state",
440
+ "checked",
441
+ "disabled"
442
+ ];
443
+ }
444
+ attributeChangedCallback(e, t, n) {
445
+ if (t !== n) switch (e) {
446
+ case "background-color":
447
+ case "visual":
448
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
449
+ break;
450
+ case "inverted":
451
+ f(this, this.$children, this.inverted, [this.$tile, this.$radio]);
452
+ break;
453
+ case "name":
454
+ case "value":
455
+ this.$radio && this.$radio.setAttribute(e, n);
456
+ break;
457
+ case "state":
458
+ if (this.$radio) {
459
+ if (this.checkName(u, n)) this.$radio.setAttribute("state", n);
460
+ else {
461
+ o(`"${n}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${u.join("\", \"")}".`);
462
+ return;
463
+ }
464
+ }
465
+ break;
466
+ case "disabled":
467
+ this.handleDisabledAttributeChange(n !== null);
468
+ break;
469
+ case "checked": this.handleCheckedAttributeChange(n);
470
+ }
471
+ }
472
+ handleDisabledAttributeChange(e) {
473
+ e ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$tile.disabled = !0, this.$radio.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$tile.disabled = !1, this.$radio.removeAttribute("disabled"));
474
+ }
475
+ handleCheckedAttributeChange(e) {
476
+ this.internals?.setFormValue(this.formData()), e === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.tabIndex = -1, this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.tabIndex = 0, this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(new Event("change", {
477
+ bubbles: !0,
478
+ composed: !0
479
+ })));
480
+ }
481
+ static get formAssociated() {
482
+ return !0;
483
+ }
484
+ formResetCallback() {
485
+ this.checked = !1;
486
+ }
487
+ formStateRestoreCallback(e) {
488
+ this.checked = e;
489
+ }
490
+ formData() {
491
+ let e = new FormData();
492
+ if (this.name) {
493
+ let t = this.getAttribute("name");
494
+ t && (this.checked ? e.set(t, this.$radio.value) : e.delete(t));
495
+ }
496
+ return e;
497
+ }
498
+ get $tile() {
499
+ return this.shadowRoot.querySelector("px-tile");
500
+ }
501
+ get $el() {
502
+ return this.shadowRoot.querySelector(".tile-radio");
503
+ }
504
+ get $radio() {
505
+ return this.shadowRoot.querySelector("px-radio");
506
+ }
507
+ get $slotPrefix() {
508
+ return this.querySelector("[slot=\"prefix\"]");
509
+ }
510
+ get $children() {
511
+ return this.querySelectorAll("px-tile-radio > *");
512
+ }
513
+ get backgroundColor() {
514
+ return this.getAttribute("background-color");
515
+ }
516
+ set backgroundColor(e) {
517
+ s(this, "background-color", e);
518
+ }
519
+ get visual() {
520
+ return this.getAttribute("visual");
521
+ }
522
+ set visual(e) {
523
+ s(this, "visual", e);
524
+ }
525
+ get inverted() {
526
+ return this.hasAttribute("inverted");
527
+ }
528
+ set inverted(e) {
529
+ r(this, "inverted", e);
530
+ }
531
+ get checked() {
532
+ return this.hasAttribute("checked");
533
+ }
534
+ set checked(e) {
535
+ r(this, "checked", e);
536
+ }
537
+ get name() {
538
+ return this.getAttribute("name");
539
+ }
540
+ set name(e) {
541
+ s(this, "name", e);
542
+ }
543
+ get state() {
544
+ return this.getAttribute("state") ?? "";
545
+ }
546
+ set state(e) {
547
+ s(this, "state", e);
548
+ }
549
+ get disabled() {
550
+ return this.hasAttribute("disabled");
551
+ }
552
+ set disabled(e) {
553
+ r(this, "disabled", e);
554
+ }
555
+ get value() {
556
+ return this.getAttribute("value");
557
+ }
558
+ set value(e) {
559
+ s(this, "value", e);
560
+ }
561
+ };
562
+ customElements.get("px-tile-radio") || customElements.define("px-tile-radio", E);
563
+ //#endregion
564
+ //#region src/tile-link.css?inline
565
+ var D = ":host(:not([disabled])):host(:active){padding:0}:host(:not([disabled])):host(:active) .tile-link{border-width:var(--px-size-border-m);border-color:var(--px-color-border-state-active-default)}.tile-link{text-decoration:none}.tile-link px-icon{color:var(--px-color-icon-brand-default)}.tile-link[aria-disabled=true] px-icon{color:var(--px-color-icon-state-disabled-default)}:host([inverted]):host(:not([disabled])):host(:active) .tile-link{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]) .tile-link px-icon{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .tile-link[aria-disabled=true] px-icon{color:var(--px-color-icon-state-disabled-inverted)}", O = new CSSStyleSheet();
566
+ O.replaceSync(D);
567
+ var k = new CSSStyleSheet();
568
+ k.replaceSync(y);
569
+ var A = class t extends e {
570
+ static {
571
+ this.template = a("<a class=\"tile-link\"><px-tile hoverable><slot name=\"prefix\" slot=\"prefix\"></slot><px-icon\n name=\"chevron_right\"\n slot=\"suffix\"\n from=\"lavender\"\n size=\"s\"\n color=\"inherit\"\n ></px-icon><slot name=\"label\" slot=\"label\"></slot><slot name=\"description\" slot=\"description\"></slot></px-tile></a>");
572
+ }
573
+ static {
574
+ this.nativeName = "a";
575
+ }
576
+ constructor() {
577
+ super(k, O), c(this.shadowRoot, t.template);
578
+ }
579
+ connectedCallback() {
580
+ if (this.$slotPrefix) {
581
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
582
+ e && d(e);
583
+ }
584
+ this.backgroundColor ||= "container-default", this.hasAttribute("target") && this.getAttribute("target") === "_blank" && (this.$pxIcon.setAttribute("name", "target_blank"), this.$pxIcon.setAttribute("aria-label", this.targetBlankAriaLabel ? this.targetBlankAriaLabel : "Opens in a new tab"));
585
+ }
586
+ static get observedAttributes() {
587
+ return [
588
+ ...super.observedAttributes,
589
+ "background-color",
590
+ "inverted",
591
+ "disabled",
592
+ "visual",
593
+ "target-blank-aria-label"
594
+ ];
595
+ }
596
+ attributeChangedCallback(e, t, n) {
597
+ if (t !== n) switch (e) {
598
+ case "background-color":
599
+ case "visual":
600
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
601
+ break;
602
+ case "inverted":
603
+ f(this.$tile, this.$children, this.inverted, [this.$pxIcon]);
604
+ break;
605
+ case "disabled":
606
+ p(this.$tile, this.$children, this.disabled, [], {
607
+ ariaEl: this.$el,
608
+ setAria: !0,
609
+ setTabIndex: !0
610
+ });
611
+ break;
612
+ case "target-blank-aria-label":
613
+ this.$pxIcon && this.$pxIcon.setAttribute("aria-label", this.targetBlankAriaLabel || "Opens in a new tab");
614
+ break;
615
+ default: super.attributeChangedCallback(e, t, n);
616
+ }
617
+ }
618
+ get $tile() {
619
+ return this.shadowRoot.querySelector("px-tile");
620
+ }
621
+ get $slotPrefix() {
622
+ return this.querySelector("[slot=\"prefix\"]");
623
+ }
624
+ get $children() {
625
+ return this.querySelectorAll("px-tile-link > *");
626
+ }
627
+ get $pxIcon() {
628
+ return this.shadowRoot.querySelector("px-icon[slot=\"suffix\"]");
629
+ }
630
+ get backgroundColor() {
631
+ return this.getAttribute("background-color");
632
+ }
633
+ set backgroundColor(e) {
634
+ this._updateAttribute("background-color", e);
635
+ }
636
+ get visual() {
637
+ return this.getAttribute("visual");
638
+ }
639
+ set visual(e) {
640
+ this._updateAttribute("visual", e);
641
+ }
642
+ get inverted() {
643
+ return this.hasAttribute("inverted");
644
+ }
645
+ set inverted(e) {
646
+ this._updateBooleanAttribute("inverted", e);
647
+ }
648
+ get disabled() {
649
+ return this.hasAttribute("disabled");
650
+ }
651
+ set disabled(e) {
652
+ this._updateBooleanAttribute("disabled", e);
653
+ }
654
+ get targetBlankAriaLabel() {
655
+ return this.getAttribute("target-blank-aria-label");
656
+ }
657
+ set targetBlankAriaLabel(e) {
658
+ this._updateAttribute("target-blank-aria-label", e);
659
+ }
660
+ };
661
+ customElements.get("px-tile-link") || customElements.define("px-tile-link", A);
662
+ //#endregion
663
+ //#region src/TileSwitch.ts
664
+ var j = new CSSStyleSheet();
665
+ j.replaceSync(y);
666
+ var M = class e extends n {
667
+ static {
668
+ this.template = a("<div class=\"tile-switch\"><px-tile hoverable><slot name=\"prefix\" slot=\"prefix\"></slot><px-switch slot=\"suffix\" inert></px-switch><slot name=\"label\" slot=\"label\"></slot><slot name=\"description\" slot=\"description\"></slot></px-tile></div>");
669
+ }
670
+ constructor() {
671
+ super(j), c(this.shadowRoot, e.template), this.internals = this.attachInternals?.();
672
+ }
673
+ connectedCallback() {
674
+ if (this.tabIndex = 0, this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.$slotPrefix) {
675
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
676
+ e && d(e);
677
+ }
678
+ this.addEventListener("mouseover", () => {
679
+ this.$switch.setAttribute("hover", "");
680
+ }), this.addEventListener("mouseout", () => {
681
+ this.$switch.removeAttribute("hover");
682
+ }), this.addEventListener("keypress", (e) => {
683
+ e.stopPropagation(), e.preventDefault(), e.code === "Space" && this.click();
684
+ }), this.addEventListener("click", (e) => {
685
+ this.checked = !this.checked, e.stopPropagation(), e.preventDefault();
686
+ }), this.hasAttribute("checked") && (this.checked = !0);
687
+ }
688
+ static get observedAttributes() {
689
+ return [
690
+ "background-color",
691
+ "inverted",
692
+ "visual",
693
+ "name",
694
+ "value",
695
+ "checked",
696
+ "disabled"
697
+ ];
698
+ }
699
+ attributeChangedCallback(e, t, n) {
700
+ if (t !== n) switch (e) {
701
+ case "background-color":
702
+ case "visual":
703
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
704
+ break;
705
+ case "inverted":
706
+ f(this, this.$children, this.inverted, [this.$tile, this.$switch]);
707
+ break;
708
+ case "name":
709
+ case "value":
710
+ this.$switch && this.$switch.setAttribute(e, n);
711
+ break;
712
+ case "disabled":
713
+ this.handleDisabledAttributeChange(n !== null);
714
+ break;
715
+ case "checked": this.handleCheckedAttributeChange(n);
716
+ }
717
+ }
718
+ handleDisabledAttributeChange(e) {
719
+ e ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$tile.disabled = !0, this.$switch.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$tile.disabled = !1, this.$switch.removeAttribute("disabled"));
720
+ }
721
+ handleCheckedAttributeChange(e) {
722
+ this.internals?.setFormValue(this.formData()), e === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.checked = !1, this.$switch && this.$switch.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.checked = !0, this.$switch && this.$switch.setAttribute("checked", ""), this.dispatchEvent(new Event("change", {
723
+ bubbles: !0,
724
+ composed: !0
725
+ })));
726
+ }
727
+ static get formAssociated() {
728
+ return !0;
729
+ }
730
+ formResetCallback() {
731
+ this.checked = !1;
732
+ }
733
+ formStateRestoreCallback(e) {
734
+ this.checked = e;
735
+ }
736
+ formData() {
737
+ let e = new FormData();
738
+ if (this.name) {
739
+ let t = this.getAttribute("name");
740
+ t && (this.checked ? e.set(t, this.$switch.value) : e.delete(t));
741
+ }
742
+ return e;
743
+ }
744
+ get $tile() {
745
+ return this.shadowRoot.querySelector("px-tile");
746
+ }
747
+ get $el() {
748
+ return this.shadowRoot.querySelector(".tile-switch");
749
+ }
750
+ get $switch() {
751
+ return this.shadowRoot.querySelector("px-switch");
752
+ }
753
+ get $slotPrefix() {
754
+ return this.querySelector("[slot=\"prefix\"]");
755
+ }
756
+ get $children() {
757
+ return this.querySelectorAll("px-tile-switch > *");
758
+ }
759
+ get backgroundColor() {
760
+ return this.getAttribute("background-color");
761
+ }
762
+ set backgroundColor(e) {
763
+ s(this, "background-color", e);
764
+ }
765
+ get visual() {
766
+ return this.getAttribute("visual");
767
+ }
768
+ set visual(e) {
769
+ s(this, "visual", e);
770
+ }
771
+ get inverted() {
772
+ return this.hasAttribute("inverted");
773
+ }
774
+ set inverted(e) {
775
+ r(this, "inverted", e);
776
+ }
777
+ get checked() {
778
+ return this.hasAttribute("checked");
779
+ }
780
+ set checked(e) {
781
+ r(this, "checked", e);
782
+ }
783
+ get name() {
784
+ return this.getAttribute("name");
785
+ }
786
+ set name(e) {
787
+ s(this, "name", e);
788
+ }
789
+ get disabled() {
790
+ return this.hasAttribute("disabled");
791
+ }
792
+ set disabled(e) {
793
+ r(this, "disabled", e);
794
+ }
795
+ get value() {
796
+ return this.getAttribute("value");
797
+ }
798
+ set value(e) {
799
+ s(this, "value", e);
800
+ }
922
801
  };
802
+ customElements.get("px-tile-switch") || customElements.define("px-tile-switch", M);
803
+ //#endregion
804
+ export { _ as Tile, S as TileButton, w as TileCheckbox, A as TileLink, E as TileRadio, M as TileSwitch, g as tileBackgroundColorValues };