@muibook/components 2.0.0 → 3.0.0
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/esm/agent/keywords/index.js +104 -4
- package/dist/esm/agent/prompts/index.js +392 -37
- package/dist/esm/components/mui-accordion/block/index.js +2 -6
- package/dist/esm/components/mui-accordion/group/index.js +1 -1
- package/dist/esm/components/mui-accordion/inline/index.js +2 -6
- package/dist/esm/components/mui-addon/index.js +1 -1
- package/dist/esm/components/mui-alert/index.js +10 -5
- package/dist/esm/components/mui-badge/index.js +4 -4
- package/dist/esm/components/mui-body/index.js +4 -4
- package/dist/esm/components/mui-button/index.js +5 -7
- package/dist/esm/components/mui-button-group/index.js +1 -1
- package/dist/esm/components/mui-card/body/index.js +22 -18
- package/dist/esm/components/mui-card/card/index.js +1 -1
- package/dist/esm/components/mui-card/footer/index.js +1 -1
- package/dist/esm/components/mui-card/header/index.js +1 -1
- package/dist/esm/components/mui-carousel/controller/index.js +1 -1
- package/dist/esm/components/mui-carousel/panel/index.js +2 -2
- package/dist/esm/components/mui-code/index.js +9 -6
- package/dist/esm/components/mui-container/index.js +1 -1
- package/dist/esm/components/mui-field/index.js +10 -7
- package/dist/esm/components/mui-file-upload/index.js +5 -4
- package/dist/esm/components/mui-grid/index.js +1 -1
- package/dist/esm/components/mui-heading/index.js +1 -1
- package/dist/esm/components/mui-icons/accessibility/index.js +4 -4
- package/dist/esm/components/mui-icons/add/index.js +5 -5
- package/dist/esm/components/mui-icons/attention/index.js +5 -5
- package/dist/esm/components/mui-icons/check/index.js +6 -6
- package/dist/esm/components/mui-icons/close/index.js +2 -2
- package/dist/esm/components/mui-icons/down-arrow-circle/index.js +55 -0
- package/dist/esm/components/mui-icons/down-chevron/index.js +2 -2
- package/dist/esm/components/mui-icons/ellipsis/index.js +55 -0
- package/dist/esm/components/mui-icons/globe/index.js +5 -5
- package/dist/esm/components/mui-icons/grid/index.js +1 -1
- package/dist/esm/components/mui-icons/index.js +2 -0
- package/dist/esm/components/mui-icons/info/index.js +2 -2
- package/dist/esm/components/mui-icons/left-arrow/index.js +1 -1
- package/dist/esm/components/mui-icons/left-chevron/index.js +1 -1
- package/dist/esm/components/mui-icons/left-sidebar/index.js +6 -6
- package/dist/esm/components/mui-icons/menu/index.js +6 -6
- package/dist/esm/components/mui-icons/message/index.js +6 -6
- package/dist/esm/components/mui-icons/moon/index.js +2 -2
- package/dist/esm/components/mui-icons/notification/index.js +2 -2
- package/dist/esm/components/mui-icons/right-chevron/index.js +5 -5
- package/dist/esm/components/mui-icons/stop/index.js +2 -2
- package/dist/esm/components/mui-icons/subtract/index.js +7 -7
- package/dist/esm/components/mui-icons/sun/index.js +6 -6
- package/dist/esm/components/mui-icons/toggle/index.js +1 -1
- package/dist/esm/components/mui-icons/up-arrow/index.js +4 -4
- package/dist/esm/components/mui-icons/up-chevron/index.js +1 -1
- package/dist/esm/components/mui-icons/warning/index.js +2 -2
- package/dist/esm/components/mui-image/index.js +1 -1
- package/dist/esm/components/mui-input/index.js +21 -27
- package/dist/esm/components/mui-link/index.js +13 -17
- package/dist/esm/components/mui-list/item/index.js +1 -1
- package/dist/esm/components/mui-list/list/index.js +1 -1
- package/dist/esm/components/mui-message/index.js +14 -9
- package/dist/esm/components/mui-quote/index.js +1 -1
- package/dist/esm/components/mui-responsive/index.js +1 -1
- package/dist/esm/components/mui-rule/index.js +5 -5
- package/dist/esm/components/mui-select/index.js +28 -27
- package/dist/esm/components/mui-slat/accessory/index.js +29 -0
- package/dist/esm/components/mui-slat/index.js +2 -21
- package/dist/esm/components/mui-slat/slat/index.js +139 -0
- package/dist/esm/components/mui-smart-card/index.js +14 -15
- package/dist/esm/components/mui-stack/hstack/index.js +1 -1
- package/dist/esm/components/mui-stack/vstack/index.js +1 -1
- package/dist/esm/components/mui-switch/index.js +3 -9
- package/dist/esm/components/mui-table/cell/index.js +1 -1
- package/dist/esm/components/mui-table/row/index.js +1 -1
- package/dist/esm/components/mui-table/row-group/index.js +1 -1
- package/dist/esm/components/mui-table/table/index.js +1 -1
- package/dist/esm/components/mui-tabs/controller/index.js +1 -1
- package/dist/esm/components/mui-tabs/item/index.js +2 -2
- package/dist/esm/components/mui-tabs/panel/index.js +1 -1
- package/dist/esm/components/mui-tabs/tab-bar/index.js +1 -1
- package/dist/esm/css/mui-tokens.css +19 -1
- package/dist/esm/index.js +8 -5
- package/dist/types/components/mui-accordion/block/index.d.ts +1 -1
- package/dist/types/components/mui-accordion/inline/index.d.ts +1 -1
- package/dist/types/components/mui-alert/index.d.ts +5 -1
- package/dist/types/components/mui-field/index.d.ts +3 -1
- package/dist/types/components/mui-file-upload/index.d.ts +1 -1
- package/dist/types/components/mui-icons/down-arrow-circle.d.ts +1 -0
- package/dist/types/components/mui-icons/ellipsis.d.ts +1 -0
- package/dist/types/components/mui-icons/index.d.ts +2 -0
- package/dist/types/components/mui-message/index.d.ts +6 -1
- package/dist/types/components/mui-select/index.d.ts +1 -1
- package/dist/types/components/mui-slat/accessory/index.d.ts +1 -0
- package/dist/types/components/mui-slat/index.d.ts +2 -1
- package/dist/types/components/mui-slat/slat/index.d.ts +3 -0
- package/dist/types/components/mui-smart-card/index.d.ts +2 -1
- package/dist/types/index.d.ts +4 -1
- package/package.json +17 -1
- package/readme.md +19 -0
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import "../mui-stack/hstack/index.js";
|
|
2
|
+
import "../mui-stack/vstack/index.js";
|
|
3
|
+
import "../mui-icons/message/index.js";
|
|
4
|
+
import "../mui-icons/check/index.js";
|
|
5
|
+
import "../mui-icons/info/index.js";
|
|
6
|
+
import "../mui-icons/warning/index.js";
|
|
7
|
+
import "../mui-icons/attention/index.js";
|
|
8
|
+
const l = ["neutral", "positive", "info", "warning", "attention"], g = {
|
|
2
9
|
neutral: "background-color: var(--feedback-neutral-background); border: var(--feedback-neutral-border);",
|
|
3
10
|
positive: "background-color: var(--feedback-positive-background); border: var(--feedback-positive-border);",
|
|
4
11
|
info: "background-color: var(--feedback-info-background); border: var(--feedback-info-border);",
|
|
5
12
|
warning: "background-color: var(--feedback-warning-background); border: var(--feedback-warning-border);",
|
|
6
13
|
attention: "background-color: var(--feedback-attention-background); border: var(--feedback-attention-border);"
|
|
7
|
-
},
|
|
14
|
+
}, b = {
|
|
8
15
|
neutral: "polite",
|
|
9
16
|
positive: "polite",
|
|
10
17
|
info: "polite",
|
|
@@ -35,12 +42,12 @@ const l = ["neutral", "positive", "info", "warning", "attention"], b = {
|
|
|
35
42
|
warning: "mui-icon-warning",
|
|
36
43
|
attention: "mui-icon-attention"
|
|
37
44
|
};
|
|
38
|
-
class
|
|
45
|
+
class m extends HTMLElement {
|
|
39
46
|
constructor() {
|
|
40
47
|
super(), this.attachShadow({ mode: "open" });
|
|
41
48
|
}
|
|
42
49
|
connectedCallback() {
|
|
43
|
-
const
|
|
50
|
+
const t = this.getAttribute("variant") || "neutral", e = l.includes(t) ? t : "neutral", a = this.getAttribute("heading") || "Heading...", o = this.getAttribute("icon") || k[e], n = v[e], i = f[e], r = g[e], s = b[e], c = u[e], d = (
|
|
44
51
|
/*css*/
|
|
45
52
|
`
|
|
46
53
|
:host {
|
|
@@ -77,14 +84,12 @@ class p extends HTMLElement {
|
|
|
77
84
|
<${o} color="var(${n})"></${o}>
|
|
78
85
|
</div>
|
|
79
86
|
<mui-v-stack space="var(--message-gap-vertical)">
|
|
80
|
-
<div class="heading" id="message-heading">${
|
|
81
|
-
<slot>
|
|
82
|
-
<mui-body>Body content...</mui-body>
|
|
83
|
-
</slot>
|
|
87
|
+
<div class="heading" id="message-heading">${a}</div>
|
|
88
|
+
<slot></slot>
|
|
84
89
|
</mui-v-stack>
|
|
85
90
|
</mui-h-stack>
|
|
86
91
|
</section>
|
|
87
92
|
`);
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
|
-
customElements.define("mui-message",
|
|
95
|
+
customElements.get("mui-message") || customElements.define("mui-message", m);
|
|
@@ -5,9 +5,9 @@ class r extends HTMLElement {
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
const i = this.attachShadow({ mode: "open" });
|
|
8
|
-
let
|
|
9
|
-
this.setAttribute("role", "presentation"), this.setAttribute("direction", this.getAttribute("direction") ||
|
|
10
|
-
const
|
|
8
|
+
let s = "horizontal", t = "100%", e = "1px";
|
|
9
|
+
this.setAttribute("role", "presentation"), this.setAttribute("direction", this.getAttribute("direction") || s), this.setAttribute("length", this.getAttribute("length") || t), this.setAttribute("weight", this.getAttribute("weight") || e);
|
|
10
|
+
const h = (
|
|
11
11
|
/*css*/
|
|
12
12
|
`
|
|
13
13
|
:host {
|
|
@@ -25,8 +25,8 @@ class r extends HTMLElement {
|
|
|
25
25
|
`
|
|
26
26
|
);
|
|
27
27
|
i.innerHTML = `
|
|
28
|
-
<style>${
|
|
28
|
+
<style>${h}</style>
|
|
29
29
|
`;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
customElements.define("mui-rule", r);
|
|
32
|
+
customElements.get("mui-rule") || customElements.define("mui-rule", r);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { getPartMap as
|
|
2
|
-
|
|
1
|
+
import { getPartMap as s } from "../../utils/part-map/index.js";
|
|
2
|
+
import "../mui-icons/down-chevron/index.js";
|
|
3
|
+
class p extends HTMLElement {
|
|
3
4
|
constructor() {
|
|
4
5
|
super(), this.partMap = "", this.attachShadow({ mode: "open" });
|
|
5
6
|
}
|
|
@@ -7,23 +8,23 @@ class f extends HTMLElement {
|
|
|
7
8
|
return ["name", "value", "id", "label", "options", "disabled", "hide-label", "variant"];
|
|
8
9
|
}
|
|
9
10
|
async connectedCallback() {
|
|
10
|
-
await this.waitForPartMap(), this.partMap =
|
|
11
|
+
await this.waitForPartMap(), this.partMap = s("text", "visual"), this.render(), this.setupListener();
|
|
11
12
|
}
|
|
12
|
-
attributeChangedCallback(e,
|
|
13
|
+
attributeChangedCallback(e, r) {
|
|
13
14
|
if (!this.shadowRoot) return;
|
|
14
|
-
const
|
|
15
|
+
const o = (
|
|
15
16
|
/** @type {HTMLSelectElement | null} */
|
|
16
17
|
this.shadowRoot.querySelector("select")
|
|
17
18
|
);
|
|
18
|
-
e === "value" &&
|
|
19
|
+
e === "value" && o && (o.value = r || ""), e === "disabled" && o && (r === null || r === "false" ? o.removeAttribute("disabled") : o.setAttribute("disabled", "")), ["options", "label", "hide-label"].includes(e) && (this.render(), this.setupListener());
|
|
19
20
|
}
|
|
20
21
|
setupListener() {
|
|
21
22
|
if (!this.shadowRoot) return;
|
|
22
23
|
const e = this.shadowRoot.querySelector("select");
|
|
23
24
|
if (e) {
|
|
24
|
-
const
|
|
25
|
-
e.parentNode && e.parentNode.replaceChild(
|
|
26
|
-
const a =
|
|
25
|
+
const r = e.cloneNode(!0);
|
|
26
|
+
e.parentNode && e.parentNode.replaceChild(r, e), r.addEventListener("change", (o) => {
|
|
27
|
+
const a = o.target;
|
|
27
28
|
a && this.dispatchEvent(
|
|
28
29
|
new CustomEvent("change", {
|
|
29
30
|
detail: { value: a.value },
|
|
@@ -36,20 +37,14 @@ class f extends HTMLElement {
|
|
|
36
37
|
}
|
|
37
38
|
render() {
|
|
38
39
|
if (!this.shadowRoot) return;
|
|
39
|
-
const e = this.getAttribute("name") || "",
|
|
40
|
-
s && !r && console.warn(
|
|
41
|
-
"mui-select Accessibility warning: When using 'hide-label', please provide a 'label' attribute so an 'aria-label' can be generated for screen reader support."
|
|
42
|
-
), !r && !b && console.warn(
|
|
43
|
-
"mui-select Accessibility warning: A 'label' or 'aria-label' attribute is required for screen reader accessibility."
|
|
44
|
-
);
|
|
45
|
-
const u = s && r ? `aria-label="${r}"` : "";
|
|
40
|
+
const e = this.getAttribute("name") || "", r = this.getAttribute("id") || `mui-select-${Math.random().toString(36).substr(2, 9)}`, o = this.getAttribute("label") || "", a = this.getAttribute("value") || "", i = this.hasAttribute("hide-label"), c = this.hasAttribute("disabled"), d = this.getAttribute("options") || "[]", l = this.getAttribute("variant") || "", h = l || "", b = i && o ? `aria-label="${o}"` : "";
|
|
46
41
|
let n = [];
|
|
47
42
|
try {
|
|
48
43
|
n = JSON.parse(d);
|
|
49
44
|
} catch (t) {
|
|
50
45
|
console.error("Invalid JSON in options attribute", t);
|
|
51
46
|
}
|
|
52
|
-
const
|
|
47
|
+
const u = n.map((t) => `<option value="${t.value}" ${t.value === a ? "selected" : ""}>${t.label}</option>`).join(""), v = (
|
|
53
48
|
/*html*/
|
|
54
49
|
`
|
|
55
50
|
<style>
|
|
@@ -143,6 +138,12 @@ class f extends HTMLElement {
|
|
|
143
138
|
pointer-events: none;
|
|
144
139
|
}
|
|
145
140
|
|
|
141
|
+
select:disabled + .chevron {
|
|
142
|
+
background: transparent;
|
|
143
|
+
box-shadow: none;
|
|
144
|
+
opacity: 0.4;
|
|
145
|
+
}
|
|
146
|
+
|
|
146
147
|
/* ========================================================================== */
|
|
147
148
|
/* STYLE ADJUSTMENTS WHEN SELECT IS SLOTTED WITHIN INPUT */
|
|
148
149
|
/* Related styles unique to this usage is found in the mui-input/index.js */
|
|
@@ -178,29 +179,29 @@ class f extends HTMLElement {
|
|
|
178
179
|
/* ========================================================================== */
|
|
179
180
|
|
|
180
181
|
</style>
|
|
181
|
-
${
|
|
182
|
+
${o ? (
|
|
182
183
|
/*html*/
|
|
183
|
-
`<label for="${
|
|
184
|
+
`<label for="${r}" class="${i ? "vh" : ""}">${o}</label>`
|
|
184
185
|
) : ""}
|
|
185
186
|
<div style="position: relative;">
|
|
186
|
-
<select class="${h}" part="${this.partMap || ""}" name="${e}" id="${
|
|
187
|
+
<select class="${h}" part="${this.partMap || ""}" name="${e}" id="${r}" ${b}
|
|
187
188
|
${c ? "disabled" : ""}>
|
|
188
|
-
${
|
|
189
|
+
${u}
|
|
189
190
|
</select>
|
|
190
191
|
<mui-icon-down-chevron class="chevron" size="x-small"></mui-icon-down-chevron>
|
|
191
192
|
</div>
|
|
192
193
|
`
|
|
193
194
|
);
|
|
194
|
-
this.shadowRoot.innerHTML =
|
|
195
|
+
this.shadowRoot.innerHTML = v;
|
|
195
196
|
}
|
|
196
197
|
waitForPartMap() {
|
|
197
198
|
return new Promise((e) => {
|
|
198
|
-
if (typeof
|
|
199
|
-
const
|
|
200
|
-
typeof
|
|
199
|
+
if (typeof s == "function") return e();
|
|
200
|
+
const r = () => {
|
|
201
|
+
typeof s == "function" ? e() : requestAnimationFrame(r);
|
|
201
202
|
};
|
|
202
|
-
|
|
203
|
+
r();
|
|
203
204
|
});
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
|
-
customElements.define("mui-select",
|
|
207
|
+
customElements.get("mui-select") || customElements.define("mui-select", p);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class e extends HTMLElement {
|
|
2
|
+
constructor() {
|
|
3
|
+
super(), this.attachShadow({ mode: "open" });
|
|
4
|
+
}
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
this.render();
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
const s = (
|
|
10
|
+
/*css*/
|
|
11
|
+
`
|
|
12
|
+
:host {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
background: var(--slat-accessory-background);
|
|
17
|
+
padding: var(--space-200);
|
|
18
|
+
border-radius: var(--radius-400);
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
);
|
|
22
|
+
this.shadowRoot.innerHTML = /*html*/
|
|
23
|
+
`
|
|
24
|
+
<style>${s}</style>
|
|
25
|
+
<slot></slot>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
customElements.get("mui-slat-accessory") || customElements.define("mui-slat-accessory", e);
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
super(), this.attachShadow({ mode: "open" });
|
|
4
|
-
}
|
|
5
|
-
connectedCallback() {
|
|
6
|
-
this.setAttribute("role", "table"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
7
|
-
`
|
|
8
|
-
<style>
|
|
9
|
-
:host {
|
|
10
|
-
display: grid;
|
|
11
|
-
grid-template-columns: 1fr 1fr;
|
|
12
|
-
gap: var(--space-500);
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
}
|
|
15
|
-
</style>
|
|
16
|
-
<slot name="start"></slot>
|
|
17
|
-
<slot name="end"></slot>
|
|
18
|
-
`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
customElements.define("mui-slat", t);
|
|
1
|
+
import "./slat/index.js";
|
|
2
|
+
import "./accessory/index.js";
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import "../../mui-button/index.js";
|
|
2
|
+
import "../../mui-icons/right-chevron/index.js";
|
|
3
|
+
import "../../mui-stack/hstack/index.js";
|
|
4
|
+
import "../../mui-stack/vstack/index.js";
|
|
5
|
+
class i extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(), this.variant = "", this.attachShadow({ mode: "open" });
|
|
8
|
+
}
|
|
9
|
+
static get observedAttributes() {
|
|
10
|
+
return ["variant", "col", "space"];
|
|
11
|
+
}
|
|
12
|
+
attributeChangedCallback(t, a, r) {
|
|
13
|
+
t === "variant" && (this.variant = r), this.render();
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.variant = this.getAttribute("variant") || "", this.setAttribute("role", "row"), this.render();
|
|
17
|
+
}
|
|
18
|
+
applyCellRoles() {
|
|
19
|
+
var a;
|
|
20
|
+
const t = (a = this.shadowRoot) == null ? void 0 : a.querySelectorAll("slot");
|
|
21
|
+
t == null || t.forEach((r) => {
|
|
22
|
+
r.assignedElements({ flatten: !0 }).forEach((s) => {
|
|
23
|
+
s.setAttribute("role", "cell");
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
hasAccessorySlot() {
|
|
28
|
+
return this.querySelector('[slot="accessory"]') !== null;
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const t = this.variant === "action", a = this.getAttribute("col") || "1fr 1fr", r = this.getAttribute("space") || "var(--space-500)", e = this.hasAccessorySlot(), s = (
|
|
32
|
+
/*css*/
|
|
33
|
+
`
|
|
34
|
+
:host {
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-columns: ${a};
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: ${r};
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([variant="row"]) {
|
|
43
|
+
padding: var(--space-300) var(--space-400);
|
|
44
|
+
background: var(--slat-background);
|
|
45
|
+
border-radius: var(--slat-radius);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([variant="header"]) {
|
|
49
|
+
padding: var(--space-200) var(--space-400);
|
|
50
|
+
padding-top: var(--space-400);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([variant="action"]) {
|
|
54
|
+
display: grid;
|
|
55
|
+
grid-template-columns: 1fr;
|
|
56
|
+
align-items: center;
|
|
57
|
+
width: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.action::part(text-align) {
|
|
61
|
+
text-align: left;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.action:focus {
|
|
65
|
+
z-index: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.action::part(padding) {
|
|
69
|
+
padding: var(--space-300) var(--space-400);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.action::part(border) {
|
|
73
|
+
border: var(--space-000);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.action::part(background) {
|
|
77
|
+
background: var(--slat-background);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.action:hover::part(background) {
|
|
81
|
+
background: var(--slat-background-hover);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.action::part(border-radius) {
|
|
85
|
+
border-radius: var(--slat-radius);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.end {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: var(--space-300);
|
|
92
|
+
text-align: right;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host(.card-slot) {
|
|
96
|
+
--slat-background: var(--slat-card-background);
|
|
97
|
+
--slat-background-hover: var(--slat-card-background-hover);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host(.condensed-slot) .action::part(border-radius) {
|
|
101
|
+
border-radius: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host(.condensed-slot:last-of-type) .action::part(border-radius) {
|
|
105
|
+
border-bottom-left-radius: var(--card-radius);
|
|
106
|
+
border-bottom-right-radius: var(--card-radius);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
`
|
|
110
|
+
), o = e ? `
|
|
111
|
+
<mui-h-stack alignY="center" space="var(--space-400)">
|
|
112
|
+
<slot name="accessory"></slot>
|
|
113
|
+
<slot name="start"></slot>
|
|
114
|
+
</mui-h-stack>
|
|
115
|
+
` : '<slot name="start"></slot>';
|
|
116
|
+
this.shadowRoot.innerHTML = t ? (
|
|
117
|
+
/*html*/
|
|
118
|
+
`
|
|
119
|
+
<style>${s}</style>
|
|
120
|
+
<mui-button variant="tertiary" class="action">
|
|
121
|
+
${o}
|
|
122
|
+
<div class="end" slot="after">
|
|
123
|
+
<slot name="end"></slot>
|
|
124
|
+
<mui-icon-right-chevron size="x-small"></mui-icon-right-chevron>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
</mui-button>
|
|
128
|
+
`
|
|
129
|
+
) : (
|
|
130
|
+
/*html*/
|
|
131
|
+
`
|
|
132
|
+
<style>${s}</style>
|
|
133
|
+
${o}
|
|
134
|
+
<slot name="end"></slot>
|
|
135
|
+
`
|
|
136
|
+
), requestAnimationFrame(() => this.applyCellRoles());
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
customElements.get("mui-slat") || customElements.define("mui-slat", i);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import "../mui-body/index.js";
|
|
2
|
+
import "../mui-badge/index.js";
|
|
3
|
+
class u extends HTMLElement {
|
|
2
4
|
static get observedAttributes() {
|
|
3
5
|
return [
|
|
4
6
|
"state",
|
|
@@ -24,18 +26,15 @@ class b extends HTMLElement {
|
|
|
24
26
|
this.render();
|
|
25
27
|
}
|
|
26
28
|
render() {
|
|
27
|
-
const p = this.getAttribute("state") || "default", l = this.getAttribute("number") || "0000", n = this.getAttribute("bg-color"), o = this.getAttribute("bg-image"),
|
|
28
|
-
t && t > 126 && console.warn(
|
|
29
|
-
`[mui-smart-card] The logo height (${t}px) exceeds the recommended maximum of 126px. This may affect vertical alignment or visual consistency.`
|
|
30
|
-
);
|
|
29
|
+
const p = this.getAttribute("state") || "default", l = this.getAttribute("number") || "0000", n = this.getAttribute("bg-color"), o = this.getAttribute("bg-image"), b = this.getAttribute("variant") || "plain", t = this.hasAttribute("inverted"), s = this.getAttribute("type") || "", d = p === "frozen", c = this.getAttribute("logo") || "", g = this.getAttribute("partner") || "", a = this.getAttribute("logo-height"), e = a && !isNaN(parseInt(a, 10)) ? parseInt(a, 10) : void 0;
|
|
31
30
|
let r = "card", i = "";
|
|
32
|
-
|
|
31
|
+
b === "animated" ? r += " animated" : r += " plain", o ? i = `
|
|
33
32
|
background-image: url(${o});
|
|
34
33
|
background-size: cover;
|
|
35
34
|
background-position: center;
|
|
36
35
|
background-repeat: no-repeat;
|
|
37
36
|
` : n ? i = `background: ${n};` : i = `
|
|
38
|
-
background: ${
|
|
37
|
+
background: ${t ? "linear-gradient(180deg, var(--grey-900) 0%, var(--black) 100%)" : "linear-gradient(180deg, var(--grey-200) 0%, var(--white) 100%)"};
|
|
39
38
|
`, this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
40
39
|
`
|
|
41
40
|
<style>
|
|
@@ -110,13 +109,13 @@ class b extends HTMLElement {
|
|
|
110
109
|
object-fit: contain;
|
|
111
110
|
display: block;
|
|
112
111
|
width: auto;
|
|
113
|
-
height: ${
|
|
112
|
+
height: ${e ? `calc(${e}px / 1.5)` : "auto"};
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
@media (min-width: 500px) {
|
|
117
116
|
.logo img {
|
|
118
117
|
width: auto;
|
|
119
|
-
height: ${
|
|
118
|
+
height: ${e ? `${e}px` : "auto"};
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
|
|
@@ -124,21 +123,21 @@ class b extends HTMLElement {
|
|
|
124
123
|
/* =========================================== */
|
|
125
124
|
.type,
|
|
126
125
|
.card-number::part(display) {
|
|
127
|
-
color: ${
|
|
128
|
-
text-shadow: ${
|
|
126
|
+
color: ${t ? "var(--white)" : "var(--black)"};
|
|
127
|
+
text-shadow: ${t ? "0 0px 8px rgb(0 0 0 / 12%);" : "0 0px 8px rgb(255 255 255 / 12%);"};
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
img {
|
|
132
|
-
filter: ${
|
|
131
|
+
filter: ${t ? "drop-shadow(0px 1px 0px var(--black-opacity-60))" : "drop-shadow(0px 1px 0px var(--white-opacity-60))"};
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
|
|
136
135
|
.inner {
|
|
137
|
-
box-shadow: ${
|
|
136
|
+
box-shadow: ${t ? "inset 0 1px 0 0 rgb(255 255 255 / 20%), 0 1px 0 0 rgb(0 0 0 / 10%)" : "inset 0 1px 0 0 rgb(255 255 255 / 60%), 0 1px 0 0 rgb(0 0 0 / 40%)"};
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
.card.animated .inner::after {
|
|
141
|
-
background: linear-gradient(${
|
|
140
|
+
background: linear-gradient(${t ? "120deg, rgb(255 255 255 / 2%) 30%, rgb(255 255 255 / 8%) 40%, rgb(255 255 255 / 4%) 40%" : "120deg, rgb(255 255 255 / 2%) 30%, rgb(255 255 255 / 25%) 40%, rgb(255 255 255 / 8%) 40%"});
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
/* Type */
|
|
@@ -332,4 +331,4 @@ class b extends HTMLElement {
|
|
|
332
331
|
`);
|
|
333
332
|
}
|
|
334
333
|
}
|
|
335
|
-
customElements.define("mui-smart-card",
|
|
334
|
+
customElements.get("mui-smart-card") || customElements.define("mui-smart-card", u);
|
|
@@ -35,11 +35,7 @@ class h extends HTMLElement {
|
|
|
35
35
|
this.hasAttribute("disabled") ? (this.shadowRoot.host.classList.add("disabled"), (e = this._checkbox) == null || e.setAttribute("aria-disabled", "true"), (i = this._checkbox) == null || i.setAttribute("tabindex", "-1")) : (this.shadowRoot.host.classList.remove("disabled"), (s = this._checkbox) == null || s.removeAttribute("aria-disabled"), (c = this._checkbox) == null || c.removeAttribute("tabindex"));
|
|
36
36
|
}
|
|
37
37
|
_updateIcons() {
|
|
38
|
-
const t = this.shadowRoot.querySelector(
|
|
39
|
-
'slot[name="on-icon"]'
|
|
40
|
-
), e = this.shadowRoot.querySelector(
|
|
41
|
-
'slot[name="off-icon"]'
|
|
42
|
-
);
|
|
38
|
+
const t = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]');
|
|
43
39
|
t && t.assignedElements().forEach((i) => {
|
|
44
40
|
i.style.display = this._checked ? "inline" : "none";
|
|
45
41
|
}), e && e.assignedElements().forEach((i) => {
|
|
@@ -48,9 +44,7 @@ class h extends HTMLElement {
|
|
|
48
44
|
}
|
|
49
45
|
render() {
|
|
50
46
|
const t = this.getAttribute("label");
|
|
51
|
-
|
|
52
|
-
"mui-switch Accessibility warning: Provide a 'label' to ensure the switch is described for assistive technologies."
|
|
53
|
-
), this.shadowRoot.innerHTML = /*html*/
|
|
47
|
+
this.shadowRoot.innerHTML = /*html*/
|
|
54
48
|
`
|
|
55
49
|
<style>
|
|
56
50
|
:host { display: inline-block; }
|
|
@@ -140,4 +134,4 @@ class h extends HTMLElement {
|
|
|
140
134
|
`;
|
|
141
135
|
}
|
|
142
136
|
}
|
|
143
|
-
customElements.define("mui-switch", h);
|
|
137
|
+
customElements.get("mui-switch") || customElements.define("mui-switch", h);
|
|
@@ -13,7 +13,7 @@ class s extends HTMLElement {
|
|
|
13
13
|
const t = this.getAttribute("icon");
|
|
14
14
|
this.setAttribute("tabindex", this.hasAttribute("active") ? "0" : "-1"), this.shadowRoot.innerHTML = "";
|
|
15
15
|
const i = document.createElement("style");
|
|
16
|
-
if (i.textContent = /*
|
|
16
|
+
if (i.textContent = /*css*/
|
|
17
17
|
`
|
|
18
18
|
:host {
|
|
19
19
|
user-select: none;
|
|
@@ -58,4 +58,4 @@ class s extends HTMLElement {
|
|
|
58
58
|
this.classList.toggle("active", t), this.setAttribute("role", "tab"), this.setAttribute("aria-selected", t ? "true" : "false"), this.setAttribute("tabindex", t ? "0" : "-1"), this.iconEl && this.iconEl.setAttribute("color", t ? "var(--tab-icon-active)" : "var(--tab-icon)");
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
customElements.define("mui-tab-item", s);
|
|
61
|
+
customElements.get("mui-tab-item") || customElements.define("mui-tab-item", s);
|
|
@@ -370,6 +370,13 @@ html[data-theme="light"] {
|
|
|
370
370
|
|
|
371
371
|
/* Carousel */
|
|
372
372
|
--carousel-background: var(--white);
|
|
373
|
+
|
|
374
|
+
/* Slat */
|
|
375
|
+
--slat-background: var(--white-opacity-60);
|
|
376
|
+
--slat-background-hover: var(--white-opacity-90);
|
|
377
|
+
--slat-card-background: var(--surface-elevated-100);
|
|
378
|
+
--slat-card-background-hover: var(--surface-elevated-200);
|
|
379
|
+
--slat-accessory-background: var(--black-opacity-10);
|
|
373
380
|
}
|
|
374
381
|
|
|
375
382
|
/* ==================================================================================================== */
|
|
@@ -540,6 +547,13 @@ html[data-theme="dark"] {
|
|
|
540
547
|
|
|
541
548
|
/* Carousel */
|
|
542
549
|
--carousel-background: var(--grey-700);
|
|
550
|
+
|
|
551
|
+
/* Slat */
|
|
552
|
+
--slat-background: var(--black-opacity-20);
|
|
553
|
+
--slat-background-hover: var(--black-opacity-50);
|
|
554
|
+
--slat-card-background: var(--surface-elevated-100);
|
|
555
|
+
--slat-card-background-hover: var(--surface-elevated-200);
|
|
556
|
+
--slat-accessory-background: var(--white-opacity-10);
|
|
543
557
|
}
|
|
544
558
|
|
|
545
559
|
/* ==================================================================================================== */
|
|
@@ -576,7 +590,9 @@ html[data-theme="dark"] {
|
|
|
576
590
|
--action-attention-border-focus: var(--stroke-size-200) var(--stroke-solid) var(--action-attention-border-color-focus);
|
|
577
591
|
--action-attention-border-disabled: var(--stroke-size-200) var(--stroke-solid)
|
|
578
592
|
var(--action-attention-border-color-disabled);
|
|
579
|
-
--action-padding: var(--space-200) var(--space-
|
|
593
|
+
--action-padding: var(--space-200) calc(var(--space-300) + var(--space-100));
|
|
594
|
+
--action-before-slot-padding: var(--space-300);
|
|
595
|
+
--action-after-slot-padding: var(--space-300);
|
|
580
596
|
--action-icon-only-padding: var(--space-000);
|
|
581
597
|
--action-radius: var(--radius-100);
|
|
582
598
|
--action-font-size: var(--text-font-size);
|
|
@@ -651,4 +667,6 @@ html[data-theme="dark"] {
|
|
|
651
667
|
--carousel-radius: var(--radius-300);
|
|
652
668
|
--carousel-tab-position: var(--space-400);
|
|
653
669
|
--carousel-tab-offset: calc(4.4rem + var(--carousel-tab-position)); /* Tab Height */
|
|
670
|
+
/* Slat [Action] */
|
|
671
|
+
--slat-radius: var(--radius-200);
|
|
654
672
|
}
|