monobill-mintui 0.4.2 → 0.4.4
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/components/button/Button.d.ts +1 -0
- package/dist/components/button/Button.d.ts.map +10 -0
- package/dist/components/button/index.cjs +1 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.d.ts.map +10 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/card/Card.d.ts +1 -0
- package/dist/components/card/Card.d.ts.map +10 -0
- package/dist/components/card/index.cjs +1 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.d.ts.map +10 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/checkbox/Checkbox.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +10 -0
- package/dist/components/checkbox/index.cjs +1 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.d.ts.map +10 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/choice/Choice.d.ts +1 -0
- package/dist/components/choice/Choice.d.ts.map +10 -0
- package/dist/components/choice/index.cjs +1 -0
- package/dist/components/choice/index.d.ts +1 -0
- package/dist/components/choice/index.d.ts.map +10 -0
- package/dist/components/choice/index.js +1 -0
- package/dist/components/chunks/Icon-BTlX8dXa.js +1 -0
- package/dist/components/chunks/Icon-xNhleOos.js +77 -0
- package/dist/components/chunks/button-4_r-rdhN.js +1 -0
- package/dist/components/chunks/button-DFs4DmfC.js +575 -0
- package/dist/components/chunks/card-D8FpQZBD.js +1 -0
- package/dist/components/chunks/card-DhRHTSkL.js +58 -0
- package/dist/components/chunks/checkbox-Bakjptcp.js +1 -0
- package/dist/components/chunks/checkbox-D95xYxXV.js +169 -0
- package/dist/components/chunks/choice-BlAkXCQN.js +204 -0
- package/dist/components/chunks/choice-C0EYGPxa.js +1 -0
- package/dist/components/chunks/grid-DVHtippr.js +1 -0
- package/dist/components/chunks/grid-DqlQrFkp.js +62 -0
- package/dist/components/chunks/icon-BZolpoyx.js +1 -0
- package/dist/components/chunks/icon-a2ABTJf-.js +701 -0
- package/dist/components/chunks/link-C49HKGxh.js +75 -0
- package/dist/components/chunks/link-S0yBi9n7.js +1 -0
- package/dist/components/chunks/modal-B2sNSV2Q.js +1 -0
- package/dist/components/chunks/modal-BQlup2Mw.js +98 -0
- package/dist/components/chunks/page-BiSPS1-l.js +1 -0
- package/dist/components/chunks/page-DFKYJekL.js +112 -0
- package/dist/components/chunks/popover-BkTNH5gb.js +181 -0
- package/dist/components/chunks/popover-DFCs6KnJ.js +1 -0
- package/dist/components/chunks/spinner-Ch8momJm.js +63 -0
- package/dist/components/chunks/spinner-zGnecx3W.js +111 -0
- package/dist/components/chunks/stack-BvgkqvMX.js +1 -0
- package/dist/components/chunks/stack-DzZy3iH1.js +114 -0
- package/dist/components/chunks/switch-C5FOAA64.js +1 -0
- package/dist/components/chunks/switch-CCyMw1-M.js +138 -0
- package/dist/components/chunks/text-B-qq-sZ2.js +111 -0
- package/dist/components/chunks/text-nTrVku3e.js +1 -0
- package/dist/components/grid/Grid.d.ts +1 -0
- package/dist/components/grid/Grid.d.ts.map +10 -0
- package/dist/components/grid/index.cjs +1 -0
- package/dist/components/grid/index.d.ts +1 -0
- package/dist/components/grid/index.d.ts.map +10 -0
- package/dist/components/grid/index.js +2 -0
- package/dist/components/icon/Icon.d.ts +1 -0
- package/dist/components/icon/Icon.d.ts.map +10 -0
- package/dist/components/icon/index.cjs +1 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.d.ts.map +10 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/link/Link.d.ts +1 -0
- package/dist/components/link/Link.d.ts.map +10 -0
- package/dist/components/link/index.cjs +1 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/index.d.ts.map +10 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/modal/Modal.d.ts +1 -0
- package/dist/components/modal/Modal.d.ts.map +10 -0
- package/dist/components/modal/index.cjs +1 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/index.d.ts.map +10 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/page/Page.d.ts +1 -0
- package/dist/components/page/Page.d.ts.map +10 -0
- package/dist/components/page/index.cjs +1 -0
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/index.d.ts.map +10 -0
- package/dist/components/page/index.js +2 -0
- package/dist/components/popover/Popover.d.ts +1 -0
- package/dist/components/popover/Popover.d.ts.map +10 -0
- package/dist/components/popover/index.cjs +1 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.d.ts.map +10 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/spinner/Spinner.d.ts +1 -0
- package/dist/components/spinner/Spinner.d.ts.map +10 -0
- package/dist/components/spinner/index.cjs +1 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.d.ts.map +10 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/stack/Stack.d.ts +1 -0
- package/dist/components/stack/Stack.d.ts.map +10 -0
- package/dist/components/stack/index.cjs +1 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.d.ts.map +10 -0
- package/dist/components/stack/index.js +2 -0
- package/dist/components/switch/Switch.d.ts +1 -0
- package/dist/components/switch/Switch.d.ts.map +10 -0
- package/dist/components/switch/index.cjs +1 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.d.ts.map +10 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/text/Text.d.ts +1 -0
- package/dist/components/text/Text.d.ts.map +10 -0
- package/dist/components/text/index.cjs +1 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/index.d.ts.map +10 -0
- package/dist/components/text/index.js +2 -0
- package/dist/index.cjs +1 -63
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +10 -0
- package/dist/index.js +16 -2756
- package/dist/mintui-elements.d.ts +78 -0
- package/dist/mintui-elements.d.ts.map +10 -0
- package/dist/styles.css +1 -0
- package/package.json +51 -24
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
//#region src/components/spinner/Spinner.js
|
|
2
|
+
var e = class extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return [
|
|
5
|
+
"size",
|
|
6
|
+
"data-button-variant",
|
|
7
|
+
"data-button-tone"
|
|
8
|
+
];
|
|
9
|
+
}
|
|
10
|
+
constructor() {
|
|
11
|
+
super(), this._darkModeObserver = null;
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "inline-block"), this.render(), this._observeDarkMode();
|
|
15
|
+
}
|
|
16
|
+
attributeChangedCallback(e, t, n) {
|
|
17
|
+
t !== n && this.render();
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
this._darkModeObserver &&= (this._darkModeObserver.disconnect(), null);
|
|
21
|
+
}
|
|
22
|
+
_observeDarkMode() {
|
|
23
|
+
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => {
|
|
24
|
+
this.render();
|
|
25
|
+
}), this._darkModeObserver.observe(document.documentElement, {
|
|
26
|
+
attributes: !0,
|
|
27
|
+
attributeFilter: ["class"]
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
getSize() {
|
|
31
|
+
let e = this.getAttribute("size") || "default", t = {
|
|
32
|
+
default: "w-4 h-4",
|
|
33
|
+
large: "w-16 h-16"
|
|
34
|
+
};
|
|
35
|
+
return t[e] || t.default;
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
let e = this.getSize(), t = this.getAttribute("size") || "default", n = this.style.width && this.style.height, r = this.getAttribute("data-button-variant"), i = document.documentElement.classList.contains("dark"), a;
|
|
39
|
+
if (n) {
|
|
40
|
+
let e = this.getAttribute("data-button-tone") || "neutral";
|
|
41
|
+
a = r === "solid" ? e === "neutral" ? i ? "#ffffff" : "#0f172a" : "#ffffff" : i ? "#ffffff" : "#0f172a";
|
|
42
|
+
} else a = i ? "#e2e8f0" : "#0f172a";
|
|
43
|
+
let o = t === "large" ? "2" : "4", s = this.style.width && this.style.height;
|
|
44
|
+
this.innerHTML = `
|
|
45
|
+
<svg
|
|
46
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
47
|
+
fill="none"
|
|
48
|
+
viewBox="0 0 24 24"
|
|
49
|
+
class="mint-spinner-rotate ${s ? "" : e}"
|
|
50
|
+
style="${s ? `width: ${this.style.width}; height: ${this.style.height};` : ""} --mint-spinner-rotate-duration: 0.8s; --mint-spinner-dash-duration: 1.2s;"
|
|
51
|
+
>
|
|
52
|
+
<style>
|
|
53
|
+
@keyframes mint-spinner-rotate {
|
|
54
|
+
to { transform: rotate(360deg); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes mint-spinner-dash-array {
|
|
58
|
+
0% { stroke-dasharray: 0 62.83; }
|
|
59
|
+
25% { stroke-dasharray: 15.7 47.13; }
|
|
60
|
+
50% { stroke-dasharray: 31.4 31.4; }
|
|
61
|
+
75% { stroke-dasharray: 15.7 47.13; }
|
|
62
|
+
100% { stroke-dasharray: 0 62.83; }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes mint-spinner-dash-offset {
|
|
66
|
+
0% { stroke-dashoffset: 0; }
|
|
67
|
+
100% { stroke-dashoffset: -62.83; }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.mint-spinner-rotate {
|
|
71
|
+
transform-origin: 50% 50%;
|
|
72
|
+
transform-box: fill-box;
|
|
73
|
+
animation: mint-spinner-rotate var(--mint-spinner-rotate-duration, 0.8s) linear infinite;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.mint-spinner-progress {
|
|
77
|
+
animation:
|
|
78
|
+
mint-spinner-dash-array var(--mint-spinner-dash-duration, 1.2s) ease-in-out infinite,
|
|
79
|
+
mint-spinner-dash-offset var(--mint-spinner-dash-duration, 1.2s) linear infinite;
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
82
|
+
|
|
83
|
+
<circle
|
|
84
|
+
cx="12"
|
|
85
|
+
cy="12"
|
|
86
|
+
r="10"
|
|
87
|
+
stroke="${a}"
|
|
88
|
+
stroke-width="${o}"
|
|
89
|
+
opacity="0.25"
|
|
90
|
+
class="opacity-25"
|
|
91
|
+
></circle>
|
|
92
|
+
<circle
|
|
93
|
+
cx="12"
|
|
94
|
+
cy="12"
|
|
95
|
+
r="10"
|
|
96
|
+
stroke="${a}"
|
|
97
|
+
stroke-width="${o}"
|
|
98
|
+
stroke-linecap="round"
|
|
99
|
+
fill="none"
|
|
100
|
+
opacity="0.75"
|
|
101
|
+
stroke-dasharray="0 62.83"
|
|
102
|
+
stroke-dashoffset="0"
|
|
103
|
+
class="mint-spinner-progress"
|
|
104
|
+
/>
|
|
105
|
+
</svg>
|
|
106
|
+
`.trim();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
customElements.get("mint-spinner") || customElements.define("mint-spinner", e);
|
|
110
|
+
//#endregion
|
|
111
|
+
export { e as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class extends HTMLElement{static get observedAttributes(){return[`direction`,`text-align`]}constructor(){super()}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`block`),this.render(),this.getTextAlign()&&this._observeChildren()}attributeChangedCallback(e,t,n){t!==n&&(this.render(),e===`text-align`&&this._observeChildren())}_observeChildren(){this._childObserver||(this._childObserver=new MutationObserver(()=>{let e=this.getTextAlign();e&&this._applyTextAlignToChildren(e)}),this._childObserver.observe(this,{childList:!0,subtree:!1}))}disconnectedCallback(){this._childObserver&&=(this._childObserver.disconnect(),null)}getDirection(){return(this.getAttribute(`direction`)||`vertical`)===`horizontal`?`horizontal`:`vertical`}getTextAlign(){let e=this.getAttribute(`text-align`)||``;return[`left`,`center`,`right`,`justify`].includes(e)?e:``}getStackClasses(){let e=this.getDirection(),t=this.getTextAlign(),n=[`flex`,e===`horizontal`?`flex-row`:`flex-col`,`gap-3`];return t&&(n.push(`text-${t}`),n.push(`[&>*]:text-${t}`),n.push(`[&>*_.mint-button-content]:text-${t}`),t===`left`?(n.push(`[&>mint-button]:!justify-start`),n.push(`[&>mint-button>button]:!justify-start`)):t===`right`?(n.push(`[&>mint-button]:!justify-end`),n.push(`[&>mint-button>button]:!justify-end`)):t===`center`&&(n.push(`[&>mint-button]:!justify-center`),n.push(`[&>mint-button>button]:!justify-center`))),n.join(` `)}render(){let e=this.getStackClasses(),t=this.getTextAlign();[`flex`,`flex-row`,`flex-col`,`gap-1`,`gap-2`,`gap-3`,`text-left`,`text-center`,`text-right`,`text-justify`,`[&>*]:text-left`,`[&>*]:text-center`,`[&>*]:text-right`,`[&>*]:text-justify`,`[&>*_.mint-button-content]:text-left`,`[&>*_.mint-button-content]:text-center`,`[&>*_.mint-button-content]:text-right`,`[&>*_.mint-button-content]:text-justify`,`[&>mint-button]:!justify-start`,`[&>mint-button]:!justify-center`,`[&>mint-button]:!justify-end`,`[&>mint-button>button]:!justify-start`,`[&>mint-button>button]:!justify-center`,`[&>mint-button>button]:!justify-end`].forEach(e=>this.classList.remove(e)),e.split(` `).forEach(e=>{e&&this.classList.add(e)}),[`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`block`].forEach(e=>{this.classList.contains(e)||this.classList.add(e)}),t?this._applyTextAlignToChildren(t):this._removeTextAlignFromChildren()}_applyTextAlignToChildren(e){Array.from(this.children).forEach(t=>{if(t.tagName===`MINT-BUTTON`){let n=t.querySelector(`button`);if(n){n.classList.remove(`justify-start`,`justify-center`,`justify-end`),e===`left`?n.classList.add(`justify-start`):e===`right`?n.classList.add(`justify-end`):e===`center`&&n.classList.add(`justify-center`);let t=n.querySelector(`.mint-button-content`);t&&(t.classList.remove(`text-left`,`text-center`,`text-right`,`text-justify`),t.classList.add(`text-${e}`))}}else t.classList.remove(`text-left`,`text-center`,`text-right`,`text-justify`),t.classList.add(`text-${e}`)})}_removeTextAlignFromChildren(){Array.from(this.children).forEach(e=>{if(e.tagName===`MINT-BUTTON`){let t=e.querySelector(`button`);if(t){t.classList.remove(`justify-start`,`justify-end`),t.classList.add(`justify-center`);let e=t.querySelector(`.mint-button-content`);e&&e.classList.remove(`text-left`,`text-center`,`text-right`,`text-justify`)}}else e.classList.remove(`text-left`,`text-center`,`text-right`,`text-justify`)})}};customElements.get(`mint-stack`)||customElements.define(`mint-stack`,e),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//#region src/components/stack/Stack.js
|
|
2
|
+
var e = class extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return ["direction", "text-align"];
|
|
5
|
+
}
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "block"), this.render(), this.getTextAlign() && this._observeChildren();
|
|
11
|
+
}
|
|
12
|
+
attributeChangedCallback(e, t, n) {
|
|
13
|
+
t !== n && (this.render(), e === "text-align" && this._observeChildren());
|
|
14
|
+
}
|
|
15
|
+
_observeChildren() {
|
|
16
|
+
this._childObserver || (this._childObserver = new MutationObserver(() => {
|
|
17
|
+
let e = this.getTextAlign();
|
|
18
|
+
e && this._applyTextAlignToChildren(e);
|
|
19
|
+
}), this._childObserver.observe(this, {
|
|
20
|
+
childList: !0,
|
|
21
|
+
subtree: !1
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
this._childObserver &&= (this._childObserver.disconnect(), null);
|
|
26
|
+
}
|
|
27
|
+
getDirection() {
|
|
28
|
+
return (this.getAttribute("direction") || "vertical") === "horizontal" ? "horizontal" : "vertical";
|
|
29
|
+
}
|
|
30
|
+
getTextAlign() {
|
|
31
|
+
let e = this.getAttribute("text-align") || "";
|
|
32
|
+
return [
|
|
33
|
+
"left",
|
|
34
|
+
"center",
|
|
35
|
+
"right",
|
|
36
|
+
"justify"
|
|
37
|
+
].includes(e) ? e : "";
|
|
38
|
+
}
|
|
39
|
+
getStackClasses() {
|
|
40
|
+
let e = this.getDirection(), t = this.getTextAlign(), n = [
|
|
41
|
+
"flex",
|
|
42
|
+
e === "horizontal" ? "flex-row" : "flex-col",
|
|
43
|
+
"gap-3"
|
|
44
|
+
];
|
|
45
|
+
return t && (n.push(`text-${t}`), n.push(`[&>*]:text-${t}`), n.push(`[&>*_.mint-button-content]:text-${t}`), t === "left" ? (n.push("[&>mint-button]:!justify-start"), n.push("[&>mint-button>button]:!justify-start")) : t === "right" ? (n.push("[&>mint-button]:!justify-end"), n.push("[&>mint-button>button]:!justify-end")) : t === "center" && (n.push("[&>mint-button]:!justify-center"), n.push("[&>mint-button>button]:!justify-center"))), n.join(" ");
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
let e = this.getStackClasses(), t = this.getTextAlign();
|
|
49
|
+
[
|
|
50
|
+
"flex",
|
|
51
|
+
"flex-row",
|
|
52
|
+
"flex-col",
|
|
53
|
+
"gap-1",
|
|
54
|
+
"gap-2",
|
|
55
|
+
"gap-3",
|
|
56
|
+
"text-left",
|
|
57
|
+
"text-center",
|
|
58
|
+
"text-right",
|
|
59
|
+
"text-justify",
|
|
60
|
+
"[&>*]:text-left",
|
|
61
|
+
"[&>*]:text-center",
|
|
62
|
+
"[&>*]:text-right",
|
|
63
|
+
"[&>*]:text-justify",
|
|
64
|
+
"[&>*_.mint-button-content]:text-left",
|
|
65
|
+
"[&>*_.mint-button-content]:text-center",
|
|
66
|
+
"[&>*_.mint-button-content]:text-right",
|
|
67
|
+
"[&>*_.mint-button-content]:text-justify",
|
|
68
|
+
"[&>mint-button]:!justify-start",
|
|
69
|
+
"[&>mint-button]:!justify-center",
|
|
70
|
+
"[&>mint-button]:!justify-end",
|
|
71
|
+
"[&>mint-button>button]:!justify-start",
|
|
72
|
+
"[&>mint-button>button]:!justify-center",
|
|
73
|
+
"[&>mint-button>button]:!justify-end"
|
|
74
|
+
].forEach((e) => this.classList.remove(e)), e.split(" ").forEach((e) => {
|
|
75
|
+
e && this.classList.add(e);
|
|
76
|
+
}), [
|
|
77
|
+
"box-border",
|
|
78
|
+
"m-0",
|
|
79
|
+
"p-0",
|
|
80
|
+
"border-0",
|
|
81
|
+
"align-baseline",
|
|
82
|
+
"block"
|
|
83
|
+
].forEach((e) => {
|
|
84
|
+
this.classList.contains(e) || this.classList.add(e);
|
|
85
|
+
}), t ? this._applyTextAlignToChildren(t) : this._removeTextAlignFromChildren();
|
|
86
|
+
}
|
|
87
|
+
_applyTextAlignToChildren(e) {
|
|
88
|
+
Array.from(this.children).forEach((t) => {
|
|
89
|
+
if (t.tagName === "MINT-BUTTON") {
|
|
90
|
+
let n = t.querySelector("button");
|
|
91
|
+
if (n) {
|
|
92
|
+
n.classList.remove("justify-start", "justify-center", "justify-end"), e === "left" ? n.classList.add("justify-start") : e === "right" ? n.classList.add("justify-end") : e === "center" && n.classList.add("justify-center");
|
|
93
|
+
let t = n.querySelector(".mint-button-content");
|
|
94
|
+
t && (t.classList.remove("text-left", "text-center", "text-right", "text-justify"), t.classList.add(`text-${e}`));
|
|
95
|
+
}
|
|
96
|
+
} else t.classList.remove("text-left", "text-center", "text-right", "text-justify"), t.classList.add(`text-${e}`);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
_removeTextAlignFromChildren() {
|
|
100
|
+
Array.from(this.children).forEach((e) => {
|
|
101
|
+
if (e.tagName === "MINT-BUTTON") {
|
|
102
|
+
let t = e.querySelector("button");
|
|
103
|
+
if (t) {
|
|
104
|
+
t.classList.remove("justify-start", "justify-end"), t.classList.add("justify-center");
|
|
105
|
+
let e = t.querySelector(".mint-button-content");
|
|
106
|
+
e && e.classList.remove("text-left", "text-center", "text-right", "text-justify");
|
|
107
|
+
}
|
|
108
|
+
} else e.classList.remove("text-left", "text-center", "text-right", "text-justify");
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
customElements.get("mint-stack") || customElements.define("mint-stack", e);
|
|
113
|
+
//#endregion
|
|
114
|
+
export { e as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./Icon-BTlX8dXa.js`);var e=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`icon`]}constructor(){super(),this._button=null,this._checked=!1}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`inline-block`,`flex`,`items-center`),this._checked=this.hasAttribute(`checked`),this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null),t!==n&&this.render()}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this.render()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getIcon(){return this.getAttribute(`icon`)||``}hasIcon(){return!!this.getIcon()}getSwitchClasses(){let e=[`relative`,`inline-flex`,`items-center`,`rounded-full`,`h-5`,`w-10`,`border`,`transition-colors`,`duration-200`,`ease-in-out`,`outline-none`,`focus:outline-none`,`focus-visible:ring-2`,`focus-visible:ring-offset-2`,`focus-visible:ring-slate-500`,`dark:focus-visible:ring-slate-400`,`active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]`,`disabled:opacity-50`,`disabled:cursor-not-allowed`],t=this._checked?[`bg-slate-950`,`dark:bg-slate-600`,`border-slate-700`,`dark:border-slate-500`]:[`bg-slate-200`,`dark:bg-slate-400`,`border-slate-300`,`dark:border-slate-500`];return[...e,...t].join(` `)}getThumbClasses(){let e=[`relative`,`inline-block`,`rounded-full`,`bg-white`,`dark:bg-gray-50`,`h-4`,`w-4`,`shadow-lg`,`transform`,`transition-transform`,`duration-200`,`ease-in-out`,`pointer-events-none`,`overflow-hidden`],t=this._checked?`translate-x-5`:`translate-x-0.5`;return[...e,t].join(` `)}getIconClasses(){return[`absolute`,`inset-0`,`flex`,`items-center`,`justify-center`,`pointer-events-none`].join(` `)}render(){let e=this.getSwitchClasses(),t=this.getThumbClasses(),n=this.getLabel(),r=this.getIcon();this._button||(this._button=document.createElement(`button`),this.appendChild(this._button),this.setupEventListeners()),this._button.className=e,this._button.disabled=this.isDisabled(),this._button.setAttribute(`aria-checked`,this._checked),this._button.setAttribute(`aria-label`,n),this._button.setAttribute(`role`,`switch`),this._button.type=`button`;let i=this._button.querySelector(`span`);i||(i=document.createElement(`span`),this._button.appendChild(i)),i.className=t;let a=i.querySelector(`span`);if(r){let e=a;e||(e=document.createElement(`span`),e.className=this.getIconClasses(),i.appendChild(e));let t=e.querySelector(`mint-icon`);t||(t=document.createElement(`mint-icon`),e.appendChild(t)),t.setAttribute(`name`,r)}else a&&a.remove()}setupEventListeners(){this._button&&this._button.addEventListener(`click`,this.handleToggle.bind(this))}removeEventListeners(){this._button&&this._button.removeEventListener(`click`,this.handleToggle.bind(this))}handleToggle(e){this.isDisabled()||(this.checked=!this._checked,this.dispatchEvent(new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`toggle`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0})))}};customElements.get(`mint-switch`)||customElements.define(`mint-switch`,e),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import "./Icon-xNhleOos.js";
|
|
2
|
+
//#region src/components/switch/Switch.js
|
|
3
|
+
var e = class extends HTMLElement {
|
|
4
|
+
static get observedAttributes() {
|
|
5
|
+
return [
|
|
6
|
+
"checked",
|
|
7
|
+
"disabled",
|
|
8
|
+
"label",
|
|
9
|
+
"icon"
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
super(), this._button = null, this._checked = !1;
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "inline-block", "flex", "items-center"), this._checked = this.hasAttribute("checked"), this.render();
|
|
17
|
+
}
|
|
18
|
+
disconnectedCallback() {
|
|
19
|
+
this.removeEventListeners();
|
|
20
|
+
}
|
|
21
|
+
attributeChangedCallback(e, t, n) {
|
|
22
|
+
e === "checked" && (this._checked = n !== null), t !== n && this.render();
|
|
23
|
+
}
|
|
24
|
+
get checked() {
|
|
25
|
+
return this._checked;
|
|
26
|
+
}
|
|
27
|
+
set checked(e) {
|
|
28
|
+
e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checked = !!e, this.render();
|
|
29
|
+
}
|
|
30
|
+
isDisabled() {
|
|
31
|
+
return this.hasAttribute("disabled");
|
|
32
|
+
}
|
|
33
|
+
getLabel() {
|
|
34
|
+
return this.getAttribute("label") || "";
|
|
35
|
+
}
|
|
36
|
+
getIcon() {
|
|
37
|
+
return this.getAttribute("icon") || "";
|
|
38
|
+
}
|
|
39
|
+
hasIcon() {
|
|
40
|
+
return !!this.getIcon();
|
|
41
|
+
}
|
|
42
|
+
getSwitchClasses() {
|
|
43
|
+
let e = [
|
|
44
|
+
"relative",
|
|
45
|
+
"inline-flex",
|
|
46
|
+
"items-center",
|
|
47
|
+
"rounded-full",
|
|
48
|
+
"h-5",
|
|
49
|
+
"w-10",
|
|
50
|
+
"border",
|
|
51
|
+
"transition-colors",
|
|
52
|
+
"duration-200",
|
|
53
|
+
"ease-in-out",
|
|
54
|
+
"outline-none",
|
|
55
|
+
"focus:outline-none",
|
|
56
|
+
"focus-visible:ring-2",
|
|
57
|
+
"focus-visible:ring-offset-2",
|
|
58
|
+
"focus-visible:ring-slate-500",
|
|
59
|
+
"dark:focus-visible:ring-slate-400",
|
|
60
|
+
"active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]",
|
|
61
|
+
"disabled:opacity-50",
|
|
62
|
+
"disabled:cursor-not-allowed"
|
|
63
|
+
], t = this._checked ? [
|
|
64
|
+
"bg-slate-950",
|
|
65
|
+
"dark:bg-slate-600",
|
|
66
|
+
"border-slate-700",
|
|
67
|
+
"dark:border-slate-500"
|
|
68
|
+
] : [
|
|
69
|
+
"bg-slate-200",
|
|
70
|
+
"dark:bg-slate-400",
|
|
71
|
+
"border-slate-300",
|
|
72
|
+
"dark:border-slate-500"
|
|
73
|
+
];
|
|
74
|
+
return [...e, ...t].join(" ");
|
|
75
|
+
}
|
|
76
|
+
getThumbClasses() {
|
|
77
|
+
let e = [
|
|
78
|
+
"relative",
|
|
79
|
+
"inline-block",
|
|
80
|
+
"rounded-full",
|
|
81
|
+
"bg-white",
|
|
82
|
+
"dark:bg-gray-50",
|
|
83
|
+
"h-4",
|
|
84
|
+
"w-4",
|
|
85
|
+
"shadow-lg",
|
|
86
|
+
"transform",
|
|
87
|
+
"transition-transform",
|
|
88
|
+
"duration-200",
|
|
89
|
+
"ease-in-out",
|
|
90
|
+
"pointer-events-none",
|
|
91
|
+
"overflow-hidden"
|
|
92
|
+
], t = this._checked ? "translate-x-5" : "translate-x-0.5";
|
|
93
|
+
return [...e, t].join(" ");
|
|
94
|
+
}
|
|
95
|
+
getIconClasses() {
|
|
96
|
+
return [
|
|
97
|
+
"absolute",
|
|
98
|
+
"inset-0",
|
|
99
|
+
"flex",
|
|
100
|
+
"items-center",
|
|
101
|
+
"justify-center",
|
|
102
|
+
"pointer-events-none"
|
|
103
|
+
].join(" ");
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
let e = this.getSwitchClasses(), t = this.getThumbClasses(), n = this.getLabel(), r = this.getIcon();
|
|
107
|
+
this._button || (this._button = document.createElement("button"), this.appendChild(this._button), this.setupEventListeners()), this._button.className = e, this._button.disabled = this.isDisabled(), this._button.setAttribute("aria-checked", this._checked), this._button.setAttribute("aria-label", n), this._button.setAttribute("role", "switch"), this._button.type = "button";
|
|
108
|
+
let i = this._button.querySelector("span");
|
|
109
|
+
i || (i = document.createElement("span"), this._button.appendChild(i)), i.className = t;
|
|
110
|
+
let a = i.querySelector("span");
|
|
111
|
+
if (r) {
|
|
112
|
+
let e = a;
|
|
113
|
+
e || (e = document.createElement("span"), e.className = this.getIconClasses(), i.appendChild(e));
|
|
114
|
+
let t = e.querySelector("mint-icon");
|
|
115
|
+
t || (t = document.createElement("mint-icon"), e.appendChild(t)), t.setAttribute("name", r);
|
|
116
|
+
} else a && a.remove();
|
|
117
|
+
}
|
|
118
|
+
setupEventListeners() {
|
|
119
|
+
this._button && this._button.addEventListener("click", this.handleToggle.bind(this));
|
|
120
|
+
}
|
|
121
|
+
removeEventListeners() {
|
|
122
|
+
this._button && this._button.removeEventListener("click", this.handleToggle.bind(this));
|
|
123
|
+
}
|
|
124
|
+
handleToggle(e) {
|
|
125
|
+
this.isDisabled() || (this.checked = !this._checked, this.dispatchEvent(new CustomEvent("change", {
|
|
126
|
+
detail: { checked: this._checked },
|
|
127
|
+
bubbles: !0,
|
|
128
|
+
cancelable: !0
|
|
129
|
+
})), this.dispatchEvent(new CustomEvent("toggle", {
|
|
130
|
+
detail: { checked: this._checked },
|
|
131
|
+
bubbles: !0,
|
|
132
|
+
cancelable: !0
|
|
133
|
+
})));
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
customElements.get("mint-switch") || customElements.define("mint-switch", e);
|
|
137
|
+
//#endregion
|
|
138
|
+
export { e as t };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
//#region src/components/text/Text.js
|
|
2
|
+
var e = class extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return [
|
|
5
|
+
"variant",
|
|
6
|
+
"size",
|
|
7
|
+
"bold",
|
|
8
|
+
"underline",
|
|
9
|
+
"strike",
|
|
10
|
+
"italic",
|
|
11
|
+
"display"
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
constructor() {
|
|
15
|
+
super(), this._darkModeObserver = null, this._userClasses = /* @__PURE__ */ new Set();
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline"), this._captureUserClasses(), this.render(), this._observeDarkMode();
|
|
19
|
+
}
|
|
20
|
+
_captureUserClasses() {
|
|
21
|
+
Array.from(this.classList).forEach((e) => this._userClasses.add(e));
|
|
22
|
+
}
|
|
23
|
+
attributeChangedCallback(e, t, n) {
|
|
24
|
+
t !== n && this.render();
|
|
25
|
+
}
|
|
26
|
+
disconnectedCallback() {
|
|
27
|
+
this._darkModeObserver &&= (this._darkModeObserver.disconnect(), null);
|
|
28
|
+
}
|
|
29
|
+
_observeDarkMode() {
|
|
30
|
+
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => {
|
|
31
|
+
this.render();
|
|
32
|
+
}), this._darkModeObserver.observe(document.documentElement, {
|
|
33
|
+
attributes: !0,
|
|
34
|
+
attributeFilter: ["class"]
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
getVariant() {
|
|
38
|
+
return this.getAttribute("variant") || "default";
|
|
39
|
+
}
|
|
40
|
+
getSize() {
|
|
41
|
+
return this.getAttribute("size") || "regular";
|
|
42
|
+
}
|
|
43
|
+
isBold() {
|
|
44
|
+
return this.hasAttribute("bold");
|
|
45
|
+
}
|
|
46
|
+
isUnderline() {
|
|
47
|
+
return this.hasAttribute("underline");
|
|
48
|
+
}
|
|
49
|
+
isStrike() {
|
|
50
|
+
return this.hasAttribute("strike");
|
|
51
|
+
}
|
|
52
|
+
isItalic() {
|
|
53
|
+
return this.hasAttribute("italic");
|
|
54
|
+
}
|
|
55
|
+
getDisplay() {
|
|
56
|
+
return this.hasAttribute("display") ? this.getAttribute("display") : this.getSize() === "regular" ? "inline-block" : "block";
|
|
57
|
+
}
|
|
58
|
+
getTextClasses() {
|
|
59
|
+
let e = this.getSize(), t = this.getVariant(), n = document.documentElement.classList.contains("dark"), r = {
|
|
60
|
+
heading: ["font-semibold"],
|
|
61
|
+
"sub-heading": ["font-medium"],
|
|
62
|
+
regular: []
|
|
63
|
+
}, i = {
|
|
64
|
+
default: n ? ["text-gray-100"] : ["text-gray-900"],
|
|
65
|
+
muted: ["text-gray-400"],
|
|
66
|
+
danger: n ? ["text-red-400"] : ["text-red-600"],
|
|
67
|
+
success: n ? ["text-green-400"] : ["text-green-600"]
|
|
68
|
+
}, a = [];
|
|
69
|
+
this.isBold() && a.push("font-bold"), this.isUnderline() && a.push("underline"), this.isStrike() && a.push("line-through"), this.isItalic() && a.push("italic");
|
|
70
|
+
let o = this.getDisplay();
|
|
71
|
+
return [
|
|
72
|
+
o === "block" ? "block" : o === "inline" ? "inline" : "inline-block",
|
|
73
|
+
...r[e] || r.regular,
|
|
74
|
+
...i[t] || i.default,
|
|
75
|
+
...a
|
|
76
|
+
].join(" ");
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
let e = this.getSize(), t = [
|
|
80
|
+
"text-gray-100",
|
|
81
|
+
"text-gray-900",
|
|
82
|
+
"text-gray-400",
|
|
83
|
+
"text-red-400",
|
|
84
|
+
"text-red-600",
|
|
85
|
+
"text-green-400",
|
|
86
|
+
"text-green-600"
|
|
87
|
+
], n = [
|
|
88
|
+
"text-2xl",
|
|
89
|
+
"text-lg",
|
|
90
|
+
"text-sm"
|
|
91
|
+
];
|
|
92
|
+
n.forEach((e) => {
|
|
93
|
+
this.classList.remove(e), this._userClasses.delete(e);
|
|
94
|
+
}), t.forEach((e) => {
|
|
95
|
+
this.classList.remove(e), this._userClasses.delete(e);
|
|
96
|
+
});
|
|
97
|
+
let r = this.getTextClasses().split(" ").filter((e) => e.trim());
|
|
98
|
+
Array.from(this.classList).forEach((e) => {
|
|
99
|
+
!t.includes(e) && !n.includes(e) && this._userClasses.add(e);
|
|
100
|
+
}), this.className = [...new Set([...r, ...Array.from(this._userClasses)])].join(" ");
|
|
101
|
+
let i = {
|
|
102
|
+
heading: "clamp(1.25rem, 2.5vw + 0.5rem, 1.5rem)",
|
|
103
|
+
"sub-heading": "clamp(1rem, 1.5vw + 0.5rem, 1.125rem)",
|
|
104
|
+
regular: "clamp(0.875rem, 1vw + 0.5rem, 0.875rem)"
|
|
105
|
+
}, a = i[e] || i.regular;
|
|
106
|
+
this.style.setProperty("font-size", a);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
customElements.get("mint-text") || customElements.define("mint-text", e);
|
|
110
|
+
//#endregion
|
|
111
|
+
export { e as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class extends HTMLElement{static get observedAttributes(){return[`variant`,`size`,`bold`,`underline`,`strike`,`italic`,`display`]}constructor(){super(),this._darkModeObserver=null,this._userClasses=new Set}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`),this._captureUserClasses(),this.render(),this._observeDarkMode()}_captureUserClasses(){Array.from(this.classList).forEach(e=>this._userClasses.add(e))}attributeChangedCallback(e,t,n){t!==n&&this.render()}disconnectedCallback(){this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}_observeDarkMode(){this._darkModeObserver||(this._darkModeObserver=new MutationObserver(()=>{this.render()}),this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}))}getVariant(){return this.getAttribute(`variant`)||`default`}getSize(){return this.getAttribute(`size`)||`regular`}isBold(){return this.hasAttribute(`bold`)}isUnderline(){return this.hasAttribute(`underline`)}isStrike(){return this.hasAttribute(`strike`)}isItalic(){return this.hasAttribute(`italic`)}getDisplay(){return this.hasAttribute(`display`)?this.getAttribute(`display`):this.getSize()===`regular`?`inline-block`:`block`}getTextClasses(){let e=this.getSize(),t=this.getVariant(),n=document.documentElement.classList.contains(`dark`),r={heading:[`font-semibold`],"sub-heading":[`font-medium`],regular:[]},i={default:n?[`text-gray-100`]:[`text-gray-900`],muted:[`text-gray-400`],danger:n?[`text-red-400`]:[`text-red-600`],success:n?[`text-green-400`]:[`text-green-600`]},a=[];this.isBold()&&a.push(`font-bold`),this.isUnderline()&&a.push(`underline`),this.isStrike()&&a.push(`line-through`),this.isItalic()&&a.push(`italic`);let o=this.getDisplay();return[o===`block`?`block`:o===`inline`?`inline`:`inline-block`,...r[e]||r.regular,...i[t]||i.default,...a].join(` `)}render(){let e=this.getSize(),t=[`text-gray-100`,`text-gray-900`,`text-gray-400`,`text-red-400`,`text-red-600`,`text-green-400`,`text-green-600`],n=[`text-2xl`,`text-lg`,`text-sm`];n.forEach(e=>{this.classList.remove(e),this._userClasses.delete(e)}),t.forEach(e=>{this.classList.remove(e),this._userClasses.delete(e)});let r=this.getTextClasses().split(` `).filter(e=>e.trim());Array.from(this.classList).forEach(e=>{!t.includes(e)&&!n.includes(e)&&this._userClasses.add(e)}),this.className=[...new Set([...r,...Array.from(this._userClasses)])].join(` `);let i={heading:`clamp(1.25rem, 2.5vw + 0.5rem, 1.5rem)`,"sub-heading":`clamp(1rem, 1.5vw + 0.5rem, 1.125rem)`,regular:`clamp(0.875rem, 1vw + 0.5rem, 0.875rem)`},a=i[e]||i.regular;this.style.setProperty(`font-size`,a)}};customElements.get(`mint-text`)||customElements.define(`mint-text`,e),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MintGrid as default, MintGrid } from '../../mintui-elements'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../chunks/grid-DVHtippr.js`);module.exports=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, MintGrid } from './Grid'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MintIcon as default, MintIcon, registerIcon, getIcon, hasIcon, getAllIcons } from '../../mintui-elements'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../chunks/Icon-BTlX8dXa.js`);require(`../chunks/icon-BZolpoyx.js`),exports.default=e.t,exports.getAllIcons=e.n,exports.getIcon=e.r,exports.hasIcon=e.i,exports.registerIcon=e.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MintLink as default, MintLink } from '../../mintui-elements'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../chunks/link-S0yBi9n7.js`);module.exports=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, MintLink } from './Link'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MintModal as default, MintModal } from '../../mintui-elements'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../chunks/modal-B2sNSV2Q.js`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, MintModal } from './Modal'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../chunks/modal-BQlup2Mw.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MintPage as default, MintPage } from '../../mintui-elements'
|