@appartmint/tsm-mint 0.3.2 → 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 (89) 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.esm.js +31 -0
  9. package/dist/components/widget/menu.cjs.js +1 -1
  10. package/dist/{src/components → components}/widget/menu.d.ts +1 -1
  11. package/dist/components/widget/menu.esm.js +117 -0
  12. package/dist/components/widget/panel.cjs.js +1 -1
  13. package/dist/{src/components → components}/widget/panel.d.ts +1 -1
  14. package/dist/components/widget/panel.esm.js +90 -0
  15. package/dist/types/breakpoints.cjs.js +1 -1
  16. package/dist/types/breakpoints.esm.js +10 -0
  17. package/dist/types/components/form/input.cjs.js +1 -1
  18. package/dist/{src/types → types}/components/form/input.d.ts +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/{src/util → util}/display.d.ts +1 -1
  34. package/dist/util/display.esm.js +26 -0
  35. package/dist/util/event.cjs.js +1 -1
  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.esm.js +105 -0
  41. package/dist/util/scroll.cjs.js +1 -1
  42. package/dist/util/scroll.esm.js +27 -0
  43. package/dist/util/selectors.cjs.js +7 -7
  44. package/dist/util/selectors.esm.js +46 -0
  45. package/dist/util/text.cjs.js +2 -2
  46. package/dist/util/text.esm.js +70 -0
  47. package/dist/util/window.cjs.js +1 -1
  48. package/dist/util/window.esm.js +11 -0
  49. package/package.json +7 -7
  50. package/dist/abstract/attaches-events.es.js +0 -23
  51. package/dist/components/section/grid.es.js +0 -11
  52. package/dist/components/ui/text/title.es.js +0 -11
  53. package/dist/components/widget/header.es.js +0 -28
  54. package/dist/components/widget/menu.es.js +0 -120
  55. package/dist/components/widget/panel.es.js +0 -94
  56. package/dist/types/breakpoints.es.js +0 -10
  57. package/dist/types/components/form/input.es.js +0 -1
  58. package/dist/types/side.es.js +0 -9
  59. package/dist/types/time.es.js +0 -13
  60. package/dist/types/util.es.js +0 -1
  61. package/dist/util/async.es.js +0 -11
  62. package/dist/util/color.es.js +0 -22
  63. package/dist/util/date.es.js +0 -7
  64. package/dist/util/display.es.js +0 -35
  65. package/dist/util/event.es.js +0 -33
  66. package/dist/util/math.es.js +0 -10
  67. package/dist/util/object.es.js +0 -116
  68. package/dist/util/scroll.es.js +0 -31
  69. package/dist/util/selectors.es.js +0 -69
  70. package/dist/util/text.es.js +0 -82
  71. package/dist/util/window.es.js +0 -12
  72. /package/dist/{src/abstract → abstract}/attaches-events.d.ts +0 -0
  73. /package/dist/{src/components → components}/section/grid.d.ts +0 -0
  74. /package/dist/{src/components → components}/ui/text/title.d.ts +0 -0
  75. /package/dist/{src/components → components}/widget/header.d.ts +0 -0
  76. /package/dist/{src/types → types}/breakpoints.d.ts +0 -0
  77. /package/dist/{src/types → types}/side.d.ts +0 -0
  78. /package/dist/{src/types → types}/time.d.ts +0 -0
  79. /package/dist/{src/types → types}/util.d.ts +0 -0
  80. /package/dist/{src/util → util}/async.d.ts +0 -0
  81. /package/dist/{src/util → util}/color.d.ts +0 -0
  82. /package/dist/{src/util → util}/date.d.ts +0 -0
  83. /package/dist/{src/util → util}/event.d.ts +0 -0
  84. /package/dist/{src/util → util}/math.d.ts +0 -0
  85. /package/dist/{src/util → util}/object.d.ts +0 -0
  86. /package/dist/{src/util → util}/scroll.d.ts +0 -0
  87. /package/dist/{src/util → util}/selectors.d.ts +0 -0
  88. /package/dist/{src/util → util}/text.d.ts +0 -0
  89. /package/dist/{src/util → util}/window.d.ts +0 -0
@@ -1,94 +0,0 @@
1
- import { breakpoints as r } from "../../types/breakpoints.es.js";
2
- import { sides as h } from "../../types/side.es.js";
3
- import { delay as l } from "../../types/time.es.js";
4
- import { AttachesEvents as f } from "../../abstract/attaches-events.es.js";
5
- import { windowWidth as p } from "../../util/window.es.js";
6
- import { throttleEvent as a } from "../../util/event.es.js";
7
- import { controls as d, getFocusables as c } from "../../util/selectors.es.js";
8
- class L extends f {
9
- settings = {
10
- title: "panel",
11
- from: h[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", a(this.eHandleResize.bind(this), l.default)), this.attachEvent(this.el.main, "click", a(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", a(this.eWrapTab.bind(this)));
28
- });
29
- const e = this.settings.wrapperId;
30
- if (typeof e != "string")
31
- return;
32
- this.el.panel?.querySelectorAll(d(e))?.forEach((s) => {
33
- this.attachEvent(s, "click", a(this.eToggle.bind(this), l.slower, { trailing: !1 }));
34
- });
35
- }
36
- addClasses() {
37
- this.el.panel?.classList.add("mint-panel"), this.el.wrapper?.classList.add("mint-panel-wrap"), this.el.toggleButton?.classList.add("mint-panel-toggle");
38
- const t = this.settings.from;
39
- typeof t == "string" && (this.el.panel?.classList.remove("mint-top", "mint-right", "mint-bottom", "mint-left"), this.el.panel?.classList.add(`mint-${t.toLowerCase()}`)), this.settings.tray && this.el.panel?.classList.add("mint-tray");
40
- }
41
- setPanel(t = !1) {
42
- const e = typeof this.settings.title == "string" ? this.settings.title : "panel", i = t ? "true" : "false", s = t ? `close ${e}` : `open ${e}`;
43
- this.el.toggleButton?.setAttribute("aria-expanded", i), setTimeout(() => {
44
- this.el.toggleButton?.setAttribute("aria-label", s);
45
- }, l.faster), t ? (this.closeOtherPanels(), this.settings.fixed !== !0 && window.scroll({
46
- top: 0,
47
- left: 0,
48
- behavior: "smooth"
49
- }), setTimeout(() => {
50
- if (this.el.html) {
51
- const o = p() <= r.sm;
52
- let n = "auto";
53
- this.settings.tray ? o && (n = "hidden") : n = "hidden", this.el.html.style.overflow = n;
54
- }
55
- }, this.settings.from === h[3] ? l.default : l.instant), this.el.wrapper && (this.el.wrapper.style.display = "flex"), requestAnimationFrame(() => {
56
- this.el.wrapper?.classList.add("mint-open");
57
- })) : (this.el.html && (this.el.html.style.overflow = "auto"), requestAnimationFrame(() => {
58
- this.el.wrapper?.classList.remove("mint-open");
59
- }));
60
- }
61
- togglePanel() {
62
- this.setPanel(this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase() === "false");
63
- }
64
- closeOtherPanels() {
65
- const e = `.mint-panel-toggle[aria-expanded="true"]:not([aria-controls="${typeof this.settings.wrapperId == "string" ? this.settings.wrapperId : ""}"])`, i = document.querySelector(e);
66
- i && i.click();
67
- }
68
- eHandleResize() {
69
- const t = p() <= r.sm;
70
- let e = !0;
71
- this.el.panel?.classList.contains("mint-tray") ? e = !1 : this.el.panel?.classList.contains("mint-expand") || (e = !1), !t && e && this.setPanel(!1);
72
- const i = this.el.toggleButton?.getAttribute("aria-expanded")?.toLowerCase() === "true";
73
- let s = "auto";
74
- i && (this.settings.tray ? t && (s = "hidden") : s = "hidden"), this.el.html && (this.el.html.style.overflow = s);
75
- }
76
- eWrapTab(t) {
77
- if (!(t instanceof KeyboardEvent))
78
- return;
79
- const e = c(this.el.panel), i = e[e.length - 1], s = e.length > 1 && document.activeElement === i;
80
- t.key.toLowerCase() === "tab" && !t.shiftKey && s && (this.el.toggleButton?.focus(), document.activeElement === this.el.toggleButton && t.preventDefault());
81
- }
82
- eToggle() {
83
- this.togglePanel();
84
- }
85
- eClose() {
86
- this.setPanel(!1);
87
- }
88
- eTransitionEnd() {
89
- this.el.wrapper?.classList.contains("mint-open") === !1 && (this.el.wrapper.style.display = "none");
90
- }
91
- }
92
- export {
93
- L as Panel
94
- };
@@ -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.toString()}px` : t.style.width = `${n.toString()}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.toString()}px` : t.style.width = `${n.toString()}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,33 +0,0 @@
1
- import { delay as f } from "../types/time.es.js";
2
- function m(l, t = f.default) {
3
- let e;
4
- return function(...u) {
5
- e && clearTimeout(e), e = window.setTimeout(() => {
6
- l(...u);
7
- }, t);
8
- };
9
- }
10
- function w(l, t = f.default) {
11
- return m(l, t);
12
- }
13
- function s(l, t = f.default, e) {
14
- let u, n = 0, r = 0, i = null;
15
- const c = () => {
16
- r = e?.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), n = 0, i && (u = i()), n || (i = null);
17
- };
18
- return function(...d) {
19
- const o = (/* @__PURE__ */ new Date()).getTime();
20
- !r && e?.leading === !1 && (r = o);
21
- const a = t - o + r;
22
- return i = () => l.apply(this, d), a <= 0 || a > t ? (n && (clearTimeout(n), n = 0), r = o, u = i(), n || (i = null)) : !n && e?.trailing !== !1 && (n = window.setTimeout(c, a)), u;
23
- };
24
- }
25
- function T(l, t = f.default, e) {
26
- return s(l, t, e);
27
- }
28
- export {
29
- m as debounce,
30
- w as debounceEvent,
31
- s as throttle,
32
- T as throttleEvent
33
- };
@@ -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,116 +0,0 @@
1
- function l(t, n) {
2
- const e = Object.keys(t);
3
- if (e.length !== Object.keys(n).length)
4
- return !1;
5
- let r = !0;
6
- return e.forEach((c) => {
7
- t[c] !== n[c] && (r = !1);
8
- }), r;
9
- }
10
- function o(t, n) {
11
- let e = !0;
12
- if (t === n)
13
- return e;
14
- try {
15
- if (typeof n == "object" && n !== null && Object.keys(n).length === 0)
16
- return !e;
17
- } catch {
18
- return !e;
19
- }
20
- return Object.keys(n).forEach((r) => {
21
- e = e && o(
22
- t[r],
23
- n[r]
24
- );
25
- }), e;
26
- }
27
- function a(t, n) {
28
- return Object.keys(t).reduce((e, r) => (n.includes(r) || (e[r] = t[r]), e), {});
29
- }
30
- function h(t, n) {
31
- return Object.keys(t).reduce((e, r) => (n.includes(t[r]) || (e[r] = t[r]), e), {});
32
- }
33
- function O(t, n) {
34
- return Object.keys(t).sort(n).reduce((e, r) => (e[r] = t[r], e), {});
35
- }
36
- function d(t, n) {
37
- return Object.keys(t).sort((e, r) => n(t[e], t[r])).reduce((e, r) => (e[r] = t[r], e), {});
38
- }
39
- function p(t, n) {
40
- return n.reduce((e, r) => (e[r] = t[r], e), {});
41
- }
42
- function y(t, n) {
43
- return Object.keys(t).reduce((e, r) => (n.includes(t[r]) && (e[r] = t[r]), e), {});
44
- }
45
- function m(t, n, e = "id") {
46
- if (!n?.length)
47
- n?.forEach((c) => t.push(c));
48
- else {
49
- const c = n.reduce((u, s) => ({
50
- ...u,
51
- [s[e] ?? ""]: s
52
- }), {});
53
- t.filter((u) => !c[u[e] ?? ""]).forEach((u) => {
54
- const s = t.indexOf(u);
55
- typeof s == "number" && s !== -1 && t.splice(s, 1);
56
- }), t.forEach((u) => {
57
- c[u[e] ?? ""] && Object.assign(u, c[u[e] ?? ""]);
58
- });
59
- }
60
- n?.filter((c) => !t.some((f) => f[e] === c[e]))?.forEach((c) => t.push(c));
61
- }
62
- function E(t, n) {
63
- return Object.keys(t).find((e) => t[e] === n);
64
- }
65
- function j(t) {
66
- if (typeof t != "object")
67
- return t;
68
- const n = /* @__PURE__ */ new WeakMap(), e = [[t, {}]];
69
- for (; e.length; ) {
70
- const r = e.pop();
71
- if (!r)
72
- continue;
73
- const [c, f, u] = r;
74
- if (u !== void 0) {
75
- const s = c[u];
76
- if (typeof s == "function") {
77
- f[u] = s.bind(f);
78
- continue;
79
- }
80
- if (typeof s != "object" || s === null) {
81
- f[u] = s;
82
- continue;
83
- }
84
- if (n.has(s)) {
85
- f[u] = n.get(s);
86
- continue;
87
- }
88
- const i = Array.isArray(s) ? [] : {};
89
- f[u] = i, n.set(s, i), e.push([s, i]);
90
- } else {
91
- if (n.set(c, f), Array.isArray(c)) {
92
- c.forEach((s, i) => {
93
- e.push([c, f, i]);
94
- });
95
- continue;
96
- }
97
- Object.keys(c).forEach((s) => {
98
- e.push([c, f, s]);
99
- });
100
- }
101
- }
102
- return n.get(t);
103
- }
104
- export {
105
- j as objectDeepClone,
106
- p as objectFilterKeys,
107
- y as objectFilterValues,
108
- E as objectGetKeyByValue,
109
- o as objectIsSuperset,
110
- h as objectRemoveValues,
111
- l as objectSameKeys,
112
- O as objectSortKeys,
113
- d as objectSortValues,
114
- m as objectUpdateArray,
115
- a as removeKeys
116
- };
@@ -1,31 +0,0 @@
1
- import { throttleEvent as n } from "./event.es.js";
2
- function l(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)"), o = [];
16
- for (const e of t)
17
- e.getBoundingClientRect().top < 0 ? e.classList.add("mint-show") : e.getBoundingClientRect().top < window.innerHeight * 3 / 4 && o.push(e);
18
- for (let e = 0; e < o.length; e++)
19
- setTimeout(() => {
20
- o[e].classList.add("mint-show");
21
- }, e * 100);
22
- });
23
- }
24
- function c() {
25
- window.addEventListener("scroll", n(i, 200));
26
- }
27
- export {
28
- l 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 ? "true" : "false"}"]` : 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,82 +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
- let a = 0;
17
- for (; a < n.length; a++) {
18
- switch (a) {
19
- case 0:
20
- i += "(";
21
- break;
22
- case 3:
23
- i += ") ";
24
- break;
25
- case 6:
26
- i += "-";
27
- break;
28
- }
29
- i += n[a];
30
- }
31
- switch (t[t.length - 1]) {
32
- case ")":
33
- a === 3 && (i += ") ");
34
- break;
35
- case "-":
36
- a === 6 && (i += "-");
37
- break;
38
- }
39
- return i;
40
- }
41
- function x(e) {
42
- 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";
43
- }
44
- function s(e) {
45
- return e.toLowerCase().replace(/(?:^|\s)\S/g, (t) => t.toUpperCase());
46
- }
47
- async function f(e) {
48
- const t = document.createElement("textarea");
49
- return e ? (t.value = e, t.style.cssText = `
50
- position: fixed;
51
- top: 0;
52
- left: 0;
53
- transform: translate(-100%, -100%);
54
- opacity: 0;
55
- z-index: -1;
56
- `, document.body.appendChild(t), t.select(), t.setSelectionRange(0, 99999), await navigator.clipboard.writeText(t.value), document.body.removeChild(t), !0) : !1;
57
- }
58
- function g(e) {
59
- 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;
60
- }
61
- function h(e = 10) {
62
- return Math.random().toString(36).substring(2, e + 2);
63
- }
64
- function o(e) {
65
- return !!e?.match(/\.(jpe?g|png|webp|gif|svg)$/i);
66
- }
67
- function p(e) {
68
- return !!e?.match(/\.(mp4|webm|ogg)$/i);
69
- }
70
- export {
71
- f as copyText,
72
- l as formatPhone,
73
- h as generateId,
74
- g as isEmail,
75
- o as isImage,
76
- p as isVideo,
77
- x as plural,
78
- c as slug,
79
- s as titleCase,
80
- r as truncate,
81
- u as unslug
82
- };
@@ -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
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes