monobill-mintui 0.4.93 → 0.5.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/components/button/Button.d.ts.map +1 -1
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/chart/Chart.d.ts +0 -2
- package/dist/components/chart/Chart.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/choice/ChoiceOption.d.ts.map +1 -1
- package/dist/components/clickable/Clickable.d.ts.map +1 -1
- package/dist/components/icon/Icon.d.ts +1 -0
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/icons/index.cjs +2 -2
- package/dist/components/icon/icons/index.js +103 -113
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/side-navigation/SideNavigation.d.ts.map +1 -1
- package/dist/components/side-navigation/SideNavigationActionMenu.d.ts.map +1 -1
- package/dist/components/side-navigation/SideNavigationLink.d.ts.map +1 -1
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/tabs/Tab.d.ts.map +1 -1
- package/dist/components/tags/Tags.d.ts.map +1 -1
- package/dist/components/top-navigation/TopNavigation.d.ts +41 -5
- package/dist/components/top-navigation/TopNavigation.d.ts.map +1 -1
- package/dist/index.cjs +17 -30
- package/dist/index.js +449 -285
- package/dist/{menu-CeF8GTxj.cjs → search-CEaBjA3d.cjs} +1 -1
- package/dist/{menu-BD7OJkcn.js → search-DMCxWW8i.js} +11 -1
- package/package.json +1 -1
- package/tailwind.preset.cjs +55 -4
- package/tailwind.preset.js +75 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as e } from "./search-DMCxWW8i.js";
|
|
2
2
|
//#region src/components/spinner/Spinner.ts
|
|
3
3
|
var t = class extends HTMLElement {
|
|
4
4
|
static get observedAttributes() {
|
|
@@ -93,7 +93,7 @@ customElements.get("mint-spinner") || customElements.define("mint-spinner", t);
|
|
|
93
93
|
//#region src/components/icon/Icon.ts
|
|
94
94
|
var n = class extends HTMLElement {
|
|
95
95
|
static get observedAttributes() {
|
|
96
|
-
return ["name"];
|
|
96
|
+
return ["name", "color"];
|
|
97
97
|
}
|
|
98
98
|
constructor() {
|
|
99
99
|
super(), this._darkModeObserver = null;
|
|
@@ -121,6 +121,18 @@ var n = class extends HTMLElement {
|
|
|
121
121
|
getName() {
|
|
122
122
|
return this.getAttribute("name") || "";
|
|
123
123
|
}
|
|
124
|
+
_normalizeColorValue(e) {
|
|
125
|
+
if (!e) return "";
|
|
126
|
+
let t = e.trim();
|
|
127
|
+
if (!t) return "";
|
|
128
|
+
if (/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t) || /^rgba?\(\s*[\d.\s]+,\s*[\d.\s]+,\s*[\d.\s]+(?:,\s*[\d.\s]+)?\s*\)$/.test(t)) return t;
|
|
129
|
+
if (/^\(\s*[\d.\s]+,\s*[\d.\s]+,\s*[\d.\s]+(?:,\s*[\d.\s]+)?\s*\)$/.test(t)) {
|
|
130
|
+
let e = t.slice(1, -1).trim().split(",").map((e) => e.trim());
|
|
131
|
+
if (e.length === 3) return `rgb(${e.join(", ")})`;
|
|
132
|
+
if (e.length === 4) return `rgba(${e.join(", ")})`;
|
|
133
|
+
}
|
|
134
|
+
return "";
|
|
135
|
+
}
|
|
124
136
|
generateSVGMarkup(e) {
|
|
125
137
|
if (e.customSvg) return e.customSvg;
|
|
126
138
|
let t;
|
|
@@ -139,12 +151,12 @@ var n = class extends HTMLElement {
|
|
|
139
151
|
render() {
|
|
140
152
|
let t = this.getName();
|
|
141
153
|
if (!t) {
|
|
142
|
-
this.innerHTML = "", this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.backgroundColor = "";
|
|
154
|
+
this.innerHTML = "", this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.backgroundColor = "", this.style.color = "";
|
|
143
155
|
return;
|
|
144
156
|
}
|
|
145
157
|
let n = e(t);
|
|
146
158
|
if (!n) {
|
|
147
|
-
console.warn(`Icon "${t}" not found. Make sure you've imported the icon: import '@monobill-mintui/icon/icons/${t}'`), this.innerHTML = "", this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.backgroundColor = "";
|
|
159
|
+
console.warn(`Icon "${t}" not found. Make sure you've imported the icon: import '@monobill-mintui/icon/icons/${t}'`), this.innerHTML = "", this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.backgroundColor = "", this.style.color = "";
|
|
148
160
|
return;
|
|
149
161
|
}
|
|
150
162
|
let r = this.closest("mint-button") || this.parentElement?.closest("mint-button"), i = this.closest("mint-switch") || this.parentElement?.closest("mint-switch"), a = this.closest("mint-select") || this.parentElement?.closest("mint-select"), o = !!this.closest("mint-sidenav-link") && !r && !i && !a;
|
|
@@ -156,7 +168,13 @@ var n = class extends HTMLElement {
|
|
|
156
168
|
}
|
|
157
169
|
this.innerHTML = this.generateSVGMarkup(n), this.style.maskImage = "", this.style.webkitMaskImage = "", this.style.maskSize = "", this.style.webkitMaskSize = "", this.style.maskRepeat = "", this.style.webkitMaskRepeat = "", this.style.maskPosition = "", this.style.webkitMaskPosition = "", this.style.backgroundColor = "", this.style.aspectRatio = "1 / 1";
|
|
158
170
|
let s = this.querySelector("svg");
|
|
159
|
-
|
|
171
|
+
s && (s.style.width = "100%", s.style.height = "100%");
|
|
172
|
+
let c = this._normalizeColorValue(this.getAttribute("color"));
|
|
173
|
+
if (c) {
|
|
174
|
+
this.style.color = c, this.classList.remove("text-gray-100", "text-gray-900");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (this.style.color = "", i) this.classList.remove("text-gray-100", "text-gray-900"), this.classList.add("text-gray-900");
|
|
160
178
|
else if (!r && !o) {
|
|
161
179
|
let e = document.documentElement.classList.contains("dark") ? "text-gray-100" : "text-gray-900";
|
|
162
180
|
this.classList.remove("text-gray-100", "text-gray-900"), this.classList.add(e);
|
|
@@ -274,32 +292,32 @@ var r = class e extends HTMLElement {
|
|
|
274
292
|
let e = `${this.getVariant()}-${this.getTone()}`;
|
|
275
293
|
return {
|
|
276
294
|
"solid-action": [
|
|
277
|
-
"!bg-
|
|
278
|
-
"dark:!bg-
|
|
279
|
-
"hover:!bg-
|
|
280
|
-
"dark:hover:!bg-
|
|
281
|
-
"!border-t-
|
|
282
|
-
"!border-l-
|
|
283
|
-
"!border-r-
|
|
284
|
-
"!border-b-
|
|
285
|
-
"dark:!border-t-
|
|
286
|
-
"dark:!border-l-
|
|
287
|
-
"dark:!border-r-
|
|
288
|
-
"dark:!border-b-
|
|
295
|
+
"!bg-neutral-900",
|
|
296
|
+
"dark:!bg-neutral-700",
|
|
297
|
+
"hover:!bg-neutral-900",
|
|
298
|
+
"dark:hover:!bg-neutral-700",
|
|
299
|
+
"!border-t-neutral-900",
|
|
300
|
+
"!border-l-neutral-900",
|
|
301
|
+
"!border-r-neutral-600",
|
|
302
|
+
"!border-b-neutral-600",
|
|
303
|
+
"dark:!border-t-neutral-700",
|
|
304
|
+
"dark:!border-l-neutral-700",
|
|
305
|
+
"dark:!border-r-neutral-500",
|
|
306
|
+
"dark:!border-b-neutral-500"
|
|
289
307
|
],
|
|
290
308
|
"solid-neutral": [
|
|
291
309
|
"!bg-gray-100",
|
|
292
|
-
"dark:!bg-
|
|
310
|
+
"dark:!bg-mint-hover",
|
|
293
311
|
"hover:!bg-gray-100",
|
|
294
|
-
"dark:hover:!bg-
|
|
312
|
+
"dark:hover:!bg-mint-hover",
|
|
295
313
|
"!border-t-gray-400",
|
|
296
314
|
"!border-l-gray-400",
|
|
297
315
|
"!border-r-gray-200",
|
|
298
316
|
"!border-b-gray-200",
|
|
299
317
|
"dark:!border-t-gray-950",
|
|
300
318
|
"dark:!border-l-gray-950",
|
|
301
|
-
"dark:!border-r-
|
|
302
|
-
"dark:!border-b-
|
|
319
|
+
"dark:!border-r-mint-divider",
|
|
320
|
+
"dark:!border-b-mint-divider"
|
|
303
321
|
],
|
|
304
322
|
"solid-info": [
|
|
305
323
|
"!bg-blue-900",
|
|
@@ -346,19 +364,19 @@ var r = class e extends HTMLElement {
|
|
|
346
364
|
"ghost-action": [
|
|
347
365
|
"!bg-gray-100",
|
|
348
366
|
"!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
349
|
-
"dark:!bg-
|
|
367
|
+
"dark:!bg-mint-hover",
|
|
350
368
|
"hover:!bg-gray-100",
|
|
351
|
-
"dark:hover:!bg-
|
|
369
|
+
"dark:hover:!bg-mint-hover",
|
|
352
370
|
"hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]"
|
|
353
371
|
],
|
|
354
372
|
"ghost-neutral": [
|
|
355
373
|
"!bg-gray-50",
|
|
356
374
|
"!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
357
|
-
"dark:!bg-
|
|
375
|
+
"dark:!bg-mint-hover",
|
|
358
376
|
"!text-gray-900",
|
|
359
377
|
"dark:!text-white",
|
|
360
378
|
"hover:!bg-gray-50",
|
|
361
|
-
"dark:hover:!bg-
|
|
379
|
+
"dark:hover:!bg-mint-hover",
|
|
362
380
|
"hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
363
381
|
"hover:!text-gray-900",
|
|
364
382
|
"dark:hover:!text-white"
|
|
@@ -366,32 +384,32 @@ var r = class e extends HTMLElement {
|
|
|
366
384
|
"ghost-info": [
|
|
367
385
|
"!bg-gray-100",
|
|
368
386
|
"!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
369
|
-
"dark:!bg-
|
|
387
|
+
"dark:!bg-mint-hover",
|
|
370
388
|
"hover:!bg-gray-100",
|
|
371
|
-
"dark:hover:!bg-
|
|
389
|
+
"dark:hover:!bg-mint-hover",
|
|
372
390
|
"hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]"
|
|
373
391
|
],
|
|
374
392
|
"ghost-warning": [
|
|
375
393
|
"!bg-gray-100",
|
|
376
394
|
"!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
377
|
-
"dark:!bg-
|
|
395
|
+
"dark:!bg-mint-hover",
|
|
378
396
|
"hover:!bg-gray-100",
|
|
379
|
-
"dark:hover:!bg-
|
|
397
|
+
"dark:hover:!bg-mint-hover",
|
|
380
398
|
"hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]"
|
|
381
399
|
],
|
|
382
400
|
"ghost-danger": [
|
|
383
401
|
"!bg-gray-100",
|
|
384
402
|
"!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
385
|
-
"dark:!bg-
|
|
403
|
+
"dark:!bg-mint-hover",
|
|
386
404
|
"hover:!bg-gray-100",
|
|
387
|
-
"dark:hover:!bg-
|
|
405
|
+
"dark:hover:!bg-mint-hover",
|
|
388
406
|
"hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]"
|
|
389
407
|
],
|
|
390
408
|
"link-action": [
|
|
391
|
-
"!text-
|
|
392
|
-
"dark:!text-
|
|
393
|
-
"hover:!text-
|
|
394
|
-
"dark:hover:!text-
|
|
409
|
+
"!text-neutral-900",
|
|
410
|
+
"dark:!text-neutral-300",
|
|
411
|
+
"hover:!text-neutral-900",
|
|
412
|
+
"dark:hover:!text-neutral-300"
|
|
395
413
|
],
|
|
396
414
|
"link-neutral": [
|
|
397
415
|
"!text-gray-950",
|
|
@@ -441,8 +459,6 @@ var r = class e extends HTMLElement {
|
|
|
441
459
|
"min-h-[2.25rem]"
|
|
442
460
|
],
|
|
443
461
|
"text-sm",
|
|
444
|
-
"transition-all",
|
|
445
|
-
"duration-100",
|
|
446
462
|
"outline-none",
|
|
447
463
|
"focus:outline-none",
|
|
448
464
|
"focus-visible:ring-2",
|
|
@@ -451,18 +467,18 @@ var r = class e extends HTMLElement {
|
|
|
451
467
|
"disabled:opacity-50",
|
|
452
468
|
"disabled:cursor-not-allowed"
|
|
453
469
|
], a = this.getTone(), o = {
|
|
454
|
-
"solid-action": /* @__PURE__ */ "bg-
|
|
455
|
-
"solid-neutral": /* @__PURE__ */ "bg-white.dark:bg-
|
|
470
|
+
"solid-action": /* @__PURE__ */ "bg-neutral-800.dark:bg-neutral-600.text-white.hover:bg-neutral-950.dark:hover:bg-neutral-700.active:bg-neutral-900.dark:active:bg-neutral-700.disabled:active:bg-neutral-800.dark:disabled:active:bg-neutral-600.focus-visible:ring-gray-400.dark:focus-visible:ring-gray-500.border-2.border-t-neutral-600.border-l-neutral-600.border-r-neutral-900.border-b-neutral-900.dark:border-t-neutral-500.dark:border-l-neutral-500.dark:border-r-neutral-700.dark:border-b-neutral-700.active:border-t-neutral-900.active:border-l-neutral-900.active:border-r-neutral-600.active:border-b-neutral-600.dark:active:border-t-neutral-700.dark:active:border-l-neutral-700.dark:active:border-r-neutral-500.dark:active:border-b-neutral-500.disabled:active:border-t-neutral-600.disabled:active:border-l-neutral-600.disabled:active:border-r-neutral-900.disabled:active:border-b-neutral-900.dark:disabled:active:border-t-neutral-500.dark:disabled:active:border-l-neutral-500.dark:disabled:active:border-r-neutral-700.dark:disabled:active:border-b-neutral-700.[&[data-loading=\"true\"]:active]:border-t-neutral-600.[&[data-loading=\"true\"]:active]:border-l-neutral-600.[&[data-loading=\"true\"]:active]:border-r-neutral-900.[&[data-loading=\"true\"]:active]:border-b-neutral-900.[&[data-loading=\"true\"]:active]:dark:border-t-neutral-500.[&[data-loading=\"true\"]:active]:dark:border-l-neutral-500.[&[data-loading=\"true\"]:active]:dark:border-r-neutral-700.[&[data-loading=\"true\"]:active]:dark:border-b-neutral-700".split("."),
|
|
471
|
+
"solid-neutral": /* @__PURE__ */ "bg-white.dark:bg-mint-canvas.text-gray-900.dark:text-white.hover:bg-gray-50.dark:hover:bg-mint-hover.active:bg-gray-100.dark:active:bg-mint-hover.disabled:active:bg-white.dark:disabled:active:bg-mint-canvas.focus-visible:ring-gray-400.dark:focus-visible:ring-gray-500.border-2.border-t-gray-200.border-l-gray-200.border-r-gray-300.border-b-gray-300.dark:border-t-gray-600.dark:border-l-gray-600.dark:border-r-mint-divider.dark:border-b-mint-divider.active:border-t-gray-400.active:border-l-gray-400.active:border-r-gray-200.active:border-b-gray-200.dark:active:border-t-gray-950.dark:active:border-l-gray-950.dark:active:border-r-mint-divider.dark:active:border-b-mint-divider.disabled:active:border-t-gray-200.disabled:active:border-l-gray-200.disabled:active:border-r-gray-400.disabled:active:border-b-gray-400.dark:disabled:active:border-t-mint-divider.dark:disabled:active:border-l-mint-divider.dark:disabled:active:border-r-gray-950.dark:disabled:active:border-b-gray-950.[&[data-loading=\"true\"]:active]:border-t-gray-200.[&[data-loading=\"true\"]:active]:border-l-gray-200.[&[data-loading=\"true\"]:active]:border-r-gray-400.[&[data-loading=\"true\"]:active]:border-b-gray-400.[&[data-loading=\"true\"]:active]:dark:border-t-mint-divider.[&[data-loading=\"true\"]:active]:dark:border-l-mint-divider.[&[data-loading=\"true\"]:active]:dark:border-r-gray-950.[&[data-loading=\"true\"]:active]:dark:border-b-gray-950".split("."),
|
|
456
472
|
"solid-info": /* @__PURE__ */ "bg-blue-800.dark:bg-blue-600.text-white.hover:bg-blue-950.dark:hover:bg-blue-700.active:bg-blue-900.dark:active:bg-blue-700.disabled:active:bg-blue-800.dark:disabled:active:bg-blue-600.focus-visible:ring-gray-400.dark:focus-visible:ring-gray-500.border-2.border-t-blue-600.border-l-blue-600.border-r-blue-900.border-b-blue-900.dark:border-t-blue-500.dark:border-l-blue-500.dark:border-r-blue-700.dark:border-b-blue-700.active:border-t-blue-900.active:border-l-blue-900.active:border-r-blue-600.active:border-b-blue-600.dark:active:border-t-blue-700.dark:active:border-l-blue-700.dark:active:border-r-blue-500.dark:active:border-b-blue-500.disabled:active:border-t-blue-600.disabled:active:border-l-blue-600.disabled:active:border-r-blue-900.disabled:active:border-b-blue-900.dark:disabled:active:border-t-blue-500.dark:disabled:active:border-l-blue-500.dark:disabled:active:border-r-blue-700.dark:disabled:active:border-b-blue-700.[&[data-loading=\"true\"]:active]:border-t-blue-600.[&[data-loading=\"true\"]:active]:border-l-blue-600.[&[data-loading=\"true\"]:active]:border-r-blue-900.[&[data-loading=\"true\"]:active]:border-b-blue-900.[&[data-loading=\"true\"]:active]:dark:border-t-blue-500.[&[data-loading=\"true\"]:active]:dark:border-l-blue-500.[&[data-loading=\"true\"]:active]:dark:border-r-blue-700.[&[data-loading=\"true\"]:active]:dark:border-b-blue-700".split("."),
|
|
457
473
|
"solid-warning": /* @__PURE__ */ "bg-amber-800.dark:bg-amber-600.text-white.hover:bg-amber-950.dark:hover:bg-amber-700.active:bg-amber-900.dark:active:bg-amber-700.disabled:active:bg-amber-800.dark:disabled:active:bg-amber-600.focus-visible:ring-gray-400.dark:focus-visible:ring-gray-500.border-2.border-t-amber-600.border-l-amber-600.border-r-amber-900.border-b-amber-900.dark:border-t-amber-500.dark:border-l-amber-500.dark:border-r-amber-700.dark:border-b-amber-700.active:border-t-amber-900.active:border-l-amber-900.active:border-r-amber-600.active:border-b-amber-600.dark:active:border-t-amber-700.dark:active:border-l-amber-700.dark:active:border-r-amber-500.dark:active:border-b-amber-500.disabled:active:border-t-amber-600.disabled:active:border-l-amber-600.disabled:active:border-r-amber-900.disabled:active:border-b-amber-900.dark:disabled:active:border-t-amber-500.dark:disabled:active:border-l-amber-500.dark:disabled:active:border-r-amber-700.dark:disabled:active:border-b-amber-700.[&[data-loading=\"true\"]:active]:border-t-amber-600.[&[data-loading=\"true\"]:active]:border-l-amber-600.[&[data-loading=\"true\"]:active]:border-r-amber-900.[&[data-loading=\"true\"]:active]:border-b-amber-900.[&[data-loading=\"true\"]:active]:dark:border-t-amber-500.[&[data-loading=\"true\"]:active]:dark:border-l-amber-500.[&[data-loading=\"true\"]:active]:dark:border-r-amber-700.[&[data-loading=\"true\"]:active]:dark:border-b-amber-700".split("."),
|
|
458
474
|
"solid-danger": /* @__PURE__ */ "bg-red-800.dark:bg-red-600.text-white.hover:bg-red-950.dark:hover:bg-red-700.active:bg-red-900.dark:active:bg-red-700.disabled:active:bg-red-800.dark:disabled:active:bg-red-600.focus-visible:ring-gray-400.dark:focus-visible:ring-gray-500.border-2.border-t-red-600.border-l-red-600.border-r-red-900.border-b-red-900.dark:border-t-red-500.dark:border-l-red-500.dark:border-r-red-700.dark:border-b-red-700.active:border-t-red-900.active:border-l-red-900.active:border-r-red-600.active:border-b-red-600.dark:active:border-t-red-700.dark:active:border-l-red-700.dark:active:border-r-red-500.dark:active:border-b-red-500.disabled:active:border-t-red-600.disabled:active:border-l-red-600.disabled:active:border-r-red-900.disabled:active:border-b-red-900.dark:disabled:active:border-t-red-500.dark:disabled:active:border-l-red-500.dark:disabled:active:border-r-red-700.dark:disabled:active:border-b-red-700.[&[data-loading=\"true\"]:active]:border-t-red-600.[&[data-loading=\"true\"]:active]:border-l-red-600.[&[data-loading=\"true\"]:active]:border-r-red-900.[&[data-loading=\"true\"]:active]:border-b-red-900.[&[data-loading=\"true\"]:active]:dark:border-t-red-500.[&[data-loading=\"true\"]:active]:dark:border-l-red-500.[&[data-loading=\"true\"]:active]:dark:border-r-red-700.[&[data-loading=\"true\"]:active]:dark:border-b-red-700".split("."),
|
|
459
475
|
"ghost-action": [
|
|
460
476
|
"bg-transparent",
|
|
461
|
-
"text-
|
|
462
|
-
"dark:text-
|
|
477
|
+
"text-neutral-800",
|
|
478
|
+
"dark:text-neutral-400",
|
|
463
479
|
"active:bg-gray-100",
|
|
464
480
|
"active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
465
|
-
"dark:active:bg-
|
|
481
|
+
"dark:active:bg-mint-hover",
|
|
466
482
|
"disabled:active:bg-transparent",
|
|
467
483
|
"dark:disabled:active:bg-transparent",
|
|
468
484
|
"disabled:active:shadow-none",
|
|
@@ -479,7 +495,7 @@ var r = class e extends HTMLElement {
|
|
|
479
495
|
"dark:text-gray-200",
|
|
480
496
|
"active:bg-gray-50",
|
|
481
497
|
"active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
482
|
-
"dark:active:bg-
|
|
498
|
+
"dark:active:bg-mint-hover",
|
|
483
499
|
"active:text-gray-900",
|
|
484
500
|
"dark:active:text-white",
|
|
485
501
|
"disabled:active:bg-transparent",
|
|
@@ -498,7 +514,7 @@ var r = class e extends HTMLElement {
|
|
|
498
514
|
"dark:text-blue-400",
|
|
499
515
|
"active:bg-gray-100",
|
|
500
516
|
"active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
501
|
-
"dark:active:bg-
|
|
517
|
+
"dark:active:bg-mint-hover",
|
|
502
518
|
"disabled:active:bg-transparent",
|
|
503
519
|
"dark:disabled:active:bg-transparent",
|
|
504
520
|
"disabled:active:shadow-none",
|
|
@@ -515,7 +531,7 @@ var r = class e extends HTMLElement {
|
|
|
515
531
|
"dark:text-amber-400",
|
|
516
532
|
"active:bg-gray-100",
|
|
517
533
|
"active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
518
|
-
"dark:active:bg-
|
|
534
|
+
"dark:active:bg-mint-hover",
|
|
519
535
|
"disabled:active:bg-transparent",
|
|
520
536
|
"dark:disabled:active:bg-transparent",
|
|
521
537
|
"disabled:active:shadow-none",
|
|
@@ -532,7 +548,7 @@ var r = class e extends HTMLElement {
|
|
|
532
548
|
"dark:text-red-400",
|
|
533
549
|
"active:bg-gray-100",
|
|
534
550
|
"active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]",
|
|
535
|
-
"dark:active:bg-
|
|
551
|
+
"dark:active:bg-mint-hover",
|
|
536
552
|
"disabled:active:bg-transparent",
|
|
537
553
|
"dark:disabled:active:bg-transparent",
|
|
538
554
|
"disabled:active:shadow-none",
|
|
@@ -545,12 +561,12 @@ var r = class e extends HTMLElement {
|
|
|
545
561
|
],
|
|
546
562
|
"link-action": [
|
|
547
563
|
"bg-transparent",
|
|
548
|
-
"text-
|
|
549
|
-
"dark:text-
|
|
550
|
-
"hover:text-
|
|
551
|
-
"dark:hover:text-
|
|
552
|
-
"active:text-
|
|
553
|
-
"dark:active:text-
|
|
564
|
+
"text-neutral-800",
|
|
565
|
+
"dark:text-neutral-400",
|
|
566
|
+
"hover:text-neutral-950",
|
|
567
|
+
"dark:hover:text-neutral-200",
|
|
568
|
+
"active:text-neutral-900",
|
|
569
|
+
"dark:active:text-neutral-300",
|
|
554
570
|
"disabled:active:bg-transparent",
|
|
555
571
|
"dark:disabled:active:bg-transparent",
|
|
556
572
|
"disabled:active:shadow-none",
|
|
@@ -827,9 +843,6 @@ var i = class extends HTMLElement {
|
|
|
827
843
|
"h-5",
|
|
828
844
|
"w-10",
|
|
829
845
|
"border",
|
|
830
|
-
"transition-colors",
|
|
831
|
-
"duration-200",
|
|
832
|
-
"ease-in-out",
|
|
833
846
|
"outline-none",
|
|
834
847
|
"focus:outline-none",
|
|
835
848
|
"focus-visible:ring-2",
|
|
@@ -839,13 +852,13 @@ var i = class extends HTMLElement {
|
|
|
839
852
|
"disabled:opacity-50",
|
|
840
853
|
"disabled:cursor-not-allowed"
|
|
841
854
|
], n = this._checked ? [
|
|
842
|
-
"bg-
|
|
843
|
-
"dark:bg-
|
|
844
|
-
e ? "border-red-300 dark:border-red-300" : "border-
|
|
855
|
+
"bg-neutral-900",
|
|
856
|
+
"dark:bg-neutral-700",
|
|
857
|
+
e ? "border-red-300 dark:border-red-300" : "border-neutral-800 dark:border-neutral-600"
|
|
845
858
|
] : [
|
|
846
|
-
"bg-
|
|
847
|
-
"dark:bg-
|
|
848
|
-
e ? "border-red-300 dark:border-red-300" : "border-
|
|
859
|
+
"bg-neutral-200",
|
|
860
|
+
"dark:bg-neutral-600",
|
|
861
|
+
e ? "border-red-300 dark:border-red-300" : "border-neutral-300 dark:border-neutral-500"
|
|
849
862
|
];
|
|
850
863
|
return [...t, ...n].join(" ");
|
|
851
864
|
}
|
|
@@ -932,9 +945,9 @@ var i = class extends HTMLElement {
|
|
|
932
945
|
if (e) {
|
|
933
946
|
t.classList.contains("relative") || t.classList.add("relative"), i || (i = document.createElement("div"), i.className = "mint-switch-skeleton-container absolute inset-0 z-10 pointer-events-none flex items-center gap-2", t.appendChild(i));
|
|
934
947
|
let e = i.querySelector(".mint-switch-skeleton-box");
|
|
935
|
-
if (e || (e = document.createElement("div"), e.className = "mint-switch-skeleton-box flex-shrink-0 w-10 h-5 rounded-full bg-gray-200 dark:bg-
|
|
948
|
+
if (e || (e = document.createElement("div"), e.className = "mint-switch-skeleton-box flex-shrink-0 w-10 h-5 rounded-full bg-gray-200 dark:bg-mint-hover animate-pulse", i.appendChild(e)), n) {
|
|
936
949
|
let e = i.querySelector(".mint-switch-skeleton-label");
|
|
937
|
-
e || (e = document.createElement("div"), e.className = "mint-switch-skeleton-label h-4 w-24 rounded bg-gray-200 dark:bg-
|
|
950
|
+
e || (e = document.createElement("div"), e.className = "mint-switch-skeleton-label h-4 w-24 rounded bg-gray-200 dark:bg-mint-hover animate-pulse", i.appendChild(e));
|
|
938
951
|
} else {
|
|
939
952
|
let e = i.querySelector(".mint-switch-skeleton-label");
|
|
940
953
|
e && e.remove();
|
|
@@ -942,7 +955,7 @@ var i = class extends HTMLElement {
|
|
|
942
955
|
i.style.display = "flex", this._button && (this._button.style.visibility = "hidden", this._button.style.pointerEvents = "none");
|
|
943
956
|
let o = t.querySelector(".mint-switch-label");
|
|
944
957
|
if (o && (o.style.visibility = "hidden", o.style.pointerEvents = "none"), r) {
|
|
945
|
-
a || (a = document.createElement("div"), a.className = "mint-switch-info-skeleton h-3 w-32 rounded bg-gray-200 dark:bg-
|
|
958
|
+
a || (a = document.createElement("div"), a.className = "mint-switch-info-skeleton h-3 w-32 rounded bg-gray-200 dark:bg-mint-hover animate-pulse mt-2", t && t.parentElement === this ? this.insertBefore(a, t.nextSibling) : this.appendChild(a)), a.style.display = "block";
|
|
946
959
|
let e = this.querySelector(".mint-switch-info");
|
|
947
960
|
e && (e.style.display = "none");
|
|
948
961
|
} else a && (a.style.display = "none");
|
|
@@ -1214,7 +1227,7 @@ var s = class extends HTMLElement {
|
|
|
1214
1227
|
return Array.from(this.classList).some((e) => /^p-\d+|^px-|^py-|^pt-|^pb-|^pl-|^pr-/.test(e));
|
|
1215
1228
|
}
|
|
1216
1229
|
render() {
|
|
1217
|
-
this.classList.add("rounded-lg", "shadow", "bg-white", "dark:bg-
|
|
1230
|
+
this.classList.add("rounded-lg", "shadow", "bg-white", "dark:bg-mint-elevated", "border", "border-gray-200", "dark:border-mint-divider", "overflow-hidden"), this.hasPaddingClass() || this.classList.add("p-4");
|
|
1218
1231
|
let e = this.getHeading();
|
|
1219
1232
|
e ? (this._headingElement || (this._headingElement = document.createElement("mint-text"), this._headingElement.setAttribute("size", "sub-heading"), this.insertBefore(this._headingElement, this.firstChild)), this._headingElement.textContent = e) : this._headingElement && this._headingElement.parentNode && (this._headingElement.remove(), this._headingElement = null);
|
|
1220
1233
|
}
|
|
@@ -1270,8 +1283,6 @@ var c = class extends HTMLElement {
|
|
|
1270
1283
|
"underline",
|
|
1271
1284
|
"hover:text-slate-950",
|
|
1272
1285
|
"dark:hover:text-slate-100",
|
|
1273
|
-
"transition-colors",
|
|
1274
|
-
"duration-200",
|
|
1275
1286
|
"focus-visible:outline-none",
|
|
1276
1287
|
"focus-visible:ring-2",
|
|
1277
1288
|
"focus-visible:ring-offset-1",
|
|
@@ -1395,10 +1406,10 @@ var u = class extends HTMLElement {
|
|
|
1395
1406
|
}), this._updateBackgroundColor();
|
|
1396
1407
|
}
|
|
1397
1408
|
_applyContainerClasses() {
|
|
1398
|
-
this._pageContainer && (this._pageContainer.classList.add("
|
|
1409
|
+
this._pageContainer && (this._pageContainer.classList.add("p-8"), this.getAttribute("containered") === "true" ? this._pageContainer.classList.add("max-w-6xl", "mx-auto", "w-full") : this._pageContainer.classList.remove("max-w-6xl", "mx-auto", "w-full"));
|
|
1399
1410
|
}
|
|
1400
1411
|
_updateBackgroundColor() {
|
|
1401
|
-
this._pageContainer && (document.documentElement.classList.contains("dark") ? (this._pageContainer.classList.remove("bg-gray-20"), this._pageContainer.classList.add("bg-
|
|
1412
|
+
this._pageContainer && (document.documentElement.classList.contains("dark") ? (this._pageContainer.classList.remove("bg-gray-20"), this._pageContainer.classList.add("bg-mint-canvas")) : (this._pageContainer.classList.remove("bg-mint-canvas"), this._pageContainer.classList.add("bg-gray-20")));
|
|
1402
1413
|
}
|
|
1403
1414
|
_observeDarkMode() {
|
|
1404
1415
|
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => {
|
|
@@ -1530,16 +1541,16 @@ var f = class extends HTMLElement {
|
|
|
1530
1541
|
let e = this.getId(), t = this.getHeading(), n = this.isOpen();
|
|
1531
1542
|
if (e && (this.id = e), this._overlay || (this._overlay = document.createElement("div"), this._overlay.className = "fixed inset-0 bg-black/50 transition-opacity duration-200 z-40", this._overlay.addEventListener("click", () => this.close()), this.appendChild(this._overlay)), this._modal || (this._modal = document.createElement("div"), this._modal.className = "fixed inset-0 flex items-center justify-center p-2 pointer-events-none z-50", this.appendChild(this._modal)), n) {
|
|
1532
1543
|
let e = this._modal.querySelector(".modal-content");
|
|
1533
|
-
e || (e = document.createElement("div"), e.className = "modal-content bg-white dark:bg-
|
|
1544
|
+
e || (e = document.createElement("div"), e.className = "modal-content bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col pointer-events-auto transform", this._modal.appendChild(e)), this._animateEnter();
|
|
1534
1545
|
} else this._animateExit();
|
|
1535
1546
|
let r = this._modal.querySelector(".modal-content");
|
|
1536
|
-
r || (r = document.createElement("div"), r.className = "modal-content bg-white dark:bg-
|
|
1547
|
+
r || (r = document.createElement("div"), r.className = "modal-content bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col pointer-events-auto transform", this._modal.appendChild(r)), this._header || (this._header = document.createElement("div"), this._header.className = "flex items-center justify-between p-4 border-b border-gray-200 dark:border-mint-divider", r.appendChild(this._header)), this._headingSlot || (this._headingSlot = document.createElement("div"), this._headingSlot.className = "flex-1", this._headingSlot.setAttribute("slot", "heading"), this._header.appendChild(this._headingSlot));
|
|
1537
1548
|
let i = this._headingSlot.querySelector("mint-text");
|
|
1538
1549
|
t ? (i || (i = document.createElement("mint-text"), i.setAttribute("size", "sub-heading"), i.setAttribute("bold", "true"), this._headingSlot.appendChild(i)), i.textContent = t) : i && i.remove(), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._headingSlot && e.getAttribute("slot") === "heading").forEach((e) => {
|
|
1539
1550
|
this._headingSlot && e.parentElement !== this._headingSlot && this._headingSlot.appendChild(e);
|
|
1540
1551
|
}), this._closeButton || (this._closeButton = document.createElement("mint-button"), this._closeButton.setAttribute("variant", "ghost"), this._closeButton.setAttribute("icon", "close"), this._closeButton.addEventListener("click", () => this.close()), this._header.appendChild(this._closeButton)), this._bodySlot || (this._bodySlot = document.createElement("div"), this._bodySlot.className = "flex-1 overflow-y-auto p-4", this._bodySlot.setAttribute("slot", "body"), r.appendChild(this._bodySlot)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._bodySlot && e.getAttribute("slot") === "body").forEach((e) => {
|
|
1541
1552
|
this._bodySlot && e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
1542
|
-
}), this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "p-4 border-t border-gray-200 dark:border-
|
|
1553
|
+
}), this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "p-4 border-t border-gray-200 dark:border-mint-divider", this._actionsSlot.setAttribute("slot", "actions"), r.appendChild(this._actionsSlot));
|
|
1543
1554
|
let a = this._actionsSlot.querySelector("mint-stack");
|
|
1544
1555
|
a || (a = document.createElement("mint-stack"), a.setAttribute("direction", "horizontal"), a.className = "justify-end", this._actionsSlot.appendChild(a)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._actionsSlot && e.getAttribute("slot") === "actions").forEach((e) => {
|
|
1545
1556
|
Array.from(e.children).forEach((e) => {
|
|
@@ -1552,7 +1563,7 @@ var f = class extends HTMLElement {
|
|
|
1552
1563
|
_updateBackgroundColor() {
|
|
1553
1564
|
if (!this._modal) return;
|
|
1554
1565
|
let e = document.documentElement.classList.contains("dark"), t = this._modal.querySelector(".modal-content");
|
|
1555
|
-
t && (e ? (t.classList.remove("bg-white"), t.classList.add("bg-
|
|
1566
|
+
t && (e ? (t.classList.remove("bg-white"), t.classList.add("bg-mint-elevated", "border", "border-mint-divider")) : (t.classList.remove("bg-mint-elevated", "border", "border-mint-divider"), t.classList.add("bg-white")));
|
|
1556
1567
|
}
|
|
1557
1568
|
_observeDarkMode() {
|
|
1558
1569
|
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => {
|
|
@@ -1564,7 +1575,7 @@ var f = class extends HTMLElement {
|
|
|
1564
1575
|
}
|
|
1565
1576
|
_animateEnter() {
|
|
1566
1577
|
let e = this._modal?.querySelector(".modal-content");
|
|
1567
|
-
e && (e.style.transform = "scale(0.97) translateY(10px)", e.style.opacity = "0", e.style.transition = "
|
|
1578
|
+
e && (e.style.transform = "scale(0.97) translateY(10px)", e.style.opacity = "0", e.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", this.classList.remove("hidden"), requestAnimationFrame(() => {
|
|
1568
1579
|
requestAnimationFrame(() => {
|
|
1569
1580
|
e.style.transform = "scale(1) translateY(0)", e.style.opacity = "1";
|
|
1570
1581
|
});
|
|
@@ -1576,7 +1587,7 @@ var f = class extends HTMLElement {
|
|
|
1576
1587
|
this.classList.add("hidden");
|
|
1577
1588
|
return;
|
|
1578
1589
|
}
|
|
1579
|
-
e.style.transition = "
|
|
1590
|
+
e.style.transition = "opacity 200ms ease-in, transform 200ms ease-in", e.style.transform = "scale(0.97) translateY(10px)", e.style.opacity = "0", setTimeout(() => {
|
|
1580
1591
|
this.classList.add("hidden"), e.style.transform = "", e.style.opacity = "", e.style.transition = "";
|
|
1581
1592
|
}, 200);
|
|
1582
1593
|
}
|
|
@@ -1623,8 +1634,8 @@ var p = class extends HTMLElement {
|
|
|
1623
1634
|
attributeChangedCallback(e, t, n) {
|
|
1624
1635
|
if (t !== n) {
|
|
1625
1636
|
if (this.isConnected) {
|
|
1626
|
-
let e = this._isInsideModal() ? "z-[
|
|
1627
|
-
this.classList.remove("z-50", "z-[60]"), this.classList.add(e);
|
|
1637
|
+
let e = this._isInsideModal() ? "z-[80]" : "z-[60]";
|
|
1638
|
+
this.classList.remove("z-50", "z-[60]", "z-[80]"), this.classList.add(e);
|
|
1628
1639
|
}
|
|
1629
1640
|
this.render(), (e === "trigger-id" || e === "hover") && this._setupTrigger(), e === "open" && this.isOpen() && this._closeOtherPopovers();
|
|
1630
1641
|
}
|
|
@@ -1796,24 +1807,24 @@ var p = class extends HTMLElement {
|
|
|
1796
1807
|
});
|
|
1797
1808
|
}), this._clickOutsideHandler &&= (document.removeEventListener("click", this._clickOutsideHandler, !1), null);
|
|
1798
1809
|
if (this._overlay) {
|
|
1799
|
-
let e = this._isInsideModal() ? "z-[
|
|
1810
|
+
let e = this._isInsideModal() ? "z-[75]" : "z-[55]";
|
|
1800
1811
|
this._overlay.className = `fixed inset-0 pointer-events-none ${e}`, this._overlay.parentElement !== this && this.appendChild(this._overlay);
|
|
1801
1812
|
} else {
|
|
1802
1813
|
this._overlay = document.createElement("div");
|
|
1803
|
-
let e = this._isInsideModal() ? "z-[
|
|
1814
|
+
let e = this._isInsideModal() ? "z-[75]" : "z-[55]";
|
|
1804
1815
|
this._overlay.className = `fixed inset-0 pointer-events-none ${e}`, this.appendChild(this._overlay);
|
|
1805
1816
|
}
|
|
1806
1817
|
if (this._popover) {
|
|
1807
|
-
let e = this._isInsideModal() ? "z-[
|
|
1818
|
+
let e = this._isInsideModal() ? "z-[80]" : "z-[60]";
|
|
1808
1819
|
this._popover.className = `fixed ${e} pointer-events-auto`, this._popover.parentElement !== this && this.appendChild(this._popover);
|
|
1809
1820
|
} else {
|
|
1810
1821
|
this._popover = document.createElement("div");
|
|
1811
|
-
let e = this._isInsideModal() ? "z-[
|
|
1822
|
+
let e = this._isInsideModal() ? "z-[80]" : "z-[60]";
|
|
1812
1823
|
this._popover.className = `fixed ${e} pointer-events-auto`, this.appendChild(this._popover);
|
|
1813
1824
|
}
|
|
1814
1825
|
this.isHoverEnabled() && this._attachHoverListeners();
|
|
1815
1826
|
let r = this._popover.querySelector(".popover-content");
|
|
1816
|
-
if (!r) r = document.createElement("div"), r.className = `popover-content bg-white dark:bg-
|
|
1827
|
+
if (!r) r = document.createElement("div"), r.className = `popover-content bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider rounded-lg shadow-xl ${n} transform`, this._popover.appendChild(r);
|
|
1817
1828
|
else {
|
|
1818
1829
|
let e = r.className.split(" "), t = [
|
|
1819
1830
|
"p-0",
|
|
@@ -1838,18 +1849,18 @@ var p = class extends HTMLElement {
|
|
|
1838
1849
|
}
|
|
1839
1850
|
Array.from(this.children).forEach((e) => {
|
|
1840
1851
|
e !== this._overlay && e !== this._popover && e.parentElement === this && r.appendChild(e);
|
|
1841
|
-
}), t ? (this._triggerElement || this._setupTrigger(), this._setupPositionListeners(), this.offsetHeight, this._triggerElement ? this._updatePosition(r) : (this._popover.style.top = "50%", this._popover.style.left = "50%", this._popover.style.transform = "translate(-50%, -50%)", this._popover.style.visibility = "visible", this._popover.style.display = "block", r.style.transform = "scale(0.97) translateY(10px)", r.style.opacity = "0", r.style.transition = "
|
|
1852
|
+
}), t ? (this._triggerElement || this._setupTrigger(), this._setupPositionListeners(), this.offsetHeight, this._triggerElement ? this._updatePosition(r) : (this._popover.style.top = "50%", this._popover.style.left = "50%", this._popover.style.transform = "translate(-50%, -50%)", this._popover.style.visibility = "visible", this._popover.style.display = "block", r.style.transform = "scale(0.97) translateY(10px)", r.style.opacity = "0", r.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", requestAnimationFrame(() => {
|
|
1842
1853
|
requestAnimationFrame(() => {
|
|
1843
1854
|
r.style.transform = "scale(1) translateY(0)", r.style.opacity = "1";
|
|
1844
1855
|
});
|
|
1845
|
-
}))) : !t && r && (this._removePositionListeners(), r.style.opacity !== "0" && r.style.opacity !== "" && (r.style.transition = "
|
|
1856
|
+
}))) : !t && r && (this._removePositionListeners(), r.style.opacity !== "0" && r.style.opacity !== "" && (r.style.transition = "opacity 200ms ease-in, transform 200ms ease-in", r.style.transform = "scale(0.97) translateY(10px)", r.style.opacity = "0", setTimeout(() => {
|
|
1846
1857
|
r.style.transform = "", r.style.opacity = "", r.style.transition = "", this._popover.style.visibility = "", this._popover.style.display = "";
|
|
1847
1858
|
}, 200))), this._updateBackgroundColor();
|
|
1848
1859
|
}
|
|
1849
1860
|
_updateBackgroundColor() {
|
|
1850
1861
|
if (!this._popover) return;
|
|
1851
1862
|
let e = document.documentElement.classList.contains("dark"), t = this._popover.querySelector(".popover-content");
|
|
1852
|
-
t && (e ? (t.classList.remove("bg-white"), t.classList.add("bg-
|
|
1863
|
+
t && (e ? (t.classList.remove("bg-white"), t.classList.add("bg-mint-elevated", "border", "border-mint-divider")) : (t.classList.remove("bg-mint-elevated", "border", "border-mint-divider"), t.classList.add("bg-white")));
|
|
1853
1864
|
}
|
|
1854
1865
|
_observeDarkMode() {
|
|
1855
1866
|
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => {
|
|
@@ -1864,7 +1875,7 @@ var p = class extends HTMLElement {
|
|
|
1864
1875
|
let t = this._popover.style.visibility !== "hidden";
|
|
1865
1876
|
t || (this._popover.style.visibility = "hidden", this._popover.style.display = "block", this._popover.style.top = "0", this._popover.style.left = "0"), this._popover.offsetHeight;
|
|
1866
1877
|
let n = this._calculatePosition();
|
|
1867
|
-
this._popover.style.top = `${n.top}px`, this._popover.style.left = `${n.left}px`, t || (this._popover.style.visibility = "visible", e && (!e.style.opacity || e.style.opacity === "") && (e.style.transform = "scale(0.97) translateY(10px)", e.style.opacity = "0", e.style.transition = "
|
|
1878
|
+
this._popover.style.top = `${n.top}px`, this._popover.style.left = `${n.left}px`, t || (this._popover.style.visibility = "visible", e && (!e.style.opacity || e.style.opacity === "") && (e.style.transform = "scale(0.97) translateY(10px)", e.style.opacity = "0", e.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", requestAnimationFrame(() => {
|
|
1868
1879
|
requestAnimationFrame(() => {
|
|
1869
1880
|
e.style.transform = "scale(1) translateY(0)", e.style.opacity = "1";
|
|
1870
1881
|
});
|
|
@@ -1992,8 +2003,6 @@ var m = class extends HTMLElement {
|
|
|
1992
2003
|
"h-5",
|
|
1993
2004
|
"rounded",
|
|
1994
2005
|
"border-2",
|
|
1995
|
-
"transition-all",
|
|
1996
|
-
"duration-200",
|
|
1997
2006
|
"outline-none",
|
|
1998
2007
|
"focus:outline-none",
|
|
1999
2008
|
"focus-visible:ring-2",
|
|
@@ -2003,12 +2012,12 @@ var m = class extends HTMLElement {
|
|
|
2003
2012
|
"disabled:opacity-40",
|
|
2004
2013
|
"disabled:cursor-not-allowed"
|
|
2005
2014
|
], n = this._checked ? [
|
|
2006
|
-
"bg-
|
|
2007
|
-
"dark:bg-
|
|
2008
|
-
e ? "border-red-300 dark:border-red-300" : "border-
|
|
2015
|
+
"bg-neutral-800",
|
|
2016
|
+
"dark:bg-neutral-600",
|
|
2017
|
+
e ? "border-red-300 dark:border-red-300" : "border-neutral-800 dark:border-neutral-600"
|
|
2009
2018
|
] : [
|
|
2010
2019
|
"bg-white",
|
|
2011
|
-
"dark:bg-
|
|
2020
|
+
"dark:bg-mint-elevated",
|
|
2012
2021
|
e ? "border-red-300 dark:border-red-300" : "border-gray-300 dark:border-gray-500"
|
|
2013
2022
|
];
|
|
2014
2023
|
return [...t, ...n].join(" ");
|
|
@@ -2076,7 +2085,7 @@ var m = class extends HTMLElement {
|
|
|
2076
2085
|
}, this._checkbox.addEventListener("change", this._changeHandler), this._mousedownHandler = (e) => {
|
|
2077
2086
|
e.stopPropagation();
|
|
2078
2087
|
let t = this.querySelector(".mint-checkbox-wrapper");
|
|
2079
|
-
t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "rgb(
|
|
2088
|
+
t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "rgb(38 38 38)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.3)") : (t.style.backgroundColor = "rgb(243 244 246)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.1)"), document.documentElement.classList.contains("dark") && (this._checked ? t.style.backgroundColor = "rgb(64 64 64)" : t.style.backgroundColor = "rgb(48 48 48)"));
|
|
2080
2089
|
}, this._mouseupHandler = (e) => {
|
|
2081
2090
|
e.stopPropagation();
|
|
2082
2091
|
let t = this.querySelector(".mint-checkbox-wrapper");
|
|
@@ -2095,7 +2104,7 @@ var m = class extends HTMLElement {
|
|
|
2095
2104
|
}, this._checkbox.addEventListener("focus", this._focusHandler), this._checkbox.addEventListener("blur", this._blurHandler), this._touchstartHandler = (e) => {
|
|
2096
2105
|
e.stopPropagation();
|
|
2097
2106
|
let t = this.querySelector(".mint-checkbox-wrapper");
|
|
2098
|
-
t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "rgb(
|
|
2107
|
+
t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "rgb(38 38 38)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.3)") : (t.style.backgroundColor = "rgb(243 244 246)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.1)"), document.documentElement.classList.contains("dark") && (this._checked ? t.style.backgroundColor = "rgb(64 64 64)" : t.style.backgroundColor = "rgb(48 48 48)"));
|
|
2099
2108
|
}, this._touchendHandler = (e) => {
|
|
2100
2109
|
e.stopPropagation();
|
|
2101
2110
|
let t = this.querySelector(".mint-checkbox-wrapper");
|
|
@@ -2135,9 +2144,9 @@ var m = class extends HTMLElement {
|
|
|
2135
2144
|
if (e) {
|
|
2136
2145
|
t || (t = document.createElement("div"), t.className = "mint-checkbox-skeleton-container absolute inset-0 z-10 pointer-events-none flex items-center gap-2", n ? n.appendChild(t) : (this.style.position = "relative", this.appendChild(t)));
|
|
2137
2146
|
let e = t.querySelector(".mint-checkbox-skeleton-box");
|
|
2138
|
-
if (e || (e = document.createElement("div"), e.className = "mint-checkbox-skeleton-box flex-shrink-0 w-5 h-5 rounded bg-gray-200 dark:bg-
|
|
2147
|
+
if (e || (e = document.createElement("div"), e.className = "mint-checkbox-skeleton-box flex-shrink-0 w-5 h-5 rounded bg-gray-200 dark:bg-mint-hover animate-pulse", t.appendChild(e)), i) {
|
|
2139
2148
|
let e = t.querySelector(".mint-checkbox-skeleton-label");
|
|
2140
|
-
e || (e = document.createElement("div"), e.className = "mint-checkbox-skeleton-label h-4 w-24 rounded bg-gray-200 dark:bg-
|
|
2149
|
+
e || (e = document.createElement("div"), e.className = "mint-checkbox-skeleton-label h-4 w-24 rounded bg-gray-200 dark:bg-mint-hover animate-pulse", t.appendChild(e));
|
|
2141
2150
|
}
|
|
2142
2151
|
t.style.display = "flex", r && (r.style.visibility = "hidden", r.style.pointerEvents = "none"), i && (i.style.visibility = "hidden", i.style.pointerEvents = "none");
|
|
2143
2152
|
} else t && (t.style.display = "none"), r && (r.style.visibility = "visible", r.style.pointerEvents = "auto"), i && (i.style.visibility = "visible", i.style.pointerEvents = "auto");
|
|
@@ -2286,7 +2295,7 @@ var h = class extends HTMLElement {
|
|
|
2286
2295
|
t > 0 && e.remove();
|
|
2287
2296
|
});
|
|
2288
2297
|
let c = s.querySelector(".mint-choice-option-indicator");
|
|
2289
|
-
c || (c = document.createElement("div"), c.className = "mint-choice-option-indicator", s.appendChild(c)), c.className = "mint-choice-option-indicator w-2 h-2 rounded-full bg-white
|
|
2298
|
+
c || (c = document.createElement("div"), c.className = "mint-choice-option-indicator", s.appendChild(c)), c.className = "mint-choice-option-indicator w-2 h-2 rounded-full bg-white pointer-events-none", c.style.position = "absolute", c.style.top = "50%", c.style.left = "50%", c.style.transform = this._checked ? "translate(-50%, -50%) scale(1)" : "translate(-50%, -50%) scale(0)", c.style.opacity = this._checked ? "1" : "0", this._updateVisualState(), this._renderSkeleton(e);
|
|
2290
2299
|
let l = this.getInfo(), u = this.querySelector(".mint-choice-option-label-container");
|
|
2291
2300
|
if (i || l) {
|
|
2292
2301
|
u || (u = document.createElement("div"), u.className = "mint-choice-option-label-container flex flex-col gap-0.5", this.appendChild(u), Array.from(this.childNodes).forEach((e) => {
|
|
@@ -2308,12 +2317,10 @@ var h = class extends HTMLElement {
|
|
|
2308
2317
|
"h-[1rem]",
|
|
2309
2318
|
"rounded-full",
|
|
2310
2319
|
"border-2",
|
|
2311
|
-
"transition-all",
|
|
2312
|
-
"duration-200",
|
|
2313
2320
|
"flex-shrink-0",
|
|
2314
2321
|
"mt-0.5"
|
|
2315
2322
|
];
|
|
2316
|
-
return e && t.push("opacity-40", "cursor-not-allowed"), this._checked ? t.push("bg-slate-800", "dark:bg-slate-600", "border-slate-800", "dark:border-slate-600") : t.push("bg-white", "dark:bg-
|
|
2323
|
+
return e && t.push("opacity-40", "cursor-not-allowed"), this._checked ? t.push("bg-slate-800", "dark:bg-slate-600", "border-slate-800", "dark:border-slate-600") : t.push("bg-white", "dark:bg-mint-elevated", "border-gray-300", "dark:border-gray-500"), t.join(" ");
|
|
2317
2324
|
}
|
|
2318
2325
|
_updateVisualState() {
|
|
2319
2326
|
let e = this.querySelector(".mint-choice-option-wrapper");
|
|
@@ -2326,7 +2333,7 @@ var h = class extends HTMLElement {
|
|
|
2326
2333
|
if (e) {
|
|
2327
2334
|
t || (t = document.createElement("div"), t.className = "mint-choice-option-skeleton-container absolute inset-0 z-10 pointer-events-none flex items-center gap-2", n ? (n.classList.contains("relative") || n.classList.add("relative"), n.appendChild(t)) : (this.style.position = "relative", this.appendChild(t)));
|
|
2328
2335
|
let e = t.querySelector(".mint-choice-option-skeleton-radio");
|
|
2329
|
-
if (e || (e = document.createElement("div"), e.className = "mint-choice-option-skeleton-radio flex-shrink-0 w-5 h-5 rounded-full bg-gray-200 dark:bg-
|
|
2336
|
+
if (e || (e = document.createElement("div"), e.className = "mint-choice-option-skeleton-radio flex-shrink-0 w-5 h-5 rounded-full bg-gray-200 dark:bg-mint-hover animate-pulse", t.appendChild(e)), t.style.display = "flex", n) {
|
|
2330
2337
|
let e = n.querySelector("input[type=\"radio\"]"), t = n.querySelector(".mint-choice-option-indicator");
|
|
2331
2338
|
e && (e.style.visibility = "hidden"), t && (t.style.visibility = "hidden"), n.style.pointerEvents = "none";
|
|
2332
2339
|
}
|
|
@@ -2544,9 +2551,9 @@ var g = class extends HTMLElement {
|
|
|
2544
2551
|
let e = document.createElement("div");
|
|
2545
2552
|
e.className = "mint-choice-option-skeleton flex items-center gap-3";
|
|
2546
2553
|
let n = document.createElement("div");
|
|
2547
|
-
n.className = "flex-shrink-0 w-5 h-5 rounded-full bg-gray-200 dark:bg-
|
|
2554
|
+
n.className = "flex-shrink-0 w-5 h-5 rounded-full bg-gray-200 dark:bg-mint-hover animate-pulse", e.appendChild(n);
|
|
2548
2555
|
let r = document.createElement("div");
|
|
2549
|
-
r.className = "h-4 w-20 rounded bg-gray-200 dark:bg-
|
|
2556
|
+
r.className = "h-4 w-20 rounded bg-gray-200 dark:bg-mint-hover animate-pulse", e.appendChild(r), t.appendChild(e);
|
|
2550
2557
|
}
|
|
2551
2558
|
t.style.display = "flex", r && (r.style.opacity = "0", r.style.pointerEvents = "none");
|
|
2552
2559
|
} else t && (t.style.display = "none"), r && (r.style.opacity = "1", r.style.pointerEvents = "auto");
|
|
@@ -2684,11 +2691,9 @@ var _ = class extends HTMLElement {
|
|
|
2684
2691
|
"rounded-lg",
|
|
2685
2692
|
"box-border",
|
|
2686
2693
|
"bg-white",
|
|
2687
|
-
"dark:bg-
|
|
2694
|
+
"dark:bg-mint-elevated",
|
|
2688
2695
|
"text-gray-900",
|
|
2689
2696
|
"dark:text-white",
|
|
2690
|
-
e ? "transition-colors transition-opacity" : "transition-all",
|
|
2691
|
-
"duration-200",
|
|
2692
2697
|
"outline-none",
|
|
2693
2698
|
"focus:outline-none",
|
|
2694
2699
|
"disabled:opacity-40",
|
|
@@ -2696,7 +2701,7 @@ var _ = class extends HTMLElement {
|
|
|
2696
2701
|
"readonly:cursor-default",
|
|
2697
2702
|
e ? "resize-y" : "",
|
|
2698
2703
|
r ? "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" : ""
|
|
2699
|
-
], o = ["border-2", i ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-
|
|
2704
|
+
], o = ["border-2", i ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-mint-divider"], s = [
|
|
2700
2705
|
"focus-visible:ring-2",
|
|
2701
2706
|
"focus-visible:ring-offset-1",
|
|
2702
2707
|
i ? "focus-visible:ring-red-400 dark:focus-visible:ring-red-500" : "focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500"
|
|
@@ -2776,9 +2781,9 @@ var _ = class extends HTMLElement {
|
|
|
2776
2781
|
}
|
|
2777
2782
|
if (this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "relative w-full", this.appendChild(this._wrapper)), this._colorContainer && (this._colorContainer.remove(), this._colorContainer = null, this._colorPicker = null, this._colorTextInput = null), this._colorPickerWrapper && !r && (this._colorPickerWrapper.remove(), this._colorPickerWrapper = null, this._colorPicker = null, this._colorTextInput = null), f && !t ? this._icon ? this._icon.setAttribute("name", f) : (this._icon = document.createElement("mint-icon"), this._icon.setAttribute("name", f), this._icon.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none", this._wrapper.appendChild(this._icon)) : this._icon &&= (this._icon.remove(), null), this._isNumber() && !t) {
|
|
2778
2783
|
if (!this._numberSpinnerContainer) {
|
|
2779
|
-
this._numberSpinnerContainer = document.createElement("div"), this._numberSpinnerContainer.className = "absolute right-1 top-1/2 -translate-y-1/2 flex flex-col h-8 pointer-events-none", this._wrapper.appendChild(this._numberSpinnerContainer), this._numberIncrementButton = document.createElement("button"), this._numberIncrementButton.type = "button", this._numberIncrementButton.className = "flex items-center justify-center w-5 h-4 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed
|
|
2784
|
+
this._numberSpinnerContainer = document.createElement("div"), this._numberSpinnerContainer.className = "absolute right-1 top-1/2 -translate-y-1/2 flex flex-col h-8 pointer-events-none", this._wrapper.appendChild(this._numberSpinnerContainer), this._numberIncrementButton = document.createElement("button"), this._numberIncrementButton.type = "button", this._numberIncrementButton.className = "flex items-center justify-center w-5 h-4 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed pointer-events-auto bg-gray-100 dark:bg-mint-hover active:bg-gray-200 dark:active:bg-mint-elevated rounded";
|
|
2780
2785
|
let e = document.createElement("mint-icon");
|
|
2781
|
-
e.setAttribute("name", "caret-up"), e.className = "w-[1rem] h-[1rem]", this._numberIncrementButton.appendChild(e), this._numberSpinnerContainer.appendChild(this._numberIncrementButton), this._numberDecrementButton = document.createElement("button"), this._numberDecrementButton.type = "button", this._numberDecrementButton.className = "flex items-center justify-center w-5 h-4 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed
|
|
2786
|
+
e.setAttribute("name", "caret-up"), e.className = "w-[1rem] h-[1rem]", this._numberIncrementButton.appendChild(e), this._numberSpinnerContainer.appendChild(this._numberIncrementButton), this._numberDecrementButton = document.createElement("button"), this._numberDecrementButton.type = "button", this._numberDecrementButton.className = "flex items-center justify-center w-5 h-4 text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed pointer-events-auto bg-gray-100 dark:bg-mint-hover active:bg-gray-200 dark:active:bg-mint-elevated rounded";
|
|
2782
2787
|
let t = document.createElement("mint-icon");
|
|
2783
2788
|
t.setAttribute("name", "caret-down"), t.className = "w-[1rem] h-[1rem]", this._numberDecrementButton.appendChild(t), this._numberSpinnerContainer.appendChild(this._numberDecrementButton), this._numberIncrementButton.addEventListener("click", (e) => {
|
|
2784
2789
|
if (e.preventDefault(), e.stopPropagation(), this._input && !this._input.disabled && !this._input.readOnly) {
|
|
@@ -2865,7 +2870,7 @@ var _ = class extends HTMLElement {
|
|
|
2865
2870
|
t || (t = document.createElement("div"), t.className = "mint-input-skeleton-container absolute inset-0 z-10 pointer-events-none", n ? (n.classList.contains("relative") || n.classList.add("relative"), n.appendChild(t)) : (this.style.position = "relative", this.appendChild(t)));
|
|
2866
2871
|
let e = t.querySelector(".mint-input-skeleton");
|
|
2867
2872
|
if (!e) {
|
|
2868
|
-
e = document.createElement("div"), e.className = "mint-input-skeleton w-full rounded-lg bg-gray-200 dark:bg-
|
|
2873
|
+
e = document.createElement("div"), e.className = "mint-input-skeleton w-full rounded-lg bg-gray-200 dark:bg-mint-hover animate-pulse";
|
|
2869
2874
|
let n = this._isTextarea(), r = this.getRows();
|
|
2870
2875
|
if (n) {
|
|
2871
2876
|
let t = r * 24 + 12;
|
|
@@ -3465,10 +3470,10 @@ var v = class extends HTMLElement {
|
|
|
3465
3470
|
}
|
|
3466
3471
|
_getFieldContainerClass(e, t) {
|
|
3467
3472
|
return [
|
|
3468
|
-
"mint-date-fields relative w-full pl-10 pr-3.5 py-1.5 min-h-[2rem] text-sm font-medium rounded-lg box-border bg-white dark:bg-
|
|
3473
|
+
"mint-date-fields relative w-full pl-10 pr-3.5 py-1.5 min-h-[2rem] text-sm font-medium rounded-lg box-border bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider text-gray-900 dark:text-white",
|
|
3469
3474
|
"border-2",
|
|
3470
|
-
e ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-
|
|
3471
|
-
"
|
|
3475
|
+
e ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-mint-divider",
|
|
3476
|
+
"outline-none focus-within:ring-2 focus-within:ring-offset-1",
|
|
3472
3477
|
e ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500",
|
|
3473
3478
|
"flex items-center gap-1"
|
|
3474
3479
|
].join(" ") + (t ? " opacity-40 cursor-not-allowed" : "");
|
|
@@ -3572,7 +3577,7 @@ var v = class extends HTMLElement {
|
|
|
3572
3577
|
}
|
|
3573
3578
|
_buildCalendar() {
|
|
3574
3579
|
if (!this._popover) return;
|
|
3575
|
-
this._calendarContainer && this._calendarContainer.parentNode && this._calendarContainer.remove(), this._calendarContainer = document.createElement("div"), this._calendarContainer.className = "mint-date-calendar bg-white dark:bg-
|
|
3580
|
+
this._calendarContainer && this._calendarContainer.parentNode && this._calendarContainer.remove(), this._calendarContainer = document.createElement("div"), this._calendarContainer.className = "mint-date-calendar bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider rounded-lg p-4 w-[22rem] md:w-auto md:min-w-[28rem]";
|
|
3576
3581
|
let e = this.getMode();
|
|
3577
3582
|
e === "month" && this._viewMode === "calendar" ? this._viewMode = "month" : e === "year" && this._viewMode === "calendar" ? this._viewMode = "year" : e === "default" && this._viewMode !== "month" && this._viewMode !== "year" && (this._viewMode = "calendar"), this._viewMode === "calendar" ? this._buildCalendarView() : this._viewMode === "month" ? this._buildMonthView() : this._viewMode === "year" && this._buildYearView();
|
|
3578
3583
|
let t = this._popover.querySelector(".popover-content");
|
|
@@ -3605,7 +3610,7 @@ var v = class extends HTMLElement {
|
|
|
3605
3610
|
"Fri",
|
|
3606
3611
|
"Sat"
|
|
3607
3612
|
], a = [...i.slice(r), ...i.slice(0, r)], o = this.getShortcuts(), s = o.length > 0;
|
|
3608
|
-
this._calendarContainer.className = s ? "mint-date-calendar bg-white dark:bg-
|
|
3613
|
+
this._calendarContainer.className = s ? "mint-date-calendar bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider rounded-lg p-4 w-[18rem] md:w-auto md:min-w-[28rem]" : "mint-date-calendar bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider rounded-lg p-4 w-[18rem] md:min-w-[18rem]";
|
|
3609
3614
|
let c = document.createElement("div");
|
|
3610
3615
|
c.className = "flex flex-col md:flex-row md:gap-6 md:items-start";
|
|
3611
3616
|
let l = document.createElement("div");
|
|
@@ -3613,7 +3618,7 @@ var v = class extends HTMLElement {
|
|
|
3613
3618
|
let u = document.createElement("div");
|
|
3614
3619
|
u.className = "flex items-center justify-between mb-4";
|
|
3615
3620
|
let d = document.createElement("button");
|
|
3616
|
-
d.type = "button", d.tabIndex = 0, d.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-
|
|
3621
|
+
d.type = "button", d.tabIndex = 0, d.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-mint-hover text-gray-600 dark:text-gray-300 flex items-center focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", d.setAttribute("data-keep-popover-open", "true");
|
|
3617
3622
|
let f = document.createElement("mint-icon");
|
|
3618
3623
|
f.setAttribute("name", "caret-left"), f.className = "w-4 h-4", d.appendChild(f), d.addEventListener("click", () => {
|
|
3619
3624
|
let e = this._currentMonth, t = this._currentYear;
|
|
@@ -3622,7 +3627,7 @@ var v = class extends HTMLElement {
|
|
|
3622
3627
|
let p = document.createElement("div");
|
|
3623
3628
|
p.className = "flex items-center gap-2";
|
|
3624
3629
|
let m = document.createElement("button");
|
|
3625
|
-
m.type = "button", m.tabIndex = 0, m.className = "text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-600 dark:hover:text-gray-300
|
|
3630
|
+
m.type = "button", m.tabIndex = 0, m.className = "text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-600 dark:hover:text-gray-300 flex items-center focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", m.setAttribute("data-keep-popover-open", "true"), m.textContent = n[this._currentMonth];
|
|
3626
3631
|
let h = () => {
|
|
3627
3632
|
let e = this.getMode();
|
|
3628
3633
|
e !== "month" && e !== "year" && (this._viewMode = "month", this._buildCalendar());
|
|
@@ -3631,11 +3636,11 @@ var v = class extends HTMLElement {
|
|
|
3631
3636
|
e.preventDefault(), h();
|
|
3632
3637
|
}, { passive: !1 }), p.appendChild(m);
|
|
3633
3638
|
let g = document.createElement("button");
|
|
3634
|
-
g.type = "button", g.tabIndex = 0, g.className = "text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-600 dark:hover:text-gray-300
|
|
3639
|
+
g.type = "button", g.tabIndex = 0, g.className = "text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-600 dark:hover:text-gray-300 flex items-center focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", g.setAttribute("data-keep-popover-open", "true"), g.textContent = String(this._currentYear), g.addEventListener("click", () => {
|
|
3635
3640
|
this.getMode() !== "year" && (this._viewMode = "year", this._buildCalendar());
|
|
3636
3641
|
}), p.appendChild(g), u.appendChild(p);
|
|
3637
3642
|
let _ = document.createElement("button");
|
|
3638
|
-
_.type = "button", _.tabIndex = 0, _.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-
|
|
3643
|
+
_.type = "button", _.tabIndex = 0, _.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-mint-hover text-gray-600 dark:text-gray-300 flex items-center focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", _.setAttribute("data-keep-popover-open", "true");
|
|
3639
3644
|
let v = document.createElement("mint-icon");
|
|
3640
3645
|
v.setAttribute("name", "caret-right"), v.className = "w-4 h-4", _.appendChild(v);
|
|
3641
3646
|
let y = () => {
|
|
@@ -3662,8 +3667,8 @@ var v = class extends HTMLElement {
|
|
|
3662
3667
|
} else c && (d || f) && m ? d && f ? s = "rounded-md" : d ? s = "rounded-l-md" : f && (s = "rounded-r-md") : i && !this._isRange || i && this._isRange && !this._selectedEndDate ? s = "rounded-md" : a && c && m && (s = "rounded-none");
|
|
3663
3668
|
let h = document.createElement("button");
|
|
3664
3669
|
h.type = "button", h.disabled = !!o, h.tabIndex = o ? -1 : 0;
|
|
3665
|
-
let g = `w-full h-8 ${s} border-0 text-sm font-medium
|
|
3666
|
-
return n ? g += _ ? " bg-slate-800 dark:bg-slate-600 text-white" : a ? " bg-slate-100 dark:bg-slate-700 text-slate-800 dark:text-slate-200" : r ? " text-gray-900 dark:text-gray-100 font-semibold" : " text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-
|
|
3670
|
+
let g = `w-full h-8 ${s} border-0 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500`, _ = i || c && p && m;
|
|
3671
|
+
return n ? g += _ ? " bg-slate-800 dark:bg-slate-600 text-white" : a ? " bg-slate-100 dark:bg-slate-700 text-slate-800 dark:text-slate-200" : r ? " text-gray-900 dark:text-gray-100 font-semibold" : " text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-mint-hover" : g += _ ? " bg-slate-800 dark:bg-slate-600 text-white" : a ? " bg-slate-100 dark:bg-slate-700 text-slate-800 dark:text-slate-200" : " text-gray-400 dark:text-gray-500 hover:bg-gray-100 dark:hover:bg-mint-hover", g += o ? " opacity-40 cursor-not-allowed" : "", h.className = g, h.textContent = t.toString(), o || (h.addEventListener("click", (t) => {
|
|
3667
3672
|
t.preventDefault(), t.stopPropagation(), this._handleDateClick(e);
|
|
3668
3673
|
}), h.addEventListener("touchstart", (t) => {
|
|
3669
3674
|
t.preventDefault(), t.stopPropagation(), this._isTouchActive = !0, this._touchStartDate = e, this._touchStartElement = h, h.classList.add("active", "bg-gray-200", "dark:bg-gray-600");
|
|
@@ -3705,7 +3710,7 @@ var v = class extends HTMLElement {
|
|
|
3705
3710
|
n && !x.contains(n) && (this._hoveredDate = null, this._buildCalendar());
|
|
3706
3711
|
}, { passive: !0 })), s) {
|
|
3707
3712
|
let e = document.createElement("div");
|
|
3708
|
-
e.className = "mb-4 pb-4 border-b border-gray-200 dark:border-
|
|
3713
|
+
e.className = "mb-4 pb-4 border-b border-gray-200 dark:border-mint-divider md:mb-0 md:pb-0 md:border-b-0 md:border-r md:border-r-gray-200 dark:md:border-r-mint-divider md:pr-6 md:mr-0 md:w-32 md:flex-shrink-0 md:h-full md:flex md:flex-col";
|
|
3709
3714
|
let t = document.createElement("div");
|
|
3710
3715
|
t.className = "relative md:relative md:flex-1 md:min-h-0";
|
|
3711
3716
|
let n = document.createElement("div");
|
|
@@ -3713,13 +3718,13 @@ var v = class extends HTMLElement {
|
|
|
3713
3718
|
let r = document.createElement("style");
|
|
3714
3719
|
r.textContent = "\n .mint-date-shortcuts-row::-webkit-scrollbar {\n display: none;\n }\n @media (min-width: 768px) {\n .mint-date-shortcuts-row {\n height: 17rem;\n overflow-y: auto;\n }\n .mint-date-shortcuts-row::-webkit-scrollbar {\n display: block;\n width: 4px;\n }\n .mint-date-shortcuts-row::-webkit-scrollbar-track {\n background: transparent;\n }\n .mint-date-shortcuts-row::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n }\n .dark .mint-date-shortcuts-row::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2);\n }\n }\n ", n.classList.add("mint-date-shortcuts-row"), document.head.querySelector("style[data-mint-date-shortcuts]") || (r.setAttribute("data-mint-date-shortcuts", "true"), document.head.appendChild(r));
|
|
3715
3720
|
let i = document.createElement("div");
|
|
3716
|
-
i.className = "absolute left-0 top-0 bottom-0 w-8 pointer-events-none z-10 bg-gradient-to-r from-white dark:from-
|
|
3721
|
+
i.className = "absolute left-0 top-0 bottom-0 w-8 pointer-events-none z-10 bg-gradient-to-r from-white dark:from-mint-elevated to-transparent opacity-0 md:hidden", t.appendChild(i);
|
|
3717
3722
|
let a = document.createElement("div");
|
|
3718
|
-
a.className = "absolute right-0 top-0 bottom-0 w-8 pointer-events-none z-10 bg-gradient-to-l from-white dark:from-
|
|
3723
|
+
a.className = "absolute right-0 top-0 bottom-0 w-8 pointer-events-none z-10 bg-gradient-to-l from-white dark:from-mint-elevated to-transparent opacity-100 md:hidden", t.appendChild(a);
|
|
3719
3724
|
let s = document.createElement("div");
|
|
3720
|
-
s.className = "hidden md:block absolute top-0 left-0 right-0 h-8 pointer-events-none z-10 bg-gradient-to-b from-white dark:from-
|
|
3725
|
+
s.className = "hidden md:block absolute top-0 left-0 right-0 h-8 pointer-events-none z-10 bg-gradient-to-b from-white dark:from-mint-elevated to-transparent opacity-0", t.appendChild(s);
|
|
3721
3726
|
let l = document.createElement("div");
|
|
3722
|
-
l.className = "hidden md:block absolute bottom-0 left-0 right-0 h-8 pointer-events-none z-10 bg-gradient-to-t from-white dark:from-
|
|
3727
|
+
l.className = "hidden md:block absolute bottom-0 left-0 right-0 h-8 pointer-events-none z-10 bg-gradient-to-t from-white dark:from-mint-elevated to-transparent opacity-100", t.appendChild(l);
|
|
3723
3728
|
let u = () => {
|
|
3724
3729
|
if (window.innerWidth >= 768) {
|
|
3725
3730
|
let e = n.scrollTop, t = n.scrollHeight, r = n.clientHeight;
|
|
@@ -3731,7 +3736,7 @@ var v = class extends HTMLElement {
|
|
|
3731
3736
|
};
|
|
3732
3737
|
n.addEventListener("scroll", u), window.addEventListener("resize", u), setTimeout(u, 0), o.forEach((e) => {
|
|
3733
3738
|
let t = document.createElement("button");
|
|
3734
|
-
t.type = "button", t.tabIndex = 0, t.className = "px-3 py-1.5 text-xs font-medium rounded-md bg-gray-100 dark:bg-
|
|
3739
|
+
t.type = "button", t.tabIndex = 0, t.className = "px-3 py-1.5 text-xs font-medium rounded-md bg-gray-100 dark:bg-mint-hover text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-mint-elevated whitespace-nowrap flex-shrink-0 md:w-full md:text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", t.textContent = e.label, t.setAttribute("data-keep-popover-open", "true");
|
|
3735
3740
|
let r = () => {
|
|
3736
3741
|
let t = e.action();
|
|
3737
3742
|
if (t) {
|
|
@@ -3780,7 +3785,7 @@ var v = class extends HTMLElement {
|
|
|
3780
3785
|
], t = document.createElement("div");
|
|
3781
3786
|
t.className = "flex items-center justify-between mb-4";
|
|
3782
3787
|
let n = document.createElement("button");
|
|
3783
|
-
n.type = "button", n.tabIndex = 0, n.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-
|
|
3788
|
+
n.type = "button", n.tabIndex = 0, n.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-mint-hover text-gray-600 dark:text-gray-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", n.setAttribute("data-keep-popover-open", "true");
|
|
3784
3789
|
let r = document.createElement("mint-icon");
|
|
3785
3790
|
r.setAttribute("name", "caret-left"), r.className = "w-4 h-4", n.appendChild(r);
|
|
3786
3791
|
let i = () => {
|
|
@@ -3791,7 +3796,7 @@ var v = class extends HTMLElement {
|
|
|
3791
3796
|
e.preventDefault(), i();
|
|
3792
3797
|
}, { passive: !1 }), t.appendChild(n);
|
|
3793
3798
|
let a = document.createElement("button");
|
|
3794
|
-
a.type = "button", a.tabIndex = 0, a.className = "text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer
|
|
3799
|
+
a.type = "button", a.tabIndex = 0, a.className = "text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500 rounded px-1", a.setAttribute("data-keep-popover-open", "true"), a.textContent = String(this._currentYear);
|
|
3795
3800
|
let o = () => {
|
|
3796
3801
|
this.getMode() !== "year" && (this._viewMode = "year", this._buildCalendar());
|
|
3797
3802
|
};
|
|
@@ -3799,7 +3804,7 @@ var v = class extends HTMLElement {
|
|
|
3799
3804
|
e.preventDefault(), o();
|
|
3800
3805
|
}, { passive: !1 }), t.appendChild(a);
|
|
3801
3806
|
let s = document.createElement("button");
|
|
3802
|
-
s.type = "button", s.tabIndex = 0, s.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-
|
|
3807
|
+
s.type = "button", s.tabIndex = 0, s.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-mint-hover text-gray-600 dark:text-gray-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", s.setAttribute("data-keep-popover-open", "true");
|
|
3803
3808
|
let c = document.createElement("mint-icon");
|
|
3804
3809
|
c.setAttribute("name", "caret-right"), c.className = "w-4 h-4", s.appendChild(c);
|
|
3805
3810
|
let l = () => {
|
|
@@ -3812,7 +3817,7 @@ var v = class extends HTMLElement {
|
|
|
3812
3817
|
let u = document.createElement("div");
|
|
3813
3818
|
u.className = "grid grid-cols-3 gap-2", e.forEach((e, t) => {
|
|
3814
3819
|
let n = document.createElement("button");
|
|
3815
|
-
n.type = "button", n.tabIndex = 0, n.setAttribute("data-keep-popover-open", "true"), n.className = `p-2 rounded text-sm font-medium
|
|
3820
|
+
n.type = "button", n.tabIndex = 0, n.setAttribute("data-keep-popover-open", "true"), n.className = `p-2 rounded text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500 ${this._currentMonth === t ? "bg-slate-800 dark:bg-slate-600 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-mint-hover"}`, n.textContent = e;
|
|
3816
3821
|
let r = () => {
|
|
3817
3822
|
if (this.getMode() === "month") {
|
|
3818
3823
|
let e = new Date(this._currentYear, t, 1), n = this.getFormat(), r = this._formatDate(e, n);
|
|
@@ -3842,7 +3847,7 @@ var v = class extends HTMLElement {
|
|
|
3842
3847
|
let e = this._currentYear - 6, t = this._currentYear + 6, n = document.createElement("div");
|
|
3843
3848
|
n.className = "flex items-center justify-between mb-4";
|
|
3844
3849
|
let r = document.createElement("button");
|
|
3845
|
-
r.type = "button", r.tabIndex = 0, r.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-
|
|
3850
|
+
r.type = "button", r.tabIndex = 0, r.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-mint-hover text-gray-600 dark:text-gray-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", r.setAttribute("data-keep-popover-open", "true");
|
|
3846
3851
|
let i = document.createElement("mint-icon");
|
|
3847
3852
|
i.setAttribute("name", "caret-left"), i.className = "w-4 h-4", r.appendChild(i);
|
|
3848
3853
|
let a = () => {
|
|
@@ -3855,7 +3860,7 @@ var v = class extends HTMLElement {
|
|
|
3855
3860
|
let o = document.createElement("div");
|
|
3856
3861
|
o.className = "text-sm font-medium text-gray-900 dark:text-gray-100", o.textContent = `${e} - ${t}`, n.appendChild(o);
|
|
3857
3862
|
let s = document.createElement("button");
|
|
3858
|
-
s.type = "button", s.tabIndex = 0, s.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-
|
|
3863
|
+
s.type = "button", s.tabIndex = 0, s.className = "p-1 rounded hover:bg-gray-100 dark:hover:bg-mint-hover text-gray-600 dark:text-gray-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500", s.setAttribute("data-keep-popover-open", "true");
|
|
3859
3864
|
let c = document.createElement("mint-icon");
|
|
3860
3865
|
c.setAttribute("name", "caret-right"), c.className = "w-4 h-4", s.appendChild(c);
|
|
3861
3866
|
let l = () => {
|
|
@@ -3869,7 +3874,7 @@ var v = class extends HTMLElement {
|
|
|
3869
3874
|
u.className = "grid grid-cols-3 gap-2";
|
|
3870
3875
|
for (let n = e; n <= t; n++) {
|
|
3871
3876
|
let e = document.createElement("button");
|
|
3872
|
-
e.type = "button", e.tabIndex = 0, e.setAttribute("data-keep-popover-open", "true"), e.className = `p-2 rounded text-sm font-medium
|
|
3877
|
+
e.type = "button", e.tabIndex = 0, e.setAttribute("data-keep-popover-open", "true"), e.className = `p-2 rounded text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500 ${this._currentYear === n ? "bg-slate-800 dark:bg-slate-600 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-mint-hover"}`, e.textContent = String(n), e.addEventListener("click", () => {
|
|
3873
3878
|
let e = this.getMode();
|
|
3874
3879
|
if (e === "year") {
|
|
3875
3880
|
let e = new Date(n, 0, 1), t = this.getFormat(), r = this._formatDate(e, t);
|
|
@@ -4073,7 +4078,7 @@ var v = class extends HTMLElement {
|
|
|
4073
4078
|
if (e) {
|
|
4074
4079
|
t || (t = document.createElement("div"), t.className = "mint-date-picker-skeleton-container absolute inset-0 z-10 pointer-events-none", r ? (r.classList.contains("relative") || r.classList.add("relative"), r.appendChild(t)) : (this.style.position = "relative", this.appendChild(t)));
|
|
4075
4080
|
let e = t.querySelector(".mint-date-picker-skeleton");
|
|
4076
|
-
e || (e = document.createElement("div"), e.className = "mint-date-picker-skeleton w-full rounded-lg bg-gray-200 dark:bg-
|
|
4081
|
+
e || (e = document.createElement("div"), e.className = "mint-date-picker-skeleton w-full rounded-lg bg-gray-200 dark:bg-mint-hover animate-pulse", e.style.height = "2.25rem", t.appendChild(e)), t.style.display = "block", n && (n.style.visibility = "hidden", n.style.pointerEvents = "none"), this._displayEl && (this._displayEl.style.visibility = "hidden", this._displayEl.style.pointerEvents = "none");
|
|
4077
4082
|
} else t && (t.style.display = "none"), n && (n.style.visibility = "visible", n.style.pointerEvents = "auto"), this._displayEl && (this._displayEl.style.visibility = "visible", this._displayEl.style.pointerEvents = "auto");
|
|
4078
4083
|
}
|
|
4079
4084
|
_getFocusableElements() {
|
|
@@ -4249,11 +4254,9 @@ var y = class extends HTMLElement {
|
|
|
4249
4254
|
"rounded-lg",
|
|
4250
4255
|
"box-border",
|
|
4251
4256
|
"bg-white",
|
|
4252
|
-
"dark:bg-
|
|
4257
|
+
"dark:bg-mint-elevated",
|
|
4253
4258
|
"text-gray-900",
|
|
4254
4259
|
"dark:text-white",
|
|
4255
|
-
"transition-all",
|
|
4256
|
-
"duration-200",
|
|
4257
4260
|
"outline-none",
|
|
4258
4261
|
"focus:outline-none",
|
|
4259
4262
|
"disabled:opacity-40",
|
|
@@ -4262,7 +4265,7 @@ var y = class extends HTMLElement {
|
|
|
4262
4265
|
"bg-no-repeat",
|
|
4263
4266
|
"bg-right",
|
|
4264
4267
|
"cursor-pointer"
|
|
4265
|
-
], r = ["border-2", e ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-
|
|
4268
|
+
], r = ["border-2", e ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-mint-divider"], i = [
|
|
4266
4269
|
"focus-visible:ring-2",
|
|
4267
4270
|
"focus-visible:ring-offset-1",
|
|
4268
4271
|
e ? "focus-visible:ring-red-400 dark:focus-visible:ring-red-500" : "focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500"
|
|
@@ -4340,7 +4343,7 @@ var y = class extends HTMLElement {
|
|
|
4340
4343
|
t || (t = document.createElement("div"), t.className = "mint-select-skeleton-container absolute inset-0 z-10 pointer-events-none", n ? (n.classList.contains("relative") || n.classList.add("relative"), n.appendChild(t)) : (this.style.position = "relative", this.appendChild(t)));
|
|
4341
4344
|
let e = t.querySelector(".mint-select-skeleton");
|
|
4342
4345
|
if (!e) {
|
|
4343
|
-
e = document.createElement("div"), e.className = "mint-select-skeleton w-full rounded-lg bg-gray-200 dark:bg-
|
|
4346
|
+
e = document.createElement("div"), e.className = "mint-select-skeleton w-full rounded-lg bg-gray-200 dark:bg-mint-hover animate-pulse";
|
|
4344
4347
|
let n = this.isMultiple();
|
|
4345
4348
|
e.style.height = n ? "6rem" : "2.25rem", t.appendChild(e);
|
|
4346
4349
|
}
|
|
@@ -4415,7 +4418,7 @@ var b = class extends HTMLElement {
|
|
|
4415
4418
|
if (e) {
|
|
4416
4419
|
t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container absolute inset-0 z-10 pointer-events-none flex items-center justify-center", n ? (n.classList.contains("relative") || n.classList.add("relative"), n.appendChild(t)) : (this.style.position = "relative", this.appendChild(t)));
|
|
4417
4420
|
let e = t.querySelector(".mint-dropzone-skeleton");
|
|
4418
|
-
if (e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton rounded-lg border-2 border-dashed border-gray-300 dark:border-
|
|
4421
|
+
if (e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton rounded-lg border-2 border-dashed border-gray-300 dark:border-mint-divider bg-gray-200 dark:bg-mint-hover animate-pulse", e.style.width = "100%", e.style.height = "100%", t.appendChild(e)), t.style.display = "flex", n) {
|
|
4419
4422
|
let e = n.querySelector(".mint-dropzone-icon"), t = n.querySelector(".mint-dropzone-label"), r = n.querySelector(".mint-dropzone-previews-wrapper"), i = this._fileInput;
|
|
4420
4423
|
if (e) {
|
|
4421
4424
|
let t = e;
|
|
@@ -4486,7 +4489,7 @@ var b = class extends HTMLElement {
|
|
|
4486
4489
|
}
|
|
4487
4490
|
_updateDragStateClass() {
|
|
4488
4491
|
if (!this._dropzone) return;
|
|
4489
|
-
let e = this.isDisabled(), t = this.hasError(), n = `relative border-2 border-dashed rounded-lg
|
|
4492
|
+
let e = this.isDisabled(), t = this.hasError(), n = `relative border-2 border-dashed rounded-lg flex flex-col items-center ${this._selectedFiles.length > 0 ? "justify-start" : "justify-center"} cursor-pointer overflow-hidden`, r = this._isDragging ? "border-gray-400 dark:border-gray-500 bg-gray-50 dark:bg-mint-elevated dark:border-mint-divider" : "border-gray-300 dark:border-mint-divider bg-white dark:bg-mint-elevated dark:border-mint-divider hover:border-gray-400 dark:hover:border-mint-divider", i = t ? "border-red-300 dark:border-red-300 bg-red-50/50 dark:bg-red-900/30" : "", a = e ? "opacity-40 cursor-not-allowed" : "";
|
|
4490
4493
|
this._dropzone.className = `${n} ${t ? i : r} ${a} focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500`.trim();
|
|
4491
4494
|
}
|
|
4492
4495
|
setupEventListeners() {
|
|
@@ -4638,9 +4641,9 @@ var b = class extends HTMLElement {
|
|
|
4638
4641
|
let t = document.createElement("div");
|
|
4639
4642
|
t.className = "mint-dropzone-previews w-full flex flex-col gap-2 max-h-48 overflow-y-auto overflow-x-hidden px-2 pb-2", this._selectedFiles.forEach((e, n) => {
|
|
4640
4643
|
let r = document.createElement("div");
|
|
4641
|
-
if (r.className = "flex items-center gap-3 p-2 rounded border border-gray-200 dark:border-
|
|
4644
|
+
if (r.className = "flex items-center gap-3 p-2 rounded border border-gray-200 dark:border-mint-divider bg-gray-50 dark:bg-mint-elevated", e.type.startsWith("image/")) {
|
|
4642
4645
|
let t = document.createElement("img");
|
|
4643
|
-
t.className = "w-12 h-12 object-cover rounded border border-gray-200 dark:border-
|
|
4646
|
+
t.className = "w-12 h-12 object-cover rounded border border-gray-200 dark:border-mint-divider";
|
|
4644
4647
|
let n = URL.createObjectURL(e);
|
|
4645
4648
|
this._previewUrls.push(n), t.src = n, r.appendChild(t);
|
|
4646
4649
|
} else {
|
|
@@ -4650,18 +4653,18 @@ var b = class extends HTMLElement {
|
|
|
4650
4653
|
let i = document.createElement("div");
|
|
4651
4654
|
i.className = "flex-1 text-sm text-gray-800 dark:text-gray-100 truncate", i.textContent = e.name, r.appendChild(i);
|
|
4652
4655
|
let a = document.createElement("button");
|
|
4653
|
-
a.type = "button", a.className = "text-gray-500 hover:bg-red-100 dark:hover:bg-red-900/30
|
|
4656
|
+
a.type = "button", a.className = "text-gray-500 hover:bg-red-100 dark:hover:bg-red-900/30 flex items-center justify-center w-6 h-6 rounded-full";
|
|
4654
4657
|
let o = document.createElement("mint-icon");
|
|
4655
4658
|
o.setAttribute("name", "close"), o.className = "w-4 h-4", a.appendChild(o), a.addEventListener("click", (e) => {
|
|
4656
4659
|
e.preventDefault(), e.stopPropagation(), this._removeFileAt(n);
|
|
4657
4660
|
}), r.appendChild(a), t.appendChild(r);
|
|
4658
4661
|
});
|
|
4659
|
-
let n = this.hasError(), r = this._isDragging, i = "from-white dark:from-
|
|
4660
|
-
n ? i = "from-red-50 dark:from-red-900/30" : r && (i = "from-gray-50 dark:from-
|
|
4662
|
+
let n = this.hasError(), r = this._isDragging, i = "from-white dark:from-mint-elevated";
|
|
4663
|
+
n ? i = "from-red-50 dark:from-red-900/30" : r && (i = "from-gray-50 dark:from-mint-elevated");
|
|
4661
4664
|
let a = document.createElement("div");
|
|
4662
|
-
a.className = `absolute top-0 left-0 right-0 h-4 pointer-events-none z-10 bg-gradient-to-b ${i} to-transparent opacity-0
|
|
4665
|
+
a.className = `absolute top-0 left-0 right-0 h-4 pointer-events-none z-10 bg-gradient-to-b ${i} to-transparent opacity-0`, e.appendChild(a);
|
|
4663
4666
|
let o = document.createElement("div");
|
|
4664
|
-
o.className = `absolute bottom-0 left-0 right-0 h-4 pointer-events-none z-10 bg-gradient-to-t ${i} to-transparent opacity-100
|
|
4667
|
+
o.className = `absolute bottom-0 left-0 right-0 h-4 pointer-events-none z-10 bg-gradient-to-t ${i} to-transparent opacity-100`, e.appendChild(o);
|
|
4665
4668
|
let s = () => {
|
|
4666
4669
|
let e = t.scrollTop, n = t.scrollHeight, r = t.clientHeight;
|
|
4667
4670
|
e > 0 ? a.style.opacity = "1" : a.style.opacity = "0", e + r < n - 1 ? o.style.opacity = "1" : o.style.opacity = "0";
|
|
@@ -5562,7 +5565,7 @@ var S = class extends HTMLElement {
|
|
|
5562
5565
|
]);
|
|
5563
5566
|
let a = e.querySelector("thead");
|
|
5564
5567
|
if (a) {
|
|
5565
|
-
this._setClasses(a, ["bg-[#F7F7F7]", "dark:bg-
|
|
5568
|
+
this._setClasses(a, ["bg-[#F7F7F7]", "dark:bg-mint-elevated"]);
|
|
5566
5569
|
let e = a.querySelectorAll("th");
|
|
5567
5570
|
e.forEach((t, n) => {
|
|
5568
5571
|
let r = t.querySelector("mint-icon"), i = r?.getAttribute("name") || "", a = r !== null && i !== "ellipsis";
|
|
@@ -5575,8 +5578,8 @@ var S = class extends HTMLElement {
|
|
|
5575
5578
|
"py-2",
|
|
5576
5579
|
"border-b",
|
|
5577
5580
|
"border-gray-200",
|
|
5578
|
-
"dark:border-
|
|
5579
|
-
]), a && t.classList.add("cursor-pointer", "bg-[#F7F7F7]", "dark:bg-
|
|
5581
|
+
"dark:border-mint-divider"
|
|
5582
|
+
]), a && t.classList.add("cursor-pointer", "bg-[#F7F7F7]", "dark:bg-mint-elevated", "hover:bg-gray-100", "dark:hover:bg-mint-hover"), n === 0 && t.classList.add("pl-6"), n === e.length - 1 && t.classList.add("pr-6");
|
|
5580
5583
|
});
|
|
5581
5584
|
}
|
|
5582
5585
|
let o = e.querySelector("tbody");
|
|
@@ -5586,11 +5589,11 @@ var S = class extends HTMLElement {
|
|
|
5586
5589
|
let a = n.hasAttribute("data-row-clickable");
|
|
5587
5590
|
this._setClasses(n, [
|
|
5588
5591
|
"bg-white",
|
|
5589
|
-
"dark:bg-
|
|
5592
|
+
"dark:bg-mint-canvas",
|
|
5590
5593
|
"border-b",
|
|
5591
5594
|
"border-gray-200",
|
|
5592
|
-
"dark:border-
|
|
5593
|
-
]), a && n.classList.add("cursor-pointer", "hover:bg-gray-50", "dark:hover:bg-
|
|
5595
|
+
"dark:border-mint-divider"
|
|
5596
|
+
]), a && n.classList.add("cursor-pointer", "hover:bg-gray-50", "dark:hover:bg-mint-elevated"), i === e.length - 1 && n.classList.remove("border-b");
|
|
5594
5597
|
let o = n.querySelectorAll("td");
|
|
5595
5598
|
o.forEach((e, n) => {
|
|
5596
5599
|
this._setClasses(e, [
|
|
@@ -5605,7 +5608,7 @@ var S = class extends HTMLElement {
|
|
|
5605
5608
|
let s = e.querySelector("tfoot");
|
|
5606
5609
|
s && (this._setClasses(s, [
|
|
5607
5610
|
"bg-[#F7F7F7]",
|
|
5608
|
-
"dark:bg-
|
|
5611
|
+
"dark:bg-mint-elevated",
|
|
5609
5612
|
"font-semibold"
|
|
5610
5613
|
]), s.querySelectorAll("td").forEach((e) => {
|
|
5611
5614
|
this._setClasses(e, [
|
|
@@ -5615,7 +5618,7 @@ var S = class extends HTMLElement {
|
|
|
5615
5618
|
"py-2",
|
|
5616
5619
|
"border-t",
|
|
5617
5620
|
"border-gray-200",
|
|
5618
|
-
"dark:border-
|
|
5621
|
+
"dark:border-mint-divider"
|
|
5619
5622
|
]), this._restoreCell(e);
|
|
5620
5623
|
})), this._observer && this._observeChanges();
|
|
5621
5624
|
}
|
|
@@ -5674,7 +5677,7 @@ var C = class extends HTMLElement {
|
|
|
5674
5677
|
this._render();
|
|
5675
5678
|
}
|
|
5676
5679
|
_render() {
|
|
5677
|
-
if (this.classList.add("inline-flex", "items-center", "gap-2", "px-3", "py-1", "rounded-full", "border", "border-gray-200", "dark:border-
|
|
5680
|
+
if (this.classList.add("inline-flex", "items-center", "gap-2", "px-3", "py-1", "rounded-full", "border", "border-gray-200", "dark:border-mint-divider", "bg-gray-100", "dark:bg-mint-elevated", "text-gray-900", "dark:text-gray-100", "text-sm", "font-medium"), !this._root) {
|
|
5678
5681
|
for (this._root = document.createElement("div"), this._root.className = "flex items-center gap-2 w-full", this._textWrap = document.createElement("span"), this._textWrap.className = "inline-flex items-center min-w-[0.5rem]", this._textWrap.setAttribute("data-mt-chip-text", ""); this.firstChild;) {
|
|
5679
5682
|
let e = this.firstChild;
|
|
5680
5683
|
if (e === this._root) break;
|
|
@@ -5703,8 +5706,6 @@ var C = class extends HTMLElement {
|
|
|
5703
5706
|
"focus-visible:ring-offset-1",
|
|
5704
5707
|
"focus-visible:ring-gray-400",
|
|
5705
5708
|
"dark:focus-visible:ring-gray-500",
|
|
5706
|
-
"transition-colors",
|
|
5707
|
-
"duration-150",
|
|
5708
5709
|
"border-none",
|
|
5709
5710
|
"bg-transparent",
|
|
5710
5711
|
"cursor-pointer"
|
|
@@ -5758,14 +5759,12 @@ var w = class extends HTMLElement {
|
|
|
5758
5759
|
"min-h-[2rem]",
|
|
5759
5760
|
"rounded-lg",
|
|
5760
5761
|
"border-2",
|
|
5761
|
-
e ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-
|
|
5762
|
+
e ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-mint-divider",
|
|
5762
5763
|
"bg-white",
|
|
5763
|
-
"dark:bg-
|
|
5764
|
+
"dark:bg-mint-elevated",
|
|
5764
5765
|
"focus-within:ring-2",
|
|
5765
5766
|
"focus-within:ring-offset-1",
|
|
5766
|
-
e ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500"
|
|
5767
|
-
"transition-colors",
|
|
5768
|
-
"duration-200"
|
|
5767
|
+
e ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500"
|
|
5769
5768
|
];
|
|
5770
5769
|
this._container.className = t.join(" ");
|
|
5771
5770
|
}
|
|
@@ -5840,14 +5839,12 @@ var w = class extends HTMLElement {
|
|
|
5840
5839
|
"min-h-[2rem]",
|
|
5841
5840
|
"rounded-lg",
|
|
5842
5841
|
"border-2",
|
|
5843
|
-
r ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-
|
|
5842
|
+
r ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-mint-divider",
|
|
5844
5843
|
"bg-white",
|
|
5845
|
-
"dark:bg-
|
|
5844
|
+
"dark:bg-mint-elevated",
|
|
5846
5845
|
"focus-within:ring-2",
|
|
5847
5846
|
"focus-within:ring-offset-1",
|
|
5848
|
-
r ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500"
|
|
5849
|
-
"transition-colors",
|
|
5850
|
-
"duration-200"
|
|
5847
|
+
r ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500"
|
|
5851
5848
|
];
|
|
5852
5849
|
this._container.className = e.join(" "), this._chipsWrap = document.createElement("div"), this._chipsWrap.className = "flex flex-wrap items-center gap-2", this._chipsWrap.addEventListener("dragover", (e) => {
|
|
5853
5850
|
this.hasAttribute("sortable") && e.preventDefault();
|
|
@@ -5881,14 +5878,12 @@ var w = class extends HTMLElement {
|
|
|
5881
5878
|
"min-h-[2rem]",
|
|
5882
5879
|
"rounded-lg",
|
|
5883
5880
|
"border-2",
|
|
5884
|
-
r ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-
|
|
5881
|
+
r ? "border-red-300 dark:border-red-300" : "border-gray-200 dark:border-mint-divider",
|
|
5885
5882
|
"bg-white",
|
|
5886
|
-
"dark:bg-
|
|
5883
|
+
"dark:bg-mint-elevated",
|
|
5887
5884
|
"focus-within:ring-2",
|
|
5888
5885
|
"focus-within:ring-offset-1",
|
|
5889
|
-
r ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500"
|
|
5890
|
-
"transition-colors",
|
|
5891
|
-
"duration-200"
|
|
5886
|
+
r ? "focus-within:ring-red-400 dark:focus-within:ring-red-500" : "focus-within:ring-gray-400 dark:focus-within:ring-gray-500"
|
|
5892
5887
|
];
|
|
5893
5888
|
this._container.className = e.join(" ");
|
|
5894
5889
|
}
|
|
@@ -5908,7 +5903,7 @@ var w = class extends HTMLElement {
|
|
|
5908
5903
|
if (!t) return;
|
|
5909
5904
|
t.classList.contains("relative") || t.classList.add("relative");
|
|
5910
5905
|
let n = t.querySelector(".mint-tags-skeleton");
|
|
5911
|
-
e ? (n || (n = document.createElement("div"), n.className = "mint-tags-skeleton absolute inset-0 z-10 pointer-events-none rounded-lg bg-gray-200 dark:bg-
|
|
5906
|
+
e ? (n || (n = document.createElement("div"), n.className = "mint-tags-skeleton absolute inset-0 z-10 pointer-events-none rounded-lg bg-gray-200 dark:bg-mint-hover animate-pulse", t.appendChild(n)), n.style.display = "block", this._chipsWrap && (this._chipsWrap.style.visibility = "hidden", this._chipsWrap.style.pointerEvents = "none"), this._input && (this._input.style.visibility = "hidden", this._input.style.pointerEvents = "none")) : (n && (n.style.display = "none"), this._chipsWrap && (this._chipsWrap.style.visibility = "visible", this._chipsWrap.style.pointerEvents = "auto"), this._input && (this._input.style.visibility = "visible", this._input.style.pointerEvents = "auto"));
|
|
5912
5907
|
}
|
|
5913
5908
|
_renderErrorState() {
|
|
5914
5909
|
let e = this.hasError(), t = this.getErrorMessage(), n = this.querySelector(".mint-tags-error");
|
|
@@ -6063,7 +6058,7 @@ var T = class extends HTMLElement {
|
|
|
6063
6058
|
this._cleanupEventListeners();
|
|
6064
6059
|
}
|
|
6065
6060
|
_render() {
|
|
6066
|
-
this.classList.add("
|
|
6061
|
+
this.classList.add("focus-visible:outline-none", "focus-visible:ring-2", "focus-visible:ring-offset-1", "focus-visible:ring-gray-400", "dark:focus-visible:ring-gray-500", "rounded"), this.getAttribute("disabled") === "true" ? this.classList.add("cursor-not-allowed", "opacity-50") : this.classList.add("cursor-pointer"), this.getAttribute("role") || this.setAttribute("role", "button"), this.getAttribute("tabindex") || this.setAttribute("tabindex", "0");
|
|
6067
6062
|
}
|
|
6068
6063
|
_setupEventListeners() {
|
|
6069
6064
|
this._clickHandler = (e) => {
|
|
@@ -6143,11 +6138,11 @@ var E = class extends HTMLElement {
|
|
|
6143
6138
|
}
|
|
6144
6139
|
getIconColorClasses() {
|
|
6145
6140
|
switch (this.getTone()) {
|
|
6146
|
-
case "info": return "text-
|
|
6141
|
+
case "info": return "text-gray-700 dark:text-gray-300";
|
|
6147
6142
|
case "success": return "text-green-600 dark:text-green-400";
|
|
6148
6143
|
case "warning": return "text-yellow-600 dark:text-yellow-400";
|
|
6149
6144
|
case "danger": return "text-red-600 dark:text-red-400";
|
|
6150
|
-
default: return "text-
|
|
6145
|
+
default: return "text-gray-700 dark:text-gray-300";
|
|
6151
6146
|
}
|
|
6152
6147
|
}
|
|
6153
6148
|
getHeadingColorClasses() {
|
|
@@ -6155,20 +6150,20 @@ var E = class extends HTMLElement {
|
|
|
6155
6150
|
}
|
|
6156
6151
|
getHeaderBackgroundClasses() {
|
|
6157
6152
|
switch (this.getTone()) {
|
|
6158
|
-
case "info": return "bg-
|
|
6153
|
+
case "info": return "bg-gray-100 dark:bg-white/5";
|
|
6159
6154
|
case "success": return "bg-green-100 dark:bg-green-900/30";
|
|
6160
6155
|
case "warning": return "bg-yellow-100 dark:bg-yellow-900/30";
|
|
6161
6156
|
case "danger": return "bg-red-100 dark:bg-red-900/30";
|
|
6162
|
-
default: return "bg-
|
|
6157
|
+
default: return "bg-gray-100 dark:bg-white/5";
|
|
6163
6158
|
}
|
|
6164
6159
|
}
|
|
6165
6160
|
getBorderClasses() {
|
|
6166
6161
|
switch (this.getTone()) {
|
|
6167
|
-
case "info": return "border-
|
|
6162
|
+
case "info": return "border-gray-200 dark:border-mint-divider";
|
|
6168
6163
|
case "success": return "border-green-200 dark:border-green-800";
|
|
6169
6164
|
case "warning": return "border-yellow-200 dark:border-yellow-800";
|
|
6170
6165
|
case "danger": return "border-red-200 dark:border-red-800";
|
|
6171
|
-
default: return "border-
|
|
6166
|
+
default: return "border-gray-200 dark:border-mint-divider";
|
|
6172
6167
|
}
|
|
6173
6168
|
}
|
|
6174
6169
|
getAriaLive() {
|
|
@@ -6176,7 +6171,7 @@ var E = class extends HTMLElement {
|
|
|
6176
6171
|
}
|
|
6177
6172
|
render() {
|
|
6178
6173
|
let e = this.getTone(), t = this.getHeading(), n = this.isDismissable();
|
|
6179
|
-
this.className = `box-border m-0 p-0 border-0 align-baseline block rounded-lg border shadow-sm overflow-hidden
|
|
6174
|
+
this.className = `box-border m-0 p-0 border-0 align-baseline block rounded-lg border shadow-sm overflow-hidden ${this.getBorderClasses()}`;
|
|
6180
6175
|
let r = this.getAriaLive();
|
|
6181
6176
|
this.setAttribute("role", "alert"), this.setAttribute("aria-live", r), e === "danger" ? this.setAttribute("aria-atomic", "true") : this.removeAttribute("aria-atomic");
|
|
6182
6177
|
let i = [];
|
|
@@ -6186,7 +6181,7 @@ var E = class extends HTMLElement {
|
|
|
6186
6181
|
e !== this._headerWrapper && e !== this._bodyWrapper && e !== this._iconElement && e !== this._headingElement && e !== this._dismissButton && i.push(e);
|
|
6187
6182
|
}), this._dismissButton && this._dismissHandler && this._dismissButton.removeEventListener("click", this._dismissHandler); this.firstChild;) this.removeChild(this.firstChild);
|
|
6188
6183
|
if (this._headerWrapper = null, this._bodyWrapper = null, this._iconElement = null, this._headingElement = null, this._dismissButton = null, this._headerWrapper = document.createElement("div"), this._headerWrapper.className = `px-4 py-3 flex items-center gap-3 ${this.getHeaderBackgroundClasses()}`, this._iconElement = document.createElement("mint-icon"), this._iconElement.setAttribute("name", this.getIconName()), this._iconElement.className = `flex-shrink-0 w-5 h-5 ${this.getIconColorClasses()}`, this._headerWrapper.appendChild(this._iconElement), this._headingElement = document.createElement("mint-text"), this._headingElement.className = `font-semibold flex-1 ${this.getHeadingColorClasses()}`, this._headingElement.textContent = t || "", this._headerWrapper.appendChild(this._headingElement), n) {
|
|
6189
|
-
this._dismissButton = document.createElement("button"), this._dismissButton.className = "flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10
|
|
6184
|
+
this._dismissButton = document.createElement("button"), this._dismissButton.className = "flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10", this._dismissButton.setAttribute("aria-label", "Dismiss alert"), this._dismissButton.setAttribute("type", "button");
|
|
6190
6185
|
let e = document.createElement("mint-icon");
|
|
6191
6186
|
e.setAttribute("name", "close"), e.className = "w-4 h-4 text-gray-700 dark:text-gray-300", this._dismissButton.appendChild(e), this._dismissHandler = (e) => {
|
|
6192
6187
|
e.preventDefault(), e.stopPropagation(), this.dispatchEvent(new CustomEvent("dismissed", {
|
|
@@ -6195,7 +6190,7 @@ var E = class extends HTMLElement {
|
|
|
6195
6190
|
})), this.remove();
|
|
6196
6191
|
}, this._dismissButton.addEventListener("click", this._dismissHandler), this._headerWrapper.appendChild(this._dismissButton);
|
|
6197
6192
|
}
|
|
6198
|
-
this._bodyWrapper = document.createElement("div"), this._bodyWrapper.className = "px-4 py-3 bg-white dark:bg-
|
|
6193
|
+
this._bodyWrapper = document.createElement("div"), this._bodyWrapper.className = "px-4 py-3 bg-white dark:bg-mint-elevated", i.forEach((e) => {
|
|
6199
6194
|
this._bodyWrapper.appendChild(e);
|
|
6200
6195
|
}), this.appendChild(this._headerWrapper), this.appendChild(this._bodyWrapper);
|
|
6201
6196
|
}
|
|
@@ -6433,7 +6428,7 @@ var D = class extends HTMLElement {
|
|
|
6433
6428
|
}
|
|
6434
6429
|
let n = this.querySelector(`#search-${this._tableId}`), r = document.activeElement === n || n?.querySelector("input") === document.activeElement, i = this._search, a = "";
|
|
6435
6430
|
if (!((this._fetching || this._loading) && !this._loaded && !this._sorting) && (e.forEach((e, t) => {
|
|
6436
|
-
let n = typeof this._configuration.onRowClick == "function", r = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800
|
|
6431
|
+
let n = typeof this._configuration.onRowClick == "function", r = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800" : "";
|
|
6437
6432
|
a += `<tr data-row-index="${t}" ${n ? "data-row-clickable=\"true\"" : ""}${r ? ` class="${r}"` : ""}>`, this._configuration.columns.forEach((n, r) => {
|
|
6438
6433
|
if (n.hidden) return;
|
|
6439
6434
|
let i = !n.show || n.show(this, e);
|
|
@@ -6443,7 +6438,7 @@ var D = class extends HTMLElement {
|
|
|
6443
6438
|
a += `<mint-button id="${i}" variant="link" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${r}" trigger-id="${i}" direction="down">`, n.actions.forEach((r, i) => {
|
|
6444
6439
|
if (!r.show || r.show(this, e)) {
|
|
6445
6440
|
let o = typeof r.label == "function" ? r.label(this, e) : r.label;
|
|
6446
|
-
a += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-
|
|
6441
|
+
a += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-mint-hover" data-action="row-action" data-row-index="${t}" data-action-index="${i}" data-column-key="${this._configuration.columns.indexOf(n)}">${o}</div>`;
|
|
6447
6442
|
}
|
|
6448
6443
|
}), a += "</mint-popover>";
|
|
6449
6444
|
} else n.actions.forEach((r, i) => {
|
|
@@ -6463,7 +6458,7 @@ var D = class extends HTMLElement {
|
|
|
6463
6458
|
a += `<mint-button id="${i}" variant="link" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${r}" trigger-id="${i}" direction="down">`, n.actions.forEach((r, i) => {
|
|
6464
6459
|
if (!r.show || r.show(this, e)) {
|
|
6465
6460
|
let o = typeof r.label == "function" ? r.label(this, e) : r.label;
|
|
6466
|
-
a += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-
|
|
6461
|
+
a += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-mint-hover" data-action="row-action" data-row-index="${t}" data-action-index="${i}" data-column-key="${this._configuration.columns.indexOf(n)}">${o}</div>`;
|
|
6467
6462
|
}
|
|
6468
6463
|
}), a += "</mint-popover>";
|
|
6469
6464
|
} else n.actions.forEach((r, i) => {
|
|
@@ -6641,7 +6636,7 @@ var D = class extends HTMLElement {
|
|
|
6641
6636
|
e.hidden || (r += `<th width="${e.width || ""}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}">`, e.showLabel !== !1 && (r += "<div class=\"flex items-center\">", r += `<div class="flex-1">${e.raw ? e.label : this._escapeHtml(e.label)}</div>`, e.sortable && (r += "<div class=\"ml-2 flex items-center\">", r += "<mint-icon name=\"\" class=\"w-4 h-4 text-gray-400\"></mint-icon>", r += "</div>"), r += "</div>"), r += "</th>");
|
|
6642
6637
|
}), r += "</tr></thead>", r += "<tbody>";
|
|
6643
6638
|
for (let e = 0; e < 4; e++) r += "<tr>", this._configuration.columns.forEach((e) => {
|
|
6644
|
-
e.hidden || (r += `<td style="${this._getStyle(e)}" class="${this._getClasses(e, !0)}">`, r += "<div class=\"h-4 bg-gray-200 dark:bg-
|
|
6639
|
+
e.hidden || (r += `<td style="${this._getStyle(e)}" class="${this._getClasses(e, !0)}">`, r += "<div class=\"h-4 bg-gray-200 dark:bg-mint-hover rounded animate-pulse\"></div>", r += "</td>");
|
|
6645
6640
|
}), r += "</tr>";
|
|
6646
6641
|
if (r += "</tbody>", r += "</table>", r += "</mint-table>", this._configuration.perPage && !this._configuration.loadMore && (n > 1 || this._lastPage > 0)) {
|
|
6647
6642
|
let e = this._lastPage > 0 ? this._lastPage : n;
|
|
@@ -6671,7 +6666,7 @@ var D = class extends HTMLElement {
|
|
|
6671
6666
|
r += "</th>";
|
|
6672
6667
|
}
|
|
6673
6668
|
}), r += "</tr></thead>", r += "<tbody>", !this._fetching && !this._loading && t.forEach((e, t) => {
|
|
6674
|
-
let n = typeof this._configuration.onRowClick == "function", i = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800
|
|
6669
|
+
let n = typeof this._configuration.onRowClick == "function", i = n ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800" : "";
|
|
6675
6670
|
r += `<tr data-row-index="${t}" ${n ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, this._configuration.columns.forEach((n, i) => {
|
|
6676
6671
|
if (n.hidden) return;
|
|
6677
6672
|
let a = !n.show || n.show(this, e);
|
|
@@ -6685,7 +6680,7 @@ var D = class extends HTMLElement {
|
|
|
6685
6680
|
r += `<mint-button id="${a}" variant="link" icon="ellipsis">`, r += "</mint-button>", r += `<mint-popover id="${i}" trigger-id="${a}" direction="down">`, n.actions.forEach((i, a) => {
|
|
6686
6681
|
if (!i.show || i.show(this, e)) {
|
|
6687
6682
|
let o = typeof i.label == "function" ? i.label(this, e) : i.label;
|
|
6688
|
-
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-
|
|
6683
|
+
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-mint-hover" data-action="row-action" data-row-index="${t}" data-action-index="${a}" data-column-key="${this._configuration.columns.indexOf(n)}">${this._escapeHtml(String(o))}</div>`;
|
|
6689
6684
|
}
|
|
6690
6685
|
}), r += "</mint-popover>";
|
|
6691
6686
|
} else n.actions.forEach((i, a) => {
|
|
@@ -6701,7 +6696,7 @@ var D = class extends HTMLElement {
|
|
|
6701
6696
|
r += `<mint-button id="${a}" variant="link" icon="ellipsis">`, r += "</mint-button>", r += `<mint-popover id="${i}" trigger-id="${a}" direction="down">`, n.actions.forEach((i, a) => {
|
|
6702
6697
|
if (!i.show || i.show(this, e)) {
|
|
6703
6698
|
let o = typeof i.label == "function" ? i.label(this, e) : i.label;
|
|
6704
|
-
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-
|
|
6699
|
+
r += `<div class="p-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-mint-hover" data-action="row-action" data-row-index="${t}" data-action-index="${a}" data-column-key="${this._configuration.columns.indexOf(n)}">${this._escapeHtml(String(o))}</div>`;
|
|
6705
6700
|
}
|
|
6706
6701
|
}), r += "</mint-popover>";
|
|
6707
6702
|
} else n.actions.forEach((i, a) => {
|
|
@@ -6894,7 +6889,7 @@ var O = class extends HTMLElement {
|
|
|
6894
6889
|
let o = this._getPositionClasses(r, i);
|
|
6895
6890
|
this._offCanvas.className = o;
|
|
6896
6891
|
let s = this._offCanvas.querySelector(".off-canvas-content");
|
|
6897
|
-
if (s || (s = document.createElement("div"), s.className = "off-canvas-content bg-white dark:bg-
|
|
6892
|
+
if (s || (s = document.createElement("div"), s.className = "off-canvas-content bg-white dark:bg-mint-elevated dark:border dark:border-mint-divider shadow-xl flex flex-col pointer-events-auto", s.style.transform = this._getTransformValue(r, !1), this._offCanvas.appendChild(s)), n ? this._animateEnter() : this._animateExit(), Array.from(s.classList).forEach((e) => {
|
|
6898
6893
|
(e.startsWith("w-") || e.startsWith("max-w-") || e.startsWith("md:w-") || e.startsWith("md:max-w-") || e.startsWith("sm:w-") || e.startsWith("sm:max-w-")) && s.classList.remove(e);
|
|
6899
6894
|
}), s.classList.remove("h-full", "max-h-[90vh]", "max-h-screen", "md:h-full", "md:max-h-[90vh]", "md:max-h-screen", "sm:h-full", "sm:max-h-[90vh]"), s.classList.remove("has-custom-width", "has-custom-height"), s.style.removeProperty("--off-canvas-width"), s.style.removeProperty("--off-canvas-height"), i) s.classList.add("w-full", "h-full", "max-w-none");
|
|
6900
6895
|
else if (r === "top" || r === "bottom") if (s.classList.add("w-full", "h-full", "max-w-none"), a) {
|
|
@@ -6906,13 +6901,13 @@ var O = class extends HTMLElement {
|
|
|
6906
6901
|
let e = this.getWidth(), t = this._normalizeCssValue(e);
|
|
6907
6902
|
s.style.setProperty("--off-canvas-width", t), s.classList.add("has-custom-width"), this._ensureWidthStyle();
|
|
6908
6903
|
}
|
|
6909
|
-
this._header || (this._header = document.createElement("div"), this._header.className = "flex items-center justify-between p-4 border-b border-gray-200 dark:border-
|
|
6904
|
+
this._header || (this._header = document.createElement("div"), this._header.className = "flex items-center justify-between p-4 border-b border-gray-200 dark:border-mint-divider flex-shrink-0", s.appendChild(this._header)), this._headingSlot || (this._headingSlot = document.createElement("div"), this._headingSlot.className = "flex-1", this._headingSlot.setAttribute("slot", "heading"), this._header.appendChild(this._headingSlot));
|
|
6910
6905
|
let c = this._headingSlot.querySelector("mint-text");
|
|
6911
6906
|
t ? (c || (c = document.createElement("mint-text"), c.setAttribute("size", "sub-heading"), c.setAttribute("bold", "true"), this._headingSlot.appendChild(c)), c.textContent = t) : c && c.remove(), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._offCanvas && e !== this._headingSlot && e.getAttribute("slot") === "heading").forEach((e) => {
|
|
6912
6907
|
this._headingSlot && e.parentElement !== this._headingSlot && this._headingSlot.appendChild(e);
|
|
6913
6908
|
}), this._closeButton || (this._closeButton = document.createElement("mint-button"), this._closeButton.setAttribute("variant", "ghost"), this._closeButton.setAttribute("icon", "close"), this._closeButton.addEventListener("click", () => this.close()), this._header.appendChild(this._closeButton)), this._bodySlot || (this._bodySlot = document.createElement("div"), this._bodySlot.className = "flex-1 overflow-y-auto p-4", this._bodySlot.setAttribute("slot", "body"), s.appendChild(this._bodySlot)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._offCanvas && e !== this._bodySlot && e.getAttribute("slot") === "body").forEach((e) => {
|
|
6914
6909
|
this._bodySlot && e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
6915
|
-
}), this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "p-4 border-t border-gray-200 dark:border-
|
|
6910
|
+
}), this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "p-4 border-t border-gray-200 dark:border-mint-divider flex-shrink-0", this._actionsSlot.setAttribute("slot", "actions"), s.appendChild(this._actionsSlot));
|
|
6916
6911
|
let l = this._actionsSlot.querySelector("mint-stack");
|
|
6917
6912
|
l || (l = document.createElement("mint-stack"), l.setAttribute("direction", "horizontal"), l.className = "justify-end", this._actionsSlot.appendChild(l)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._offCanvas && e !== this._actionsSlot && e.getAttribute("slot") === "actions").forEach((e) => {
|
|
6918
6913
|
Array.from(e.children).forEach((e) => {
|
|
@@ -6923,7 +6918,7 @@ var O = class extends HTMLElement {
|
|
|
6923
6918
|
}), this._updateBackgroundColor();
|
|
6924
6919
|
}
|
|
6925
6920
|
_getPositionClasses(e, t) {
|
|
6926
|
-
let n = "fixed z-50 pointer-events-none
|
|
6921
|
+
let n = "fixed z-50 pointer-events-none";
|
|
6927
6922
|
switch (e) {
|
|
6928
6923
|
case "top": return `${n} inset-0 md:inset-x-0 md:top-0 md:bottom-auto ${t ? "md:h-full" : "md:h-auto"}`;
|
|
6929
6924
|
case "bottom": return `${n} inset-0 md:inset-x-0 md:bottom-0 md:top-auto ${t ? "md:h-full" : "md:h-auto"}`;
|
|
@@ -6951,7 +6946,7 @@ var O = class extends HTMLElement {
|
|
|
6951
6946
|
_updateBackgroundColor() {
|
|
6952
6947
|
if (!this._offCanvas) return;
|
|
6953
6948
|
let e = document.documentElement.classList.contains("dark"), t = this._offCanvas.querySelector(".off-canvas-content");
|
|
6954
|
-
t && (e ? (t.classList.remove("bg-white"), t.classList.add("bg-
|
|
6949
|
+
t && (e ? (t.classList.remove("bg-white"), t.classList.add("bg-mint-elevated", "border", "border-mint-divider")) : (t.classList.remove("bg-mint-elevated", "border", "border-mint-divider"), t.classList.add("bg-white")));
|
|
6955
6950
|
}
|
|
6956
6951
|
_observeDarkMode() {
|
|
6957
6952
|
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => {
|
|
@@ -7036,9 +7031,9 @@ var k = class extends HTMLElement {
|
|
|
7036
7031
|
}
|
|
7037
7032
|
render() {
|
|
7038
7033
|
let e = this.isActive(), t = this.isDisabled();
|
|
7039
|
-
this.className = "", this.classList.add("box-border", "m-0", "p-0", "border-0", "inline-block", "cursor-pointer", "px-4", "py-1.5", "text-sm", "font-medium", "
|
|
7034
|
+
this.className = "", this.classList.add("box-border", "m-0", "p-0", "border-0", "inline-block", "cursor-pointer", "px-4", "py-1.5", "text-sm", "font-medium", "rounded-lg", "border", "text-gray-700", "dark:text-gray-300");
|
|
7040
7035
|
let n = this.closest("mint-tab-list")?.getAttribute("position") || "top", r = n === "left" || n === "right";
|
|
7041
|
-
t ? (this.classList.add("opacity-60", "cursor-not-allowed", "pointer-events-none", "bg-gray-50", "dark:bg-
|
|
7036
|
+
t ? (this.classList.add("opacity-60", "cursor-not-allowed", "pointer-events-none", "bg-gray-50", "dark:bg-mint-elevated", "border-gray-300", "dark:border-mint-divider", "text-gray-400", "dark:text-gray-500"), this.classList.remove("cursor-pointer")) : e ? (this.classList.add("bg-white", "dark:bg-mint-elevated", "border-gray-200", "dark:border-mint-divider", "text-gray-900", "dark:text-gray-100", "shadow-sm", "relative", "z-10"), r ? n === "left" ? this.classList.add("mr-[-1px]") : this.classList.add("ml-[-1px]") : this.classList.add("mb-[-1px]")) : this.classList.add("bg-gray-100", "dark:bg-mint-elevated", "border-gray-200", "dark:border-mint-divider", "text-gray-600", "dark:text-gray-400", "hover:bg-gray-50", "dark:hover:bg-mint-hover");
|
|
7042
7037
|
}
|
|
7043
7038
|
setupEventListeners() {
|
|
7044
7039
|
this.isDisabled() || this._clickHandler || (this._clickHandler = this.handleClick.bind(this), this.addEventListener("click", this._clickHandler));
|
|
@@ -7083,7 +7078,7 @@ var A = class extends HTMLElement {
|
|
|
7083
7078
|
}
|
|
7084
7079
|
render() {
|
|
7085
7080
|
let e = this.getPosition();
|
|
7086
|
-
this.classList.remove("flex", "inline-flex", "flex-row", "flex-col", "gap-1", "gap-2", "pb-0", "pr-0", "pl-0", "mb-0", "mr-0", "ml-0", "self-start"), this.classList.add("box-border", "m-0", "p-1", "border", "bg-gray-100", "dark:bg-
|
|
7081
|
+
this.classList.remove("flex", "inline-flex", "flex-row", "flex-col", "gap-1", "gap-2", "pb-0", "pr-0", "pl-0", "mb-0", "mr-0", "ml-0", "self-start"), this.classList.add("box-border", "m-0", "p-1", "border", "bg-gray-100", "dark:bg-mint-elevated", "dark:border-mint-divider", "border-gray-200", "w-auto", "rounded-lg", "gap-2"), e === "top" ? this.classList.add("inline-flex", "flex-row", "mb-0", "self-start") : e === "left" ? this.classList.add("flex", "flex-col", "mr-0") : e === "right" && this.classList.add("flex", "flex-col", "ml-0");
|
|
7087
7082
|
}
|
|
7088
7083
|
};
|
|
7089
7084
|
customElements.get("mint-tab-list") || customElements.define("mint-tab-list", A);
|
|
@@ -7241,14 +7236,14 @@ var N = class e extends HTMLElement {
|
|
|
7241
7236
|
values: null,
|
|
7242
7237
|
dataHash: ""
|
|
7243
7238
|
}, this._renderScheduled = !1, this._datasetVisibility = /* @__PURE__ */ new Map(), this._widthValue = "100%", this._heightValue = 400, this._defaultColors = [
|
|
7244
|
-
"#
|
|
7239
|
+
"#525252",
|
|
7240
|
+
"#737373",
|
|
7241
|
+
"#a3a3a3",
|
|
7242
|
+
"#d4d4d4",
|
|
7245
7243
|
"#ef4444",
|
|
7246
|
-
"#10b981",
|
|
7247
7244
|
"#f59e0b",
|
|
7248
|
-
"#
|
|
7249
|
-
"#
|
|
7250
|
-
"#06b6d4",
|
|
7251
|
-
"#f97316"
|
|
7245
|
+
"#22c55e",
|
|
7246
|
+
"#eab308"
|
|
7252
7247
|
], this._legendHeight = 0, this._rotatedLabelHeight = 0;
|
|
7253
7248
|
}
|
|
7254
7249
|
connectedCallback() {
|
|
@@ -7452,7 +7447,7 @@ var N = class e extends HTMLElement {
|
|
|
7452
7447
|
this._showTooltip && this._chartType !== "pie" && (this._setupChartTooltip(), this._setupTooltipScrollHandler()), this._createVerticalLine();
|
|
7453
7448
|
}
|
|
7454
7449
|
_createTooltip() {
|
|
7455
|
-
this._tooltip && this._tooltip.parentNode && this._tooltip.parentNode.removeChild(this._tooltip), this._tooltip = document.createElement("div"), this._tooltip.className = "fixed pointer-events-none z-50 bg-gray-900 dark:bg-
|
|
7450
|
+
this._tooltip && this._tooltip.parentNode && this._tooltip.parentNode.removeChild(this._tooltip), this._tooltip = document.createElement("div"), this._tooltip.className = "fixed pointer-events-none z-50 bg-gray-900 dark:bg-mint-elevated text-white text-xs rounded px-2 py-1 shadow-lg opacity-0", this._tooltip.style.display = "none", document.body.appendChild(this._tooltip);
|
|
7456
7451
|
}
|
|
7457
7452
|
_showTooltipAt(e, t, n) {
|
|
7458
7453
|
if (!this._tooltip) return;
|
|
@@ -7648,9 +7643,6 @@ var N = class e extends HTMLElement {
|
|
|
7648
7643
|
}
|
|
7649
7644
|
return String(e);
|
|
7650
7645
|
}
|
|
7651
|
-
_formatXAxisForTooltip(e) {
|
|
7652
|
-
return this._formatXAxisValue(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
7653
|
-
}
|
|
7654
7646
|
_formatYAxisValue(e) {
|
|
7655
7647
|
if (this._chartData?.formatYAxis) {
|
|
7656
7648
|
if (typeof this._chartData.formatYAxis == "function") return this._chartData.formatYAxis(e);
|
|
@@ -7732,7 +7724,7 @@ var N = class e extends HTMLElement {
|
|
|
7732
7724
|
if (i.length > 0) {
|
|
7733
7725
|
this._activeXValue = e, this._showPlotPointsForX(e), this._showVerticalLineAtX(e, t);
|
|
7734
7726
|
let a = this._cachedTooltipContent.get(e);
|
|
7735
|
-
a || (a = `<strong>${
|
|
7727
|
+
a || (a = `<strong>${e}</strong><br/>`, i.forEach((e) => {
|
|
7736
7728
|
a += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7737
7729
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7738
7730
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -7753,7 +7745,7 @@ var N = class e extends HTMLElement {
|
|
|
7753
7745
|
this._activeXValue = s, this._showPlotPointsForX(s), this._showVerticalLineAtX(s, t);
|
|
7754
7746
|
let l = this._cachedTooltipContent.get(s);
|
|
7755
7747
|
if (!l) {
|
|
7756
|
-
if (l = `<strong>${
|
|
7748
|
+
if (l = `<strong>${s}</strong><br/>`, c.forEach((e) => {
|
|
7757
7749
|
l += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7758
7750
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7759
7751
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -7781,7 +7773,7 @@ var N = class e extends HTMLElement {
|
|
|
7781
7773
|
if (n.length === 0) return;
|
|
7782
7774
|
this._showPlotPointsForX(a), this._showVerticalLineAtX(a, t);
|
|
7783
7775
|
let r = this._cachedTooltipContent.get(a);
|
|
7784
|
-
r || (r = `<strong>${
|
|
7776
|
+
r || (r = `<strong>${a}</strong><br/>`, n.forEach((e) => {
|
|
7785
7777
|
r += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7786
7778
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7787
7779
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -7809,7 +7801,7 @@ var N = class e extends HTMLElement {
|
|
|
7809
7801
|
if (e.length === 0) return;
|
|
7810
7802
|
this._showPlotPointsForX(o), this._showVerticalLineAtX(o, t);
|
|
7811
7803
|
let r = this._cachedTooltipContent.get(o);
|
|
7812
|
-
r || (r = `<strong>${
|
|
7804
|
+
r || (r = `<strong>${o}</strong><br/>`, e.forEach((e) => {
|
|
7813
7805
|
r += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7814
7806
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7815
7807
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -7829,7 +7821,7 @@ var N = class e extends HTMLElement {
|
|
|
7829
7821
|
if (n.length > 0) {
|
|
7830
7822
|
this._activeXValue = e, this._showPlotPointsForX(e), this._showVerticalLineAtX(e, t);
|
|
7831
7823
|
let i = this._cachedTooltipContent.get(e);
|
|
7832
|
-
i || (i = `<strong>${
|
|
7824
|
+
i || (i = `<strong>${e}</strong><br/>`, n.forEach((e) => {
|
|
7833
7825
|
i += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7834
7826
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7835
7827
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -7844,7 +7836,7 @@ var N = class e extends HTMLElement {
|
|
|
7844
7836
|
if (n.length > 0) {
|
|
7845
7837
|
this._activeXValue = e, this._showPlotPointsForX(e), this._showVerticalLineAtX(e, t);
|
|
7846
7838
|
let i = this._cachedTooltipContent.get(e);
|
|
7847
|
-
i || (i = `<strong>${
|
|
7839
|
+
i || (i = `<strong>${e}</strong><br/>`, n.forEach((e) => {
|
|
7848
7840
|
i += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7849
7841
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7850
7842
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -7870,7 +7862,7 @@ var N = class e extends HTMLElement {
|
|
|
7870
7862
|
this._activeXValue = o, this._showPlotPointsForX(o), this._showVerticalLineAtX(o, t);
|
|
7871
7863
|
let c = this._cachedTooltipContent.get(o);
|
|
7872
7864
|
if (!c) {
|
|
7873
|
-
if (c = `<strong>${
|
|
7865
|
+
if (c = `<strong>${o}</strong><br/>`, s.forEach((e) => {
|
|
7874
7866
|
c += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
7875
7867
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
7876
7868
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
@@ -8133,7 +8125,7 @@ var N = class e extends HTMLElement {
|
|
|
8133
8125
|
p++, t.data.forEach((o) => {
|
|
8134
8126
|
let s = this._scaleXForBarChart(o.x, e), c = this._scaleY(o.y, e), l = e.y + e.height - c, d = s + a, f = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
8135
8127
|
f.setAttribute("x", d.toString()), f.setAttribute("y", c.toString()), f.setAttribute("width", u.toString()), f.setAttribute("height", l.toString()), f.setAttribute("fill", i), f.setAttribute("rx", "2"), f.setAttribute("class", "chart-bar"), f.setAttribute("data-dataset", r.toString()), f.setAttribute("data-x", String(o.x)), f.setAttribute("data-y", o.y.toString()), f.setAttribute("data-name", t.name), f.style.cursor = "pointer", this._showTooltip && (f.addEventListener("mouseenter", (e) => {
|
|
8136
|
-
let t = this._getAllDatasetsAtX(o.x), n = `<strong>${
|
|
8128
|
+
let t = this._getAllDatasetsAtX(o.x), n = `<strong>${o.x}</strong><br/>`;
|
|
8137
8129
|
t.forEach((e) => {
|
|
8138
8130
|
n += `<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
8139
8131
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
@@ -8231,7 +8223,7 @@ var N = class e extends HTMLElement {
|
|
|
8231
8223
|
t !== null && clearTimeout(t);
|
|
8232
8224
|
let n = window.setTimeout(() => {
|
|
8233
8225
|
r = !0, this._pieChartTooltipShown = !0;
|
|
8234
|
-
let o = this._formatValue(l, i), s = `<strong>${
|
|
8226
|
+
let o = this._formatValue(l, i), s = `<strong>${e.x}</strong><br/>${i.name}: ${o}<br/>${u.toFixed(1)}%`;
|
|
8235
8227
|
this._showTooltipAt(a.clientX, a.clientY, s), t = null, this._pieChartTimeouts.delete(n);
|
|
8236
8228
|
}, 150);
|
|
8237
8229
|
t = n, this._pieChartTimeouts.add(n);
|
|
@@ -8246,7 +8238,7 @@ var N = class e extends HTMLElement {
|
|
|
8246
8238
|
}
|
|
8247
8239
|
}), p.addEventListener("click", (a) => {
|
|
8248
8240
|
a.stopPropagation(), t !== null && (clearTimeout(t), t = null), n !== null && (clearTimeout(n), n = null), r = !0, this._pieChartTooltipShown = !0;
|
|
8249
|
-
let o = this._formatValue(l, i), s = `<strong>${
|
|
8241
|
+
let o = this._formatValue(l, i), s = `<strong>${e.x}</strong><br/>${i.name}: ${o}<br/>${u.toFixed(1)}%`;
|
|
8250
8242
|
this._showTooltipAt(a.clientX, a.clientY, s);
|
|
8251
8243
|
});
|
|
8252
8244
|
}
|
|
@@ -8492,8 +8484,6 @@ var P = class extends HTMLElement {
|
|
|
8492
8484
|
this._isSubmenuItem() ? "px-2 py-1.5" : "px-3 py-2",
|
|
8493
8485
|
"text-left",
|
|
8494
8486
|
"text-sm",
|
|
8495
|
-
"transition-colors",
|
|
8496
|
-
"duration-150",
|
|
8497
8487
|
e
|
|
8498
8488
|
].join(" ");
|
|
8499
8489
|
}
|
|
@@ -8530,7 +8520,7 @@ var P = class extends HTMLElement {
|
|
|
8530
8520
|
"border-gray-200",
|
|
8531
8521
|
"pl-2",
|
|
8532
8522
|
"space-y-1",
|
|
8533
|
-
"dark:border-
|
|
8523
|
+
"dark:border-mint-divider",
|
|
8534
8524
|
this._isExpanded() ? "block" : "hidden"
|
|
8535
8525
|
].join(" "), r.forEach((e) => {
|
|
8536
8526
|
e.setAttribute("submenu-item", "true"), e.setAttribute("slot", "submenu"), this._submenuContainer?.appendChild(e);
|
|
@@ -8584,7 +8574,7 @@ var I = class extends HTMLElement {
|
|
|
8584
8574
|
return this.getAttribute("separated") === "true";
|
|
8585
8575
|
}
|
|
8586
8576
|
render() {
|
|
8587
|
-
this.className = this._isSeparated() ? "block w-full mt-2 border-t border-gray-200 pt-2 px-2 pb-2 dark:border-
|
|
8577
|
+
this.className = this._isSeparated() ? "block w-full mt-2 border-t border-gray-200 pt-2 px-2 pb-2 dark:border-mint-divider" : "block w-full p-2";
|
|
8588
8578
|
}
|
|
8589
8579
|
};
|
|
8590
8580
|
customElements.get("mint-sidenav-action-links") || customElements.define("mint-sidenav-action-links", I);
|
|
@@ -8604,37 +8594,20 @@ var L = class extends HTMLElement {
|
|
|
8604
8594
|
t !== n && this.render();
|
|
8605
8595
|
}
|
|
8606
8596
|
_getTitle() {
|
|
8607
|
-
return this.getAttribute("title") || "
|
|
8597
|
+
return this.getAttribute("title") || "";
|
|
8608
8598
|
}
|
|
8609
8599
|
_getSubtitle() {
|
|
8610
|
-
return this.getAttribute("subtitle") || "
|
|
8600
|
+
return this.getAttribute("subtitle") || "";
|
|
8611
8601
|
}
|
|
8612
8602
|
_createDefaultGroup() {
|
|
8613
|
-
let e = document.createElement("mint-sidenav-action-links"), t = (
|
|
8614
|
-
|
|
8615
|
-
return r.setAttribute("variant", "ghost"), r.setAttribute("full-width", "true"), r.setAttribute("align", "left"), r.innerHTML = `
|
|
8616
|
-
<span class="flex w-full items-center justify-between">
|
|
8617
|
-
<span class="inline-flex items-center gap-2">
|
|
8618
|
-
<mint-icon name="${t}" class="h-4 w-4"></mint-icon>
|
|
8619
|
-
<span class="text-sm">${e}</span>
|
|
8620
|
-
</span>
|
|
8621
|
-
${n ? `<span class="text-xs text-gray-500 dark:text-gray-400">${n}</span>` : ""}
|
|
8622
|
-
</span>
|
|
8623
|
-
`, r;
|
|
8624
|
-
};
|
|
8625
|
-
e.appendChild(t("Acme Inc", "user", "⌘ 1")), e.appendChild(t("Acme Corp.", "user", "⌘ 2")), e.appendChild(t("Evil Corp.", "user", "⌘ 3"));
|
|
8626
|
-
let n = document.createElement("mint-sidenav-action-links");
|
|
8627
|
-
n.setAttribute("separated", "true");
|
|
8628
|
-
let r = document.createElement("mint-button");
|
|
8629
|
-
r.setAttribute("variant", "ghost"), r.setAttribute("full-width", "true"), r.setAttribute("align", "left"), r.innerHTML = "\n <span class=\"inline-flex items-center gap-2\">\n <mint-icon name=\"plus\" class=\"h-4 w-4\"></mint-icon>\n <span class=\"text-sm\">Add team</span>\n </span>\n ", n.appendChild(r);
|
|
8630
|
-
let i = document.createElement("div");
|
|
8631
|
-
return i.appendChild(e), i.appendChild(n), i;
|
|
8603
|
+
let e = document.createElement("mint-sidenav-action-links"), t = document.createElement("div");
|
|
8604
|
+
return t.appendChild(e), t;
|
|
8632
8605
|
}
|
|
8633
8606
|
render() {
|
|
8634
8607
|
let e = Array.from(this.children).filter((e) => e !== this._wrapper && e.getAttribute("slot") === "action-links");
|
|
8635
|
-
this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "relative", this.appendChild(this._wrapper)), this._wrapper.innerHTML = "", this._trigger = document.createElement("button"), this._trigger.type = "button", this._trigger.id = this._triggerId, this._trigger.className = "flex w-full cursor-pointer items-center gap-3 rounded-xl border border-gray-200 bg-gray-50 px-3 py-2 text-left
|
|
8608
|
+
this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "relative", this.appendChild(this._wrapper)), this._wrapper.innerHTML = "", this._trigger = document.createElement("button"), this._trigger.type = "button", this._trigger.id = this._triggerId, this._trigger.className = "flex w-full cursor-pointer items-center gap-3 rounded-xl border border-gray-200 bg-gray-50 px-3 py-2 text-left hover:bg-gray-100 dark:border-mint-divider dark:bg-white/5 dark:hover:bg-white/10";
|
|
8636
8609
|
let t = document.createElement("div");
|
|
8637
|
-
t.className = "inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-
|
|
8610
|
+
t.className = "inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gray-700 text-xs font-semibold text-white dark:bg-mint-nav", t.textContent = this._getTitle().split(" ").map((e) => e[0]).join("").slice(0, 2).toUpperCase();
|
|
8638
8611
|
let n = document.createElement("div");
|
|
8639
8612
|
n.className = "min-w-0 flex-1";
|
|
8640
8613
|
let r = document.createElement("mint-text");
|
|
@@ -8734,8 +8707,8 @@ var R = class extends HTMLElement {
|
|
|
8734
8707
|
"border-gray-200",
|
|
8735
8708
|
"bg-white",
|
|
8736
8709
|
"p-2",
|
|
8737
|
-
"dark:border-
|
|
8738
|
-
"dark:bg-
|
|
8710
|
+
"dark:border-mint-divider",
|
|
8711
|
+
"dark:bg-mint-nav",
|
|
8739
8712
|
"w-[4.75rem]",
|
|
8740
8713
|
"max-[1099.98px]:fixed",
|
|
8741
8714
|
e,
|
|
@@ -8754,9 +8727,8 @@ var R = class extends HTMLElement {
|
|
|
8754
8727
|
"min-[1100px]:left-0",
|
|
8755
8728
|
"min-[1100px]:top-14",
|
|
8756
8729
|
"min-[1100px]:bottom-0",
|
|
8757
|
-
"min-[1100px]:z-
|
|
8730
|
+
"min-[1100px]:z-[60]",
|
|
8758
8731
|
"min-[1100px]:w-[17rem]",
|
|
8759
|
-
"min-[1100px]:translate-x-0",
|
|
8760
8732
|
"min-[1100px]:p-3",
|
|
8761
8733
|
"min-[1100px]:shadow-none"
|
|
8762
8734
|
].join(" ");
|
|
@@ -8782,7 +8754,7 @@ var R = class extends HTMLElement {
|
|
|
8782
8754
|
}
|
|
8783
8755
|
_buildFooter() {
|
|
8784
8756
|
if (!this._container) return;
|
|
8785
|
-
this._footer || (this._footer = document.createElement("div"), this._footer.className = "mt-auto border-t border-gray-200 py-3 dark:border-
|
|
8757
|
+
this._footer || (this._footer = document.createElement("div"), this._footer.className = "mt-auto border-t border-gray-200 py-3 dark:border-mint-divider", this._container.appendChild(this._footer));
|
|
8786
8758
|
let e = document.createElement("div");
|
|
8787
8759
|
e.className = "space-y-1", this._replaceSlottedChildren(e, "bottom-links"), this._footer.innerHTML = "", this._footer.appendChild(e);
|
|
8788
8760
|
}
|
|
@@ -8795,45 +8767,42 @@ customElements.get("mint-side-navigation") || customElements.define("mint-side-n
|
|
|
8795
8767
|
//#region src/components/top-navigation/TopNavigation.ts
|
|
8796
8768
|
var z = class extends HTMLElement {
|
|
8797
8769
|
constructor(...e) {
|
|
8798
|
-
super(...e), this._bar = null, this._menuButton = null, this._logoLink = null, this._menuClickHandler = null, this.
|
|
8770
|
+
super(...e), this._bar = null, this._menuButton = null, this._logoLink = null, this._menuClickHandler = null, this._darkModeObserver = null, this._resizeHandler = null, this._desktopSearchInput = null, this._desktopSearchShell = null, this._mobileSearchButton = null, this._searchPanel = null, this._searchPanelInput = null, this._searchResultsWrap = null, this._searchStateWrap = null, this._searchDebounceId = null, this._searchAbortController = null, this._searchOpen = !1, this._searchQuery = "", this._globalKeydownHandler = null, this._docClickHandler = null;
|
|
8799
8771
|
}
|
|
8800
8772
|
static get observedAttributes() {
|
|
8801
8773
|
return [
|
|
8802
8774
|
"logo-src",
|
|
8803
8775
|
"logo-src-light",
|
|
8804
8776
|
"logo-src-dark",
|
|
8777
|
+
"logo-src-mobile",
|
|
8778
|
+
"logo-src-mobile-light",
|
|
8779
|
+
"logo-src-mobile-dark",
|
|
8805
8780
|
"logo-href",
|
|
8806
8781
|
"logo-alt",
|
|
8807
|
-
"menu-target"
|
|
8782
|
+
"menu-target",
|
|
8783
|
+
"search-endpoint",
|
|
8784
|
+
"search-param",
|
|
8785
|
+
"search-placeholder"
|
|
8808
8786
|
];
|
|
8809
8787
|
}
|
|
8810
8788
|
connectedCallback() {
|
|
8811
|
-
this.classList.add("
|
|
8789
|
+
this.classList.add("relative", "block", "h-14", "w-full", "shrink-0"), this._observeDarkMode(), this._attachResizeListener(), this._attachGlobalHandlers(), this.render();
|
|
8812
8790
|
}
|
|
8813
8791
|
disconnectedCallback() {
|
|
8814
|
-
this._menuButton && this._menuClickHandler && (this._menuButton.removeEventListener("click", this._menuClickHandler), this._menuClickHandler = null), this.
|
|
8792
|
+
this._menuButton && this._menuClickHandler && (this._menuButton.removeEventListener("click", this._menuClickHandler), this._menuClickHandler = null), this._disconnectDarkModeObserver(), this._detachResizeListener(), this._detachGlobalHandlers(), this._cancelSearchDebounce(), this._abortSearch();
|
|
8815
8793
|
}
|
|
8816
8794
|
attributeChangedCallback(e, t, n) {
|
|
8817
8795
|
t !== n && this.render();
|
|
8818
8796
|
}
|
|
8819
|
-
|
|
8820
|
-
return
|
|
8821
|
-
}
|
|
8822
|
-
_getLogoSrcLight() {
|
|
8823
|
-
return this.getAttribute("logo-src-light") || "";
|
|
8824
|
-
}
|
|
8825
|
-
_getLogoSrcDark() {
|
|
8826
|
-
return this.getAttribute("logo-src-dark") || "";
|
|
8797
|
+
_isDarkMode() {
|
|
8798
|
+
return document.documentElement.classList.contains("dark");
|
|
8827
8799
|
}
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
return e || t ? document.documentElement.classList.contains("dark") ? t || e : e || t : this._getLogoSrc();
|
|
8800
|
+
_isMobileViewport() {
|
|
8801
|
+
return window.matchMedia("(max-width: 1099.98px)").matches;
|
|
8831
8802
|
}
|
|
8832
|
-
|
|
8833
|
-
this.
|
|
8834
|
-
|
|
8835
|
-
attributeFilter: ["class"]
|
|
8836
|
-
}));
|
|
8803
|
+
_getLogoSrc() {
|
|
8804
|
+
let e = this.getAttribute("logo-src") || "", t = this.getAttribute("logo-src-light") || "", n = this.getAttribute("logo-src-dark") || "", r = this.getAttribute("logo-src-mobile") || "", i = this.getAttribute("logo-src-mobile-light") || "", a = this.getAttribute("logo-src-mobile-dark") || "", o = this._isDarkMode(), s = this._isMobileViewport();
|
|
8805
|
+
return s && o ? a || r || n || t || e : s && !o ? i || r || t || n || e : o ? n || t || e : t || n || e;
|
|
8837
8806
|
}
|
|
8838
8807
|
_getLogoHref() {
|
|
8839
8808
|
return this.getAttribute("logo-href") || "/";
|
|
@@ -8844,6 +8813,166 @@ var z = class extends HTMLElement {
|
|
|
8844
8813
|
_getMenuTargetId() {
|
|
8845
8814
|
return (this.getAttribute("menu-target") || "").replace(/^#/, "");
|
|
8846
8815
|
}
|
|
8816
|
+
_getSearchEndpoint() {
|
|
8817
|
+
return (this.getAttribute("search-endpoint") || "").trim();
|
|
8818
|
+
}
|
|
8819
|
+
_getSearchParam() {
|
|
8820
|
+
return (this.getAttribute("search-param") || "q").trim() || "q";
|
|
8821
|
+
}
|
|
8822
|
+
_getSearchPlaceholder() {
|
|
8823
|
+
return this.getAttribute("search-placeholder") || "Search";
|
|
8824
|
+
}
|
|
8825
|
+
_isSearchEnabled() {
|
|
8826
|
+
return !!this._getSearchEndpoint();
|
|
8827
|
+
}
|
|
8828
|
+
_attachGlobalHandlers() {
|
|
8829
|
+
this._globalKeydownHandler || (this._globalKeydownHandler = (e) => {
|
|
8830
|
+
let t = e.key.toLowerCase();
|
|
8831
|
+
if ((e.metaKey || e.ctrlKey) && t === "k") {
|
|
8832
|
+
e.preventDefault(), this._openSearch(!0);
|
|
8833
|
+
return;
|
|
8834
|
+
}
|
|
8835
|
+
t === "escape" && this._searchOpen && this._closeSearch();
|
|
8836
|
+
}, document.addEventListener("keydown", this._globalKeydownHandler)), this._docClickHandler || (this._docClickHandler = (e) => {
|
|
8837
|
+
if (!this._searchOpen) return;
|
|
8838
|
+
let t = e.target;
|
|
8839
|
+
t && (this.contains(t) || this._closeSearch());
|
|
8840
|
+
}, document.addEventListener("click", this._docClickHandler));
|
|
8841
|
+
}
|
|
8842
|
+
_detachGlobalHandlers() {
|
|
8843
|
+
this._globalKeydownHandler &&= (document.removeEventListener("keydown", this._globalKeydownHandler), null), this._docClickHandler &&= (document.removeEventListener("click", this._docClickHandler), null);
|
|
8844
|
+
}
|
|
8845
|
+
_cancelSearchDebounce() {
|
|
8846
|
+
this._searchDebounceId !== null && (window.clearTimeout(this._searchDebounceId), this._searchDebounceId = null);
|
|
8847
|
+
}
|
|
8848
|
+
_abortSearch() {
|
|
8849
|
+
this._searchAbortController &&= (this._searchAbortController.abort(), null);
|
|
8850
|
+
}
|
|
8851
|
+
_openSearch(e = !1) {
|
|
8852
|
+
if (this._isSearchEnabled() && (this._searchOpen = !0, this._syncSearchPanelVisibility(), e)) {
|
|
8853
|
+
let e = this._isMobileViewport() ? this._searchPanelInput : this._desktopSearchInput;
|
|
8854
|
+
e?.focus(), e?.select();
|
|
8855
|
+
}
|
|
8856
|
+
}
|
|
8857
|
+
_closeSearch() {
|
|
8858
|
+
this._searchOpen = !1, this._syncSearchPanelVisibility();
|
|
8859
|
+
}
|
|
8860
|
+
_syncSearchPanelVisibility() {
|
|
8861
|
+
this._searchPanel && (this._searchPanel.classList.toggle("hidden", !this._searchOpen), this._syncDesktopSearchOpenState(), this._positionSearchPanel());
|
|
8862
|
+
}
|
|
8863
|
+
_syncDesktopSearchOpenState() {
|
|
8864
|
+
this._desktopSearchShell && (this._desktopSearchShell.classList.toggle("rounded-b-none", this._searchOpen), this._desktopSearchShell.classList.toggle("border-b-transparent", this._searchOpen));
|
|
8865
|
+
}
|
|
8866
|
+
_positionSearchPanel() {
|
|
8867
|
+
if (!this._searchPanel) return;
|
|
8868
|
+
if (this._isMobileViewport() || !this._desktopSearchShell) {
|
|
8869
|
+
this._searchPanel.style.left = "", this._searchPanel.style.right = "", this._searchPanel.style.top = "", this._searchPanel.style.width = "", this._searchPanel.style.maxWidth = "", this._searchPanel.style.transform = "";
|
|
8870
|
+
return;
|
|
8871
|
+
}
|
|
8872
|
+
let e = this._desktopSearchShell.getBoundingClientRect();
|
|
8873
|
+
this._searchPanel.style.left = `${e.left}px`, this._searchPanel.style.right = "auto", this._searchPanel.style.top = `${e.bottom - 1}px`, this._searchPanel.style.width = `${e.width}px`, this._searchPanel.style.maxWidth = `${e.width}px`, this._searchPanel.style.transform = "none";
|
|
8874
|
+
}
|
|
8875
|
+
_setSearchQuery(e) {
|
|
8876
|
+
this._searchQuery = e, this._desktopSearchInput && this._desktopSearchInput.value !== e && (this._desktopSearchInput.value = e), this._searchPanelInput && this._searchPanelInput.value !== e && (this._searchPanelInput.value = e);
|
|
8877
|
+
}
|
|
8878
|
+
_normalizeResults(e) {
|
|
8879
|
+
return ((e) => {
|
|
8880
|
+
if (Array.isArray(e)) return e;
|
|
8881
|
+
if (!e || typeof e != "object") return [];
|
|
8882
|
+
let t = e;
|
|
8883
|
+
for (let e of [
|
|
8884
|
+
"results",
|
|
8885
|
+
"items",
|
|
8886
|
+
"data",
|
|
8887
|
+
"products"
|
|
8888
|
+
]) {
|
|
8889
|
+
let n = t[e];
|
|
8890
|
+
if (Array.isArray(n)) return n;
|
|
8891
|
+
}
|
|
8892
|
+
return [];
|
|
8893
|
+
})(e).map((e) => {
|
|
8894
|
+
let t = e || {};
|
|
8895
|
+
return {
|
|
8896
|
+
title: String(t.title || t.name || t.label || t.email || t.id || "").trim() || "Untitled",
|
|
8897
|
+
subtitle: String(t.description || t.category || t.username || "").trim()
|
|
8898
|
+
};
|
|
8899
|
+
}).slice(0, 8);
|
|
8900
|
+
}
|
|
8901
|
+
_renderSearchState(e) {
|
|
8902
|
+
this._searchStateWrap && (this._searchStateWrap.textContent = e, this._searchStateWrap.classList.remove("hidden"), this._searchResultsWrap && (this._searchResultsWrap.innerHTML = ""));
|
|
8903
|
+
}
|
|
8904
|
+
_renderSearchResults(e) {
|
|
8905
|
+
if (!(!this._searchResultsWrap || !this._searchStateWrap)) {
|
|
8906
|
+
if (this._searchResultsWrap.innerHTML = "", e.length === 0) {
|
|
8907
|
+
this._renderSearchState("No results found");
|
|
8908
|
+
return;
|
|
8909
|
+
}
|
|
8910
|
+
this._searchStateWrap.classList.add("hidden");
|
|
8911
|
+
for (let t of e) {
|
|
8912
|
+
let e = document.createElement("button");
|
|
8913
|
+
e.type = "button", e.className = "flex w-full cursor-pointer items-start gap-3 rounded-lg px-3 py-2 text-left hover:bg-gray-100 dark:hover:bg-white/10";
|
|
8914
|
+
let n = document.createElement("mint-icon");
|
|
8915
|
+
n.setAttribute("name", "search"), n.className = "mt-0.5 h-4 w-4 text-gray-500 dark:text-gray-400";
|
|
8916
|
+
let r = document.createElement("div");
|
|
8917
|
+
r.className = "min-w-0";
|
|
8918
|
+
let i = document.createElement("div");
|
|
8919
|
+
if (i.className = "truncate text-sm font-semibold text-gray-900 dark:text-gray-100", i.textContent = t.title, r.appendChild(i), t.subtitle) {
|
|
8920
|
+
let e = document.createElement("div");
|
|
8921
|
+
e.className = "truncate text-xs text-gray-500 dark:text-gray-400", e.textContent = t.subtitle, r.appendChild(e);
|
|
8922
|
+
}
|
|
8923
|
+
e.appendChild(n), e.appendChild(r), e.addEventListener("click", () => {
|
|
8924
|
+
this.dispatchEvent(new CustomEvent("search-select", {
|
|
8925
|
+
detail: {
|
|
8926
|
+
query: this._searchQuery,
|
|
8927
|
+
result: t
|
|
8928
|
+
},
|
|
8929
|
+
bubbles: !0,
|
|
8930
|
+
composed: !0
|
|
8931
|
+
})), this._closeSearch();
|
|
8932
|
+
}), this._searchResultsWrap.appendChild(e);
|
|
8933
|
+
}
|
|
8934
|
+
}
|
|
8935
|
+
}
|
|
8936
|
+
_fetchSearchResults(e) {
|
|
8937
|
+
let t = this._getSearchEndpoint();
|
|
8938
|
+
if (!t) return;
|
|
8939
|
+
let n = e.trim();
|
|
8940
|
+
if (!n) {
|
|
8941
|
+
this._renderSearchState("Start typing to search");
|
|
8942
|
+
return;
|
|
8943
|
+
}
|
|
8944
|
+
this._abortSearch(), this._searchAbortController = new AbortController(), this._renderSearchState("Searching...");
|
|
8945
|
+
let r = t.includes("{query}") ? t.replace("{query}", encodeURIComponent(n)) : `${t}${t.includes("?") ? "&" : "?"}${encodeURIComponent(this._getSearchParam())}=${encodeURIComponent(n)}`;
|
|
8946
|
+
fetch(r, { signal: this._searchAbortController.signal }).then((e) => {
|
|
8947
|
+
if (!e.ok) throw Error(`Request failed: ${e.status}`);
|
|
8948
|
+
return e.json();
|
|
8949
|
+
}).then((e) => {
|
|
8950
|
+
let t = this._normalizeResults(e);
|
|
8951
|
+
this._renderSearchResults(t);
|
|
8952
|
+
}).catch((e) => {
|
|
8953
|
+
e?.name !== "AbortError" && this._renderSearchState("Unable to load results");
|
|
8954
|
+
});
|
|
8955
|
+
}
|
|
8956
|
+
_scheduleSearch(e) {
|
|
8957
|
+
this._setSearchQuery(e), this._cancelSearchDebounce(), this._searchDebounceId = window.setTimeout(() => this._fetchSearchResults(e), 220);
|
|
8958
|
+
}
|
|
8959
|
+
_observeDarkMode() {
|
|
8960
|
+
this._darkModeObserver || (this._darkModeObserver = new MutationObserver(() => this.render()), this._darkModeObserver.observe(document.documentElement, {
|
|
8961
|
+
attributes: !0,
|
|
8962
|
+
attributeFilter: ["class"]
|
|
8963
|
+
}));
|
|
8964
|
+
}
|
|
8965
|
+
_disconnectDarkModeObserver() {
|
|
8966
|
+
this._darkModeObserver &&= (this._darkModeObserver.disconnect(), null);
|
|
8967
|
+
}
|
|
8968
|
+
_attachResizeListener() {
|
|
8969
|
+
this._resizeHandler || (this._resizeHandler = () => {
|
|
8970
|
+
this.render(), this._positionSearchPanel();
|
|
8971
|
+
}, window.addEventListener("resize", this._resizeHandler, { passive: !0 }));
|
|
8972
|
+
}
|
|
8973
|
+
_detachResizeListener() {
|
|
8974
|
+
this._resizeHandler &&= (window.removeEventListener("resize", this._resizeHandler), null);
|
|
8975
|
+
}
|
|
8847
8976
|
_toggleMenuTarget() {
|
|
8848
8977
|
let e = this._getMenuTargetId();
|
|
8849
8978
|
if (!e) return;
|
|
@@ -8851,26 +8980,61 @@ var z = class extends HTMLElement {
|
|
|
8851
8980
|
!t || t.tagName !== "MINT-SIDE-NAVIGATION" || (t.getAttribute("open") === "true" ? t.removeAttribute("open") : t.setAttribute("open", "true"));
|
|
8852
8981
|
}
|
|
8853
8982
|
render() {
|
|
8854
|
-
if (this._bar || (this._bar = document.createElement("div"), this._bar.className = "flex h-14 w-full items-center gap-2 border-b border-gray-200 px-3 dark:border-
|
|
8855
|
-
this._menuButton = document.createElement("button"), this._menuButton.type = "button", this._menuButton.className = "inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700
|
|
8983
|
+
if (this._bar || (this._bar = document.createElement("div"), this._bar.className = "fixed inset-x-0 top-0 z-50 flex h-14 w-full items-center gap-2 border-b border-gray-200 bg-white px-3 dark:border-mint-divider dark:bg-mint-nav", this.appendChild(this._bar)), !this._menuButton) {
|
|
8984
|
+
this._menuButton = document.createElement("button"), this._menuButton.type = "button", this._menuButton.className = "inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700 hover:bg-black/5 min-[1100px]:hidden dark:text-gray-200 dark:hover:bg-white/10", this._menuButton.setAttribute("aria-label", "Open navigation menu");
|
|
8856
8985
|
let e = document.createElement("mint-icon");
|
|
8857
8986
|
e.setAttribute("name", "menu"), e.className = "h-5 w-5", this._menuButton.appendChild(e), this._menuClickHandler = () => this._toggleMenuTarget(), this._menuButton.addEventListener("click", this._menuClickHandler), this._bar.appendChild(this._menuButton);
|
|
8858
8987
|
}
|
|
8859
8988
|
let e = !!this._getMenuTargetId();
|
|
8860
|
-
this._menuButton.classList.toggle("hidden", !e), this._logoLink || (this._logoLink = document.createElement("a"), this._logoLink.className = "flex shrink-0 items-center", this._bar.appendChild(this._logoLink)), this._logoLink.href = this._getLogoHref(), this._logoLink.setAttribute("aria-label", this._getLogoAlt());
|
|
8861
|
-
let t = this.
|
|
8989
|
+
this._menuButton.classList.toggle("hidden", !e), this._logoLink || (this._logoLink = document.createElement("a"), this._logoLink.className = "flex h-8 w-40 shrink-0 items-center", this._bar.appendChild(this._logoLink)), this._logoLink.href = this._getLogoHref(), this._logoLink.setAttribute("aria-label", this._getLogoAlt());
|
|
8990
|
+
let t = this._getLogoSrc();
|
|
8862
8991
|
if (t) {
|
|
8863
8992
|
let e = document.createElement("img");
|
|
8864
|
-
e.className = "h-
|
|
8993
|
+
e.className = "h-full w-full object-contain [aspect-ratio:5/1]", e.decoding = "async", e.src = t, e.alt = this._getLogoAlt(), this._logoLink.replaceChildren(e), this._logoLink.classList.remove("pointer-events-none", "opacity-40");
|
|
8865
8994
|
} else {
|
|
8866
8995
|
this._logoLink.replaceChildren(), this._logoLink.classList.add("pointer-events-none", "opacity-40");
|
|
8867
8996
|
let e = document.createElement("span");
|
|
8868
8997
|
e.className = "text-sm font-semibold text-gray-400 dark:text-gray-500", e.textContent = "Logo", this._logoLink.appendChild(e);
|
|
8869
8998
|
}
|
|
8870
|
-
let n = this._bar.querySelector("[data-mint-topnav-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8999
|
+
let n = this._isSearchEnabled(), r = this._bar.querySelector("[data-mint-topnav-center]");
|
|
9000
|
+
if (r || (r = document.createElement("div"), r.setAttribute("data-mint-topnav-center", "true"), r.className = "max-[1099.98px]:hidden min-[1100px]:flex min-[1100px]:min-w-0 min-[1100px]:flex-1 min-[1100px]:justify-center min-[1100px]:px-4", this._bar.appendChild(r)), r.classList.toggle("min-[1100px]:hidden", !n), n && !this._desktopSearchInput) {
|
|
9001
|
+
let e = document.createElement("div");
|
|
9002
|
+
e.className = "relative w-full max-w-xl rounded-xl border border-gray-300 bg-gray-50 px-3 py-2 dark:border-mint-divider dark:bg-mint-hover", this._desktopSearchShell = e;
|
|
9003
|
+
let t = document.createElement("mint-icon");
|
|
9004
|
+
t.setAttribute("name", "search"), t.className = "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400", this._desktopSearchInput = document.createElement("input"), this._desktopSearchInput.type = "search", this._desktopSearchInput.className = "w-full bg-transparent pl-6 pr-20 text-sm text-gray-900 outline-none placeholder:text-gray-500 dark:text-gray-100 dark:placeholder:text-gray-400", this._desktopSearchInput.placeholder = this._getSearchPlaceholder(), this._desktopSearchInput.addEventListener("focus", () => this._openSearch(!1)), this._desktopSearchInput.addEventListener("input", (e) => this._scheduleSearch(e.target.value));
|
|
9005
|
+
let n = document.createElement("span");
|
|
9006
|
+
n.className = "absolute right-3 top-1/2 -translate-y-1/2 text-xs text-gray-500 dark:text-gray-400", n.textContent = "⌘K", e.appendChild(t), e.appendChild(this._desktopSearchInput), e.appendChild(n), r.appendChild(e);
|
|
9007
|
+
}
|
|
9008
|
+
this._desktopSearchInput && (this._desktopSearchInput.placeholder = this._getSearchPlaceholder(), this._desktopSearchShell = this._desktopSearchInput.closest("div"), this._syncDesktopSearchOpenState());
|
|
9009
|
+
let i = this._bar.querySelector("[data-mint-topnav-mobile-spacer]");
|
|
9010
|
+
i || (i = document.createElement("div"), i.setAttribute("data-mint-topnav-mobile-spacer", "true"), i.className = "min-w-0 flex-1 min-[1100px]:hidden", this._bar.appendChild(i));
|
|
9011
|
+
let a = Array.from(this.querySelectorAll("[slot=\"actions\"]")), o = this._bar.querySelector("[data-mint-topnav-actions]");
|
|
9012
|
+
if (o || (o = document.createElement("div"), o.setAttribute("data-mint-topnav-actions", "true"), o.className = "flex shrink-0 items-center gap-2", this._bar.appendChild(o)), n && !this._mobileSearchButton) {
|
|
9013
|
+
this._mobileSearchButton = document.createElement("button"), this._mobileSearchButton.type = "button", this._mobileSearchButton.className = "inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700 hover:bg-black/5 min-[1100px]:hidden dark:text-gray-200 dark:hover:bg-white/10", this._mobileSearchButton.setAttribute("aria-label", "Open search");
|
|
9014
|
+
let e = document.createElement("mint-icon");
|
|
9015
|
+
e.setAttribute("name", "search"), e.className = "h-5 w-5", this._mobileSearchButton.appendChild(e), this._mobileSearchButton.addEventListener("click", () => this._openSearch(!0)), o.insertBefore(this._mobileSearchButton, o.firstChild);
|
|
9016
|
+
}
|
|
9017
|
+
if (this._mobileSearchButton && this._mobileSearchButton.classList.toggle("hidden", !n), o.replaceChildren(...a), n && this._mobileSearchButton && !a.includes(this._mobileSearchButton) && o.insertBefore(this._mobileSearchButton, o.firstChild), n && !this._searchPanel) {
|
|
9018
|
+
this._searchPanel = document.createElement("div"), this._searchPanel.className = "fixed left-0 right-0 top-14 z-[90] hidden p-3 min-[1100px]:p-0";
|
|
9019
|
+
let e = document.createElement("div");
|
|
9020
|
+
e.className = "mx-auto w-full rounded-2xl border border-gray-200 bg-white shadow-xl dark:border-mint-divider dark:bg-mint-elevated min-[1100px]:rounded-t-none";
|
|
9021
|
+
let t = document.createElement("div");
|
|
9022
|
+
t.className = "relative border-b border-gray-200 p-3 dark:border-mint-divider min-[1100px]:hidden";
|
|
9023
|
+
let n = document.createElement("mint-icon");
|
|
9024
|
+
n.setAttribute("name", "search"), n.className = "absolute left-6 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400", this._searchPanelInput = document.createElement("input"), this._searchPanelInput.type = "search", this._searchPanelInput.className = "w-full rounded-lg border border-gray-300 bg-gray-50 py-2 pl-10 pr-3 text-sm text-gray-900 outline-none dark:border-mint-divider dark:bg-mint-hover dark:text-gray-100", this._searchPanelInput.placeholder = this._getSearchPlaceholder(), this._searchPanelInput.addEventListener("input", (e) => this._scheduleSearch(e.target.value)), t.appendChild(n), t.appendChild(this._searchPanelInput);
|
|
9025
|
+
let r = document.createElement("div");
|
|
9026
|
+
r.className = "flex flex-wrap gap-2 px-3 py-3", [
|
|
9027
|
+
"Apps",
|
|
9028
|
+
"Customers",
|
|
9029
|
+
"Orders",
|
|
9030
|
+
"Products",
|
|
9031
|
+
"Sales channels"
|
|
9032
|
+
].forEach((e) => {
|
|
9033
|
+
let t = document.createElement("span");
|
|
9034
|
+
t.className = "rounded-full bg-gray-100 px-3 py-1 text-xs font-semibold text-gray-600 dark:bg-mint-hover dark:text-gray-300", t.textContent = e, r.appendChild(t);
|
|
9035
|
+
}), this._searchStateWrap = document.createElement("div"), this._searchStateWrap.className = "px-4 pb-4 text-sm text-gray-500 dark:text-gray-400", this._searchStateWrap.textContent = "Start typing to search", this._searchResultsWrap = document.createElement("div"), this._searchResultsWrap.className = "max-h-[52vh] overflow-y-auto px-2 pb-2", e.appendChild(t), e.appendChild(r), e.appendChild(this._searchStateWrap), e.appendChild(this._searchResultsWrap), this._searchPanel.appendChild(e), this.appendChild(this._searchPanel);
|
|
9036
|
+
}
|
|
9037
|
+
this._searchPanelInput && (this._searchPanelInput.placeholder = this._getSearchPlaceholder()), this._syncSearchPanelVisibility(), this._positionSearchPanel();
|
|
8874
9038
|
}
|
|
8875
9039
|
};
|
|
8876
9040
|
customElements.get("mint-top-navigation") || customElements.define("mint-top-navigation", z);
|
|
@@ -8881,7 +9045,7 @@ var B = class extends HTMLElement {
|
|
|
8881
9045
|
super(...e), this._lastScrollY = 0, this._scrollHandler = null;
|
|
8882
9046
|
}
|
|
8883
9047
|
connectedCallback() {
|
|
8884
|
-
this.classList.add("fixed", "bottom-0", "left-0", "right-0", "z-30", "flex", "w-full", "items-stretch", "justify-around", "gap-1", "border-t", "border-gray-200", "bg-white", "px-1", "pt-1", "pb-[env(safe-area-inset-bottom,0px)]", "min-[1100px]:hidden", "transition-transform", "duration-200", "ease-out", "translate-y-0", "dark:border-
|
|
9048
|
+
this.classList.add("fixed", "bottom-0", "left-0", "right-0", "z-30", "flex", "w-full", "items-stretch", "justify-around", "gap-1", "border-t", "border-gray-200", "bg-white", "px-1", "pt-1", "pb-[env(safe-area-inset-bottom,0px)]", "min-[1100px]:hidden", "transition-transform", "duration-200", "ease-out", "translate-y-0", "dark:border-mint-divider", "dark:bg-mint-nav"), this.setAttribute("role", "navigation"), this.setAttribute("aria-label", "Primary"), this._lastScrollY = window.scrollY, this._attachScrollListener();
|
|
8885
9049
|
}
|
|
8886
9050
|
disconnectedCallback() {
|
|
8887
9051
|
this._detachScrollListener();
|
|
@@ -8935,8 +9099,8 @@ var V = class extends HTMLElement {
|
|
|
8935
9099
|
return this.getAttribute("href");
|
|
8936
9100
|
}
|
|
8937
9101
|
render() {
|
|
8938
|
-
let e = this._getHref(), t = this._getLabel(), n = this._getIcon(), r = this._isActive(), i = r ? "text-
|
|
8939
|
-
e ? (a = document.createElement("a"), a.href = e) : (a = document.createElement("button"), a.type = "button"), a.className = `flex min-w-0 flex-1 flex-col items-center justify-center gap-1 rounded-lg px-1 py-2 text-center text-[11px] font-medium leading-tight
|
|
9102
|
+
let e = this._getHref(), t = this._getLabel(), n = this._getIcon(), r = this._isActive(), i = r ? "text-gray-900 dark:text-gray-100" : "text-gray-600 hover:bg-black/5 dark:text-gray-300 dark:hover:bg-white/10", a;
|
|
9103
|
+
e ? (a = document.createElement("a"), a.href = e) : (a = document.createElement("button"), a.type = "button"), a.className = `flex min-w-0 flex-1 flex-col items-center justify-center gap-1 rounded-lg px-1 py-2 text-center text-[11px] font-medium leading-tight ${i}`, a.setAttribute("aria-current", r ? "page" : "false"), a.setAttribute("aria-label", t || "Navigation item");
|
|
8940
9104
|
let o = document.createElement("span");
|
|
8941
9105
|
if (o.className = "inline-flex h-6 w-6 items-center justify-center", n) {
|
|
8942
9106
|
let e = document.createElement("mint-icon");
|