@proximus/lavender-tile 2.0.0-alpha.23 → 2.0.0-alpha.230

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,822 @@
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, nativeAnchorAttributes as s, nativeAnchorMethods as c, nativeAnchorProperties as l, nativeButtonAttributes as u, nativeButtonMethods as d, nativeButtonProperties as f, propertyToAttributeSetter as p, renderTemplate as m } 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 h } from "@proximus/lavender-checkbox";
4
+ import { stateValues as g } from "@proximus/lavender-radio-group";
5
+ //#region src/Common.ts
6
+ function _(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 v(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 y(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 b = ":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)}", x = new CSSStyleSheet();
26
+ x.replaceSync(b);
27
+ var S = [
28
+ "",
29
+ "default",
30
+ "container-light",
31
+ "container-default"
32
+ ], C = 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
+ static {
40
+ this.nativeAttributes = {};
41
+ }
42
+ constructor() {
43
+ super(x), m(this.shadowRoot, e.template);
44
+ }
45
+ connectedCallback() {
46
+ if (super.connectedCallback(), this.$slotPrefix) {
47
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
48
+ e && _(e);
49
+ }
50
+ }
51
+ static get observedAttributes() {
52
+ return [
53
+ ...super.observedAttributes,
54
+ "center-prefix",
55
+ "center-content",
56
+ "background-color",
57
+ "inverted",
58
+ "disabled",
59
+ "visual"
60
+ ];
61
+ }
62
+ attributeChangedCallback(e, t, n) {
63
+ if (super.attributeChangedCallback(e, t, n), t !== n) switch (e) {
64
+ case "center-prefix":
65
+ this.updateCenterPrefix();
66
+ break;
67
+ case "center-content":
68
+ this.updateCenterContent();
69
+ break;
70
+ case "background-color": this.updateBackgroundColor(t, n, S);
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", C);
142
+ //#endregion
143
+ //#region src/tile-button.css?inline
144
+ var w = ":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)}", T = ":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)}", E = new CSSStyleSheet();
145
+ E.replaceSync(w);
146
+ var D = new CSSStyleSheet();
147
+ D.replaceSync(T);
148
+ var O = 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.nativeProperties = f;
157
+ }
158
+ static {
159
+ this.nativeMethods = d;
160
+ }
161
+ static {
162
+ this.nativeAttributes = {
163
+ ...u,
164
+ disabled: []
165
+ };
166
+ }
167
+ constructor() {
168
+ super(D, E), m(this.shadowRoot, t.template);
169
+ }
170
+ connectedCallback() {
171
+ if (this.$slotPrefix) {
172
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
173
+ e && _(e);
174
+ }
175
+ this.backgroundColor ||= "container-default";
176
+ }
177
+ static get observedAttributes() {
178
+ return [
179
+ ...super.observedAttributes,
180
+ "center-prefix",
181
+ "center-content",
182
+ "background-color",
183
+ "inverted",
184
+ "disabled",
185
+ "visual"
186
+ ];
187
+ }
188
+ attributeChangedCallback(e, t, n) {
189
+ if (t !== n) switch (e) {
190
+ case "center-prefix":
191
+ case "center-content":
192
+ this.$tile.setAttribute(e, "");
193
+ break;
194
+ case "background-color":
195
+ case "visual":
196
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
197
+ break;
198
+ case "inverted":
199
+ v(this.$tile, this.$children, this.inverted);
200
+ break;
201
+ case "disabled":
202
+ super.attributeChangedCallback(e, t, n), y(this.$tile, this.$children, this.disabled, [], {
203
+ ariaEl: this.$el,
204
+ setAria: !0,
205
+ setTabIndex: !0
206
+ });
207
+ break;
208
+ default: super.attributeChangedCallback(e, t, n);
209
+ }
210
+ }
211
+ get $tile() {
212
+ return this.shadowRoot.querySelector("px-tile");
213
+ }
214
+ get $slotPrefix() {
215
+ return this.querySelector("[slot=\"prefix\"]");
216
+ }
217
+ get $children() {
218
+ return this.querySelectorAll("px-tile-button > *");
219
+ }
220
+ get centerPrefix() {
221
+ return this.hasAttribute("center-prefix");
222
+ }
223
+ set centerPrefix(e) {
224
+ this._updateBooleanAttribute("center-prefix", e);
225
+ }
226
+ get centerContent() {
227
+ return this.hasAttribute("center-content");
228
+ }
229
+ set centerContent(e) {
230
+ this._updateBooleanAttribute("center-content", e);
231
+ }
232
+ get backgroundColor() {
233
+ return this.getAttribute("background-color");
234
+ }
235
+ set backgroundColor(e) {
236
+ this._updateAttribute("background-color", e);
237
+ }
238
+ get inverted() {
239
+ return this.hasAttribute("inverted");
240
+ }
241
+ set inverted(e) {
242
+ this._updateBooleanAttribute("inverted", e);
243
+ }
244
+ get disabled() {
245
+ return this.hasAttribute("disabled");
246
+ }
247
+ set disabled(e) {
248
+ this._updateBooleanAttribute("disabled", e);
249
+ }
250
+ get visual() {
251
+ return this.getAttribute("visual");
252
+ }
253
+ set visual(e) {
254
+ this._updateAttribute("visual", e);
255
+ }
260
256
  };
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
- }
257
+ customElements.get("px-tile-button") || customElements.define("px-tile-button", O);
258
+ //#endregion
259
+ //#region src/TileCheckbox.ts
260
+ var k = new CSSStyleSheet();
261
+ k.replaceSync(T);
262
+ var A = class e extends n {
263
+ static {
264
+ 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>");
265
+ }
266
+ constructor() {
267
+ super(k), m(this.shadowRoot, e.template), this.internals = this.attachInternals?.();
268
+ }
269
+ connectedCallback() {
270
+ if (this.tabIndex = 0, this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.$slotPrefix) {
271
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
272
+ e && _(e);
273
+ }
274
+ this.addEventListener("mouseover", () => {
275
+ this.$checkbox.setAttribute("hover", "");
276
+ }), this.addEventListener("mouseout", () => {
277
+ this.$checkbox.removeAttribute("hover");
278
+ }), this.addEventListener("keypress", (e) => {
279
+ e.stopPropagation(), e.preventDefault(), e.code === "Space" && this.click();
280
+ }), this.addEventListener("click", (e) => {
281
+ this.checked = !this.checked, e.stopPropagation(), e.preventDefault();
282
+ }), this.hasAttribute("checked") && (this.checked = !0);
283
+ }
284
+ static get observedAttributes() {
285
+ return [
286
+ "background-color",
287
+ "inverted",
288
+ "visual",
289
+ "name",
290
+ "value",
291
+ "state",
292
+ "checked",
293
+ "disabled"
294
+ ];
295
+ }
296
+ attributeChangedCallback(e, t, n) {
297
+ if (t !== n) switch (e) {
298
+ case "background-color":
299
+ case "visual":
300
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
301
+ break;
302
+ case "inverted":
303
+ v(this, this.$children, this.inverted, [this.$tile, this.$checkbox]);
304
+ break;
305
+ case "name":
306
+ case "value":
307
+ this.$checkbox && this.$checkbox.setAttribute(e, n);
308
+ break;
309
+ case "state":
310
+ if (this.$checkbox) {
311
+ if (this.checkName(h, n)) this.$checkbox.setAttribute("state", n);
312
+ else {
313
+ o(`"${n}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${h.join("\", \"")}".`);
314
+ return;
315
+ }
316
+ }
317
+ break;
318
+ case "disabled":
319
+ this.handleDisabledAttributeChange(n !== null);
320
+ break;
321
+ case "checked": this.handleCheckedAttributeChange(n);
322
+ }
323
+ }
324
+ handleDisabledAttributeChange(e) {
325
+ 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"));
326
+ }
327
+ handleCheckedAttributeChange(e) {
328
+ 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", {
329
+ bubbles: !0,
330
+ composed: !0
331
+ })));
332
+ }
333
+ static get formAssociated() {
334
+ return !0;
335
+ }
336
+ formResetCallback() {
337
+ this.checked = !1;
338
+ }
339
+ formStateRestoreCallback(e) {
340
+ this.checked = e;
341
+ }
342
+ formData() {
343
+ let e = new FormData();
344
+ if (this.name) {
345
+ let t = this.getAttribute("name");
346
+ t && (this.checked ? e.set(t, this.value ?? "") : e.delete(t));
347
+ }
348
+ return e;
349
+ }
350
+ get $tile() {
351
+ return this.shadowRoot.querySelector("px-tile");
352
+ }
353
+ get $el() {
354
+ return this.shadowRoot.querySelector(".tile-checkbox");
355
+ }
356
+ get $checkbox() {
357
+ return this.shadowRoot.querySelector("px-checkbox");
358
+ }
359
+ get $slotPrefix() {
360
+ return this.querySelector("[slot=\"prefix\"]");
361
+ }
362
+ get $children() {
363
+ return this.querySelectorAll("px-tile-checkbox > *");
364
+ }
365
+ get backgroundColor() {
366
+ return this.getAttribute("background-color");
367
+ }
368
+ set backgroundColor(e) {
369
+ p(this, "background-color", e);
370
+ }
371
+ get visual() {
372
+ return this.getAttribute("visual");
373
+ }
374
+ set visual(e) {
375
+ p(this, "visual", e);
376
+ }
377
+ get inverted() {
378
+ return this.hasAttribute("inverted");
379
+ }
380
+ set inverted(e) {
381
+ r(this, "inverted", e);
382
+ }
383
+ get checked() {
384
+ return this.hasAttribute("checked");
385
+ }
386
+ set checked(e) {
387
+ r(this, "checked", e);
388
+ }
389
+ get name() {
390
+ return this.getAttribute("name");
391
+ }
392
+ set name(e) {
393
+ p(this, "name", e);
394
+ }
395
+ get state() {
396
+ return this.getAttribute("state");
397
+ }
398
+ set state(e) {
399
+ p(this, "state", e);
400
+ }
401
+ get disabled() {
402
+ return this.hasAttribute("disabled");
403
+ }
404
+ set disabled(e) {
405
+ r(this, "disabled", e);
406
+ }
407
+ get value() {
408
+ return this.getAttribute("value");
409
+ }
410
+ set value(e) {
411
+ p(this, "value", e);
412
+ }
747
413
  };
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
414
+ customElements.get("px-tile-checkbox") || customElements.define("px-tile-checkbox", A);
415
+ //#endregion
416
+ //#region src/TileRadio.ts
417
+ var j = new CSSStyleSheet();
418
+ j.replaceSync(T);
419
+ var M = class e extends n {
420
+ static {
421
+ 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>");
422
+ }
423
+ constructor() {
424
+ super(j), m(this.shadowRoot, e.template), this.internals = this.attachInternals?.();
425
+ }
426
+ connectedCallback() {
427
+ 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) {
428
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
429
+ e && _(e);
430
+ }
431
+ this.addEventListener("mouseover", () => {
432
+ this.$radio.setAttribute("hover", "");
433
+ }), this.addEventListener("mouseout", () => {
434
+ this.$radio.removeAttribute("hover");
435
+ }), this.addEventListener("keypress", (e) => {
436
+ e.stopPropagation(), e.preventDefault(), e.code === "Space" && this.click();
437
+ }), this.addEventListener("click", (e) => {
438
+ this.checked ||= !0, e.stopPropagation(), e.preventDefault();
439
+ }), this.hasAttribute("checked") && (this.checked = !0);
440
+ }
441
+ static get observedAttributes() {
442
+ return [
443
+ "background-color",
444
+ "inverted",
445
+ "visual",
446
+ "name",
447
+ "value",
448
+ "state",
449
+ "checked",
450
+ "disabled"
451
+ ];
452
+ }
453
+ attributeChangedCallback(e, t, n) {
454
+ if (t !== n) switch (e) {
455
+ case "background-color":
456
+ case "visual":
457
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
458
+ break;
459
+ case "inverted":
460
+ v(this, this.$children, this.inverted, [this.$tile, this.$radio]);
461
+ break;
462
+ case "name":
463
+ case "value":
464
+ this.$radio && this.$radio.setAttribute(e, n);
465
+ break;
466
+ case "state":
467
+ if (this.$radio) {
468
+ if (this.checkName(g, n)) this.$radio.setAttribute("state", n);
469
+ else {
470
+ o(`"${n}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${g.join("\", \"")}".`);
471
+ return;
472
+ }
473
+ }
474
+ break;
475
+ case "disabled":
476
+ this.handleDisabledAttributeChange(n !== null);
477
+ break;
478
+ case "checked": this.handleCheckedAttributeChange(n);
479
+ }
480
+ }
481
+ handleDisabledAttributeChange(e) {
482
+ 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"));
483
+ }
484
+ handleCheckedAttributeChange(e) {
485
+ 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", {
486
+ bubbles: !0,
487
+ composed: !0
488
+ })));
489
+ }
490
+ static get formAssociated() {
491
+ return !0;
492
+ }
493
+ formResetCallback() {
494
+ this.checked = !1;
495
+ }
496
+ formStateRestoreCallback(e) {
497
+ this.checked = e;
498
+ }
499
+ formData() {
500
+ let e = new FormData();
501
+ if (this.name) {
502
+ let t = this.getAttribute("name");
503
+ t && (this.checked ? e.set(t, this.$radio.value) : e.delete(t));
504
+ }
505
+ return e;
506
+ }
507
+ get $tile() {
508
+ return this.shadowRoot.querySelector("px-tile");
509
+ }
510
+ get $el() {
511
+ return this.shadowRoot.querySelector(".tile-radio");
512
+ }
513
+ get $radio() {
514
+ return this.shadowRoot.querySelector("px-radio");
515
+ }
516
+ get $slotPrefix() {
517
+ return this.querySelector("[slot=\"prefix\"]");
518
+ }
519
+ get $children() {
520
+ return this.querySelectorAll("px-tile-radio > *");
521
+ }
522
+ get backgroundColor() {
523
+ return this.getAttribute("background-color");
524
+ }
525
+ set backgroundColor(e) {
526
+ p(this, "background-color", e);
527
+ }
528
+ get visual() {
529
+ return this.getAttribute("visual");
530
+ }
531
+ set visual(e) {
532
+ p(this, "visual", e);
533
+ }
534
+ get inverted() {
535
+ return this.hasAttribute("inverted");
536
+ }
537
+ set inverted(e) {
538
+ r(this, "inverted", e);
539
+ }
540
+ get checked() {
541
+ return this.hasAttribute("checked");
542
+ }
543
+ set checked(e) {
544
+ r(this, "checked", e);
545
+ }
546
+ get name() {
547
+ return this.getAttribute("name");
548
+ }
549
+ set name(e) {
550
+ p(this, "name", e);
551
+ }
552
+ get state() {
553
+ return this.getAttribute("state") ?? "";
554
+ }
555
+ set state(e) {
556
+ p(this, "state", e);
557
+ }
558
+ get disabled() {
559
+ return this.hasAttribute("disabled");
560
+ }
561
+ set disabled(e) {
562
+ r(this, "disabled", e);
563
+ }
564
+ get value() {
565
+ return this.getAttribute("value");
566
+ }
567
+ set value(e) {
568
+ p(this, "value", e);
569
+ }
570
+ };
571
+ customElements.get("px-tile-radio") || customElements.define("px-tile-radio", M);
572
+ //#endregion
573
+ //#region src/tile-link.css?inline
574
+ var N = ":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)}", P = new CSSStyleSheet();
575
+ P.replaceSync(N);
576
+ var F = new CSSStyleSheet();
577
+ F.replaceSync(T);
578
+ var I = class t extends e {
579
+ static {
580
+ 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>");
581
+ }
582
+ static {
583
+ this.nativeName = "a";
584
+ }
585
+ static {
586
+ this.nativeProperties = l;
587
+ }
588
+ static {
589
+ this.nativeMethods = c;
590
+ }
591
+ static {
592
+ this.nativeAttributes = s;
593
+ }
594
+ constructor() {
595
+ super(F, P), m(this.shadowRoot, t.template);
596
+ }
597
+ connectedCallback() {
598
+ if (this.$slotPrefix) {
599
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
600
+ e && _(e);
601
+ }
602
+ 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"));
603
+ }
604
+ static get observedAttributes() {
605
+ return [
606
+ ...super.observedAttributes,
607
+ "background-color",
608
+ "inverted",
609
+ "disabled",
610
+ "visual",
611
+ "target-blank-aria-label"
612
+ ];
613
+ }
614
+ attributeChangedCallback(e, t, n) {
615
+ if (t !== n) switch (e) {
616
+ case "background-color":
617
+ case "visual":
618
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
619
+ break;
620
+ case "inverted":
621
+ v(this.$tile, this.$children, this.inverted, [this.$pxIcon]);
622
+ break;
623
+ case "disabled":
624
+ y(this.$tile, this.$children, this.disabled, [], {
625
+ ariaEl: this.$el,
626
+ setAria: !0,
627
+ setTabIndex: !0
628
+ });
629
+ break;
630
+ case "target-blank-aria-label":
631
+ this.$pxIcon && this.$pxIcon.setAttribute("aria-label", this.targetBlankAriaLabel || "Opens in a new tab");
632
+ break;
633
+ default: super.attributeChangedCallback(e, t, n);
634
+ }
635
+ }
636
+ get $tile() {
637
+ return this.shadowRoot.querySelector("px-tile");
638
+ }
639
+ get $slotPrefix() {
640
+ return this.querySelector("[slot=\"prefix\"]");
641
+ }
642
+ get $children() {
643
+ return this.querySelectorAll("px-tile-link > *");
644
+ }
645
+ get $pxIcon() {
646
+ return this.shadowRoot.querySelector("px-icon[slot=\"suffix\"]");
647
+ }
648
+ get backgroundColor() {
649
+ return this.getAttribute("background-color");
650
+ }
651
+ set backgroundColor(e) {
652
+ this._updateAttribute("background-color", e);
653
+ }
654
+ get visual() {
655
+ return this.getAttribute("visual");
656
+ }
657
+ set visual(e) {
658
+ this._updateAttribute("visual", e);
659
+ }
660
+ get inverted() {
661
+ return this.hasAttribute("inverted");
662
+ }
663
+ set inverted(e) {
664
+ this._updateBooleanAttribute("inverted", e);
665
+ }
666
+ get disabled() {
667
+ return this.hasAttribute("disabled");
668
+ }
669
+ set disabled(e) {
670
+ this._updateBooleanAttribute("disabled", e);
671
+ }
672
+ get targetBlankAriaLabel() {
673
+ return this.getAttribute("target-blank-aria-label");
674
+ }
675
+ set targetBlankAriaLabel(e) {
676
+ this._updateAttribute("target-blank-aria-label", e);
677
+ }
678
+ };
679
+ customElements.get("px-tile-link") || customElements.define("px-tile-link", I);
680
+ //#endregion
681
+ //#region src/TileSwitch.ts
682
+ var L = new CSSStyleSheet();
683
+ L.replaceSync(T);
684
+ var R = class e extends n {
685
+ static {
686
+ 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>");
687
+ }
688
+ constructor() {
689
+ super(L), m(this.shadowRoot, e.template), this.internals = this.attachInternals?.();
690
+ }
691
+ connectedCallback() {
692
+ if (this.tabIndex = 0, this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.$slotPrefix) {
693
+ let e = this.querySelector("px-img[slot=\"prefix\"]");
694
+ e && _(e);
695
+ }
696
+ this.addEventListener("mouseover", () => {
697
+ this.$switch.setAttribute("hover", "");
698
+ }), this.addEventListener("mouseout", () => {
699
+ this.$switch.removeAttribute("hover");
700
+ }), this.addEventListener("keypress", (e) => {
701
+ e.stopPropagation(), e.preventDefault(), e.code === "Space" && this.click();
702
+ }), this.addEventListener("click", (e) => {
703
+ this.checked = !this.checked, e.stopPropagation(), e.preventDefault();
704
+ }), this.hasAttribute("checked") && (this.checked = !0);
705
+ }
706
+ static get observedAttributes() {
707
+ return [
708
+ "background-color",
709
+ "inverted",
710
+ "visual",
711
+ "name",
712
+ "value",
713
+ "checked",
714
+ "disabled"
715
+ ];
716
+ }
717
+ attributeChangedCallback(e, t, n) {
718
+ if (t !== n) switch (e) {
719
+ case "background-color":
720
+ case "visual":
721
+ this.$tile.setAttribute(e, this.getAttribute(e) || "");
722
+ break;
723
+ case "inverted":
724
+ v(this, this.$children, this.inverted, [this.$tile, this.$switch]);
725
+ break;
726
+ case "name":
727
+ case "value":
728
+ this.$switch && this.$switch.setAttribute(e, n);
729
+ break;
730
+ case "disabled":
731
+ this.handleDisabledAttributeChange(n !== null);
732
+ break;
733
+ case "checked": this.handleCheckedAttributeChange(n);
734
+ }
735
+ }
736
+ handleDisabledAttributeChange(e) {
737
+ 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"));
738
+ }
739
+ handleCheckedAttributeChange(e) {
740
+ 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", {
741
+ bubbles: !0,
742
+ composed: !0
743
+ })));
744
+ }
745
+ static get formAssociated() {
746
+ return !0;
747
+ }
748
+ formResetCallback() {
749
+ this.checked = !1;
750
+ }
751
+ formStateRestoreCallback(e) {
752
+ this.checked = e;
753
+ }
754
+ formData() {
755
+ let e = new FormData();
756
+ if (this.name) {
757
+ let t = this.getAttribute("name");
758
+ t && (this.checked ? e.set(t, this.$switch.value) : e.delete(t));
759
+ }
760
+ return e;
761
+ }
762
+ get $tile() {
763
+ return this.shadowRoot.querySelector("px-tile");
764
+ }
765
+ get $el() {
766
+ return this.shadowRoot.querySelector(".tile-switch");
767
+ }
768
+ get $switch() {
769
+ return this.shadowRoot.querySelector("px-switch");
770
+ }
771
+ get $slotPrefix() {
772
+ return this.querySelector("[slot=\"prefix\"]");
773
+ }
774
+ get $children() {
775
+ return this.querySelectorAll("px-tile-switch > *");
776
+ }
777
+ get backgroundColor() {
778
+ return this.getAttribute("background-color");
779
+ }
780
+ set backgroundColor(e) {
781
+ p(this, "background-color", e);
782
+ }
783
+ get visual() {
784
+ return this.getAttribute("visual");
785
+ }
786
+ set visual(e) {
787
+ p(this, "visual", e);
788
+ }
789
+ get inverted() {
790
+ return this.hasAttribute("inverted");
791
+ }
792
+ set inverted(e) {
793
+ r(this, "inverted", e);
794
+ }
795
+ get checked() {
796
+ return this.hasAttribute("checked");
797
+ }
798
+ set checked(e) {
799
+ r(this, "checked", e);
800
+ }
801
+ get name() {
802
+ return this.getAttribute("name");
803
+ }
804
+ set name(e) {
805
+ p(this, "name", e);
806
+ }
807
+ get disabled() {
808
+ return this.hasAttribute("disabled");
809
+ }
810
+ set disabled(e) {
811
+ r(this, "disabled", e);
812
+ }
813
+ get value() {
814
+ return this.getAttribute("value");
815
+ }
816
+ set value(e) {
817
+ p(this, "value", e);
818
+ }
922
819
  };
820
+ customElements.get("px-tile-switch") || customElements.define("px-tile-switch", R);
821
+ //#endregion
822
+ export { C as Tile, O as TileButton, A as TileCheckbox, I as TileLink, M as TileRadio, R as TileSwitch, S as tileBackgroundColorValues };