@muibook/components 1.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/LICENSE +21 -0
- package/dist/create-mui-app/assets/index-DfcB3F-s.js +597 -0
- package/dist/create-mui-app/create-mui-app.css +1 -0
- package/dist/create-mui-app/index.html +21 -0
- package/dist/esm/_redirects +1 -0
- package/dist/esm/favicon.ico +0 -0
- package/dist/esm/index/index.js +71 -0
- package/dist/esm/logo192.png +0 -0
- package/dist/esm/mui-accordion/block/index.js +168 -0
- package/dist/esm/mui-accordion/group/index.js +26 -0
- package/dist/esm/mui-accordion/index.js +3 -0
- package/dist/esm/mui-accordion/inline/index.js +96 -0
- package/dist/esm/mui-addon/index.js +46 -0
- package/dist/esm/mui-alert/index.js +109 -0
- package/dist/esm/mui-badge/index.js +43 -0
- package/dist/esm/mui-body/index.js +82 -0
- package/dist/esm/mui-button/index.js +296 -0
- package/dist/esm/mui-button-group/index.js +23 -0
- package/dist/esm/mui-card/body/index.js +48 -0
- package/dist/esm/mui-card/card/index.js +43 -0
- package/dist/esm/mui-card/footer/index.js +62 -0
- package/dist/esm/mui-card/header/index.js +29 -0
- package/dist/esm/mui-card/index.js +4 -0
- package/dist/esm/mui-carousel/controller/index.js +117 -0
- package/dist/esm/mui-carousel/index.js +2 -0
- package/dist/esm/mui-carousel/panel/index.js +29 -0
- package/dist/esm/mui-code/index.js +56 -0
- package/dist/esm/mui-container/index.js +57 -0
- package/dist/esm/mui-field/index.js +44 -0
- package/dist/esm/mui-file-upload/index.js +100 -0
- package/dist/esm/mui-grid/index.js +42 -0
- package/dist/esm/mui-heading/index.js +36 -0
- package/dist/esm/mui-icons/accessibility/index.js +55 -0
- package/dist/esm/mui-icons/add/index.js +55 -0
- package/dist/esm/mui-icons/attention/index.js +55 -0
- package/dist/esm/mui-icons/check/index.js +55 -0
- package/dist/esm/mui-icons/close/index.js +55 -0
- package/dist/esm/mui-icons/down-chevron/index.js +55 -0
- package/dist/esm/mui-icons/globe/index.js +55 -0
- package/dist/esm/mui-icons/grid/index.js +55 -0
- package/dist/esm/mui-icons/index.js +23 -0
- package/dist/esm/mui-icons/info/index.js +55 -0
- package/dist/esm/mui-icons/left-arrow/index.js +55 -0
- package/dist/esm/mui-icons/left-chevron/index.js +55 -0
- package/dist/esm/mui-icons/menu/index.js +55 -0
- package/dist/esm/mui-icons/message/index.js +55 -0
- package/dist/esm/mui-icons/moon/index.js +55 -0
- package/dist/esm/mui-icons/notification/index.js +55 -0
- package/dist/esm/mui-icons/right-chevron/index.js +55 -0
- package/dist/esm/mui-icons/stop/index.js +55 -0
- package/dist/esm/mui-icons/subtract/index.js +55 -0
- package/dist/esm/mui-icons/sun/index.js +55 -0
- package/dist/esm/mui-icons/toggle/index.js +72 -0
- package/dist/esm/mui-icons/up-arrow/index.js +55 -0
- package/dist/esm/mui-icons/up-chevron/index.js +55 -0
- package/dist/esm/mui-icons/warning/index.js +55 -0
- package/dist/esm/mui-image/index.js +49 -0
- package/dist/esm/mui-input/index.js +207 -0
- package/dist/esm/mui-link/index.js +263 -0
- package/dist/esm/mui-list/index.js +2 -0
- package/dist/esm/mui-list/item/index.js +65 -0
- package/dist/esm/mui-list/list/index.js +31 -0
- package/dist/esm/mui-message/index.js +90 -0
- package/dist/esm/mui-quote/index.js +27 -0
- package/dist/esm/mui-responsive/index.js +30 -0
- package/dist/esm/mui-rule/index.js +32 -0
- package/dist/esm/mui-select/index.js +204 -0
- package/dist/esm/mui-slat/index.js +21 -0
- package/dist/esm/mui-smart-card/index.js +335 -0
- package/dist/esm/mui-stack/hstack/index.js +52 -0
- package/dist/esm/mui-stack/index.js +2 -0
- package/dist/esm/mui-stack/vstack/index.js +52 -0
- package/dist/esm/mui-switch/index.js +143 -0
- package/dist/esm/mui-table/cell/index.js +64 -0
- package/dist/esm/mui-table/index.js +4 -0
- package/dist/esm/mui-table/row/index.js +26 -0
- package/dist/esm/mui-table/row-group/index.js +24 -0
- package/dist/esm/mui-table/table/index.js +21 -0
- package/dist/esm/mui-tabs/controller/index.js +23 -0
- package/dist/esm/mui-tabs/index.js +4 -0
- package/dist/esm/mui-tabs/item/index.js +61 -0
- package/dist/esm/mui-tabs/panel/index.js +32 -0
- package/dist/esm/mui-tabs/tab-bar/index.js +136 -0
- package/dist/esm/mui-utils/part-map/index.js +49 -0
- package/dist/muibook/_redirects +1 -0
- package/dist/muibook/assets/base-B4dO4n0A.js +198 -0
- package/dist/muibook/assets/components-YZ3tjmIt.js +122 -0
- package/dist/muibook/assets/contextual-D648xs_u.js +59 -0
- package/dist/muibook/assets/image-1080-Bg-8LoSs.js +1 -0
- package/dist/muibook/assets/index-0bBJZTXh.js +135 -0
- package/dist/muibook/assets/index-B4Lbi-ZX.js +82 -0
- package/dist/muibook/assets/index-BJJtzLti.js +144 -0
- package/dist/muibook/assets/index-BN6UEWFf.js +439 -0
- package/dist/muibook/assets/index-Bc68V_xw.js +140 -0
- package/dist/muibook/assets/index-BnpaoEYs.js +386 -0
- package/dist/muibook/assets/index-BrZBJGo2.js +4276 -0
- package/dist/muibook/assets/index-Bx-SU7T2.js +98 -0
- package/dist/muibook/assets/index-C10sNeH-.js +64 -0
- package/dist/muibook/assets/index-C4ZnvuXX.js +333 -0
- package/dist/muibook/assets/index-C7Tqc5BR.js +325 -0
- package/dist/muibook/assets/index-CAkZAmud.js +514 -0
- package/dist/muibook/assets/index-CCegrD2J.js +130 -0
- package/dist/muibook/assets/index-CHZJlumm.js +95 -0
- package/dist/muibook/assets/index-CPZ8jubJ.js +308 -0
- package/dist/muibook/assets/index-CSLqxg9p.js +73 -0
- package/dist/muibook/assets/index-CT3BsW8R.js +177 -0
- package/dist/muibook/assets/index-CYYG9dAN.js +270 -0
- package/dist/muibook/assets/index-CdghbWW3.js +42 -0
- package/dist/muibook/assets/index-CfD1WQYQ.js +106 -0
- package/dist/muibook/assets/index-Ch40uilB.js +52 -0
- package/dist/muibook/assets/index-CwAai54c.js +263 -0
- package/dist/muibook/assets/index-CyWt9f96.js +336 -0
- package/dist/muibook/assets/index-D8hXO6aa.js +131 -0
- package/dist/muibook/assets/index-DBkw7VLa.js +431 -0
- package/dist/muibook/assets/index-DI0vNTNv.js +56 -0
- package/dist/muibook/assets/index-DNImaJPY.js +96 -0
- package/dist/muibook/assets/index-DP6CCnt0.js +257 -0
- package/dist/muibook/assets/index-DR5X8zCc.js +67 -0
- package/dist/muibook/assets/index-DZQ8pS6y.js +133 -0
- package/dist/muibook/assets/index-DlZ1b9ZK.js +233 -0
- package/dist/muibook/assets/index-DwnvCJk0.js +177 -0
- package/dist/muibook/assets/index-_4AZFkzS.js +328 -0
- package/dist/muibook/assets/index-dkW0Vbeg.js +429 -0
- package/dist/muibook/assets/index-ehE10GAP.js +40 -0
- package/dist/muibook/assets/index-icuV1guL.js +69 -0
- package/dist/muibook/assets/index-qOE8f0sK.js +72 -0
- package/dist/muibook/assets/layout-BT0xIYa9.js +184 -0
- package/dist/muibook/assets/mui-D6S1tQ24.js +1 -0
- package/dist/muibook/assets/mui-logo-mobile-DuEMz_jq.js +31 -0
- package/dist/muibook/assets/semantic-cbNjeY5p.js +111 -0
- package/dist/muibook/assets/spacing-DY3cAXq0.js +82 -0
- package/dist/muibook/assets/surface-CMaW9FgJ.js +148 -0
- package/dist/muibook/assets/text-TVCTYde0.js +130 -0
- package/dist/muibook/assets/visual-B_21dq90.js +96 -0
- package/dist/muibook/buttercup.png +0 -0
- package/dist/muibook/create-mui-app.jpg +0 -0
- package/dist/muibook/crystal.png +0 -0
- package/dist/muibook/diamond.png +0 -0
- package/dist/muibook/emerald.svg +13 -0
- package/dist/muibook/favicon.ico +0 -0
- package/dist/muibook/hero-guides.png +0 -0
- package/dist/muibook/hero-outcomes.png +0 -0
- package/dist/muibook/image-1080.png +0 -0
- package/dist/muibook/image-220.png +0 -0
- package/dist/muibook/image-395.png +0 -0
- package/dist/muibook/index.html +38 -0
- package/dist/muibook/logo192.png +0 -0
- package/dist/muibook/mui-tokens.jpg +0 -0
- package/dist/muibook/muibook.css +1 -0
- package/dist/muibook/premier.png +0 -0
- package/dist/muibook/ruby.svg +13 -0
- package/dist/muibook/sapphire.png +0 -0
- package/dist/muibook/sapphire.svg +13 -0
- package/dist/muibook/snowy-mint.png +0 -0
- package/dist/types/components/mui-accordion/block/index.d.ts +2 -0
- package/dist/types/components/mui-accordion/group/index.d.ts +1 -0
- package/dist/types/components/mui-accordion/index.d.ts +3 -0
- package/dist/types/components/mui-accordion/inline/index.d.ts +2 -0
- package/dist/types/components/mui-accordion/mui-accordion-block/index.d.ts +2 -0
- package/dist/types/components/mui-accordion/mui-accordion-group/index.d.ts +1 -0
- package/dist/types/components/mui-accordion/mui-accordion-inline/index.d.ts +2 -0
- package/dist/types/components/mui-addon/index.d.ts +1 -0
- package/dist/types/components/mui-alert/index.d.ts +1 -0
- package/dist/types/components/mui-badge/index.d.ts +1 -0
- package/dist/types/components/mui-body/index.d.ts +1 -0
- package/dist/types/components/mui-button/index.d.ts +1 -0
- package/dist/types/components/mui-button-group/index.d.ts +1 -0
- package/dist/types/components/mui-card/body/index.d.ts +1 -0
- package/dist/types/components/mui-card/card/index.d.ts +1 -0
- package/dist/types/components/mui-card/footer/index.d.ts +1 -0
- package/dist/types/components/mui-card/header/index.d.ts +1 -0
- package/dist/types/components/mui-card/index.d.ts +4 -0
- package/dist/types/components/mui-carousel/controller/index.d.ts +1 -0
- package/dist/types/components/mui-carousel/index.d.ts +2 -0
- package/dist/types/components/mui-carousel/panel/index.d.ts +1 -0
- package/dist/types/components/mui-code/index.d.ts +1 -0
- package/dist/types/components/mui-container/index.d.ts +1 -0
- package/dist/types/components/mui-field/index.d.ts +1 -0
- package/dist/types/components/mui-file-upload/index.d.ts +1 -0
- package/dist/types/components/mui-grid/index.d.ts +1 -0
- package/dist/types/components/mui-heading/index.d.ts +1 -0
- package/dist/types/components/mui-icons/accessibility.d.ts +1 -0
- package/dist/types/components/mui-icons/add.d.ts +1 -0
- package/dist/types/components/mui-icons/attention.d.ts +1 -0
- package/dist/types/components/mui-icons/check.d.ts +1 -0
- package/dist/types/components/mui-icons/chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/close.d.ts +1 -0
- package/dist/types/components/mui-icons/down-chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/globe.d.ts +1 -0
- package/dist/types/components/mui-icons/grid.d.ts +1 -0
- package/dist/types/components/mui-icons/index.d.ts +23 -0
- package/dist/types/components/mui-icons/info.d.ts +1 -0
- package/dist/types/components/mui-icons/left-arrow.d.ts +1 -0
- package/dist/types/components/mui-icons/left-chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/menu.d.ts +1 -0
- package/dist/types/components/mui-icons/message.d.ts +1 -0
- package/dist/types/components/mui-icons/moon.d.ts +1 -0
- package/dist/types/components/mui-icons/mui-icon-add.d.ts +1 -0
- package/dist/types/components/mui-icons/mui-icon-down-chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/mui-icon-moon.d.ts +1 -0
- package/dist/types/components/mui-icons/mui-icon-right-chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/mui-icon-sun.d.ts +1 -0
- package/dist/types/components/mui-icons/notification.d.ts +1 -0
- package/dist/types/components/mui-icons/right-chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/stop.d.ts +1 -0
- package/dist/types/components/mui-icons/subtract.d.ts +1 -0
- package/dist/types/components/mui-icons/sun.d.ts +1 -0
- package/dist/types/components/mui-icons/toggle.d.ts +1 -0
- package/dist/types/components/mui-icons/up-arrow.d.ts +1 -0
- package/dist/types/components/mui-icons/up-chevron.d.ts +1 -0
- package/dist/types/components/mui-icons/warning.d.ts +1 -0
- package/dist/types/components/mui-image/index.d.ts +1 -0
- package/dist/types/components/mui-input/index.d.ts +1 -0
- package/dist/types/components/mui-link/index.d.ts +1 -0
- package/dist/types/components/mui-list/index.d.ts +2 -0
- package/dist/types/components/mui-list/item/index.d.ts +1 -0
- package/dist/types/components/mui-list/list/index.d.ts +1 -0
- package/dist/types/components/mui-message/index.d.ts +1 -0
- package/dist/types/components/mui-quote/index.d.ts +1 -0
- package/dist/types/components/mui-responsive/index.d.ts +1 -0
- package/dist/types/components/mui-rule/index.d.ts +1 -0
- package/dist/types/components/mui-select/index.d.ts +1 -0
- package/dist/types/components/mui-slat/index.d.ts +1 -0
- package/dist/types/components/mui-smart-card/index.d.ts +1 -0
- package/dist/types/components/mui-stack/hstack/index.d.ts +1 -0
- package/dist/types/components/mui-stack/index.d.ts +2 -0
- package/dist/types/components/mui-stack/mui-hstack/index.d.ts +1 -0
- package/dist/types/components/mui-stack/mui-vstack/index.d.ts +1 -0
- package/dist/types/components/mui-stack/vstack/index.d.ts +1 -0
- package/dist/types/components/mui-switch/index.d.ts +1 -0
- package/dist/types/components/mui-table/cell/index.d.ts +1 -0
- package/dist/types/components/mui-table/index.d.ts +4 -0
- package/dist/types/components/mui-table/row/index.d.ts +1 -0
- package/dist/types/components/mui-table/row/row.d.ts +1 -0
- package/dist/types/components/mui-table/row-group/index.d.ts +1 -0
- package/dist/types/components/mui-table/table/index.d.ts +1 -0
- package/dist/types/components/mui-tabs/controller/index.d.ts +1 -0
- package/dist/types/components/mui-tabs/index.d.ts +4 -0
- package/dist/types/components/mui-tabs/item/index.d.ts +1 -0
- package/dist/types/components/mui-tabs/panel/index.d.ts +1 -0
- package/dist/types/components/mui-tabs/tab-bar/index.d.ts +1 -0
- package/dist/types/create-app/index.d.ts +15 -0
- package/dist/types/create-mui-app/index.d.ts +15 -0
- package/dist/types/index.d.ts +68 -0
- package/dist/types/muibook/index.d.ts +93 -0
- package/dist/types/utils/part-map/index.d.ts +3 -0
- package/package.json +345 -0
- package/readme.md +84 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
class m extends HTMLElement {
|
|
2
|
+
static get observedAttributes() {
|
|
3
|
+
return ["type", "name", "value", "placeholder", "id", "label", "disabled", "hide-label", "variant"];
|
|
4
|
+
}
|
|
5
|
+
constructor() {
|
|
6
|
+
super(), this.attachShadow({ mode: "open" });
|
|
7
|
+
}
|
|
8
|
+
connectedCallback() {
|
|
9
|
+
this.render(), this.setupListener();
|
|
10
|
+
}
|
|
11
|
+
attributeChangedCallback(e, a, t) {
|
|
12
|
+
var o;
|
|
13
|
+
const r = (o = this.shadowRoot) == null ? void 0 : o.querySelector("input");
|
|
14
|
+
r && (e === "value" && (r.value = t ?? ""), e === "disabled" && (t === null || t === "false" ? r.removeAttribute("disabled") : r.setAttribute("disabled", "")), (e === "type" || e === "placeholder" || e === "label" || e === "hide-label") && (this.render(), this.setupListener()));
|
|
15
|
+
}
|
|
16
|
+
setupListener() {
|
|
17
|
+
var t, r;
|
|
18
|
+
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("input");
|
|
19
|
+
if (!e) return;
|
|
20
|
+
const a = e.cloneNode(!0);
|
|
21
|
+
(r = e.parentNode) == null || r.replaceChild(a, e), a.addEventListener("input", (o) => {
|
|
22
|
+
const s = o.target;
|
|
23
|
+
this.dispatchEvent(
|
|
24
|
+
new CustomEvent("input", {
|
|
25
|
+
detail: { value: s.value },
|
|
26
|
+
bubbles: !0,
|
|
27
|
+
composed: !0
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
}), a.addEventListener("change", (o) => {
|
|
31
|
+
const s = o.target;
|
|
32
|
+
this.dispatchEvent(
|
|
33
|
+
new CustomEvent("change", {
|
|
34
|
+
detail: { value: s.value },
|
|
35
|
+
bubbles: !0,
|
|
36
|
+
composed: !0
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const e = ["text", "password", "email", "number", "search", "tel", "url", "date", "time"], a = this.getAttribute("type") || "text", t = e.includes(a) ? a : "text", r = this.getAttribute("name") || "", o = this.getAttribute("value") || "", s = this.getAttribute("placeholder") || "", n = this.getAttribute("id") || `mui-input-${Math.random().toString(36).substr(2, 9)}`, i = this.getAttribute("label") || "", l = this.hasAttribute("hide-label"), u = this.hasAttribute("disabled"), d = l && i ? `aria-label="${i}"` : "", c = this.getAttribute("variant") || "", b = c || "", h = this.querySelector('[slot="before"]') !== null, p = this.querySelector('[slot="after"]') !== null, v = [b, h ? "before" : "", p ? "after" : ""].filter(Boolean).join(" ");
|
|
43
|
+
l && !i && console.warn(
|
|
44
|
+
"mui-input Accessibility warning: When using 'hide-label', please provide a 'label' attribute so an 'aria-label' can be generated for screen reader support."
|
|
45
|
+
), !i && !d && console.warn(
|
|
46
|
+
"mui-input Accessibility warning: A 'label' or 'aria-label' attribute is required for screen reader accessibility."
|
|
47
|
+
);
|
|
48
|
+
const f = (
|
|
49
|
+
/*html*/
|
|
50
|
+
`
|
|
51
|
+
<style>
|
|
52
|
+
:host {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
width: 100%;
|
|
55
|
+
}
|
|
56
|
+
label {
|
|
57
|
+
display: block;
|
|
58
|
+
font-size: var(--text-font-size);
|
|
59
|
+
font-weight: var(--font-weight-medium);
|
|
60
|
+
margin-bottom: var(--space-100);
|
|
61
|
+
color: var(--text-color);
|
|
62
|
+
}
|
|
63
|
+
.input-wrapper {
|
|
64
|
+
display: flex;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
input {
|
|
68
|
+
min-height: 4.4rem;
|
|
69
|
+
width: 100%;
|
|
70
|
+
line-height: var(--text-line-height);
|
|
71
|
+
padding: var(--space-200) var(--space-300);
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
font-size: var(--text-font-size);
|
|
74
|
+
border-radius: var(--radius-100);
|
|
75
|
+
border: var(--border-thin);
|
|
76
|
+
border-color: var(--form-default-border-color);
|
|
77
|
+
color: var(--text-color);
|
|
78
|
+
background: var(--input-background);
|
|
79
|
+
}
|
|
80
|
+
input:hover {
|
|
81
|
+
border-color: var(--form-default-border-color-hover);
|
|
82
|
+
}
|
|
83
|
+
input:focus {
|
|
84
|
+
outline: var(--outline-thick);
|
|
85
|
+
}
|
|
86
|
+
input:disabled {
|
|
87
|
+
opacity: 0.4;
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
background-color: var(--input-background-disabled);
|
|
90
|
+
}
|
|
91
|
+
input.success {
|
|
92
|
+
color: var(--form-success-text-color);
|
|
93
|
+
border-color: var(--form-success-border-color);
|
|
94
|
+
box-shadow: 0 0 0 2px var(--form-success-border-color);
|
|
95
|
+
}
|
|
96
|
+
input.warning {
|
|
97
|
+
color: var(--form-warning-text-color);
|
|
98
|
+
border-color: var(--form-warning-border-color);
|
|
99
|
+
box-shadow: 0 0 0 2px var(--form-warning-border-color);
|
|
100
|
+
}
|
|
101
|
+
input.error {
|
|
102
|
+
color: var(--form-error-text-color);
|
|
103
|
+
border-color: var(--form-error-border-color);
|
|
104
|
+
box-shadow: 0 0 0 2px var(--form-error-border-color);
|
|
105
|
+
}
|
|
106
|
+
input.success:hover {
|
|
107
|
+
color: var(--form-success-text-color-hover);
|
|
108
|
+
border-color: var(--form-success-border-color-hover);
|
|
109
|
+
box-shadow: 0 0 0 2px var(--form-success-border-color-hover);
|
|
110
|
+
}
|
|
111
|
+
input.warning:hover {
|
|
112
|
+
color: var(--form-warning-text-color-hover);
|
|
113
|
+
border-color: var(--form-warning-border-color-hover);
|
|
114
|
+
box-shadow: 0 0 0 2px var(--form-warning-border-color-hover);
|
|
115
|
+
}
|
|
116
|
+
input.error:hover {
|
|
117
|
+
color: var(--form-error-text-color-hover);
|
|
118
|
+
border-color: var(--form-error-border-color-hover);
|
|
119
|
+
box-shadow: 0 0 0 2px var(--form-error-border-color-hover);
|
|
120
|
+
}
|
|
121
|
+
.vh {
|
|
122
|
+
position: absolute;
|
|
123
|
+
width: 1px;
|
|
124
|
+
height: 1px;
|
|
125
|
+
margin: -1px;
|
|
126
|
+
padding: 0;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
clip: rect(0 0 0 0);
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
border: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* ========================================================================== */
|
|
134
|
+
/* STYLES FOR BEFORE & AFTER (ADDON & SELECT) */
|
|
135
|
+
/* ========================================================================== */
|
|
136
|
+
|
|
137
|
+
input.before { border-top-left-radius: 0; border-bottom-left-radius: 0;}
|
|
138
|
+
input.after { border-top-right-radius: 0; border-bottom-right-radius: 0;}
|
|
139
|
+
|
|
140
|
+
/* ========================================================================== */
|
|
141
|
+
/* LOGIC FOR FOCUS ORDER of BEFORE, AFTER & INPUT */
|
|
142
|
+
/* The goal is to not exceed 1 order to avoid potential UI bugs */
|
|
143
|
+
/* when input and the before/after feature is used in compositions. */
|
|
144
|
+
/* ========================================================================== */
|
|
145
|
+
|
|
146
|
+
/* ========================================================================== */
|
|
147
|
+
/* 1. BEFORE: Slotted items are Z-INDEX AUTO by default */
|
|
148
|
+
/* ========================================================================== */
|
|
149
|
+
|
|
150
|
+
/* If slotted item is BEFORE & FOCUSED then sit ABOVE INPUT */
|
|
151
|
+
|
|
152
|
+
/* ========================================================================== */
|
|
153
|
+
/* 2. INPUT: Slotted items are Z-INDEX AUTO by default */
|
|
154
|
+
/* ========================================================================== */
|
|
155
|
+
|
|
156
|
+
/* If INPUT is FOCUSED then sit ABOVE BEFORE & AFTER ITEMS */
|
|
157
|
+
|
|
158
|
+
/* ========================================================================== */
|
|
159
|
+
/* 3. AFTER: Slotted items are Z-INDEX AUTO by default */
|
|
160
|
+
/* ========================================================================== */
|
|
161
|
+
|
|
162
|
+
/* If slotted item is AFTER & FOCUSED then sit ABOVE INPUT */
|
|
163
|
+
|
|
164
|
+
/* ========================================================================== */
|
|
165
|
+
/* 4. FINAL CONCLUSION ON APPROACH */
|
|
166
|
+
/* ========================================================================== */
|
|
167
|
+
/* Currently only mui-select is slotted, this might be the only */
|
|
168
|
+
/* use-case, but for now we will use '*' to ensure any element that */
|
|
169
|
+
/* is focusable will be addressed. */
|
|
170
|
+
/* ========================================================================== */
|
|
171
|
+
|
|
172
|
+
slot[name="before"]::slotted(*:focus),
|
|
173
|
+
input:focus,
|
|
174
|
+
slot[name="after"]::slotted(*:focus) { z-index: 1; }
|
|
175
|
+
|
|
176
|
+
/* Ensure feedback styles appear above SELECT and focusable Items */
|
|
177
|
+
input.success,
|
|
178
|
+
input.warning,
|
|
179
|
+
input.error {
|
|
180
|
+
z-index: 1;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* ========================================================================== */
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
</style>
|
|
187
|
+
${i ? `<label for="${n}" class="${l ? "vh" : ""}">${i}</label>` : ""}
|
|
188
|
+
<div class="input-wrapper">
|
|
189
|
+
<slot name="before"></slot>
|
|
190
|
+
<input
|
|
191
|
+
class="${v}"
|
|
192
|
+
type="${t}"
|
|
193
|
+
name="${r}"
|
|
194
|
+
id="${n}"
|
|
195
|
+
value="${o}"
|
|
196
|
+
placeholder="${s}"
|
|
197
|
+
${u ? 'disabled aria-disabled="true"' : ""}
|
|
198
|
+
${d}
|
|
199
|
+
/>
|
|
200
|
+
<slot name="after"></slot>
|
|
201
|
+
</div>
|
|
202
|
+
`
|
|
203
|
+
);
|
|
204
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = f);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
customElements.define("mui-input", m);
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { getPartMap as i } from "../mui-utils/part-map/index.js";
|
|
2
|
+
class s extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return ["target", "href", "variant", "weight", "size"];
|
|
5
|
+
}
|
|
6
|
+
constructor() {
|
|
7
|
+
super(), this.attachShadow({ mode: "open" });
|
|
8
|
+
const o = this.getAttribute("size") || "medium", t = this.getAttribute("weight") || "regular";
|
|
9
|
+
this.setAttribute("size", o), this.setAttribute("weight", t);
|
|
10
|
+
}
|
|
11
|
+
async connectedCallback() {
|
|
12
|
+
if (!this.shadowRoot) return;
|
|
13
|
+
await this.waitForPartMap();
|
|
14
|
+
let t = (
|
|
15
|
+
/*html*/
|
|
16
|
+
`
|
|
17
|
+
<style>
|
|
18
|
+
|
|
19
|
+
:host { display: inline-flex; }
|
|
20
|
+
|
|
21
|
+
a {
|
|
22
|
+
color: var(--link-text-color-default);
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Turned back on for focus-visible */
|
|
30
|
+
a:focus, a:active, a:hover { outline: var(--space-000); }
|
|
31
|
+
a:hover { color: var(--link-text-color-default-hover); }
|
|
32
|
+
a:focus { color: var(--link-text-color-default-focus); }
|
|
33
|
+
a:disabled { color: var(--link-text-color-default-disabled); cursor: not-allowed; }
|
|
34
|
+
a, a:before, a:after {box-sizing: border-box;}
|
|
35
|
+
a:focus-visible { outline: var(--outline-thick); }
|
|
36
|
+
|
|
37
|
+
:host([size="x-small"]) a {
|
|
38
|
+
font-size: var(--text-font-size-xs);
|
|
39
|
+
line-height: var(--text-line-height-xs);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([size="small"]) a {
|
|
43
|
+
font-size: var(--text-font-size-s);
|
|
44
|
+
line-height: var(--text-line-height-s);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([size="medium"]) a {
|
|
48
|
+
font-size: var(--text-font-size-m);
|
|
49
|
+
line-height: var(--text-line-height-m);
|
|
50
|
+
}
|
|
51
|
+
:host([size="large"]) a {
|
|
52
|
+
font-size: var(--text-font-size-l);
|
|
53
|
+
line-height: var(--text-line-height-l);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([weight="regular"]) a { font-weight: var(--font-weight-regular); }
|
|
57
|
+
:host([weight="medium"]) a { font-weight: var(--font-weight-medium); }
|
|
58
|
+
:host([weight="bold"]) a { font-weight: var(--font-weight-bold); }
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/* Button
|
|
63
|
+
========================================= */
|
|
64
|
+
|
|
65
|
+
:host([variant="primary"]) a,
|
|
66
|
+
:host([variant="secondary"]) a,
|
|
67
|
+
:host([variant="tertiary"]) a,
|
|
68
|
+
:host([variant="attention"]) a {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
padding: var(--space-200) var(--space-500);
|
|
72
|
+
border-radius: var(--action-radius);
|
|
73
|
+
font-size: var(--action-font-size);
|
|
74
|
+
font-weight: var(--action-font-weight);
|
|
75
|
+
line-height: var(--action-line-height);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([variant="primary"]),
|
|
79
|
+
:host([variant="secondary"])
|
|
80
|
+
:host([variant="tertiary"]),
|
|
81
|
+
:host([variant="attention"]) { display: inline-block; }
|
|
82
|
+
|
|
83
|
+
/* Button Primary
|
|
84
|
+
========================================= */
|
|
85
|
+
|
|
86
|
+
:host([variant="primary"]) a {
|
|
87
|
+
background: var(--action-primary-background);
|
|
88
|
+
color: var(--action-primary-text-color);
|
|
89
|
+
border: var(--action-primary-stroke);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([variant="primary"]) a:hover {
|
|
93
|
+
background: var(--action-primary-background-hover);
|
|
94
|
+
color: var(--action-primary-text-color-hover);
|
|
95
|
+
border: var(--action-primary-stroke-hover);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([variant="primary"]) a:focus,
|
|
99
|
+
:host([variant="tertiary"]) a:focus-visible {
|
|
100
|
+
background: var(--action-primary-background-focus);
|
|
101
|
+
color: var(--action-primary-text-color-focus);
|
|
102
|
+
border: var(--action-primary-stroke-focus);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([variant="primary"]) a:disabled {
|
|
106
|
+
background: var(--action-primary-background-disabled);
|
|
107
|
+
color: var(--action-primary-text-color-disabled);
|
|
108
|
+
border: var(--action-primary-stroke-disabled);
|
|
109
|
+
cursor: not-allowed;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([variant="primary"]) a ::slotted(.mui-icon) { fill: var(--action-primary-text-color); }
|
|
113
|
+
:host([variant="primary"]) a:hover ::slotted(.mui-icon) { fill: var(--action-primary-text-color-hover); }
|
|
114
|
+
:host([variant="primary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-primary-text-color-focus); }
|
|
115
|
+
:host([variant="primary"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-primary-text-color-disabled); }
|
|
116
|
+
|
|
117
|
+
/* Button Secondary
|
|
118
|
+
========================================= */
|
|
119
|
+
:host([variant="secondary"]) a {
|
|
120
|
+
background: var(--action-secondary-background);
|
|
121
|
+
color: var(--action-secondary-text-color);
|
|
122
|
+
border: var(--action-secondary-stroke);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([variant="secondary"]) a:hover {
|
|
126
|
+
background: var(--action-secondary-background-hover);
|
|
127
|
+
color: var(--action-secondary-text-color-hover);
|
|
128
|
+
border: var(--action-secondary-stroke-hover);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host([variant="secondary"]) a:focus,
|
|
132
|
+
:host([variant="secondary"]) a:focus-visible {
|
|
133
|
+
background: var(--action-secondary-background-focus);
|
|
134
|
+
color: var(--action-secondary-text-color-focus);
|
|
135
|
+
border: var(--action-secondary-stroke-focus);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([variant="secondary"]) a:disabled {
|
|
139
|
+
background: var(--action-secondary-background-disabled);
|
|
140
|
+
color: var(--action-secondary-text-color-disabled);
|
|
141
|
+
border: var(--action-secondary-stroke-disabled);
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([variant="secondary"]) a ::slotted(.mui-icon) { fill: var(--action-secondary-text-color); }
|
|
146
|
+
:host([variant="secondary"]) a:hover ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-hover); }
|
|
147
|
+
:host([variant="secondary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-focus); }
|
|
148
|
+
:host([variant="secondary"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-secondary-text-color-disabled); }
|
|
149
|
+
|
|
150
|
+
/* Button Tertiary
|
|
151
|
+
========================================= */
|
|
152
|
+
:host([variant="tertiary"]) a {
|
|
153
|
+
background: var(--action-tertiary-background);
|
|
154
|
+
color: var(--action-tertiary-text-color);
|
|
155
|
+
border: var(--action-tertiary-stroke);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host([variant="tertiary"]) a:hover {
|
|
159
|
+
color: var(--action-tertiary-text-color-hover);
|
|
160
|
+
background: var(--action-tertiary-background-hover);
|
|
161
|
+
border: var(--action-tertiary-stroke-hover);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([variant="tertiary"]) a:focus,
|
|
165
|
+
:host([variant="tertiary"]) a:focus-visible {
|
|
166
|
+
color: var(--action-tertiary-text-color-focus);
|
|
167
|
+
background: var(--action-tertiary-background-focus);
|
|
168
|
+
border: var(--action-tertiary-stroke-focus);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:host([variant="tertiary"]) a:disabled {
|
|
172
|
+
background: var(--action-tertiary-background-disabled);
|
|
173
|
+
color: var(--action-tertiary-text-color-disabled);
|
|
174
|
+
border: var(--action-tertiary-stroke-disabled);
|
|
175
|
+
cursor: not-allowed;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host([variant="tertiary"]) a ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color); }
|
|
179
|
+
:host([variant="tertiary"]) a:hover ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-hover); }
|
|
180
|
+
:host([variant="tertiary"]) a:focus ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-focus); }
|
|
181
|
+
:host([variant="tertiary"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-tertiary-text-color-disabled); }
|
|
182
|
+
|
|
183
|
+
/* Button Attention
|
|
184
|
+
========================================= */
|
|
185
|
+
:host([variant="attention"]) a {
|
|
186
|
+
background: var(--action-attention-background);
|
|
187
|
+
color: var(--action-attention-text-color);
|
|
188
|
+
border: var(--action-attention-stroke);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:host([variant="attention"]) a:hover {
|
|
192
|
+
background: var(--action-attention-background-hover);
|
|
193
|
+
color: var(--action-attention-text-color-hover);
|
|
194
|
+
border: var(--action-attention-stroke-hover);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:host([variant="attention"]) a:focus,
|
|
198
|
+
:host([variant="attention"]) a:focus-visible {
|
|
199
|
+
background: var(--action-attention-background-focus);
|
|
200
|
+
color: var(--action-attention-text-color-focus);
|
|
201
|
+
border: var(--action-attention-stroke-focus);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([variant="attention"]) a:disabled {
|
|
205
|
+
background: var(--action-attention-background-disabled);
|
|
206
|
+
color: var(--action-attention-text-color-disabled);
|
|
207
|
+
border: var(--action-attention-stroke-disabled);
|
|
208
|
+
cursor: not-allowed;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:host([variant="attention"]) a ::slotted(.mui-icon) { fill: var(--action-attention-text-color); }
|
|
212
|
+
:host([variant="attention"]) a:hover ::slotted(.mui-icon) { fill: var(--action-attention-text-color-hover); }
|
|
213
|
+
:host([variant="attention"]) a:focus ::slotted(.mui-icon) { fill: var(--action-attention-text-color-focus); }
|
|
214
|
+
:host([variant="attention"]) a:disabled ::slotted(.mui-icon) { fill: var(--action-attention-text-color-disabled); }
|
|
215
|
+
|
|
216
|
+
/* Icon only
|
|
217
|
+
========================================= */
|
|
218
|
+
:host([icon-only]) a {
|
|
219
|
+
display: flex;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
align-items: center;
|
|
222
|
+
height: 44px;
|
|
223
|
+
width: 44px;
|
|
224
|
+
padding: var(--action-icon-only-padding);
|
|
225
|
+
}
|
|
226
|
+
/* ===================================== */
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
</style>
|
|
230
|
+
|
|
231
|
+
<a
|
|
232
|
+
part="${i("text", "spacing", "layout", "visual")}"
|
|
233
|
+
target="${this.getAttribute("target") || "_self"}"
|
|
234
|
+
href="${this.getAttribute("href") || "#"}"
|
|
235
|
+
>
|
|
236
|
+
<slot></slot>
|
|
237
|
+
</a>
|
|
238
|
+
`
|
|
239
|
+
);
|
|
240
|
+
this.shadowRoot.innerHTML = t, await customElements.whenDefined("mui-link"), requestAnimationFrame(() => {
|
|
241
|
+
var e;
|
|
242
|
+
const r = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
|
|
243
|
+
((r == null ? void 0 : r.assignedNodes({ flatten: !0 })) || []).every((a) => {
|
|
244
|
+
var n;
|
|
245
|
+
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
246
|
+
const c = a;
|
|
247
|
+
return c.tagName.toLowerCase() === "svg" || c.classList.contains("mui-icon");
|
|
248
|
+
}
|
|
249
|
+
return a.nodeType === Node.TEXT_NODE && !((n = a.textContent) != null && n.trim());
|
|
250
|
+
}) ? this.setAttribute("icon-only", "") : this.removeAttribute("icon-only");
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
waitForPartMap() {
|
|
254
|
+
return new Promise((o) => {
|
|
255
|
+
if (typeof i == "function") return o();
|
|
256
|
+
const t = () => {
|
|
257
|
+
typeof i == "function" ? o() : requestAnimationFrame(t);
|
|
258
|
+
};
|
|
259
|
+
t();
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
customElements.define("mui-link", s);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
class e extends HTMLElement {
|
|
2
|
+
static get observedAttributes() {
|
|
3
|
+
return ["variant", "size", "weight"];
|
|
4
|
+
}
|
|
5
|
+
constructor() {
|
|
6
|
+
super(), this.attachShadow({ mode: "open" }), this.setAttribute("role", "listitem"), this.hasAttribute("size") || this.setAttribute("size", "medium"), this.hasAttribute("weight") || this.setAttribute("weight", "regular"), this.render();
|
|
7
|
+
}
|
|
8
|
+
attributeChangedCallback() {
|
|
9
|
+
this.render();
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
const t = (
|
|
13
|
+
/*css*/
|
|
14
|
+
`
|
|
15
|
+
:host {
|
|
16
|
+
display: list-item;
|
|
17
|
+
margin: var(--space-000);
|
|
18
|
+
color: var(--text-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Size styles */
|
|
22
|
+
|
|
23
|
+
:host([size="x-small"]) {
|
|
24
|
+
font-size: var(--text-font-size-xs);
|
|
25
|
+
line-height: var(--text-line-height-xs);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([size="small"]) {
|
|
29
|
+
font-size: var(--text-font-size-s);
|
|
30
|
+
line-height: var(--text-line-height-s);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([size="medium"]) {
|
|
34
|
+
font-size: var(--text-font-size-m);
|
|
35
|
+
line-height: var(--text-line-height-m);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([size="large"]) {
|
|
39
|
+
font-size: var(--text-font-size-l);
|
|
40
|
+
line-height: var(--text-line-height-l);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/* Weight styles */
|
|
45
|
+
:host([weight="regular"]) {
|
|
46
|
+
font-weight: var(--font-weight-regular);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([weight="medium"]) {
|
|
50
|
+
font-weight: var(--font-weight-medium);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([weight="bold"]) {
|
|
54
|
+
font-weight: var(--font-weight-bold);
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
);
|
|
58
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
59
|
+
`
|
|
60
|
+
<style>${t}</style>
|
|
61
|
+
<slot></slot>
|
|
62
|
+
`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
customElements.define("mui-list-item", e);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class t extends HTMLElement {
|
|
2
|
+
constructor() {
|
|
3
|
+
super(), this.attachShadow({ mode: "open" });
|
|
4
|
+
}
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
this.setAttribute("role", "list"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
7
|
+
`
|
|
8
|
+
<style>
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
width: 100%;
|
|
13
|
+
list-style-position: outside;
|
|
14
|
+
padding: var(--space-000);
|
|
15
|
+
margin: var(--space-000);
|
|
16
|
+
padding-left: var(--space-400);
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([as="ol"]) {
|
|
21
|
+
list-style-type: decimal;
|
|
22
|
+
}
|
|
23
|
+
:host([as="ul"]) {
|
|
24
|
+
list-style-type: disc;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
customElements.define("mui-list", t);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const l = ["neutral", "positive", "info", "warning", "attention"], b = {
|
|
2
|
+
neutral: "background-color: var(--feedback-neutral-background); border: var(--feedback-neutral-border);",
|
|
3
|
+
positive: "background-color: var(--feedback-positive-background); border: var(--feedback-positive-border);",
|
|
4
|
+
info: "background-color: var(--feedback-info-background); border: var(--feedback-info-border);",
|
|
5
|
+
warning: "background-color: var(--feedback-warning-background); border: var(--feedback-warning-border);",
|
|
6
|
+
attention: "background-color: var(--feedback-attention-background); border: var(--feedback-attention-border);"
|
|
7
|
+
}, g = {
|
|
8
|
+
neutral: "polite",
|
|
9
|
+
positive: "polite",
|
|
10
|
+
info: "polite",
|
|
11
|
+
warning: "assertive",
|
|
12
|
+
attention: "assertive"
|
|
13
|
+
}, u = {
|
|
14
|
+
neutral: "status",
|
|
15
|
+
positive: "status",
|
|
16
|
+
info: "status",
|
|
17
|
+
warning: "alert",
|
|
18
|
+
attention: "alert"
|
|
19
|
+
}, v = {
|
|
20
|
+
neutral: "--feedback-neutral-icon",
|
|
21
|
+
positive: "--feedback-positive-icon",
|
|
22
|
+
info: "--feedback-info-icon",
|
|
23
|
+
warning: "--feedback-warning-icon",
|
|
24
|
+
attention: "--feedback-attention-icon"
|
|
25
|
+
}, f = {
|
|
26
|
+
neutral: "color: var(--feedback-neutral-text);",
|
|
27
|
+
positive: "color: var(--feedback-positive-text);",
|
|
28
|
+
info: "color: var(--feedback-info-text);",
|
|
29
|
+
warning: "color: var(--feedback-warning-text);",
|
|
30
|
+
attention: "color: var(--feedback-attention-text);"
|
|
31
|
+
}, k = {
|
|
32
|
+
neutral: "mui-icon-message",
|
|
33
|
+
positive: "mui-icon-check",
|
|
34
|
+
info: "mui-icon-info",
|
|
35
|
+
warning: "mui-icon-warning",
|
|
36
|
+
attention: "mui-icon-attention"
|
|
37
|
+
};
|
|
38
|
+
class p extends HTMLElement {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(), this.attachShadow({ mode: "open" });
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
const a = this.getAttribute("variant") || "neutral", e = l.includes(a) ? a : "neutral", t = this.getAttribute("heading") || "Heading...", o = this.getAttribute("icon") || k[e], n = v[e], i = f[e], r = b[e], s = g[e], c = u[e], d = (
|
|
44
|
+
/*css*/
|
|
45
|
+
`
|
|
46
|
+
:host {
|
|
47
|
+
display: block;
|
|
48
|
+
width: 100%;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
section {
|
|
53
|
+
padding: var(--message-padding);
|
|
54
|
+
border-radius: var(--message-radius);
|
|
55
|
+
${r}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.icon {
|
|
59
|
+
margin-top: var(--space-025);
|
|
60
|
+
display: flex;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.heading {
|
|
64
|
+
font-weight: var(--font-weight-bold);
|
|
65
|
+
font-size: var(--font-size-200);
|
|
66
|
+
${i}
|
|
67
|
+
}
|
|
68
|
+
`
|
|
69
|
+
);
|
|
70
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
71
|
+
`
|
|
72
|
+
<style>${d}</style>
|
|
73
|
+
|
|
74
|
+
<section aria-labelledby="message-heading" aria-live="${s}" role="${c}">
|
|
75
|
+
<mui-h-stack space="var(--message-gap-horizontal)">
|
|
76
|
+
<div class="icon">
|
|
77
|
+
<${o} color="var(${n})"></${o}>
|
|
78
|
+
</div>
|
|
79
|
+
<mui-v-stack space="var(--message-gap-vertical)">
|
|
80
|
+
<div class="heading" id="message-heading">${t}</div>
|
|
81
|
+
<slot>
|
|
82
|
+
<mui-body>Body content...</mui-body>
|
|
83
|
+
</slot>
|
|
84
|
+
</mui-v-stack>
|
|
85
|
+
</mui-h-stack>
|
|
86
|
+
</section>
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
customElements.define("mui-message", p);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class t extends HTMLElement {
|
|
2
|
+
constructor() {
|
|
3
|
+
super(), this.attachShadow({ mode: "open" });
|
|
4
|
+
}
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
let e = (
|
|
7
|
+
/*html*/
|
|
8
|
+
`
|
|
9
|
+
<style>
|
|
10
|
+
@import url("./css/mui-reset.css");
|
|
11
|
+
:host { display: block; }
|
|
12
|
+
blockquote {
|
|
13
|
+
border-left: var(--border-thick);
|
|
14
|
+
padding-left: var(--space-500);
|
|
15
|
+
font-size: var(--space-500);
|
|
16
|
+
line-height: 1.5;
|
|
17
|
+
margin: var(--space-500) var(--space-000);
|
|
18
|
+
font-style: italic;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
<blockquote><slot></slot></blockquote>
|
|
22
|
+
`
|
|
23
|
+
);
|
|
24
|
+
this.shadowRoot && (this.shadowRoot.innerHTML = e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
customElements.define("mui-quote", t);
|