@proximus/lavender-tile 2.0.0-alpha.17 → 2.0.0-alpha.170

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