@arcblock/ux 3.0.25 → 3.0.27
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/lib/CodeBlock/index.js +70 -67
- package/lib/Config/config-provider.d.ts +1 -1
- package/lib/Config/config-provider.js +22 -20
- package/lib/NFTDisplay/preview.d.ts +11 -0
- package/lib/NFTDisplay/preview.js +60 -0
- package/lib/NavMenu/style.js +1 -1
- package/lib/RelativeTime/index.d.ts +2 -1
- package/lib/RelativeTime/index.js +88 -88
- package/lib/Tag/index.js +12 -12
- package/lib/Theme/theme-provider.d.ts +4 -2
- package/lib/Theme/theme-provider.js +83 -79
- package/package.json +7 -7
- package/src/CodeBlock/index.tsx +7 -4
- package/src/Config/config-provider.tsx +3 -1
- package/src/NFTDisplay/preview.tsx +84 -0
- package/src/NavMenu/style.ts +1 -1
- package/src/RelativeTime/index.tsx +43 -29
- package/src/Tag/index.jsx +1 -1
- package/src/Theme/Theme.stories.jsx +1 -0
- package/src/Theme/theme-provider.tsx +19 -12
package/lib/CodeBlock/index.js
CHANGED
@@ -1,88 +1,90 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as i, jsx as o, Fragment as u } from "react/jsx-runtime";
|
2
2
|
import { useState as N } from "react";
|
3
3
|
import C from "copy-to-clipboard";
|
4
4
|
import e from "highlight.js/lib/core";
|
5
|
-
import
|
6
|
-
import
|
5
|
+
import s from "highlight.js/lib/languages/javascript";
|
6
|
+
import l from "highlight.js/lib/languages/typescript";
|
7
7
|
import _ from "highlight.js/lib/languages/json";
|
8
8
|
import z from "highlight.js/lib/languages/elixir";
|
9
9
|
import F from "highlight.js/lib/languages/java";
|
10
10
|
import M from "highlight.js/lib/languages/swift";
|
11
|
-
import
|
11
|
+
import d from "highlight.js/lib/languages/objectivec";
|
12
12
|
import f from "highlight.js/lib/languages/kotlin";
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import
|
16
|
-
import
|
17
|
-
import
|
18
|
-
import
|
13
|
+
import h from "highlight.js/lib/languages/protobuf";
|
14
|
+
import x from "highlight.js/lib/languages/python";
|
15
|
+
import y from "highlight.js/lib/languages/yaml";
|
16
|
+
import L from "highlight.js/lib/languages/shell";
|
17
|
+
import b from "highlight.js/lib/languages/diff";
|
18
|
+
import w from "highlight.js/lib/languages/plaintext";
|
19
19
|
import B from "highlight.js/lib/languages/markdown";
|
20
20
|
import "highlight.js/styles/atom-one-dark.css";
|
21
|
-
import { FileCopy as
|
22
|
-
import
|
23
|
-
import { styled as
|
24
|
-
import
|
25
|
-
e.registerLanguage("javascript",
|
26
|
-
e.registerLanguage("js",
|
27
|
-
e.registerLanguage("jsx",
|
28
|
-
e.registerLanguage("typescript",
|
29
|
-
e.registerLanguage("ts",
|
30
|
-
e.registerLanguage("tsx",
|
21
|
+
import { FileCopy as P, Check as S } from "@mui/icons-material";
|
22
|
+
import t from "../Colors/themes/default.js";
|
23
|
+
import { styled as T } from "../Theme/index.js";
|
24
|
+
import A from "./LightBox.js";
|
25
|
+
e.registerLanguage("javascript", s);
|
26
|
+
e.registerLanguage("js", s);
|
27
|
+
e.registerLanguage("jsx", s);
|
28
|
+
e.registerLanguage("typescript", l);
|
29
|
+
e.registerLanguage("ts", l);
|
30
|
+
e.registerLanguage("tsx", l);
|
31
31
|
e.registerLanguage("json", _);
|
32
32
|
e.registerLanguage("elixir", z);
|
33
33
|
e.registerLanguage("java", F);
|
34
34
|
e.registerLanguage("kotlin", f);
|
35
35
|
e.registerLanguage("kt", f);
|
36
|
-
e.registerLanguage("protobuf",
|
37
|
-
e.registerLanguage("protobuffer",
|
38
|
-
e.registerLanguage("python",
|
39
|
-
e.registerLanguage("py",
|
40
|
-
e.registerLanguage("yaml",
|
41
|
-
e.registerLanguage("yml",
|
42
|
-
e.registerLanguage("shell",
|
43
|
-
e.registerLanguage("sh",
|
44
|
-
e.registerLanguage("plaintext",
|
45
|
-
e.registerLanguage("text",
|
46
|
-
e.registerLanguage("patch",
|
47
|
-
e.registerLanguage("diff",
|
36
|
+
e.registerLanguage("protobuf", h);
|
37
|
+
e.registerLanguage("protobuffer", h);
|
38
|
+
e.registerLanguage("python", x);
|
39
|
+
e.registerLanguage("py", x);
|
40
|
+
e.registerLanguage("yaml", y);
|
41
|
+
e.registerLanguage("yml", y);
|
42
|
+
e.registerLanguage("shell", L);
|
43
|
+
e.registerLanguage("sh", L);
|
44
|
+
e.registerLanguage("plaintext", w);
|
45
|
+
e.registerLanguage("text", w);
|
46
|
+
e.registerLanguage("patch", b);
|
47
|
+
e.registerLanguage("diff", b);
|
48
48
|
e.registerLanguage("swift", M);
|
49
|
-
e.registerLanguage("objectivec",
|
50
|
-
e.registerLanguage("oc",
|
49
|
+
e.registerLanguage("objectivec", d);
|
50
|
+
e.registerLanguage("oc", d);
|
51
51
|
e.registerLanguage("markdown", B);
|
52
|
-
function
|
53
|
-
code:
|
54
|
-
language:
|
52
|
+
function le({
|
53
|
+
code: r = "",
|
54
|
+
language: a = "text",
|
55
55
|
children: k = null,
|
56
56
|
dark: j = !0,
|
57
57
|
...v
|
58
58
|
}) {
|
59
|
-
const [g,
|
60
|
-
g || (C(
|
61
|
-
|
59
|
+
const [g, p] = N(!1), c = r || k, $ = () => {
|
60
|
+
g || (C(c), p(!0), setTimeout(() => {
|
61
|
+
p(!1);
|
62
62
|
}, 1500));
|
63
|
-
}, m = /* @__PURE__ */
|
64
|
-
/* @__PURE__ */
|
63
|
+
}, m = /* @__PURE__ */ i(E, { ...v, children: [
|
64
|
+
/* @__PURE__ */ o("span", { className: "codeblock__inner", children: /* @__PURE__ */ o(
|
65
65
|
"code",
|
66
66
|
{
|
67
|
-
className: `hljs ${
|
68
|
-
dangerouslySetInnerHTML: { __html: e.highlightAuto(
|
67
|
+
className: `hljs ${a}`,
|
68
|
+
dangerouslySetInnerHTML: { __html: e.highlightAuto(c, [a]).value }
|
69
69
|
}
|
70
70
|
) }),
|
71
|
-
/* @__PURE__ */
|
72
|
-
/* @__PURE__ */
|
73
|
-
/* @__PURE__ */
|
74
|
-
/* @__PURE__ */
|
75
|
-
/* @__PURE__ */
|
76
|
-
] }) : /* @__PURE__ */
|
77
|
-
/* @__PURE__ */
|
78
|
-
/* @__PURE__ */
|
71
|
+
/* @__PURE__ */ i("div", { className: "copy-button", onClick: $, children: [
|
72
|
+
/* @__PURE__ */ o("span", { className: "default-text", children: a }),
|
73
|
+
/* @__PURE__ */ o("span", { className: "hover-text", children: g ? /* @__PURE__ */ i(u, { children: [
|
74
|
+
/* @__PURE__ */ o(S, { className: "copy-icon" }),
|
75
|
+
/* @__PURE__ */ o("span", { className: "button-lang-text", children: "copied" })
|
76
|
+
] }) : /* @__PURE__ */ i(u, { children: [
|
77
|
+
/* @__PURE__ */ o(P, { className: "copy-icon" }),
|
78
|
+
/* @__PURE__ */ o("span", { className: "button-lang-text", children: "copy" })
|
79
79
|
] }) })
|
80
80
|
] })
|
81
81
|
] });
|
82
|
-
return j ? m : /* @__PURE__ */
|
82
|
+
return j ? m : /* @__PURE__ */ o(A, { children: m });
|
83
83
|
}
|
84
|
-
const
|
85
|
-
|
84
|
+
const n = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important", E = T("pre", {
|
85
|
+
shouldForwardProp: (r) => r !== "sx"
|
86
|
+
})`
|
87
|
+
font-family: ${n};
|
86
88
|
display: block;
|
87
89
|
font-size: 14px;
|
88
90
|
line-height: 1.42857143;
|
@@ -91,9 +93,10 @@ const a = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !imp
|
|
91
93
|
word-wrap: break-word;
|
92
94
|
text-align: left;
|
93
95
|
border-radius: 5px;
|
94
|
-
border: 1px solid
|
95
|
-
|
96
|
-
|
96
|
+
border: 1px solid;
|
97
|
+
border-color: ${({ theme: r }) => r.palette.divider};
|
98
|
+
background: ${({ theme: r }) => r.palette.background.default};
|
99
|
+
color: ${({ theme: r }) => r.palette.common.white};
|
97
100
|
position: relative;
|
98
101
|
|
99
102
|
.codeblock__inner {
|
@@ -120,7 +123,7 @@ const a = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !imp
|
|
120
123
|
|
121
124
|
.copy-icon {
|
122
125
|
font-size: 16px;
|
123
|
-
color: ${
|
126
|
+
color: ${t.common.white};
|
124
127
|
}
|
125
128
|
|
126
129
|
.hover-text {
|
@@ -128,20 +131,20 @@ const a = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !imp
|
|
128
131
|
}
|
129
132
|
.default-text {
|
130
133
|
font-size: 12px;
|
131
|
-
color: ${
|
134
|
+
color: ${t.common.white};
|
132
135
|
}
|
133
136
|
}
|
134
137
|
|
135
138
|
&:hover {
|
136
139
|
.copy-button {
|
137
140
|
display: flex;
|
138
|
-
background: ${
|
141
|
+
background: ${t.primary.main};
|
139
142
|
|
140
143
|
.hover-text {
|
141
144
|
display: flex;
|
142
145
|
justify-content: center;
|
143
146
|
align-items: center;
|
144
|
-
color: ${
|
147
|
+
color: ${t.common.white};
|
145
148
|
}
|
146
149
|
.default-text {
|
147
150
|
display: none;
|
@@ -153,17 +156,17 @@ const a = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !imp
|
|
153
156
|
.button-lang-text {
|
154
157
|
margin-left: 4px;
|
155
158
|
font-size: 12px;
|
156
|
-
color: ${
|
159
|
+
color: ${t.common.white};
|
157
160
|
}
|
158
161
|
|
159
162
|
code {
|
160
163
|
counter-reset: line;
|
161
164
|
counter-increment: line;
|
162
165
|
padding: 16px;
|
163
|
-
font-family: ${
|
164
|
-
color: ${
|
166
|
+
font-family: ${n};
|
167
|
+
color: ${t.common.white};
|
165
168
|
* {
|
166
|
-
font-family: ${
|
169
|
+
font-family: ${n};
|
167
170
|
}
|
168
171
|
}
|
169
172
|
|
@@ -172,5 +175,5 @@ const a = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !imp
|
|
172
175
|
}
|
173
176
|
`;
|
174
177
|
export {
|
175
|
-
|
178
|
+
le as default
|
176
179
|
};
|
@@ -8,7 +8,7 @@ export interface ConfigProviderProps extends Omit<LocaleProviderProps, 'translat
|
|
8
8
|
/**
|
9
9
|
* 集中化配置
|
10
10
|
*/
|
11
|
-
export declare function ConfigProvider({ children, theme, injectFirst, darkSchemeClass, prefer, disableBlockletTheme, enableColorScheme, locale, fallbackLocale, translations, languages, onLoadingTranslation, }: ConfigProviderProps): import("react/jsx-runtime").JSX.Element;
|
11
|
+
export declare function ConfigProvider({ children, theme, injectFirst, darkSchemeClass, prefer, disableBlockletTheme, enableColorScheme, disableStyleCache, locale, fallbackLocale, translations, languages, onLoadingTranslation, }: ConfigProviderProps): import("react/jsx-runtime").JSX.Element;
|
12
12
|
export declare function useConfig(): {
|
13
13
|
mode: import('@mui/material').PaletteMode;
|
14
14
|
toggleMode: () => void;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
2
|
-
import { LocaleProvider as
|
3
|
-
import
|
4
|
-
import { useTheme as
|
2
|
+
import { LocaleProvider as C, useLocaleContext as x } from "../Locale/context.js";
|
3
|
+
import a, { useColorScheme as d } from "../Theme/theme-provider.js";
|
4
|
+
import { useTheme as v } from "@mui/material";
|
5
5
|
import "../Theme/theme.js";
|
6
|
-
function
|
6
|
+
function j({
|
7
7
|
children: o,
|
8
8
|
// theme provider
|
9
9
|
theme: e,
|
@@ -12,15 +12,16 @@ function T({
|
|
12
12
|
prefer: i,
|
13
13
|
disableBlockletTheme: n = !1,
|
14
14
|
enableColorScheme: c,
|
15
|
+
disableStyleCache: f,
|
15
16
|
// locale provider
|
16
|
-
locale:
|
17
|
-
fallbackLocale:
|
18
|
-
translations:
|
19
|
-
languages:
|
20
|
-
onLoadingTranslation:
|
17
|
+
locale: s,
|
18
|
+
fallbackLocale: l,
|
19
|
+
translations: u = {},
|
20
|
+
languages: h,
|
21
|
+
onLoadingTranslation: p
|
21
22
|
}) {
|
22
23
|
return /* @__PURE__ */ t(
|
23
|
-
|
24
|
+
a,
|
24
25
|
{
|
25
26
|
theme: e,
|
26
27
|
injectFirst: r,
|
@@ -28,22 +29,23 @@ function T({
|
|
28
29
|
prefer: i,
|
29
30
|
disableBlockletTheme: n,
|
30
31
|
enableColorScheme: c,
|
32
|
+
disableStyleCache: f,
|
31
33
|
children: /* @__PURE__ */ t(
|
32
|
-
|
34
|
+
C,
|
33
35
|
{
|
34
|
-
locale:
|
35
|
-
fallbackLocale:
|
36
|
-
translations:
|
37
|
-
onLoadingTranslation:
|
38
|
-
languages:
|
36
|
+
locale: s,
|
37
|
+
fallbackLocale: l,
|
38
|
+
translations: u,
|
39
|
+
onLoadingTranslation: p,
|
40
|
+
languages: h,
|
39
41
|
children: o
|
40
42
|
}
|
41
43
|
)
|
42
44
|
}
|
43
45
|
);
|
44
46
|
}
|
45
|
-
function
|
46
|
-
const o =
|
47
|
+
function b() {
|
48
|
+
const o = v(), e = x(), r = d();
|
47
49
|
return {
|
48
50
|
theme: o,
|
49
51
|
...e,
|
@@ -51,6 +53,6 @@ function j() {
|
|
51
53
|
};
|
52
54
|
}
|
53
55
|
export {
|
54
|
-
|
55
|
-
|
56
|
+
j as ConfigProvider,
|
57
|
+
b as useConfig
|
56
58
|
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export interface NftInfo {
|
2
|
+
address: string;
|
3
|
+
data: Record<string, any>;
|
4
|
+
display: Record<string, any>;
|
5
|
+
issuer: string;
|
6
|
+
}
|
7
|
+
export default function NftPreview({ visible, onClose, nft, }: {
|
8
|
+
visible: boolean;
|
9
|
+
onClose: () => void;
|
10
|
+
nft: NftInfo | null;
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
2
|
+
import n from "@mui/material/Modal";
|
3
|
+
import r from "@emotion/styled";
|
4
|
+
import a, { getNFTData as s } from "./index.js";
|
5
|
+
function f({
|
6
|
+
visible: e,
|
7
|
+
onClose: o,
|
8
|
+
nft: i
|
9
|
+
}) {
|
10
|
+
return !e || !i ? null : /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(n, { open: e, onClose: o, children: /* @__PURE__ */ t(h, { onClick: o, children: /* @__PURE__ */ t(a, { data: s(i), address: i.address, inset: !0 }) }) }) });
|
11
|
+
}
|
12
|
+
const d = r.div`
|
13
|
+
position: relative;
|
14
|
+
width: 100%;
|
15
|
+
height: 100%;
|
16
|
+
cursor: pointer;
|
17
|
+
|
18
|
+
&:hover {
|
19
|
+
.mask {
|
20
|
+
opacity: 1;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.mask {
|
25
|
+
position: absolute;
|
26
|
+
top: 0;
|
27
|
+
left: 0;
|
28
|
+
display: flex;
|
29
|
+
align-items: center;
|
30
|
+
justify-content: center;
|
31
|
+
width: 100%;
|
32
|
+
height: 100%;
|
33
|
+
background: rgba(0, 0, 0, 0.6);
|
34
|
+
opacity: 0;
|
35
|
+
transition: opacity 0.2s;
|
36
|
+
}
|
37
|
+
`, h = r.div`
|
38
|
+
display: flex;
|
39
|
+
justify-content: center;
|
40
|
+
align-items: center;
|
41
|
+
height: 100vh;
|
42
|
+
width: 100vw;
|
43
|
+
|
44
|
+
img,
|
45
|
+
object {
|
46
|
+
max-width: 90vw;
|
47
|
+
max-height: 75vh;
|
48
|
+
}
|
49
|
+
|
50
|
+
.nft-display--inset {
|
51
|
+
> .MuiBox-root,
|
52
|
+
.nft-display__loading {
|
53
|
+
width: 75vmin;
|
54
|
+
height: 75vmin;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
`;
|
58
|
+
export {
|
59
|
+
f as default
|
60
|
+
};
|
package/lib/NavMenu/style.js
CHANGED
@@ -15,5 +15,6 @@ export interface RelativeTimeProps {
|
|
15
15
|
placement?: TooltipProps['placement'];
|
16
16
|
sx?: SxProps;
|
17
17
|
format?: string;
|
18
|
+
mode?: 'all' | 'daysLeft';
|
18
19
|
}
|
19
|
-
export default function RelativeTime({ value, locale, withoutSuffix, from, to, type, tz, relativeRange, enableTooltip, useShortTimezone, disableTimezone, placement, format, ...rest }: RelativeTimeProps): import("react/jsx-runtime").JSX.Element;
|
20
|
+
export default function RelativeTime({ value, locale, withoutSuffix, from, to, type, tz, relativeRange, enableTooltip, useShortTimezone, disableTimezone, placement, format, mode, ...rest }: RelativeTimeProps): import("react/jsx-runtime").JSX.Element;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { jsxs as I, jsx as n, Fragment as F } from "react/jsx-runtime";
|
2
|
+
import { Box as a, Tooltip as M } from "@mui/material";
|
3
3
|
import { useEffect as R, useMemo as $ } from "react";
|
4
|
-
import
|
4
|
+
import c from "dayjs";
|
5
5
|
import "dayjs/locale/zh-cn";
|
6
6
|
import k from "dayjs/plugin/utc";
|
7
7
|
import B from "dayjs/plugin/timezone";
|
@@ -9,13 +9,13 @@ import E from "dayjs/plugin/relativeTime";
|
|
9
9
|
import H from "dayjs/plugin/updateLocale";
|
10
10
|
import N from "dayjs/plugin/localizedFormat";
|
11
11
|
import { create as Z } from "zustand";
|
12
|
-
import { formatToDatetime as
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
import { formatToDatetime as O, setDateTool as q } from "../Util/index.js";
|
13
|
+
c.extend(N);
|
14
|
+
c.extend(k);
|
15
|
+
c.extend(B);
|
16
|
+
c.extend(H);
|
17
|
+
c.extend(E);
|
18
|
+
c.updateLocale("zh-cn", {
|
19
19
|
// copy with https://github.com/iamkun/dayjs/blob/dev/src/locale/zh-cn.js
|
20
20
|
relativeTime: {
|
21
21
|
future: "%s后",
|
@@ -33,7 +33,7 @@ r.updateLocale("zh-cn", {
|
|
33
33
|
yy: "%d 年"
|
34
34
|
}
|
35
35
|
});
|
36
|
-
q(
|
36
|
+
q(c);
|
37
37
|
const j = {
|
38
38
|
en: {
|
39
39
|
utc: "UTC Timezone",
|
@@ -47,123 +47,123 @@ const j = {
|
|
47
47
|
shortUTC: "UTC",
|
48
48
|
shortLocal: "当前时区"
|
49
49
|
}
|
50
|
-
},
|
50
|
+
}, A = Z((t) => ({
|
51
51
|
isUtc: !1,
|
52
|
-
setIsUtc: (
|
52
|
+
setIsUtc: (o) => t({ isUtc: o })
|
53
53
|
}));
|
54
54
|
function w({
|
55
55
|
value: t,
|
56
|
-
locale:
|
57
|
-
withoutSuffix:
|
58
|
-
from:
|
59
|
-
to:
|
60
|
-
type:
|
61
|
-
tz:
|
62
|
-
relativeRange:
|
63
|
-
format:
|
56
|
+
locale: o = "en",
|
57
|
+
withoutSuffix: p = !1,
|
58
|
+
from: d = "",
|
59
|
+
to: u = "",
|
60
|
+
type: i = "relative",
|
61
|
+
tz: l,
|
62
|
+
relativeRange: y,
|
63
|
+
format: U
|
64
64
|
}) {
|
65
|
-
const
|
65
|
+
const x = (/* @__PURE__ */ new Date()).getTimezoneOffset(), C = x > 0 ? "-" : "+", v = Math.abs(x) / 60, g = x === 0, r = A((L) => L.isUtc), T = A((L) => L.setIsUtc);
|
66
66
|
if (R(() => {
|
67
|
-
T(
|
68
|
-
}, [
|
69
|
-
return { innerContent: "-", popContent: "-", isUtc:
|
70
|
-
const
|
71
|
-
let
|
72
|
-
|
73
|
-
const
|
74
|
-
let
|
75
|
-
if (
|
76
|
-
|
77
|
-
else if (
|
78
|
-
|
79
|
-
else if (
|
80
|
-
const
|
81
|
-
Math.abs(
|
67
|
+
T(g);
|
68
|
+
}, [g]), !t)
|
69
|
+
return { innerContent: "-", popContent: "-", isUtc: r, setIsUtc: T, sign: C, hoursOffset: v };
|
70
|
+
const m = o === "zh" ? "zh-cn" : "en-us";
|
71
|
+
let s = c(t).locale(m);
|
72
|
+
i === "utc" && (s = c(t).utc().locale(m)), l && (s = s.tz(l));
|
73
|
+
const f = O(t, { locale: m, tz: l, format: U });
|
74
|
+
let e;
|
75
|
+
if (d)
|
76
|
+
e = s.from(d, p);
|
77
|
+
else if (u)
|
78
|
+
e = s.to(u, p);
|
79
|
+
else if (y) {
|
80
|
+
const L = s.diff(c());
|
81
|
+
Math.abs(L) > y && (e = f);
|
82
82
|
}
|
83
|
-
|
84
|
-
let
|
85
|
-
return
|
83
|
+
e || (e = s.fromNow(p));
|
84
|
+
let h = e, b = f;
|
85
|
+
return i === "absolute" && (h = f, b = e), i === "utc" && (r ? (h = O(t, { locale: m, tz: l, isUtc: !0, format: U }), b = O(t, { locale: m, tz: l, isUtc: !0, format: U })) : (h = f, b = e)), { innerContent: h, popContent: b, isUtc: r, setIsUtc: T, sign: C, hoursOffset: v, relativeString: e, absoluteString: f };
|
86
86
|
}
|
87
|
-
function
|
87
|
+
function z({
|
88
88
|
locale: t,
|
89
|
-
isUtc:
|
90
|
-
setIsUtc:
|
91
|
-
useShortTimezone:
|
89
|
+
isUtc: o = !1,
|
90
|
+
setIsUtc: p,
|
91
|
+
useShortTimezone: d = !0
|
92
92
|
}) {
|
93
|
-
const
|
94
|
-
const
|
95
|
-
return
|
96
|
-
}, [t,
|
97
|
-
return /* @__PURE__ */
|
98
|
-
|
93
|
+
const u = $(() => {
|
94
|
+
const i = d ? "shortUTC" : "utc", l = d ? "shortLocal" : "local";
|
95
|
+
return o ? `${j[t][i]}` : `${j[t][l]}`;
|
96
|
+
}, [t, d, o]);
|
97
|
+
return /* @__PURE__ */ n(
|
98
|
+
a,
|
99
99
|
{
|
100
100
|
component: "span",
|
101
101
|
sx: {
|
102
102
|
color: "inherit",
|
103
103
|
cursor: "pointer",
|
104
104
|
border: "1px solid",
|
105
|
-
fontSize: "0.8rem",
|
106
105
|
borderColor: "divider",
|
107
106
|
borderRadius: "20px",
|
108
107
|
padding: "4px 8px",
|
109
108
|
lineHeight: 1
|
110
109
|
},
|
111
|
-
onClick: () =>
|
112
|
-
children:
|
110
|
+
onClick: () => p(!o),
|
111
|
+
children: u
|
113
112
|
}
|
114
113
|
);
|
115
114
|
}
|
116
115
|
function et({
|
117
116
|
value: t,
|
118
|
-
locale:
|
119
|
-
withoutSuffix:
|
120
|
-
from:
|
121
|
-
to:
|
122
|
-
type:
|
123
|
-
tz:
|
124
|
-
relativeRange:
|
125
|
-
enableTooltip:
|
126
|
-
useShortTimezone:
|
127
|
-
disableTimezone:
|
128
|
-
placement:
|
117
|
+
locale: o = "en",
|
118
|
+
withoutSuffix: p = !1,
|
119
|
+
from: d = "",
|
120
|
+
to: u = "",
|
121
|
+
type: i = "relative",
|
122
|
+
tz: l = void 0,
|
123
|
+
relativeRange: y = void 0,
|
124
|
+
enableTooltip: U = !0,
|
125
|
+
useShortTimezone: D = !1,
|
126
|
+
disableTimezone: x = !1,
|
127
|
+
placement: C = "top-end",
|
129
128
|
format: v = "lll",
|
130
|
-
|
129
|
+
mode: g = "all",
|
130
|
+
...r
|
131
131
|
}) {
|
132
|
-
const { innerContent:
|
132
|
+
const { innerContent: T, popContent: m, isUtc: s, setIsUtc: f, relativeString: e } = w({
|
133
133
|
value: t,
|
134
|
-
locale:
|
135
|
-
withoutSuffix:
|
136
|
-
from:
|
137
|
-
to:
|
138
|
-
type:
|
139
|
-
tz:
|
140
|
-
relativeRange:
|
134
|
+
locale: o,
|
135
|
+
withoutSuffix: p,
|
136
|
+
from: d,
|
137
|
+
to: u,
|
138
|
+
type: i === "all" ? "utc" : i,
|
139
|
+
tz: l,
|
140
|
+
relativeRange: y,
|
141
141
|
format: v
|
142
|
-
})
|
143
|
-
|
144
|
-
f,
|
142
|
+
}), h = /* @__PURE__ */ I(
|
143
|
+
a,
|
145
144
|
{
|
146
|
-
...
|
145
|
+
...r,
|
147
146
|
sx: [
|
148
147
|
{
|
149
148
|
display: "inline-flex",
|
150
149
|
alignItems: "center",
|
151
150
|
gap: 0.5
|
152
151
|
},
|
153
|
-
...Array.isArray(
|
152
|
+
...Array.isArray(r.sx) ? r.sx : [r.sx]
|
154
153
|
],
|
155
154
|
children: [
|
156
|
-
/* @__PURE__ */
|
157
|
-
/* @__PURE__ */
|
158
|
-
/* @__PURE__ */
|
159
|
-
!
|
160
|
-
/* @__PURE__ */
|
161
|
-
/* @__PURE__ */
|
155
|
+
/* @__PURE__ */ n(a, { component: "span", ...r, sx: {}, children: T }),
|
156
|
+
/* @__PURE__ */ n(a, { component: "span", sx: { color: "inherit" }, children: "·" }),
|
157
|
+
/* @__PURE__ */ n(a, { component: "span", sx: { color: "inherit" }, children: e }),
|
158
|
+
!x && /* @__PURE__ */ I(F, { children: [
|
159
|
+
/* @__PURE__ */ n(a, { component: "span", sx: { color: "inherit" }, children: "·" }),
|
160
|
+
/* @__PURE__ */ n(z, { locale: o, isUtc: s, setIsUtc: f, useShortTimezone: D })
|
162
161
|
] })
|
163
162
|
]
|
164
163
|
}
|
165
|
-
)
|
166
|
-
|
164
|
+
);
|
165
|
+
return g === "daysLeft" ? /* @__PURE__ */ n(M, { title: h, placement: C, enterTouchDelay: 0, children: /* @__PURE__ */ n(a, { component: "span", children: e }) }) : i === "all" && g === "all" ? /* @__PURE__ */ n(M, { title: void 0, placement: C, enterTouchDelay: 0, children: h }) : /* @__PURE__ */ n(M, { title: U ? m : void 0, placement: C, enterTouchDelay: 0, children: /* @__PURE__ */ I(
|
166
|
+
a,
|
167
167
|
{
|
168
168
|
sx: {
|
169
169
|
display: "inline-flex",
|
@@ -171,8 +171,8 @@ function et({
|
|
171
171
|
gap: 1
|
172
172
|
},
|
173
173
|
children: [
|
174
|
-
/* @__PURE__ */
|
175
|
-
|
174
|
+
/* @__PURE__ */ n(a, { component: "span", ...r, children: T }),
|
175
|
+
i === "utc" && !x && /* @__PURE__ */ n(z, { locale: o, isUtc: s, setIsUtc: f, useShortTimezone: D })
|
176
176
|
]
|
177
177
|
}
|
178
178
|
) });
|