@appartmint/tsm-mint 0.3.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/abstract/attaches-events.cjs.js +1 -1
  2. package/dist/abstract/attaches-events.esm.js +23 -0
  3. package/dist/components/section/grid.cjs.js +1 -1
  4. package/dist/components/section/grid.esm.js +13 -0
  5. package/dist/components/ui/text/title.cjs.js +1 -1
  6. package/dist/components/ui/text/title.esm.js +15 -0
  7. package/dist/components/widget/header.cjs.js +1 -1
  8. package/dist/components/widget/header.d.ts +2 -2
  9. package/dist/components/widget/header.esm.js +31 -0
  10. package/dist/components/widget/menu.cjs.js +1 -1
  11. package/dist/components/widget/menu.d.ts +4 -4
  12. package/dist/components/widget/menu.esm.js +117 -0
  13. package/dist/components/widget/panel.cjs.js +1 -1
  14. package/dist/components/widget/panel.d.ts +3 -3
  15. package/dist/components/widget/panel.esm.js +90 -0
  16. package/dist/types/breakpoints.cjs.js +1 -1
  17. package/dist/types/breakpoints.esm.js +10 -0
  18. package/dist/types/components/form/input.cjs.js +1 -1
  19. package/dist/types/components/form/input.esm.js +0 -0
  20. package/dist/types/side.cjs.js +1 -1
  21. package/dist/types/side.esm.js +9 -0
  22. package/dist/types/time.cjs.js +1 -1
  23. package/dist/types/time.esm.js +11 -0
  24. package/dist/types/util.cjs.js +1 -1
  25. package/dist/types/util.esm.js +0 -0
  26. package/dist/util/async.cjs.js +1 -1
  27. package/dist/util/async.esm.js +10 -0
  28. package/dist/util/color.cjs.js +1 -1
  29. package/dist/util/color.esm.js +24 -0
  30. package/dist/util/date.cjs.js +1 -1
  31. package/dist/util/date.esm.js +7 -0
  32. package/dist/util/display.cjs.js +1 -1
  33. package/dist/util/display.esm.js +26 -0
  34. package/dist/util/event.cjs.js +1 -1
  35. package/dist/util/event.d.ts +2 -2
  36. package/dist/util/event.esm.js +29 -0
  37. package/dist/util/math.cjs.js +1 -1
  38. package/dist/util/math.esm.js +9 -0
  39. package/dist/util/object.cjs.js +1 -1
  40. package/dist/util/object.d.ts +11 -11
  41. package/dist/util/object.esm.js +105 -0
  42. package/dist/util/scroll.cjs.js +1 -1
  43. package/dist/util/scroll.esm.js +27 -0
  44. package/dist/util/selectors.cjs.js +7 -7
  45. package/dist/util/selectors.esm.js +46 -0
  46. package/dist/util/text.cjs.js +2 -2
  47. package/dist/util/text.d.ts +1 -1
  48. package/dist/util/text.esm.js +70 -0
  49. package/dist/util/window.cjs.js +1 -1
  50. package/dist/util/window.esm.js +11 -0
  51. package/package.json +16 -15
  52. package/dist/abstract/attaches-events.es.js +0 -23
  53. package/dist/components/section/grid.es.js +0 -11
  54. package/dist/components/ui/text/title.es.js +0 -11
  55. package/dist/components/widget/header.es.js +0 -28
  56. package/dist/components/widget/menu.es.js +0 -114
  57. package/dist/components/widget/panel.es.js +0 -86
  58. package/dist/types/breakpoints.es.js +0 -10
  59. package/dist/types/components/form/input.es.js +0 -1
  60. package/dist/types/side.es.js +0 -9
  61. package/dist/types/time.es.js +0 -13
  62. package/dist/types/util.es.js +0 -1
  63. package/dist/util/async.es.js +0 -11
  64. package/dist/util/color.es.js +0 -22
  65. package/dist/util/date.es.js +0 -7
  66. package/dist/util/display.es.js +0 -35
  67. package/dist/util/event.es.js +0 -30
  68. package/dist/util/math.es.js +0 -10
  69. package/dist/util/object.es.js +0 -109
  70. package/dist/util/scroll.es.js +0 -31
  71. package/dist/util/selectors.es.js +0 -69
  72. package/dist/util/text.es.js +0 -81
  73. package/dist/util/window.es.js +0 -12
@@ -1,114 +0,0 @@
1
- import { AttachesEvents as o } from "../../abstract/attaches-events.es.js";
2
- import { delay as i } from "../../types/time.es.js";
3
- import { showElement as c, hideElement as u } from "../../util/display.es.js";
4
- import { throttleEvent as a } from "../../util/event.es.js";
5
- import { focusable as l, controls as h, subMenuButtons as r, subMenu as p } from "../../util/selectors.es.js";
6
- class w extends o {
7
- settings = {};
8
- el = {};
9
- constructor(e) {
10
- if (super(), this.settings = { ...this.settings, ...e }, !this.settings.wrapperId)
11
- throw new Error("Wrapper ID is required");
12
- this.attachElements(), this.attachEvents(), requestAnimationFrame(() => {
13
- this.closeAllMenus();
14
- });
15
- }
16
- attachElements() {
17
- this.el.wrapper = document.getElementById(this.settings.wrapperId);
18
- }
19
- attachEvents() {
20
- this.attachEvent(window, "scroll", a(this.eHandleScroll.bind(this), i.default, { trailing: !1 })), this.el.wrapper?.querySelectorAll(l)?.forEach((s) => {
21
- this.attachEvent(s, "keydown", a(this.eHandleKeypress.bind(this)));
22
- }), this.el.wrapper?.querySelectorAll(h())?.forEach((s) => {
23
- this.attachEvent(s, "click", a(this.eToggleMenu.bind(this), i.slower, { trailing: !1 }));
24
- });
25
- }
26
- setMenu(e, t = !1) {
27
- const s = t ? "true" : "false", n = e?.nextElementSibling;
28
- e && n && (e.setAttribute("aria-expanded", s), t ? c(n) : (u(n), this.closeSubMenus(e)));
29
- }
30
- toggleMenu(e) {
31
- this.setMenu(e, e?.getAttribute("aria-expanded")?.toLowerCase() !== "true");
32
- }
33
- closeSubMenus(e) {
34
- const t = e?.nextElementSibling;
35
- (t?.querySelectorAll(r)).forEach((n) => {
36
- n.parentElement?.parentElement === t && this.setMenu(n);
37
- });
38
- }
39
- closeSiblingMenus(e) {
40
- (e?.parentElement?.parentElement?.querySelectorAll(r)).forEach((n) => {
41
- n !== e && this.setMenu(n);
42
- });
43
- }
44
- closeAllMenus() {
45
- this.el.wrapper?.querySelectorAll(r)?.forEach((t) => {
46
- this.setMenu(t);
47
- });
48
- }
49
- openClosestMenu() {
50
- let e = document.activeElement, t = e?.nextElementSibling, s = e?.getAttribute("aria-expanded")?.toLowerCase() === "true";
51
- e?.getAttribute("aria-controls") === this.settings.wrapperId && (t = this.el.wrapper), e?.getAttribute("aria-controls") && t && !s && (e.click(), t.querySelector(l)?.focus());
52
- }
53
- closeClosestMenu() {
54
- let e = document.activeElement, t = e?.closest(p), s = t?.previousElementSibling;
55
- e?.getAttribute("aria-controls") && e?.getAttribute("aria-expanded")?.toLowerCase() === "true" && (s = e), s?.getAttribute("aria-expanded")?.toLowerCase() === "true" && (s?.click(), s?.focus());
56
- }
57
- toggleClosestMenu() {
58
- document.activeElement?.getAttribute("aria-expanded")?.toLowerCase() === "true" ? this.closeClosestMenu() : this.openClosestMenu();
59
- }
60
- eHandleScroll() {
61
- this.closeAllMenus();
62
- }
63
- eHandleButtonKeypress(e) {
64
- const t = e.target, s = t?.closest("li");
65
- switch (e.key.toLowerCase()) {
66
- case "escape":
67
- s?.classList.contains("mint-open") && this.setMenu(s);
68
- break;
69
- case "arrowleft":
70
- this.closeClosestMenu();
71
- break;
72
- case "arrowright":
73
- this.openClosestMenu();
74
- break;
75
- case "enter":
76
- case "space":
77
- t?.click();
78
- break;
79
- }
80
- }
81
- eHandleLinkKeypress(e) {
82
- const t = e.target;
83
- switch (e.key.toLowerCase()) {
84
- case "escape":
85
- case "arrowleft":
86
- this.closeClosestMenu();
87
- break;
88
- case "arrowright":
89
- this.openClosestMenu();
90
- break;
91
- case "enter":
92
- case "space":
93
- t?.click();
94
- break;
95
- }
96
- }
97
- eHandleKeypress(e) {
98
- switch (e.key.toLowerCase() !== "tab" && e.preventDefault(), e.target?.tagName.toLowerCase()) {
99
- case "a":
100
- this.eHandleLinkKeypress(e);
101
- break;
102
- case "button":
103
- this.eHandleButtonKeypress(e);
104
- break;
105
- }
106
- }
107
- eToggleMenu(e) {
108
- const t = e.target;
109
- this.closeSiblingMenus(t), this.toggleMenu(t);
110
- }
111
- }
112
- export {
113
- w as Menu
114
- };
@@ -1,86 +0,0 @@
1
- import { breakpoints as o } from "../../types/breakpoints.es.js";
2
- import { sides as r } from "../../types/side.es.js";
3
- import { delay as l } from "../../types/time.es.js";
4
- import { AttachesEvents as p } from "../../abstract/attaches-events.es.js";
5
- import { windowWidth as h } from "../../util/window.es.js";
6
- import { throttleEvent as n } from "../../util/event.es.js";
7
- import { controls as d, getFocusables as c } from "../../util/selectors.es.js";
8
- class v extends p {
9
- settings = {
10
- title: "panel",
11
- from: r[0],
12
- fixed: !0
13
- };
14
- el = {};
15
- constructor(t) {
16
- if (super(), this.settings = { ...this.settings, ...t }, !this.settings.id || !this.settings.wrapperId)
17
- throw new Error("Panel ID and wrapper ID are required");
18
- this.attachElements(), this.attachEvents(), this.addClasses(), requestAnimationFrame(() => {
19
- this.setPanel();
20
- });
21
- }
22
- attachElements() {
23
- this.el.html = document.querySelector("html"), this.el.main = document.querySelector("main"), this.el.panel = document.getElementById(this.settings.id), this.el.wrapper = document.getElementById(this.settings.wrapperId), this.el.toggleButton = this.el.panel?.querySelector(d(this.settings.wrapperId)) ?? null;
24
- }
25
- attachEvents() {
26
- this.attachEvent(window, "resize", n(this.eHandleResize.bind(this), l.default)), this.attachEvent(this.el.main, "click", n(this.eClose.bind(this), l.default, { trailing: !1 })), this.attachEvent(this.el.wrapper, "transitionend", this.eTransitionEnd.bind(this)), c(this.el.panel).forEach((s) => {
27
- this.attachEvent(s, "keydown", n(this.eWrapTab.bind(this)));
28
- }), (this.el.panel?.querySelectorAll(d(this.settings.wrapperId))).forEach((s) => {
29
- this.attachEvent(s, "click", n(this.eToggle.bind(this), l.slower, { trailing: !1 }));
30
- });
31
- }
32
- addClasses() {
33
- this.el.panel?.classList.add("mint-panel"), this.el.wrapper?.classList.add("mint-panel-wrap"), this.el.toggleButton?.classList.add("mint-panel-toggle"), this.settings.from && (this.el.panel?.classList.remove("mint-top", "mint-right", "mint-bottom", "mint-left"), this.el.panel?.classList.add(`mint-${this.settings.from.toLowerCase()}`)), this.settings.tray && this.el.panel?.classList.add("mint-tray");
34
- }
35
- setPanel(t = !1) {
36
- const e = t ? "true" : "false", s = t ? `close ${this.settings.title}` : `open ${this.settings.title}`;
37
- this.el.toggleButton?.setAttribute("aria-expanded", e), setTimeout(() => {
38
- this.el.toggleButton?.setAttribute("aria-label", s);
39
- }, l.faster), t ? (this.closeOtherPanels(), this.settings.fixed !== !0 && window.scroll({
40
- top: 0,
41
- left: 0,
42
- behavior: "smooth"
43
- }), setTimeout(() => {
44
- if (this.el.html) {
45
- const i = h() <= o.sm;
46
- let a = "auto";
47
- this.settings.tray ? i && (a = "hidden") : a = "hidden", this.el.html.style.overflow = a;
48
- }
49
- }, this.settings.from === r[3] ? l.default : l.instant), this.el.wrapper && (this.el.wrapper.style.display = "flex"), requestAnimationFrame(() => {
50
- this.el.wrapper?.classList.add("mint-open");
51
- })) : (this.el.html && (this.el.html.style.overflow = "auto"), requestAnimationFrame(() => {
52
- this.el.wrapper?.classList.remove("mint-open");
53
- }));
54
- }
55
- togglePanel() {
56
- this.setPanel(this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase() === "false");
57
- }
58
- closeOtherPanels() {
59
- const t = `.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${this.settings.wrapperId}"])`, e = document.querySelector(t);
60
- e && e.click();
61
- }
62
- eHandleResize() {
63
- const t = h() <= o.sm;
64
- let e = !0;
65
- this.el.panel?.classList.contains("mint-tray") ? e = !1 : this.el.panel?.classList.contains("mint-expand") || (e = !1), !t && e && this.setPanel(!1);
66
- const s = this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase() === "true";
67
- let i = "auto";
68
- s && (this.settings.tray ? t && (i = "hidden") : i = "hidden"), this.el.html && (this.el.html.style.overflow = i);
69
- }
70
- eWrapTab(t) {
71
- const e = c(this.el.panel), s = e[e.length - 1], i = e.length > 1 && document.activeElement === s;
72
- t.key.toLowerCase() === "tab" && !t.shiftKey && i && (this.el.toggleButton?.focus(), document.activeElement === this.el.toggleButton && t.preventDefault());
73
- }
74
- eToggle() {
75
- this.togglePanel();
76
- }
77
- eClose() {
78
- this.setPanel(!1);
79
- }
80
- eTransitionEnd() {
81
- this.el.wrapper?.classList.contains("mint-open") === !1 && (this.el.wrapper.style.display = "none");
82
- }
83
- }
84
- export {
85
- v as Panel
86
- };
@@ -1,10 +0,0 @@
1
- const s = {
2
- xs: 480,
3
- sm: 768,
4
- md: 1024,
5
- lg: 1200,
6
- xl: 1440
7
- };
8
- export {
9
- s as breakpoints
10
- };
@@ -1,9 +0,0 @@
1
- const t = [
2
- "top",
3
- "right",
4
- "bottom",
5
- "left"
6
- ];
7
- export {
8
- t as sides
9
- };
@@ -1,13 +0,0 @@
1
- const e = 0, a = 100, l = {
2
- instant: 0,
3
- fastest: 100,
4
- faster: 200,
5
- default: 300,
6
- slower: 400,
7
- slowest: 500
8
- };
9
- export {
10
- l as delay,
11
- e as delayBase,
12
- a as delayStep
13
- };
@@ -1 +0,0 @@
1
-
@@ -1,11 +0,0 @@
1
- function i(t) {
2
- return new Promise((e) => setTimeout(e, t));
3
- }
4
- async function r(t, e) {
5
- const [n] = await Promise.all([e, i(t)]);
6
- return n;
7
- }
8
- export {
9
- i as wait,
10
- r as waitAtLeast
11
- };
@@ -1,22 +0,0 @@
1
- function o(t) {
2
- const e = /^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.exec(t);
3
- if (e) {
4
- let s = e[1];
5
- s.length === 3 && (s = s[0] + s[0] + s[1] + s[1] + s[2] + s[2]);
6
- const r = parseInt(s.substring(0, 2), 16), a = parseInt(s.substring(2, 4), 16), c = parseInt(s.substring(4, 6), 16);
7
- return i({ r, g: a, b: c });
8
- }
9
- const n = /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)?(?:,\s*(\d(?:\.\d*)?)\s*\))?/.exec(t);
10
- if (n) {
11
- const s = parseInt(n[1]), r = parseInt(n[2]), a = parseInt(n[3]), c = n[4] ? parseFloat(n[4]) : void 0;
12
- return i({ r: s, g: r, b: a, a: c });
13
- }
14
- throw new Error(`Invalid color: ${t}`);
15
- }
16
- function i({ r: t, g: e, b: n, a: s }) {
17
- return s === 0 ? 262 : !isNaN(t) && !isNaN(e) && !isNaN(n) ? Math.round((t * 299 + e * 587 + n * 144) / 1e3) : -1;
18
- }
19
- export {
20
- o as getLuminance,
21
- i as getLuminanceRGBA
22
- };
@@ -1,7 +0,0 @@
1
- function i(t) {
2
- const e = new Date(t);
3
- return e.setTime(e.getTime() - e.getTimezoneOffset() * 60 * 1e3), e.toISOString().slice(0, -1);
4
- }
5
- export {
6
- i as toDatetimeLocal
7
- };
@@ -1,35 +0,0 @@
1
- import { sides as r } from "../types/side.es.js";
2
- import { delay as l } from "../types/time.es.js";
3
- function m(t, {
4
- duration: s = l.default,
5
- from: i = r[0]
6
- } = {}) {
7
- if (!t)
8
- return;
9
- const e = i === "top" || i === "bottom";
10
- t.style.display = "", requestAnimationFrame(() => {
11
- const { scrollHeight: o, scrollWidth: n } = t;
12
- e ? t.style.height = `${o}px` : t.style.width = `${n}px`, setTimeout(() => {
13
- e ? t.style.height = "auto" : t.style.width = "auto";
14
- }, s);
15
- });
16
- }
17
- function d(t, {
18
- duration: s = l.default,
19
- from: i = r[0]
20
- } = {}) {
21
- if (!t)
22
- return;
23
- const e = i === "top" || i === "bottom", { scrollHeight: o, scrollWidth: n, style: { transition: a } } = t;
24
- t.style.transition = "", requestAnimationFrame(() => {
25
- e ? t.style.height = `${o}px` : t.style.width = `${n}px`, t.style.transition = a, requestAnimationFrame(() => {
26
- e ? t.style.height = "0" : t.style.width = "0";
27
- });
28
- }), setTimeout(() => {
29
- t.style.display = "none";
30
- }, s);
31
- }
32
- export {
33
- d as hideElement,
34
- m as showElement
35
- };
@@ -1,30 +0,0 @@
1
- import { delay as o } from "../types/time.es.js";
2
- function d(t, n = o.default) {
3
- let e;
4
- return function(...l) {
5
- e && clearTimeout(e), e = Number(setTimeout(t, n, ...l));
6
- };
7
- }
8
- function h(t, n = o.default) {
9
- return d(t, n);
10
- }
11
- function s(t, n = o.default, e) {
12
- let l, r, f, i, u = 0, m = function() {
13
- u = e?.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), i = 0, f = t.apply(l, r), i || (l = r = null);
14
- };
15
- return function() {
16
- const a = (/* @__PURE__ */ new Date()).getTime();
17
- !u && e?.leading === !1 && (u = a);
18
- const c = n - a + u;
19
- return l = this, r = arguments, c <= 0 || c > n ? (i && (clearTimeout(i), i = 0), u = a, f = t.apply(l, r), i || (l = r = null)) : !i && e?.trailing !== !1 && (i = window.setTimeout(m, c)), f;
20
- };
21
- }
22
- function p(t, n = o.default, e) {
23
- return s(t, n, e);
24
- }
25
- export {
26
- d as debounce,
27
- h as debounceEvent,
28
- s as throttle,
29
- p as throttleEvent
30
- };
@@ -1,10 +0,0 @@
1
- function a(o, t, r) {
2
- return Math.max(t, Math.min(o ?? t, r));
3
- }
4
- function h(o, t = 0) {
5
- return t = Math.ceil(t), o = Math.floor(o), Math.floor(Math.random() * (o - t) + t);
6
- }
7
- export {
8
- a as clamp,
9
- h as randomInt
10
- };
@@ -1,109 +0,0 @@
1
- function o(e, n) {
2
- const t = Object.keys(e);
3
- if (t.length !== Object.keys(n).length)
4
- return !1;
5
- let r = !0;
6
- return t.forEach((s) => {
7
- e[s] !== n[s] && (r = !1);
8
- }), r;
9
- }
10
- function i(e, n) {
11
- let t = !0;
12
- if (e === n)
13
- return t;
14
- try {
15
- if (Object.keys(n).length === 0)
16
- return !t;
17
- } catch {
18
- return !t;
19
- }
20
- return Object.keys(n).forEach((r) => {
21
- t = t && i(e[r], n[r]);
22
- }), t;
23
- }
24
- function l(e, n) {
25
- return Object.keys(e).reduce((t, r) => (n.includes(r) || (t[r] = e[r]), t), {});
26
- }
27
- function a(e, n) {
28
- return Object.keys(e).reduce((t, r) => (n.includes(e[r]) || (t[r] = e[r]), t), {});
29
- }
30
- function h(e, n) {
31
- return Object.keys(e).sort(n).reduce((t, r) => (t[r] = e[r], t), {});
32
- }
33
- function O(e, n) {
34
- return Object.keys(e).sort((t, r) => n(e[t], e[r])).reduce((t, r) => (t[r] = e[r], t), {});
35
- }
36
- function y(e, n) {
37
- return n.reduce((t, r) => (t[r] = e[r], t), {});
38
- }
39
- function d(e, n) {
40
- return Object.keys(e).reduce((t, r) => (n.includes(e[r]) && (t[r] = e[r]), t), {});
41
- }
42
- function p(e, n, t = "id") {
43
- if (!n?.length)
44
- n?.forEach((s) => e.push(s));
45
- else {
46
- const s = n.reduce((c, f) => ({
47
- ...c,
48
- [f?.[t] ?? ""]: f
49
- }), {});
50
- e.filter((c) => !s[c?.[t] ?? ""])?.forEach((c) => {
51
- const f = e.indexOf(c);
52
- typeof f == "number" && f !== -1 && e.splice(f, 1);
53
- }), e.forEach((c) => {
54
- s[c?.[t] ?? ""] && Object.assign(c, s[c?.[t] ?? ""]);
55
- });
56
- }
57
- n?.filter((s) => !e.some((u) => u?.[t] === s?.[t]))?.forEach((s) => e.push(s));
58
- }
59
- function m(e, n) {
60
- return Object.keys(e).find((t) => e[t] === n);
61
- }
62
- function E(e) {
63
- if (typeof e != "object" || e === null)
64
- return e;
65
- const n = /* @__PURE__ */ new WeakMap(), t = [[e, Array.isArray(e) ? [] : {}]];
66
- for (; t.length; ) {
67
- const [r, s, u] = t.pop();
68
- if (u !== void 0) {
69
- const c = r[u];
70
- if (typeof c == "function") {
71
- s[u] = c.bind(s);
72
- continue;
73
- }
74
- if (typeof c != "object" || c === null) {
75
- s[u] = c;
76
- continue;
77
- }
78
- if (n.has(c)) {
79
- s[u] = n.get(c);
80
- continue;
81
- }
82
- s[u] = Array.isArray(c) ? [] : {}, n.set(c, s[u]), t.push([c, s[u]]);
83
- } else {
84
- if (n.set(r, s), Array.isArray(r)) {
85
- r.forEach((c, f) => {
86
- t.push([r, s, f]);
87
- });
88
- continue;
89
- }
90
- Object.keys(r).forEach((c) => {
91
- t.push([r, s, c]);
92
- });
93
- }
94
- }
95
- return n.get(e);
96
- }
97
- export {
98
- E as objectDeepClone,
99
- y as objectFilterKeys,
100
- d as objectFilterValues,
101
- m as objectGetKeyByValue,
102
- i as objectIsSuperset,
103
- a as objectRemoveValues,
104
- o as objectSameKeys,
105
- h as objectSortKeys,
106
- O as objectSortValues,
107
- p as objectUpdateArray,
108
- l as removeKeys
109
- };
@@ -1,31 +0,0 @@
1
- import { throttleEvent as o } from "./event.es.js";
2
- function s(t) {
3
- switch (t) {
4
- case "top":
5
- t = 0;
6
- break;
7
- case "bottom":
8
- t = document.body.scrollHeight;
9
- break;
10
- }
11
- window.scrollTo(0, t);
12
- }
13
- function i() {
14
- requestAnimationFrame(() => {
15
- const t = document.querySelectorAll(".mint-fall-in:not(.mint-show)"), n = [];
16
- for (let e = 0; e < t.length; e++)
17
- t[e].getBoundingClientRect().top < 0 ? t[e].classList.add("mint-show") : t[e].getBoundingClientRect().top < window.innerHeight * 3 / 4 && n.push(t[e]);
18
- for (let e = 0; e < n.length; e++)
19
- setTimeout(() => {
20
- n[e].classList.add("mint-show");
21
- }, e * 100);
22
- });
23
- }
24
- function c() {
25
- window.addEventListener("scroll", o(i, 200));
26
- }
27
- export {
28
- s as scrollTo,
29
- i as showElements,
30
- c as showElementsOnScroll
31
- };
@@ -1,69 +0,0 @@
1
- const $ = "mint", u = `${$}-`, o = "[disabled]", l = "[aria-controls]", d = "[aria-expanded]", c = "[href]", f = "[routerLink]", p = "[id]", b = `button${l}`, m = `${b} + ul${p}`, r = '[tabindex^="-"]', x = `[tabindex]${e(r)}`, i = `input${e(o)}${e(r)},
2
- select${e(o)}${e(r)},
3
- textarea${e(o)}${e(r)},
4
- button${e(o)}${e(r)},
5
- object${e(o)}${e(r)},
6
- a${c}, a${f},
7
- area${c}, ${x}`.replace(/\s/g, "");
8
- function a(t) {
9
- return t = t.toLowerCase(), t.startsWith(u) ? t : `${u}${t}`;
10
- }
11
- function y(t) {
12
- return `--${a(t.replace(/^-+/, ""))}`;
13
- }
14
- function w(t) {
15
- return `var(${y(t)})`;
16
- }
17
- function e(t) {
18
- return `:not(${t})`;
19
- }
20
- function L(t) {
21
- return `.${a(t)}`;
22
- }
23
- function g(t) {
24
- return `#${a(t)}`;
25
- }
26
- function A(t) {
27
- return t ? `[aria-controls="${a(t)}"]` : l;
28
- }
29
- function C(t) {
30
- return typeof t == "boolean" ? `[aria-expanded="${t}"]` : d;
31
- }
32
- function k(t) {
33
- let n;
34
- return t ? n = Array.from(t.querySelectorAll(i)) : n = Array.from(document.querySelectorAll(i)), n.filter((s) => h(s));
35
- }
36
- function h(t) {
37
- let n = t;
38
- do {
39
- if (window.getComputedStyle(n).getPropertyValue("display").toLowerCase() === "none")
40
- return !1;
41
- n = n.parentElement;
42
- } while (n);
43
- return !0;
44
- }
45
- export {
46
- L as className,
47
- A as controls,
48
- y as cssPrefix,
49
- w as cssVar,
50
- o as disabled,
51
- C as expanded,
52
- i as focusable,
53
- k as getFocusables,
54
- l as hasControls,
55
- d as hasExpanded,
56
- p as hasId,
57
- c as hasLink,
58
- f as hasRouterLink,
59
- g as id,
60
- h as isFocusable,
61
- $ as lib,
62
- e as not,
63
- r as notTabbable,
64
- u as pre,
65
- a as prefix,
66
- m as subMenu,
67
- b as subMenuButtons,
68
- x as tabbable
69
- };
@@ -1,81 +0,0 @@
1
- function r(e, t = 100) {
2
- return e.length > t ? e.slice(0, t).trim() + "..." : e;
3
- }
4
- function c(e) {
5
- return e?.trim().toLowerCase().replace(/'/g, "").replace(/[^\w/-]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "").replace(/^\/+|\/+$/g, "") ?? "";
6
- }
7
- function u(e) {
8
- return s(e.replace(/[-/]+/g, " "));
9
- }
10
- function l(e) {
11
- const t = e?.toString().trim() ?? "";
12
- if (t === "(" || t === "")
13
- return t;
14
- let n = t.replace(/\D/g, "") ?? "", i = "";
15
- n.length > 10 && (i += `+${n.slice(0, n.length - 10)} `, n = n.slice(n.length - 10));
16
- for (var a = 0; a < n.length; a++) {
17
- switch (a) {
18
- case 0:
19
- i += "(";
20
- break;
21
- case 3:
22
- i += ") ";
23
- break;
24
- case 6:
25
- i += "-";
26
- break;
27
- }
28
- i += n[a];
29
- }
30
- switch (t[t.length - 1]) {
31
- case ")":
32
- a === 3 && (i += ") ");
33
- break;
34
- case "-":
35
- a === 6 && (i += "-");
36
- break;
37
- }
38
- return i;
39
- }
40
- function x(e) {
41
- return e.endsWith("ies") || e.endsWith("es") || e.endsWith("s") && !e.endsWith("us") && !e.endsWith("is") && !e.endsWith("ss") ? e : e.endsWith("y") && !["a", "e", "i", "o", "u"].includes(e.charAt(e.length - 2)) ? e.slice(0, -1) + "ies" : e.endsWith("s") || e.endsWith("sh") || e.endsWith("ch") || e.endsWith("x") || e.endsWith("z") ? e + "es" : e + "s";
42
- }
43
- function s(e) {
44
- return e.toLowerCase().replace(/(?:^|\s)\S/g, (t) => t.toUpperCase());
45
- }
46
- function f(e) {
47
- const t = document.createElement("textarea");
48
- return !e || !t ? !1 : (t.value = e, t.style.cssText = `
49
- position: fixed;
50
- top: 0;
51
- left: 0;
52
- transform: translate(-100%, -100%);
53
- opacity: 0;
54
- z-index: -1;
55
- `, document.body.appendChild(t), t.select(), t.setSelectionRange(0, 99999), navigator.clipboard.writeText(t.value), document.body.removeChild(t), !0);
56
- }
57
- function g(e) {
58
- return /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/.exec(e) !== null;
59
- }
60
- function h(e = 10) {
61
- return Math.random().toString(36).substring(2, e + 2);
62
- }
63
- function o(e) {
64
- return !!e?.match(/\.(jpe?g|png|webp|gif|svg)$/i);
65
- }
66
- function p(e) {
67
- return !!e?.match(/\.(mp4|webm|ogg)$/i);
68
- }
69
- export {
70
- f as copyText,
71
- l as formatPhone,
72
- h as generateId,
73
- g as isEmail,
74
- o as isImage,
75
- p as isVideo,
76
- x as plural,
77
- c as slug,
78
- s as titleCase,
79
- r as truncate,
80
- u as unslug
81
- };
@@ -1,12 +0,0 @@
1
- function t() {
2
- const n = document.body.getBoundingClientRect().width % 1;
3
- return window.innerWidth + n;
4
- }
5
- function i() {
6
- const n = document.body.getBoundingClientRect().height % 1;
7
- return window.innerHeight + n;
8
- }
9
- export {
10
- i as windowHeight,
11
- t as windowWidth
12
- };