@solostylist/ui-kit 1.0.197 → 1.0.200
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/{ArrowUpward-JWPHrR6I.js → ArrowUpward-D8eqD-si.js} +1 -1
- package/dist/{Box-p3bpOtdn.js → Box-BkXoTbe8.js} +3 -3
- package/dist/{ButtonBase-PbSTzuUP.js → ButtonBase-D73M0QY5.js} +7 -7
- package/dist/{ChevronLeft-BJjuFNNQ.js → ChevronLeft-BmgmPHp9.js} +1 -1
- package/dist/{ChevronRight-5ZX3FodP.js → ChevronRight-DbWSr8yz.js} +1 -1
- package/dist/{Close-C-pCw-CD.js → Close-lHCUMitI.js} +1 -1
- package/dist/{ContentCopy-CNxsEhmq.js → ContentCopy-D4SuJd86.js} +1 -1
- package/dist/{DefaultPropsProvider-2MEHB2yv.js → DefaultPropsProvider-DPuuPIbS.js} +2 -2
- package/dist/{Download-D97XSAig.js → Download-BoRQUwCf.js} +1 -1
- package/dist/{ExpandMore-CTZrSZlF.js → ExpandMore-C7yRQv1-.js} +1 -1
- package/dist/{Favorite-Cvjg7GqN.js → Favorite-Bz_HcMgN.js} +1 -1
- package/dist/{Menu-_ZW9WiF2.js → Menu-GVFDMHCN.js} +137 -131
- package/dist/{MenuItem-DTapLhin.js → MenuItem-2wG8I2HO.js} +5 -5
- package/dist/{Paper-5nSdRRBA.js → Paper-CR019bki.js} +6 -6
- package/dist/{Select-J5gDqfEk.js → Select-80JhW337.js} +7 -7
- package/dist/{Stack-BlwLEm6H.js → Stack-Dfjnuorw.js} +5 -5
- package/dist/{Typography-Cum5_Ehu.js → Typography-PcmlIqm1.js} +4 -4
- package/dist/assets/s-overlay-scrollbar.css +1 -1
- package/dist/{createSvgIcon-DTNHY3_v.js → createSvgIcon-BkbeLOhM.js} +3 -3
- package/dist/{createTheme-CIXJrNxb.js → createTheme-DgoJyWM-.js} +874 -871
- package/dist/defaultTheme-CulFxfLR.js +5 -0
- package/dist/entries/core.d.ts +2 -2
- package/dist/entries/core.js +28 -30
- package/dist/{extendSxProp-CyoueGTe.js → extendSxProp-BJEIxcAx.js} +1 -1
- package/dist/{index-8LcCMmwl.js → index-DtGYsHSv.js} +4 -4
- package/dist/main.js +92 -94
- package/dist/s-accordion/s-accordion.js +89 -89
- package/dist/s-action-overlay/s-action-overlay.js +7 -7
- package/dist/s-ai-tool-bar/s-ai-tool-bar.d.ts +44 -0
- package/dist/s-ai-tool-bar/s-ai-tool-bar.js +241 -272
- package/dist/s-avatar/s-avatar.js +2 -2
- package/dist/s-blur-text/s-blur-text.js +25 -24
- package/dist/s-breadcrumbs/s-breadcrumbs.js +1 -1
- package/dist/s-carousel/s-carousel.d.ts +4 -4
- package/dist/s-carousel/s-carousel.js +4 -4
- package/dist/s-chat-input/s-chat-input.js +4 -4
- package/dist/s-chat-message/s-chat-message.js +135 -124
- package/dist/s-chips/s-chips.js +35 -35
- package/dist/s-code-block/s-code-block.js +1 -1
- package/dist/s-comment-message/s-comment-message.js +5 -5
- package/dist/s-copyable-text/s-copyable-text.js +1 -1
- package/dist/s-countdown/s-count-box.js +40 -37
- package/dist/s-countdown/s-count-down.d.ts +15 -10
- package/dist/s-countdown/s-count-down.js +79 -124
- package/dist/s-data-table/s-data-table.js +75 -76
- package/dist/s-date-picker/s-date-picker.js +43 -47
- package/dist/s-datetime-picker/s-datetime-picker.js +782 -782
- package/dist/s-dialog/s-dialog.js +1 -1
- package/dist/s-dialog-confirm/index.d.ts +1 -1
- package/dist/s-dialog-confirm/s-dialog-confirm.d.ts +1 -1
- package/dist/s-dialog-confirm/s-dialog-confirm.js +2 -2
- package/dist/s-dialog-message/index.d.ts +1 -1
- package/dist/s-dialog-message/s-dialog-message.d.ts +1 -1
- package/dist/s-dialog-message/s-dialog-message.js +2 -2
- package/dist/s-empty/s-empty.js +1 -1
- package/dist/s-file-dropzone/s-file-dropzone.js +16 -16
- package/dist/s-file-icon/s-file-icon.js +15 -15
- package/dist/s-flex-box/s-flex-box.js +1 -1
- package/dist/s-gallery/s-gallery.js +1 -1
- package/dist/s-gradient-icon/s-gradient-icon.js +5 -5
- package/dist/s-image-comparison/s-image-comparison.js +3 -3
- package/dist/s-image-modal/s-image-modal.js +7 -7
- package/dist/s-label/s-label.d.ts +1 -1
- package/dist/s-label/s-label.js +1 -1
- package/dist/s-language-switcher/s-language-switcher.js +8 -8
- package/dist/s-localization-provider/s-localization-provider.js +1 -1
- package/dist/s-moving-border/s-moving-border.d.ts +5 -5
- package/dist/s-multi-select/s-multi-select.js +3 -3
- package/dist/s-overlay-scrollbar/s-overlay-scrollbar.js +6 -6
- package/dist/s-pixel-reveal/s-pixel-reveal.js +76 -71
- package/dist/s-radial-pulse-animate/s-radial-pulse-animate.js +2 -2
- package/dist/s-review/s-review.d.ts +3 -2
- package/dist/s-review/s-review.js +19 -19
- package/dist/s-scroll-to-top/s-scroll-to-top.js +5 -5
- package/dist/s-scroll-velocity/scroll-velocity-container.d.ts +1 -1
- package/dist/s-scroll-velocity/scroll-velocity-row.d.ts +3 -3
- package/dist/s-scroll-velocity/scroll-velocity-row.js +2 -2
- package/dist/s-select/s-select.js +54 -67
- package/dist/s-select-list/s-select-list.js +1 -1
- package/dist/s-snackbar-message/s-snackbar-message.js +18 -18
- package/dist/s-stripe/s-stripe-cvc.d.ts +1 -1
- package/dist/s-stripe/s-stripe-expiry.d.ts +1 -1
- package/dist/s-stripe/s-stripe-number.d.ts +1 -1
- package/dist/s-stripe/stripe-input.d.ts +1 -1
- package/dist/s-text-editor/s-text-editor-toolbar.js +64 -60
- package/dist/s-text-editor/s-text-editor.js +1 -1
- package/dist/s-text-field/s-text-field.js +1 -1
- package/dist/s-text-shimmer/s-text-shimmer.js +3 -3
- package/dist/s-theme-demo/s-theme-demo.js +2 -2
- package/dist/s-theme-provider/s-theme-provider.d.ts +1 -1
- package/dist/s-theme-switch/s-theme-switch.js +1 -1
- package/dist/s-tip/s-tip.js +3 -3
- package/dist/{styled-BR6UL29H.js → styled-8Y5KoVix.js} +2 -2
- package/dist/theme/components/avatar.js +1 -1
- package/dist/theme/components/button.d.ts +2 -2
- package/dist/theme/components/button.js +1 -1
- package/dist/theme/components/chip.d.ts +2 -2
- package/dist/theme/components/chip.js +1 -1
- package/dist/theme/components/icon-button.d.ts +2 -2
- package/dist/theme/components/popover.js +2 -2
- package/dist/theme/components/skeleton.js +1 -1
- package/dist/theme/components/tooltip.js +5 -5
- package/dist/theme/customizations/data-display.js +12 -12
- package/dist/theme/customizations/feedback.js +2 -2
- package/dist/theme/customizations/inputs.js +12 -12
- package/dist/theme/customizations/navigation.js +28 -28
- package/dist/theme/customizations/surfaces.js +11 -11
- package/dist/theme/theme-primitives.js +1 -1
- package/dist/{useMobilePicker-C0pYjskU.js → useMobilePicker-DVnEuXv1.js} +3936 -3653
- package/dist/{useTheme-DSvhq4Np.js → useTheme-CWPkv7g3.js} +1 -1
- package/dist/{useThemeProps-C-oV4Fbz.js → useThemeProps-XYgXGzjS.js} +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +7 -9
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils-D1UMIV0b.js +40 -0
- package/dist/{warning-BZ61Y8gI.js → warning-Ba-7BBAN.js} +3 -3
- package/package.json +67 -62
- package/dist/defaultTheme-DLue8Fr1.js +0 -5
- package/dist/s-accordion/package.json +0 -5
- package/dist/s-action-overlay/package.json +0 -5
- package/dist/s-ai-tool-bar/package.json +0 -5
- package/dist/s-autocomplete/package.json +0 -5
- package/dist/s-avatar/package.json +0 -5
- package/dist/s-blur-text/package.json +0 -5
- package/dist/s-breadcrumbs/package.json +0 -5
- package/dist/s-button/package.json +0 -5
- package/dist/s-button-link/package.json +0 -5
- package/dist/s-carousel/package.json +0 -5
- package/dist/s-category-card/package.json +0 -5
- package/dist/s-chat-input/package.json +0 -5
- package/dist/s-chat-message/package.json +0 -5
- package/dist/s-checkbox/package.json +0 -5
- package/dist/s-chip/package.json +0 -5
- package/dist/s-chips/package.json +0 -5
- package/dist/s-code-block/package.json +0 -5
- package/dist/s-comment-message/package.json +0 -5
- package/dist/s-copyable-text/package.json +0 -5
- package/dist/s-countdown/package.json +0 -5
- package/dist/s-data-table/package.json +0 -5
- package/dist/s-date-picker/package.json +0 -5
- package/dist/s-datetime-picker/package.json +0 -5
- package/dist/s-dialog/package.json +0 -5
- package/dist/s-dialog-confirm/package.json +0 -5
- package/dist/s-dialog-message/package.json +0 -5
- package/dist/s-empty/package.json +0 -5
- package/dist/s-error/package.json +0 -5
- package/dist/s-error-layout/package.json +0 -5
- package/dist/s-file-dropzone/package.json +0 -5
- package/dist/s-file-icon/package.json +0 -5
- package/dist/s-flex-box/package.json +0 -5
- package/dist/s-form/package.json +0 -5
- package/dist/s-gallery/package.json +0 -5
- package/dist/s-glow-button/package.json +0 -5
- package/dist/s-gradient-icon/package.json +0 -5
- package/dist/s-i18n-provider/package.json +0 -5
- package/dist/s-icon-button/package.json +0 -5
- package/dist/s-image-comparison/package.json +0 -5
- package/dist/s-image-modal/package.json +0 -5
- package/dist/s-item-not-found/package.json +0 -5
- package/dist/s-label/package.json +0 -5
- package/dist/s-language-switcher/package.json +0 -5
- package/dist/s-lazy-image/package.json +0 -5
- package/dist/s-localization-provider/package.json +0 -5
- package/dist/s-moving-border/package.json +0 -5
- package/dist/s-multi-select/package.json +0 -5
- package/dist/s-no-ssr/package.json +0 -5
- package/dist/s-overlay-scrollbar/package.json +0 -5
- package/dist/s-pagination/package.json +0 -5
- package/dist/s-pixel-reveal/package.json +0 -5
- package/dist/s-radial-pulse-animate/package.json +0 -5
- package/dist/s-rating/package.json +0 -5
- package/dist/s-review/package.json +0 -5
- package/dist/s-scroll-reveal/package.json +0 -6
- package/dist/s-scroll-to-top/package.json +0 -5
- package/dist/s-scroll-velocity/package.json +0 -5
- package/dist/s-select/package.json +0 -5
- package/dist/s-select-list/package.json +0 -5
- package/dist/s-skeleton/package.json +0 -5
- package/dist/s-snackbar-message/package.json +0 -5
- package/dist/s-spotlight-cursor/package.json +0 -5
- package/dist/s-stripe/package.json +0 -5
- package/dist/s-tabs/package.json +0 -4
- package/dist/s-text-editor/package.json +0 -5
- package/dist/s-text-field/package.json +0 -5
- package/dist/s-text-shimmer/package.json +0 -5
- package/dist/s-text-truncation/package.json +0 -5
- package/dist/s-theme-demo/package.json +0 -5
- package/dist/s-theme-provider/package.json +0 -5
- package/dist/s-theme-switch/package.json +0 -5
- package/dist/s-tip/package.json +0 -5
- package/dist/s-two-pane-layout/package.json +0 -5
- package/dist/s-typewriter-text/package.json +0 -6
- package/dist/s-zoom-image/package.json +0 -5
- package/dist/utils/bytes-to-size.d.ts +0 -1
- package/dist/utils/bytes-to-size.js +0 -9
- package/dist/utils-DJIrqgo5.js +0 -18
package/dist/s-chips/s-chips.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { j as s } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Box as
|
|
2
|
+
import { useRef as g, useState as m, useCallback as C, useEffect as E } from "react";
|
|
3
|
+
import { Box as a, Chip as c, Tooltip as R } from "@mui/material";
|
|
4
4
|
const v = ({
|
|
5
|
-
chips:
|
|
6
|
-
overflow:
|
|
5
|
+
chips: n,
|
|
6
|
+
overflow: o = !0,
|
|
7
7
|
onClick: h,
|
|
8
|
-
overflowText:
|
|
8
|
+
overflowText: p = "keywords"
|
|
9
9
|
}) => {
|
|
10
|
-
const u =
|
|
10
|
+
const u = g(null), [b, w] = m([]), [y, W] = m([]), [x, j] = m(0), r = C((t) => {
|
|
11
11
|
const e = document.createElement("span");
|
|
12
|
-
e.style.visibility = "hidden", e.style.position = "absolute", e.style.whiteSpace = "nowrap", e.textContent =
|
|
13
|
-
const
|
|
14
|
-
return document.body.removeChild(e),
|
|
15
|
-
}, []),
|
|
16
|
-
const
|
|
17
|
-
let e = 0,
|
|
18
|
-
for (
|
|
19
|
-
const f =
|
|
20
|
-
if (e + f <=
|
|
21
|
-
e += f,
|
|
12
|
+
e.style.visibility = "hidden", e.style.position = "absolute", e.style.whiteSpace = "nowrap", e.textContent = t.trim(), document.body.appendChild(e);
|
|
13
|
+
const i = e.offsetWidth;
|
|
14
|
+
return document.body.removeChild(e), i + 16;
|
|
15
|
+
}, []), l = C(() => {
|
|
16
|
+
const t = u.current?.offsetWidth ?? 0;
|
|
17
|
+
let e = 0, i = 0;
|
|
18
|
+
for (const d of n) {
|
|
19
|
+
const f = r(d);
|
|
20
|
+
if (e + f <= t)
|
|
21
|
+
e += f, i++;
|
|
22
22
|
else
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
for (; e +
|
|
28
|
-
|
|
25
|
+
if (i < n.length) {
|
|
26
|
+
const d = r(`+${n.length - i} ${p}`);
|
|
27
|
+
for (; e + d > t && i > 0; )
|
|
28
|
+
i--, e -= r(n[i]);
|
|
29
29
|
}
|
|
30
|
-
w(
|
|
31
|
-
}, [
|
|
30
|
+
w(n.slice(0, i)), W(n.slice(i)), j(n.length - i);
|
|
31
|
+
}, [n, p, r]), S = o ? { textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden" } : {};
|
|
32
32
|
return E(() => {
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
35
|
-
window.removeEventListener("resize",
|
|
33
|
+
if (o)
|
|
34
|
+
return l(), window.addEventListener("resize", l), () => {
|
|
35
|
+
window.removeEventListener("resize", l);
|
|
36
36
|
};
|
|
37
|
-
}, [
|
|
38
|
-
(
|
|
39
|
-
|
|
37
|
+
}, [n, o, l]), /* @__PURE__ */ s.jsxs(a, { ref: u, display: "flex", maxWidth: "100%", flexWrap: o ? "nowrap" : "wrap", ...S, children: [
|
|
38
|
+
(o ? b : n).map((t) => /* @__PURE__ */ s.jsx(
|
|
39
|
+
a,
|
|
40
40
|
{
|
|
41
41
|
component: "span",
|
|
42
42
|
textTransform: "lowercase",
|
|
43
43
|
onClick: () => {
|
|
44
|
-
h?.(
|
|
44
|
+
h?.(t);
|
|
45
45
|
},
|
|
46
46
|
children: /* @__PURE__ */ s.jsx(
|
|
47
47
|
c,
|
|
48
48
|
{
|
|
49
|
-
label:
|
|
49
|
+
label: t.trim(),
|
|
50
50
|
sx: {
|
|
51
51
|
mr: 1,
|
|
52
52
|
mb: 1,
|
|
@@ -56,9 +56,9 @@ const v = ({
|
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
t
|
|
60
60
|
)),
|
|
61
|
-
|
|
61
|
+
o && x > 0 && /* @__PURE__ */ s.jsx(
|
|
62
62
|
R,
|
|
63
63
|
{
|
|
64
64
|
slotProps: {
|
|
@@ -66,11 +66,11 @@ const v = ({
|
|
|
66
66
|
},
|
|
67
67
|
arrow: !0,
|
|
68
68
|
placement: "top",
|
|
69
|
-
title: /* @__PURE__ */ s.jsx(
|
|
70
|
-
children: /* @__PURE__ */ s.jsx(
|
|
69
|
+
title: /* @__PURE__ */ s.jsx(a, { display: "flex", gap: 1, maxWidth: "240px", flexWrap: "wrap", children: y.map((t) => /* @__PURE__ */ s.jsx(c, { label: t.trim() }, t)) }),
|
|
70
|
+
children: /* @__PURE__ */ s.jsx(a, { component: "span", textTransform: "lowercase", children: /* @__PURE__ */ s.jsx(
|
|
71
71
|
c,
|
|
72
72
|
{
|
|
73
|
-
label: `+${x} ${
|
|
73
|
+
label: `+${x} ${p}`,
|
|
74
74
|
variant: "outlined",
|
|
75
75
|
color: "info",
|
|
76
76
|
sx: { mr: 1, mb: 1, userSelect: "none", cursor: "pointer" }
|
|
@@ -2,7 +2,7 @@ import { j as o } from "../jsx-runtime-tc70JA_2.js";
|
|
|
2
2
|
import { useState as g } from "react";
|
|
3
3
|
import { useColorScheme as p, Box as k, IconButton as u } from "@mui/material";
|
|
4
4
|
import { Prism as b } from "react-syntax-highlighter";
|
|
5
|
-
import { C as m, a as f } from "../ContentCopy-
|
|
5
|
+
import { C as m, a as f } from "../ContentCopy-D4SuJd86.js";
|
|
6
6
|
const w = {
|
|
7
7
|
'code[class*="language-"]': {
|
|
8
8
|
background: "hsl(220, 13%, 18%)",
|
|
@@ -3,10 +3,10 @@ import { useId as N, useState as v, useEffect as R } from "react";
|
|
|
3
3
|
import { Box as i, Stack as n, Typography as a, IconButton as O, Button as k, Collapse as Q } from "@mui/material";
|
|
4
4
|
import { SAvatar as U } from "../s-avatar/s-avatar.js";
|
|
5
5
|
import { SSkeleton as e } from "../s-skeleton/s-skeleton.js";
|
|
6
|
-
import { g as X } from "../utils-
|
|
7
|
-
import { F as Y } from "../Favorite-
|
|
8
|
-
import { c as I } from "../createSvgIcon-
|
|
9
|
-
import { E as Z } from "../ExpandMore-
|
|
6
|
+
import { g as X } from "../utils-D1UMIV0b.js";
|
|
7
|
+
import { F as Y } from "../Favorite-Bz_HcMgN.js";
|
|
8
|
+
import { c as I } from "../createSvgIcon-BkbeLOhM.js";
|
|
9
|
+
import { E as Z } from "../ExpandMore-C7yRQv1-.js";
|
|
10
10
|
const _ = I(/* @__PURE__ */ t.jsx("path", {
|
|
11
11
|
d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
|
|
12
12
|
}), "ExpandLess"), tt = I(/* @__PURE__ */ t.jsx("path", {
|
|
@@ -112,7 +112,7 @@ const _ = I(/* @__PURE__ */ t.jsx("path", {
|
|
|
112
112
|
showReplies: d,
|
|
113
113
|
avatarSize: Math.max(32, r - 8)
|
|
114
114
|
},
|
|
115
|
-
s.id
|
|
115
|
+
s.id ?? `reply-${K}`
|
|
116
116
|
)) }) })
|
|
117
117
|
] });
|
|
118
118
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import { useState as l } from "react";
|
|
3
3
|
import { Paper as p, Box as d, IconButton as x, Typography as m } from "@mui/material";
|
|
4
|
-
import { C as u, a as h } from "../ContentCopy-
|
|
4
|
+
import { C as u, a as h } from "../ContentCopy-D4SuJd86.js";
|
|
5
5
|
const f = ({ text: r, typographyProps: e, onCopied: a, paperProps: i }) => {
|
|
6
6
|
const [t, s] = l(!1), n = async () => {
|
|
7
7
|
if (r)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { SFlexBox as
|
|
4
|
-
const
|
|
5
|
-
digit:
|
|
6
|
-
title:
|
|
7
|
-
size:
|
|
8
|
-
color:
|
|
9
|
-
animation:
|
|
2
|
+
import { Typography as l, Fade as v, Slide as B } from "@mui/material";
|
|
3
|
+
import { SFlexBox as d } from "../s-flex-box/s-flex-box.js";
|
|
4
|
+
const C = ({
|
|
5
|
+
digit: m = 0,
|
|
6
|
+
title: x = "",
|
|
7
|
+
size: f = "medium",
|
|
8
|
+
color: o = "inherit",
|
|
9
|
+
animation: s = "none",
|
|
10
10
|
sx: g,
|
|
11
|
-
digitSx:
|
|
12
|
-
titleSx:
|
|
13
|
-
showSeparator:
|
|
14
|
-
separator:
|
|
15
|
-
digitFormat:
|
|
16
|
-
hidden:
|
|
11
|
+
digitSx: p,
|
|
12
|
+
titleSx: h,
|
|
13
|
+
showSeparator: u = !1,
|
|
14
|
+
separator: S = ":",
|
|
15
|
+
digitFormat: j = "default",
|
|
16
|
+
hidden: y = !1
|
|
17
17
|
}) => {
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
switch (
|
|
18
|
+
if (y) return null;
|
|
19
|
+
const z = (c) => j === "padded" ? c.toString().padStart(2, "0") : c.toString(), e = (() => {
|
|
20
|
+
switch (f) {
|
|
21
21
|
case "small":
|
|
22
22
|
return {
|
|
23
23
|
digit: { fontSize: "1.5rem", lineHeight: 1.2 },
|
|
@@ -34,22 +34,22 @@ const B = ({
|
|
|
34
34
|
title: { fontSize: "0.875rem", letterSpacing: "0.08em" }
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
})(), i =
|
|
38
|
-
|
|
37
|
+
})(), i = z(m), n = /* @__PURE__ */ t.jsx(
|
|
38
|
+
l,
|
|
39
39
|
{
|
|
40
40
|
variant: "h3",
|
|
41
41
|
component: "span",
|
|
42
42
|
sx: {
|
|
43
43
|
fontWeight: 700,
|
|
44
|
-
color:
|
|
44
|
+
color: o === "inherit" ? "text.primary" : `${o}.main`,
|
|
45
45
|
width: "70px",
|
|
46
46
|
...e.digit,
|
|
47
|
-
...
|
|
47
|
+
...p
|
|
48
48
|
},
|
|
49
49
|
children: i
|
|
50
50
|
}
|
|
51
|
-
),
|
|
52
|
-
|
|
51
|
+
), H = /* @__PURE__ */ t.jsx(
|
|
52
|
+
l,
|
|
53
53
|
{
|
|
54
54
|
component: "span",
|
|
55
55
|
sx: {
|
|
@@ -59,12 +59,15 @@ const B = ({
|
|
|
59
59
|
display: "block",
|
|
60
60
|
mt: 0.5,
|
|
61
61
|
...e.title,
|
|
62
|
-
...
|
|
62
|
+
...h
|
|
63
63
|
},
|
|
64
|
-
children:
|
|
64
|
+
children: x
|
|
65
65
|
}
|
|
66
|
-
)
|
|
67
|
-
|
|
66
|
+
);
|
|
67
|
+
let r = n;
|
|
68
|
+
s === "fade" ? r = /* @__PURE__ */ t.jsx(v, { in: !0, timeout: 300, children: /* @__PURE__ */ t.jsx("div", { children: n }) }, i) : s === "slide" && (r = /* @__PURE__ */ t.jsx(B, { in: !0, direction: "up", timeout: 300, children: /* @__PURE__ */ t.jsx("div", { children: n }) }, i));
|
|
69
|
+
const a = /* @__PURE__ */ t.jsxs(
|
|
70
|
+
d,
|
|
68
71
|
{
|
|
69
72
|
flexDirection: "column",
|
|
70
73
|
alignItems: "center",
|
|
@@ -74,15 +77,15 @@ const B = ({
|
|
|
74
77
|
...g
|
|
75
78
|
},
|
|
76
79
|
children: [
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
r,
|
|
81
|
+
H
|
|
79
82
|
]
|
|
80
83
|
}
|
|
81
84
|
);
|
|
82
|
-
return
|
|
83
|
-
|
|
85
|
+
return u ? /* @__PURE__ */ t.jsxs(d, { alignItems: "center", children: [
|
|
86
|
+
a,
|
|
84
87
|
/* @__PURE__ */ t.jsx(
|
|
85
|
-
|
|
88
|
+
l,
|
|
86
89
|
{
|
|
87
90
|
variant: "h3",
|
|
88
91
|
sx: {
|
|
@@ -92,13 +95,13 @@ const B = ({
|
|
|
92
95
|
alignSelf: "flex-start",
|
|
93
96
|
mt: 0.5
|
|
94
97
|
},
|
|
95
|
-
children:
|
|
98
|
+
children: S
|
|
96
99
|
}
|
|
97
100
|
)
|
|
98
|
-
] }) :
|
|
101
|
+
] }) : a;
|
|
99
102
|
};
|
|
100
|
-
|
|
103
|
+
C.displayName = "SCountBox";
|
|
101
104
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
C as SCountBox,
|
|
106
|
+
C as default
|
|
104
107
|
};
|
|
@@ -3,17 +3,22 @@ import { SxProps, Theme } from '@mui/material';
|
|
|
3
3
|
/**
|
|
4
4
|
* Props interface for SCountdown component
|
|
5
5
|
*/
|
|
6
|
+
export type SCountDownSize = 'small' | 'medium' | 'large';
|
|
7
|
+
export type SCountDownColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'inherit';
|
|
8
|
+
export type SCountDownLayout = 'horizontal' | 'vertical' | 'grid';
|
|
9
|
+
export type SCountDownAnimation = 'none' | 'fade' | 'slide';
|
|
10
|
+
export type SCountDownDigitFormat = 'default' | 'padded';
|
|
6
11
|
export interface SCountDownProps {
|
|
7
12
|
/** Target date timestamp in milliseconds (from Date.getTime()) */
|
|
8
13
|
expireDate: number;
|
|
9
14
|
/** Size variant for all count boxes */
|
|
10
|
-
size?:
|
|
15
|
+
size?: SCountDownSize;
|
|
11
16
|
/** Color theme for the countdown */
|
|
12
|
-
color?:
|
|
17
|
+
color?: SCountDownColor;
|
|
13
18
|
/** Layout orientation */
|
|
14
|
-
layout?:
|
|
19
|
+
layout?: SCountDownLayout;
|
|
15
20
|
/** Animation type for value changes */
|
|
16
|
-
animation?:
|
|
21
|
+
animation?: SCountDownAnimation;
|
|
17
22
|
/** Whether to show separators between units */
|
|
18
23
|
showSeparators?: boolean;
|
|
19
24
|
/** Custom separator element */
|
|
@@ -33,7 +38,7 @@ export interface SCountDownProps {
|
|
|
33
38
|
seconds?: string;
|
|
34
39
|
};
|
|
35
40
|
/** Format for displaying digits */
|
|
36
|
-
digitFormat?:
|
|
41
|
+
digitFormat?: SCountDownDigitFormat;
|
|
37
42
|
/** Callback fired when countdown reaches zero */
|
|
38
43
|
onComplete?: () => void;
|
|
39
44
|
/** Callback fired on each tick (every second) */
|
|
@@ -57,11 +62,11 @@ export interface SCountDownProps {
|
|
|
57
62
|
paused?: boolean;
|
|
58
63
|
/** Responsive breakpoints for size changes */
|
|
59
64
|
responsive?: {
|
|
60
|
-
xs?:
|
|
61
|
-
sm?:
|
|
62
|
-
md?:
|
|
63
|
-
lg?:
|
|
64
|
-
xl?:
|
|
65
|
+
xs?: SCountDownSize;
|
|
66
|
+
sm?: SCountDownSize;
|
|
67
|
+
md?: SCountDownSize;
|
|
68
|
+
lg?: SCountDownSize;
|
|
69
|
+
xl?: SCountDownSize;
|
|
65
70
|
};
|
|
66
71
|
}
|
|
67
72
|
/**
|
|
@@ -1,155 +1,110 @@
|
|
|
1
1
|
import { j as l } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { Typography as
|
|
3
|
-
import
|
|
4
|
-
import { SFlexBox as
|
|
5
|
-
import { SCountBox as
|
|
6
|
-
const
|
|
7
|
-
expireDate:
|
|
8
|
-
size:
|
|
9
|
-
color:
|
|
10
|
-
layout:
|
|
11
|
-
animation:
|
|
12
|
-
showSeparators:
|
|
2
|
+
import { useTheme as N, useMediaQuery as m, Typography as R } from "@mui/material";
|
|
3
|
+
import W from "../hooks/use-count-down.js";
|
|
4
|
+
import { SFlexBox as p } from "../s-flex-box/s-flex-box.js";
|
|
5
|
+
import { SCountBox as F } from "./s-count-box.js";
|
|
6
|
+
const H = ({
|
|
7
|
+
expireDate: x,
|
|
8
|
+
size: n = "medium",
|
|
9
|
+
color: u = "inherit",
|
|
10
|
+
layout: c = "horizontal",
|
|
11
|
+
animation: S = "none",
|
|
12
|
+
showSeparators: y = !1,
|
|
13
13
|
separator: k = ":",
|
|
14
|
-
units:
|
|
14
|
+
units: b = {
|
|
15
15
|
days: !0,
|
|
16
16
|
hours: !0,
|
|
17
17
|
minutes: !0,
|
|
18
18
|
seconds: !0
|
|
19
19
|
},
|
|
20
|
-
labels:
|
|
20
|
+
labels: r = {
|
|
21
21
|
days: "DAYS",
|
|
22
22
|
hours: "HOURS",
|
|
23
23
|
minutes: "MINS",
|
|
24
24
|
seconds: "SECS"
|
|
25
25
|
},
|
|
26
|
-
digitFormat:
|
|
27
|
-
onComplete:
|
|
28
|
-
onTick:
|
|
29
|
-
onStart:
|
|
30
|
-
completedText:
|
|
31
|
-
autoHideZeroUnits:
|
|
32
|
-
sx:
|
|
33
|
-
"aria-label":
|
|
34
|
-
paused:
|
|
35
|
-
responsive:
|
|
26
|
+
digitFormat: j = "default",
|
|
27
|
+
onComplete: C,
|
|
28
|
+
onTick: $,
|
|
29
|
+
onStart: w,
|
|
30
|
+
completedText: i = "Time is up!",
|
|
31
|
+
autoHideZeroUnits: v = !1,
|
|
32
|
+
sx: o,
|
|
33
|
+
"aria-label": f = "Countdown timer",
|
|
34
|
+
paused: I = !1,
|
|
35
|
+
responsive: s
|
|
36
36
|
}) => {
|
|
37
|
-
const { timeLeft:
|
|
38
|
-
expireDate:
|
|
39
|
-
onComplete:
|
|
40
|
-
onTick:
|
|
41
|
-
onStart:
|
|
42
|
-
paused:
|
|
43
|
-
});
|
|
44
|
-
if (
|
|
37
|
+
const { timeLeft: e, isExpired: A } = W({
|
|
38
|
+
expireDate: x,
|
|
39
|
+
onComplete: C,
|
|
40
|
+
onTick: $,
|
|
41
|
+
onStart: w,
|
|
42
|
+
paused: I
|
|
43
|
+
}), a = N(), D = m(a.breakpoints.only("xs")), U = m(a.breakpoints.only("sm")), B = m(a.breakpoints.only("md")), E = m(a.breakpoints.only("lg")), d = s ? D ? s.xs ?? n : U ? s.sm ?? n : B ? s.md ?? n : E ? s.lg ?? n : s.xl ?? n : n;
|
|
44
|
+
if (A && i)
|
|
45
45
|
return /* @__PURE__ */ l.jsx(
|
|
46
|
-
|
|
46
|
+
p,
|
|
47
47
|
{
|
|
48
48
|
justifyContent: "center",
|
|
49
49
|
alignItems: "center",
|
|
50
|
-
sx: { textAlign: "center", ...
|
|
50
|
+
sx: { textAlign: "center", ...o },
|
|
51
51
|
role: "timer",
|
|
52
|
-
"aria-label": `${
|
|
53
|
-
children: typeof
|
|
54
|
-
|
|
52
|
+
"aria-label": `${f} - completed`,
|
|
53
|
+
children: typeof i == "string" ? /* @__PURE__ */ l.jsx(
|
|
54
|
+
R,
|
|
55
55
|
{
|
|
56
|
-
variant:
|
|
57
|
-
color:
|
|
56
|
+
variant: d === "large" ? "h4" : d === "small" ? "h6" : "h5",
|
|
57
|
+
color: u === "inherit" ? "text.primary" : `${u}.main`,
|
|
58
58
|
sx: { fontWeight: 600 },
|
|
59
|
-
children:
|
|
59
|
+
children: i
|
|
60
60
|
}
|
|
61
|
-
) :
|
|
61
|
+
) : i
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
const
|
|
65
|
-
{ key: "days", value:
|
|
66
|
-
{ key: "hours", value:
|
|
67
|
-
{ key: "minutes", value:
|
|
68
|
-
{ key: "seconds", value:
|
|
69
|
-
]
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
flexDirection: "column",
|
|
98
|
-
gap: 2,
|
|
99
|
-
alignItems: "center"
|
|
100
|
-
};
|
|
101
|
-
case "grid":
|
|
102
|
-
return {
|
|
103
|
-
display: "grid",
|
|
104
|
-
gridTemplateColumns: `repeat(${m.length}, 1fr)`,
|
|
105
|
-
gap: 2,
|
|
106
|
-
justifyItems: "center"
|
|
107
|
-
};
|
|
108
|
-
default:
|
|
109
|
-
return {
|
|
110
|
-
flexDirection: "row",
|
|
111
|
-
gap: h ? 0 : 2,
|
|
112
|
-
alignItems: "center",
|
|
113
|
-
justifyContent: "center",
|
|
114
|
-
flexWrap: "wrap"
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}, o = r ? {
|
|
118
|
-
xs: r.xs || e,
|
|
119
|
-
sm: r.sm || e,
|
|
120
|
-
md: r.md || e,
|
|
121
|
-
lg: r.lg || e,
|
|
122
|
-
xl: r.xl || e
|
|
123
|
-
} : void 0;
|
|
64
|
+
const h = [
|
|
65
|
+
{ key: "days", value: e.days, label: r.days },
|
|
66
|
+
{ key: "hours", value: e.hours, label: r.hours },
|
|
67
|
+
{ key: "minutes", value: e.minutes, label: r.minutes },
|
|
68
|
+
{ key: "seconds", value: e.seconds, label: r.seconds }
|
|
69
|
+
].filter(
|
|
70
|
+
(t) => b[t.key] && (!v || t.value > 0 || t.key === "seconds")
|
|
71
|
+
), g = h.map((t, L) => /* @__PURE__ */ l.jsx(
|
|
72
|
+
F,
|
|
73
|
+
{
|
|
74
|
+
digit: t.value,
|
|
75
|
+
title: t.label ?? "",
|
|
76
|
+
size: d,
|
|
77
|
+
color: u,
|
|
78
|
+
animation: S,
|
|
79
|
+
digitFormat: j,
|
|
80
|
+
showSeparator: y && L < h.length - 1,
|
|
81
|
+
separator: k
|
|
82
|
+
},
|
|
83
|
+
t.key
|
|
84
|
+
)), M = () => c === "vertical" ? { flexDirection: "column", gap: 2, alignItems: "center" } : c === "grid" ? {
|
|
85
|
+
display: "grid",
|
|
86
|
+
gridTemplateColumns: `repeat(${g.length}, 1fr)`,
|
|
87
|
+
gap: 2,
|
|
88
|
+
justifyItems: "center"
|
|
89
|
+
} : {
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
gap: y ? 0 : 2,
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
justifyContent: "center",
|
|
94
|
+
flexWrap: "wrap"
|
|
95
|
+
};
|
|
124
96
|
return /* @__PURE__ */ l.jsx(
|
|
125
|
-
|
|
97
|
+
p,
|
|
126
98
|
{
|
|
127
|
-
sx: {
|
|
128
|
-
width: "fit-content",
|
|
129
|
-
...E(),
|
|
130
|
-
...f,
|
|
131
|
-
...o && {
|
|
132
|
-
// Apply responsive sizing if provided
|
|
133
|
-
"@media (max-width: 600px)": {
|
|
134
|
-
"& .MuiTypography-h3": {
|
|
135
|
-
fontSize: o.xs === "small" ? "1.5rem" : o.xs === "large" ? "3.5rem" : "2.5rem"
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
"@media (min-width: 600px) and (max-width: 960px)": {
|
|
139
|
-
"& .MuiTypography-h3": {
|
|
140
|
-
fontSize: o.sm === "small" ? "1.5rem" : o.sm === "large" ? "3.5rem" : "2.5rem"
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
},
|
|
99
|
+
sx: [{ width: "fit-content" }, M() ?? {}, ...Array.isArray(o) ? o : [o]],
|
|
145
100
|
role: "timer",
|
|
146
|
-
"aria-label": `${
|
|
147
|
-
children:
|
|
101
|
+
"aria-label": `${f} - ${e.days} days, ${e.hours} hours, ${e.minutes} minutes, ${e.seconds} seconds remaining`,
|
|
102
|
+
children: g
|
|
148
103
|
}
|
|
149
104
|
);
|
|
150
105
|
};
|
|
151
|
-
|
|
106
|
+
H.displayName = "SCountdown";
|
|
152
107
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
108
|
+
H as SCountdown,
|
|
109
|
+
H as default
|
|
155
110
|
};
|