@proximus/lavender-tile 2.0.0-alpha.2 → 2.0.0-alpha.200

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