@bioturing/components 0.43.0 → 0.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/style.css +1 -1
- package/dist/components/dialog/Dialog.d.ts +53 -0
- package/dist/components/dialog/Dialog.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.js +231 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/constants.d.ts +20 -0
- package/dist/components/dialog/constants.d.ts.map +1 -0
- package/dist/components/dialog/constants.js +20 -0
- package/dist/components/dialog/constants.js.map +1 -0
- package/dist/components/dialog/dialog.css +1 -0
- package/dist/components/dialog/index.d.ts +4 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/index.js +8 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/ds-root/component.d.ts.map +1 -1
- package/dist/components/ds-root/component.js +16 -14
- package/dist/components/ds-root/component.js.map +1 -1
- package/dist/components/icon-button/style.css +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notification/NotificationProvider.d.ts +6 -0
- package/dist/components/notification/NotificationProvider.d.ts.map +1 -0
- package/dist/components/notification/NotificationProvider.js +67 -0
- package/dist/components/notification/NotificationProvider.js.map +1 -0
- package/dist/components/notification/NotificationService.d.ts +35 -0
- package/dist/components/notification/NotificationService.d.ts.map +1 -0
- package/dist/components/notification/NotificationService.js +26 -0
- package/dist/components/notification/NotificationService.js.map +1 -0
- package/dist/components/notification/functions.d.ts +11 -0
- package/dist/components/notification/functions.d.ts.map +1 -0
- package/dist/components/notification/functions.js +38 -0
- package/dist/components/notification/functions.js.map +1 -0
- package/dist/components/notification/index.d.ts +11 -0
- package/dist/components/notification/index.d.ts.map +1 -0
- package/dist/components/notification/index.js +27 -0
- package/dist/components/notification/index.js.map +1 -0
- package/dist/components/notification/style.css +1 -0
- package/dist/components/notification/themedNotificationConfig.d.ts +5 -0
- package/dist/components/notification/themedNotificationConfig.d.ts.map +1 -0
- package/dist/components/notification/themedNotificationConfig.js +34 -0
- package/dist/components/notification/themedNotificationConfig.js.map +1 -0
- package/dist/components/notification/useNotification.d.ts +3 -0
- package/dist/components/notification/useNotification.d.ts.map +1 -0
- package/dist/components/notification/useNotification.js +25 -0
- package/dist/components/notification/useNotification.js.map +1 -0
- package/dist/components/popup-panel/component.d.ts.map +1 -1
- package/dist/components/popup-panel/component.js +184 -182
- package/dist/components/popup-panel/component.js.map +1 -1
- package/dist/components/select-trigger/style.css +1 -1
- package/dist/components/spin/Indicator/Looper.d.ts +6 -0
- package/dist/components/spin/Indicator/Looper.d.ts.map +1 -0
- package/dist/components/spin/Indicator/Looper.js +15 -0
- package/dist/components/spin/Indicator/Looper.js.map +1 -0
- package/dist/components/spin/Indicator/Progress.d.ts +6 -0
- package/dist/components/spin/Indicator/Progress.d.ts.map +1 -0
- package/dist/components/spin/Indicator/Progress.js +59 -0
- package/dist/components/spin/Indicator/Progress.js.map +1 -0
- package/dist/components/spin/Indicator/index.d.ts +8 -0
- package/dist/components/spin/Indicator/index.d.ts.map +1 -0
- package/dist/components/spin/Indicator/index.js +20 -0
- package/dist/components/spin/Indicator/index.js.map +1 -0
- package/dist/components/spin/component.d.ts +28 -4
- package/dist/components/spin/component.d.ts.map +1 -1
- package/dist/components/spin/component.js +162 -14
- package/dist/components/spin/component.js.map +1 -1
- package/dist/components/spin/style.css +1 -1
- package/dist/components/spin/usePercent.d.ts +2 -0
- package/dist/components/spin/usePercent.d.ts.map +1 -0
- package/dist/components/spin/usePercent.js +27 -0
- package/dist/components/spin/usePercent.js.map +1 -0
- package/dist/components/theme-provider/style.css +1 -1
- package/dist/components/tour/style.css +1 -1
- package/dist/components/utils/cn.d.ts.map +1 -1
- package/dist/components/utils/cn.js +112 -20
- package/dist/components/utils/cn.js.map +1 -1
- package/dist/components/utils/theme.d.ts.map +1 -1
- package/dist/components/utils/theme.js +3 -1
- package/dist/components/utils/theme.js.map +1 -1
- package/dist/index.js +267 -253
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +29 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +50 -1
- package/dist/metadata.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/tokens/and-theme/tokens.d.ts.map +1 -1
- package/dist/tokens/and-theme/tokens.js +61 -56
- package/dist/tokens/and-theme/tokens.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../../../src/components/spin/Indicator/Progress.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AA6BD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,aAAa,2CAgDrE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
import g from "rc-util/es/hooks/useLayoutEffect";
|
|
4
|
+
import * as C from "react";
|
|
5
|
+
import { clsx as m } from "../../utils/cn.js";
|
|
6
|
+
const o = 100, d = o / 5, f = o / 2 - d / 2, c = f * 2 * Math.PI, l = 50, u = ({ dotClassName: e, style: a, hasCircleBackground: s }) => /* @__PURE__ */ t(
|
|
7
|
+
"circle",
|
|
8
|
+
{
|
|
9
|
+
className: m(`${e}-circle`, {
|
|
10
|
+
[`${e}-circle-bg`]: s
|
|
11
|
+
}),
|
|
12
|
+
r: f,
|
|
13
|
+
cx: l,
|
|
14
|
+
cy: l,
|
|
15
|
+
strokeWidth: d,
|
|
16
|
+
style: a
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
function v({ percent: e, prefixCls: a }) {
|
|
20
|
+
const s = `${a}-dot`, n = `${s}-holder`, h = `${n}-hidden`, [$, x] = C.useState(!1), i = e !== 0;
|
|
21
|
+
g(() => {
|
|
22
|
+
i && x(!0);
|
|
23
|
+
}, [i]);
|
|
24
|
+
const r = Number.isFinite(e) ? Math.max(Math.min(e, 100), 0) : 0;
|
|
25
|
+
if (!$)
|
|
26
|
+
return null;
|
|
27
|
+
const I = {
|
|
28
|
+
strokeDashoffset: `${c / 4}`,
|
|
29
|
+
strokeDasharray: `${c * r / 100} ${c * (100 - r) / 100}`
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ t(
|
|
32
|
+
"span",
|
|
33
|
+
{
|
|
34
|
+
className: m(
|
|
35
|
+
n,
|
|
36
|
+
`${s}-progress`,
|
|
37
|
+
r <= 0 && h
|
|
38
|
+
),
|
|
39
|
+
children: /* @__PURE__ */ R(
|
|
40
|
+
"svg",
|
|
41
|
+
{
|
|
42
|
+
viewBox: `0 0 ${o} ${o}`,
|
|
43
|
+
role: "progressbar",
|
|
44
|
+
"aria-valuemin": 0,
|
|
45
|
+
"aria-valuemax": 100,
|
|
46
|
+
"aria-valuenow": r,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ t(u, { dotClassName: s, hasCircleBackground: !0 }),
|
|
49
|
+
/* @__PURE__ */ t(u, { dotClassName: s, style: I })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
v as default
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../../../src/components/spin/Indicator/Progress.tsx"],"sourcesContent":["\"use client\";\n\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport * as React from \"react\";\nimport { clsx } from \"../../utils\";\n\nexport interface ProgressProps {\n prefixCls: string;\n percent: number;\n}\n\nconst VIEW_SIZE = 100;\nconst BORDER_WIDTH = VIEW_SIZE / 5;\nconst RADIUS = VIEW_SIZE / 2 - BORDER_WIDTH / 2;\nconst CIRCUMFERENCE = RADIUS * 2 * Math.PI;\nconst POSITION = 50;\n\ninterface CircleProps {\n dotClassName: string;\n style?: React.CSSProperties;\n hasCircleBackground?: boolean;\n}\n\nconst Circle = ({ dotClassName, style, hasCircleBackground }: CircleProps) => {\n return (\n <circle\n className={clsx(`${dotClassName}-circle`, {\n [`${dotClassName}-circle-bg`]: hasCircleBackground,\n })}\n r={RADIUS}\n cx={POSITION}\n cy={POSITION}\n strokeWidth={BORDER_WIDTH}\n style={style}\n />\n );\n};\n\nexport default function Progress({ percent, prefixCls }: ProgressProps) {\n const dotClassName = `${prefixCls}-dot`;\n const holderClassName = `${dotClassName}-holder`;\n const hideClassName = `${holderClassName}-hidden`;\n const [render, setRender] = React.useState(false);\n const shouldRenderProgress = percent !== 0;\n\n useLayoutEffect(() => {\n if (shouldRenderProgress) {\n setRender(true);\n }\n }, [shouldRenderProgress]);\n\n const safePercent = Number.isFinite(percent)\n ? Math.max(Math.min(percent, 100), 0)\n : 0;\n\n if (!render) {\n return null;\n }\n\n const circleStyle: React.CSSProperties = {\n strokeDashoffset: `${CIRCUMFERENCE / 4}`,\n strokeDasharray: `${(CIRCUMFERENCE * safePercent) / 100} ${\n (CIRCUMFERENCE * (100 - safePercent)) / 100\n }`,\n };\n\n return (\n <span\n className={clsx(\n holderClassName,\n `${dotClassName}-progress`,\n safePercent <= 0 && hideClassName,\n )}\n >\n <svg\n viewBox={`0 0 ${VIEW_SIZE} ${VIEW_SIZE}`}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={safePercent}\n >\n <Circle dotClassName={dotClassName} hasCircleBackground />\n <Circle dotClassName={dotClassName} style={circleStyle} />\n </svg>\n </span>\n );\n}\n"],"names":["VIEW_SIZE","BORDER_WIDTH","RADIUS","CIRCUMFERENCE","POSITION","Circle","dotClassName","style","hasCircleBackground","jsx","clsx","Progress","percent","prefixCls","holderClassName","hideClassName","render","setRender","React","shouldRenderProgress","useLayoutEffect","safePercent","circleStyle","jsxs"],"mappings":";;;;;AAWA,MAAMA,IAAY,KACZC,IAAeD,IAAY,GAC3BE,IAASF,IAAY,IAAIC,IAAe,GACxCE,IAAgBD,IAAS,IAAI,KAAK,IAClCE,IAAW,IAQXC,IAAS,CAAC,EAAE,cAAAC,GAAc,OAAAC,GAAO,qBAAAC,QAEnC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAK,GAAGJ,CAAY,WAAW;AAAA,MACxC,CAAC,GAAGA,CAAY,YAAY,GAAGE;AAAA,IAAA,CAChC;AAAA,IACD,GAAGN;AAAA,IACH,IAAIE;AAAA,IACJ,IAAIA;AAAA,IACJ,aAAaH;AAAA,IACb,OAAAM;AAAA,EAAA;AAAA;AAKN,SAAwBI,EAAS,EAAE,SAAAC,GAAS,WAAAC,KAA4B;AACtE,QAAMP,IAAe,GAAGO,CAAS,QAC3BC,IAAkB,GAAGR,CAAY,WACjCS,IAAgB,GAAGD,CAAe,WAClC,CAACE,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAC1CC,IAAuBP,MAAY;AAEzC,EAAAQ,EAAgB,MAAM;AACpB,IAAID,KACFF,EAAU,EAAI;AAAA,EAElB,GAAG,CAACE,CAAoB,CAAC;AAEzB,QAAME,IAAc,OAAO,SAAST,CAAO,IACvC,KAAK,IAAI,KAAK,IAAIA,GAAS,GAAG,GAAG,CAAC,IAClC;AAEJ,MAAI,CAACI;AACH,WAAO;AAGT,QAAMM,IAAmC;AAAA,IACvC,kBAAkB,GAAGnB,IAAgB,CAAC;AAAA,IACtC,iBAAiB,GAAIA,IAAgBkB,IAAe,GAAG,IACpDlB,KAAiB,MAAMkB,KAAgB,GAC1C;AAAA,EAAA;AAGF,SACE,gBAAAZ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTI;AAAA,QACA,GAAGR,CAAY;AAAA,QACfe,KAAe,KAAKN;AAAA,MAAA;AAAA,MAGtB,UAAA,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,OAAOvB,CAAS,IAAIA,CAAS;AAAA,UACtC,MAAK;AAAA,UACL,iBAAe;AAAA,UACf,iBAAe;AAAA,UACf,iBAAeqB;AAAA,UAEf,UAAA;AAAA,YAAA,gBAAAZ,EAACJ,GAAA,EAAO,cAAAC,GAA4B,qBAAmB,GAAA,CAAC;AAAA,YACxD,gBAAAG,EAACJ,GAAA,EAAO,cAAAC,GAA4B,OAAOgB,EAAA,CAAa;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1D;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface IndicatorProps {
|
|
3
|
+
prefixCls: string;
|
|
4
|
+
indicator?: React.ReactNode;
|
|
5
|
+
percent?: number;
|
|
6
|
+
}
|
|
7
|
+
export default function Indicator({ prefixCls, indicator, percent, }: IndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/spin/Indicator/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE,cAAc,2CAchB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import a from "./Looper.js";
|
|
5
|
+
import { clsx as l } from "../../utils/cn.js";
|
|
6
|
+
function c({
|
|
7
|
+
prefixCls: e,
|
|
8
|
+
indicator: o,
|
|
9
|
+
percent: m
|
|
10
|
+
}) {
|
|
11
|
+
const t = `${e}-dot`;
|
|
12
|
+
return o && s.isValidElement(o) ? s.cloneElement(o, {
|
|
13
|
+
className: l(o.props?.className, t),
|
|
14
|
+
percent: m
|
|
15
|
+
}) : /* @__PURE__ */ r(a, { prefixCls: e, percent: m });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
c as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/spin/Indicator/index.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { clsx } from \"../../utils\";\nimport Looper from \"./Looper\";\n\nexport interface IndicatorProps {\n prefixCls: string;\n indicator?: React.ReactNode;\n percent?: number;\n}\n\nexport default function Indicator({\n prefixCls,\n indicator,\n percent,\n}: IndicatorProps) {\n const dotClassName = `${prefixCls}-dot`;\n\n if (\n indicator &&\n React.isValidElement<{ className?: string; percent?: number }>(indicator)\n ) {\n return React.cloneElement(indicator, {\n className: clsx(indicator.props?.className, dotClassName),\n percent,\n });\n }\n\n return <Looper prefixCls={prefixCls} percent={percent} />;\n}\n"],"names":["Indicator","prefixCls","indicator","percent","dotClassName","React","clsx","jsx","Looper"],"mappings":";;;;;AAYA,SAAwBA,EAAU;AAAA,EAChC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AACF,GAAmB;AACjB,QAAMC,IAAe,GAAGH,CAAS;AAEjC,SACEC,KACAG,EAAM,eAAyDH,CAAS,IAEjEG,EAAM,aAAaH,GAAW;AAAA,IACnC,WAAWI,EAAKJ,EAAU,OAAO,WAAWE,CAAY;AAAA,IACxD,SAAAD;AAAA,EAAA,CACD,IAGI,gBAAAI,EAACC,GAAA,EAAO,WAAAP,GAAsB,SAAAE,EAAA,CAAkB;AACzD;"}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SpinSize = "small" | "default" | "large" | number;
|
|
3
|
+
export type SpinIndicator = React.ReactElement<HTMLElement>;
|
|
4
|
+
export interface SpinClassNames {
|
|
5
|
+
wrapper?: string;
|
|
6
|
+
container?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SpinProps {
|
|
9
|
+
prefixCls?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
rootClassName?: string;
|
|
12
|
+
spinning?: boolean;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
size?: SpinSize;
|
|
15
|
+
tip?: React.ReactNode;
|
|
16
|
+
delay?: number;
|
|
17
|
+
wrapperClassName?: string;
|
|
18
|
+
containerClassName?: string;
|
|
19
|
+
classNames?: SpinClassNames;
|
|
20
|
+
indicator?: SpinIndicator;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
fullscreen?: boolean;
|
|
23
|
+
percent?: number | "auto";
|
|
24
|
+
}
|
|
25
|
+
type SpinType = React.FC<SpinProps> & {
|
|
26
|
+
setDefaultIndicator: (indicator: React.ReactNode) => void;
|
|
4
27
|
};
|
|
5
|
-
export declare const Spin:
|
|
28
|
+
export declare const Spin: SpinType;
|
|
29
|
+
export {};
|
|
6
30
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/spin/component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/spin/component.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;AAC5D,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,KAAK,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG;IACpC,mBAAmB,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;CAC3D,CAAC;AAcF,eAAO,MAAM,IAAI,EAAE,QAgLlB,CAAC"}
|
|
@@ -1,24 +1,172 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as n, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import { devUseWarning as B } from "antd/es/_util/warning";
|
|
4
|
+
import { useComponentConfig as G } from "antd/es/config-provider/context";
|
|
5
|
+
import H from "antd/es/spin/style";
|
|
6
|
+
import * as E from "react";
|
|
7
|
+
import D from "./Indicator/index.js";
|
|
8
|
+
import J from "./usePercent.js";
|
|
4
9
|
import './style.css';/* empty css */
|
|
5
|
-
import { useCls as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
import { useCls as K } from "../utils/antdUtils.js";
|
|
11
|
+
import { clsx as c } from "../utils/cn.js";
|
|
12
|
+
let V;
|
|
13
|
+
function P(r, t) {
|
|
14
|
+
return !!r && !!t && !Number.isNaN(Number(t));
|
|
15
|
+
}
|
|
16
|
+
function T(r) {
|
|
17
|
+
return typeof r == "string";
|
|
18
|
+
}
|
|
19
|
+
const M = 0, Q = ({
|
|
20
|
+
prefixCls: r,
|
|
21
|
+
spinning: t = !0,
|
|
22
|
+
delay: l = M,
|
|
23
|
+
className: _,
|
|
24
|
+
rootClassName: g,
|
|
25
|
+
size: i = "default",
|
|
26
|
+
tip: s,
|
|
27
|
+
wrapperClassName: j,
|
|
28
|
+
containerClassName: A,
|
|
29
|
+
classNames: x,
|
|
30
|
+
style: L,
|
|
31
|
+
children: $,
|
|
32
|
+
fullscreen: o = !1,
|
|
33
|
+
indicator: U,
|
|
34
|
+
percent: h,
|
|
35
|
+
...u
|
|
36
|
+
}) => {
|
|
37
|
+
const k = K(), {
|
|
38
|
+
getPrefixCls: F,
|
|
39
|
+
direction: O,
|
|
40
|
+
className: R,
|
|
41
|
+
style: W,
|
|
42
|
+
indicator: Y
|
|
43
|
+
} = G("spin"), e = F("spin", r), [f, p, N] = H(e), [a, d] = E.useState(
|
|
44
|
+
() => t && !P(t, l)
|
|
45
|
+
), w = J(a, h);
|
|
46
|
+
E.useEffect(() => {
|
|
47
|
+
if (!t) {
|
|
48
|
+
d(!1);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!P(t, l)) {
|
|
52
|
+
d(!0);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
d(!1);
|
|
56
|
+
const b = window.setTimeout(() => {
|
|
57
|
+
d(!0);
|
|
58
|
+
}, l);
|
|
59
|
+
return () => window.clearTimeout(b);
|
|
60
|
+
}, [t, l]);
|
|
61
|
+
const m = typeof $ < "u" && !o;
|
|
62
|
+
process.env.NODE_ENV !== "production" && B("Spin")(
|
|
63
|
+
!s || m || o,
|
|
64
|
+
"usage",
|
|
65
|
+
"`tip` only work in nest or fullscreen pattern."
|
|
66
|
+
);
|
|
67
|
+
const C = U ?? Y ?? V ?? (h === void 0 ? /* @__PURE__ */ n("span", { className: k("spin-loader") }) : void 0), y = {
|
|
68
|
+
...W,
|
|
69
|
+
...L,
|
|
70
|
+
...typeof i == "number" ? {
|
|
71
|
+
"--spin-size": `${i}px`
|
|
72
|
+
} : {}
|
|
73
|
+
}, I = c(
|
|
9
74
|
e,
|
|
75
|
+
R,
|
|
10
76
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
77
|
+
[`${e}-sm`]: T(i) && i === "small",
|
|
78
|
+
[`${e}-lg`]: T(i) && i === "large",
|
|
79
|
+
[`${e}-spinning`]: a,
|
|
80
|
+
[`${e}-show-text`]: !!s,
|
|
81
|
+
[`${e}-rtl`]: O === "rtl",
|
|
82
|
+
[`${e}-numeric`]: typeof i == "number"
|
|
83
|
+
},
|
|
84
|
+
_,
|
|
85
|
+
!o && g,
|
|
86
|
+
p,
|
|
87
|
+
N
|
|
88
|
+
), q = c(`${e}-container`, {
|
|
89
|
+
[`${e}-blur`]: a
|
|
90
|
+
}), S = /* @__PURE__ */ v(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
style: y,
|
|
94
|
+
className: I,
|
|
95
|
+
"aria-live": "polite",
|
|
96
|
+
"aria-busy": a,
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ n(
|
|
99
|
+
D,
|
|
100
|
+
{
|
|
101
|
+
prefixCls: e,
|
|
102
|
+
indicator: C,
|
|
103
|
+
percent: w
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
s && (m || o) ? /* @__PURE__ */ n("div", { className: `${e}-text`, children: s }) : null
|
|
107
|
+
]
|
|
18
108
|
}
|
|
19
109
|
);
|
|
110
|
+
return f(
|
|
111
|
+
m ? /* @__PURE__ */ v(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
...u,
|
|
115
|
+
className: c(
|
|
116
|
+
`${e}-nested-loading`,
|
|
117
|
+
j,
|
|
118
|
+
x?.wrapper,
|
|
119
|
+
p,
|
|
120
|
+
N
|
|
121
|
+
),
|
|
122
|
+
children: [
|
|
123
|
+
a ? /* @__PURE__ */ n("div", { children: S }, "loading") : null,
|
|
124
|
+
/* @__PURE__ */ n(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: c(
|
|
128
|
+
q,
|
|
129
|
+
A,
|
|
130
|
+
x?.container
|
|
131
|
+
),
|
|
132
|
+
children: $
|
|
133
|
+
},
|
|
134
|
+
"container"
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
) : o ? /* @__PURE__ */ n(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
...u,
|
|
142
|
+
className: c(
|
|
143
|
+
`${e}-fullscreen`,
|
|
144
|
+
{
|
|
145
|
+
[`${e}-fullscreen-show`]: a
|
|
146
|
+
},
|
|
147
|
+
g,
|
|
148
|
+
p,
|
|
149
|
+
N
|
|
150
|
+
),
|
|
151
|
+
children: S
|
|
152
|
+
}
|
|
153
|
+
) : /* @__PURE__ */ v("div", { ...u, style: y, className: I, children: [
|
|
154
|
+
/* @__PURE__ */ n(
|
|
155
|
+
D,
|
|
156
|
+
{
|
|
157
|
+
prefixCls: e,
|
|
158
|
+
indicator: C,
|
|
159
|
+
percent: w
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
s && (m || o) ? /* @__PURE__ */ n("div", { className: `${e}-text`, children: s }) : null
|
|
163
|
+
] })
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
Q.setDefaultIndicator = (r) => {
|
|
167
|
+
V = r;
|
|
20
168
|
};
|
|
21
169
|
export {
|
|
22
|
-
|
|
170
|
+
Q as Spin
|
|
23
171
|
};
|
|
24
172
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/spin/component.tsx"],"sourcesContent":["\"use client\";\nimport { useCls } from \"../utils\";\nimport { default as AntdSpin, SpinProps as AntdSpinProps } from \"antd/es/spin\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type SpinProps = Omit<AntdSpinProps, \"size\"> & {\n size?: \"small\" | \"default\" | \"large\" | number;\n};\n\nexport const Spin = ({ indicator, size, className, ...rest }: SpinProps) => {\n const cls = useCls();\n const spinIndicator = indicator || <span className={cls(\"spin-loader\")} />;\n return (\n <AntdSpin\n className={className}\n indicator={spinIndicator}\n size={typeof size === \"number\" ? \"default\" : size}\n style={\n {\n \"--spin-size\": typeof size == \"number\" ? `${size}px` : undefined,\n } as React.CSSProperties\n }\n {...rest}\n />\n );\n};\n"],"names":["Spin","indicator","size","className","rest","cls","useCls","spinIndicator","jsx","AntdSpin"],"mappings":";;;;;AAWO,MAAMA,IAAO,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,WAAAC,GAAW,GAAGC,QAAsB;AAC1E,QAAMC,IAAMC,EAAA,GACNC,IAAgBN,KAAa,gBAAAO,EAAC,UAAK,WAAWH,EAAI,aAAa,GAAG;AACxE,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAN;AAAA,MACA,WAAWI;AAAA,MACX,MAAM,OAAOL,KAAS,WAAW,YAAYA;AAAA,MAC7C,OACE;AAAA,QACE,eAAe,OAAOA,KAAQ,WAAW,GAAGA,CAAI,OAAO;AAAA,MAAA;AAAA,MAG1D,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/spin/component.tsx"],"sourcesContent":["\"use client\";\n\nimport { devUseWarning } from \"antd/es/_util/warning\";\nimport { useComponentConfig } from \"antd/es/config-provider/context\";\nimport useStyle from \"antd/es/spin/style\";\nimport * as React from \"react\";\nimport { clsx, useCls } from \"../utils\";\nimport Indicator from \"./Indicator\";\nimport usePercent from \"./usePercent\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type SpinSize = \"small\" | \"default\" | \"large\" | number;\nexport type SpinIndicator = React.ReactElement<HTMLElement>;\nexport interface SpinClassNames {\n wrapper?: string;\n container?: string;\n}\n\nexport interface SpinProps {\n prefixCls?: string;\n className?: string;\n rootClassName?: string;\n spinning?: boolean;\n style?: React.CSSProperties;\n size?: SpinSize;\n tip?: React.ReactNode;\n delay?: number;\n wrapperClassName?: string;\n containerClassName?: string;\n classNames?: SpinClassNames;\n indicator?: SpinIndicator;\n children?: React.ReactNode;\n fullscreen?: boolean;\n percent?: number | \"auto\";\n}\n\ntype SpinType = React.FC<SpinProps> & {\n setDefaultIndicator: (indicator: React.ReactNode) => void;\n};\n\nlet defaultIndicator: React.ReactNode | undefined;\n\nfunction shouldDelay(spinning?: boolean, delay?: number): boolean {\n return !!spinning && !!delay && !Number.isNaN(Number(delay));\n}\n\nfunction isPresetSize(size: SpinSize): size is Exclude<SpinSize, number> {\n return typeof size === \"string\";\n}\n\nconst DEFAULT_SPIN_DELAY = 0;\n\nexport const Spin: SpinType = ({\n prefixCls: customizePrefixCls,\n spinning: customSpinning = true,\n delay = DEFAULT_SPIN_DELAY,\n className,\n rootClassName,\n size = \"default\",\n tip,\n wrapperClassName,\n containerClassName,\n classNames,\n style,\n children,\n fullscreen = false,\n indicator,\n percent,\n ...restProps\n}) => {\n const cls = useCls();\n const {\n getPrefixCls,\n direction,\n className: contextClassName,\n style: contextStyle,\n indicator: contextIndicator,\n } = useComponentConfig(\"spin\");\n const prefixCls = getPrefixCls(\"spin\", customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const [spinning, setSpinning] = React.useState(\n () => customSpinning && !shouldDelay(customSpinning, delay),\n );\n const mergedPercent = usePercent(spinning, percent);\n\n React.useEffect(() => {\n if (!customSpinning) {\n setSpinning(false);\n return undefined;\n }\n\n if (!shouldDelay(customSpinning, delay)) {\n setSpinning(true);\n return undefined;\n }\n\n setSpinning(false);\n const timeoutId = window.setTimeout(() => {\n setSpinning(true);\n }, delay);\n\n return () => window.clearTimeout(timeoutId);\n }, [customSpinning, delay]);\n\n const isNestedPattern = typeof children !== \"undefined\" && !fullscreen;\n\n if (process.env.NODE_ENV !== \"production\") {\n const warning = devUseWarning(\"Spin\");\n warning(\n !tip || isNestedPattern || fullscreen,\n \"usage\",\n \"`tip` only work in nest or fullscreen pattern.\",\n );\n }\n\n const mergedIndicator =\n indicator ??\n contextIndicator ??\n defaultIndicator ??\n (percent === undefined ? <span className={cls(\"spin-loader\")} /> : undefined);\n\n const mergedStyle: React.CSSProperties = {\n ...contextStyle,\n ...style,\n ...(typeof size === \"number\"\n ? {\n \"--spin-size\": `${size}px`,\n }\n : {}),\n };\n\n const spinClassName = clsx(\n prefixCls,\n contextClassName,\n {\n [`${prefixCls}-sm`]: isPresetSize(size) && size === \"small\",\n [`${prefixCls}-lg`]: isPresetSize(size) && size === \"large\",\n [`${prefixCls}-spinning`]: spinning,\n [`${prefixCls}-show-text`]: !!tip,\n [`${prefixCls}-rtl`]: direction === \"rtl\",\n [`${prefixCls}-numeric`]: typeof size === \"number\",\n },\n className,\n !fullscreen && rootClassName,\n hashId,\n cssVarCls,\n );\n\n const spinContainerClassName = clsx(`${prefixCls}-container`, {\n [`${prefixCls}-blur`]: spinning,\n });\n\n const spinElement = (\n <div\n style={mergedStyle}\n className={spinClassName}\n aria-live=\"polite\"\n aria-busy={spinning}\n >\n <Indicator\n prefixCls={prefixCls}\n indicator={mergedIndicator}\n percent={mergedPercent}\n />\n {tip && (isNestedPattern || fullscreen) ? (\n <div className={`${prefixCls}-text`}>{tip}</div>\n ) : null}\n </div>\n );\n\n if (isNestedPattern) {\n return wrapCSSVar(\n <div\n {...restProps}\n className={clsx(\n `${prefixCls}-nested-loading`,\n wrapperClassName,\n classNames?.wrapper,\n hashId,\n cssVarCls,\n )}\n >\n {spinning ? <div key=\"loading\">{spinElement}</div> : null}\n <div\n className={clsx(\n spinContainerClassName,\n containerClassName,\n classNames?.container,\n )}\n key=\"container\"\n >\n {children}\n </div>\n </div>,\n );\n }\n\n if (fullscreen) {\n return wrapCSSVar(\n <div\n {...restProps}\n className={clsx(\n `${prefixCls}-fullscreen`,\n {\n [`${prefixCls}-fullscreen-show`]: spinning,\n },\n rootClassName,\n hashId,\n cssVarCls,\n )}\n >\n {spinElement}\n </div>,\n );\n }\n\n return wrapCSSVar(\n <div {...restProps} style={mergedStyle} className={spinClassName}>\n <Indicator\n prefixCls={prefixCls}\n indicator={mergedIndicator}\n percent={mergedPercent}\n />\n {tip && (isNestedPattern || fullscreen) ? (\n <div className={`${prefixCls}-text`}>{tip}</div>\n ) : null}\n </div>,\n );\n};\n\nSpin.setDefaultIndicator = (indicator: React.ReactNode) => {\n defaultIndicator = indicator;\n};\n"],"names":["defaultIndicator","shouldDelay","spinning","delay","isPresetSize","size","DEFAULT_SPIN_DELAY","Spin","customizePrefixCls","customSpinning","className","rootClassName","tip","wrapperClassName","containerClassName","classNames","style","children","fullscreen","indicator","percent","restProps","cls","useCls","getPrefixCls","direction","contextClassName","contextStyle","contextIndicator","useComponentConfig","prefixCls","wrapCSSVar","hashId","cssVarCls","useStyle","setSpinning","React","mergedPercent","usePercent","timeoutId","isNestedPattern","devUseWarning","mergedIndicator","jsx","mergedStyle","spinClassName","clsx","spinContainerClassName","spinElement","jsxs","Indicator"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-spin
|
|
1
|
+
@layer components{.ds-spin-nested-loading,.ds-spin-container{min-width:0;min-height:0}.ds-spin-nested-loading{display:flex;flex-direction:column}.ds-spin-container{display:flex;flex:1 1 auto;flex-direction:column;width:100%}.ds-spin-text{color:var(--ds-color-icon)}.ds-spin-loader{width:var(--spin-size, 1em);height:var(--spin-size, 1em);border:max(2px,.12em) solid var(--ds-color-border);border-bottom-color:var(--ds-color-icon);border-radius:50%;display:inline-block;box-sizing:border-box;animation:spin 1s linear infinite}.ds-spin-numeric .ds-spin-dot{font-size:var(--spin-size, 1em)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePercent.d.ts","sourceRoot":"","sources":["../../../src/components/spin/usePercent.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GACxB,MAAM,GAAG,SAAS,CAwCpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
const E = 200, a = [
|
|
4
|
+
[30, 0.05],
|
|
5
|
+
[70, 0.03],
|
|
6
|
+
[96, 0.01]
|
|
7
|
+
];
|
|
8
|
+
function I(u, l) {
|
|
9
|
+
const [o, s] = c.useState(0), t = c.useRef(null), r = l === "auto";
|
|
10
|
+
return c.useEffect(() => (r && u && (s(0), t.current = setInterval(() => {
|
|
11
|
+
s((e) => {
|
|
12
|
+
const f = 100 - e;
|
|
13
|
+
for (let n = 0; n < a.length; n += 1) {
|
|
14
|
+
const [i, m] = a[n];
|
|
15
|
+
if (e <= i)
|
|
16
|
+
return e + f * m;
|
|
17
|
+
}
|
|
18
|
+
return t.current && (clearInterval(t.current), t.current = null), e;
|
|
19
|
+
});
|
|
20
|
+
}, E)), () => {
|
|
21
|
+
t.current && (clearInterval(t.current), t.current = null);
|
|
22
|
+
}), [r, u]), r ? o : l;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
I as default
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=usePercent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePercent.js","sources":["../../../src/components/spin/usePercent.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nconst AUTO_INTERVAL = 200;\nconst STEP_BUCKETS: [limit: number, stepPercent: number][] = [\n [30, 0.05],\n [70, 0.03],\n [96, 0.01],\n];\n\nexport default function usePercent(\n spinning: boolean,\n percent?: number | \"auto\",\n): number | undefined {\n const [mockPercent, setMockPercent] = React.useState(0);\n const intervalRef = React.useRef<ReturnType<typeof setInterval> | null>(null);\n const isAuto = percent === \"auto\";\n\n React.useEffect(() => {\n if (isAuto && spinning) {\n setMockPercent(0);\n\n intervalRef.current = setInterval(() => {\n setMockPercent((previousPercent) => {\n const remainingPercent = 100 - previousPercent;\n\n for (let index = 0; index < STEP_BUCKETS.length; index += 1) {\n const [limit, stepPercent] = STEP_BUCKETS[index];\n\n if (previousPercent <= limit) {\n return previousPercent + remainingPercent * stepPercent;\n }\n }\n\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n\n return previousPercent;\n });\n }, AUTO_INTERVAL);\n }\n\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n };\n }, [isAuto, spinning]);\n\n return isAuto ? mockPercent : percent;\n}\n"],"names":["AUTO_INTERVAL","STEP_BUCKETS","usePercent","spinning","percent","mockPercent","setMockPercent","React","intervalRef","isAuto","previousPercent","remainingPercent","index","limit","stepPercent"],"mappings":";;AAIA,MAAMA,IAAgB,KAChBC,IAAuD;AAAA,EAC3D,CAAC,IAAI,IAAI;AAAA,EACT,CAAC,IAAI,IAAI;AAAA,EACT,CAAC,IAAI,IAAI;AACX;AAEA,SAAwBC,EACtBC,GACAC,GACoB;AACpB,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAM,SAAS,CAAC,GAChDC,IAAcD,EAAM,OAA8C,IAAI,GACtEE,IAASL,MAAY;AAE3B,SAAAG,EAAM,UAAU,OACVE,KAAUN,MACZG,EAAe,CAAC,GAEhBE,EAAY,UAAU,YAAY,MAAM;AACtC,IAAAF,EAAe,CAACI,MAAoB;AAClC,YAAMC,IAAmB,MAAMD;AAE/B,eAASE,IAAQ,GAAGA,IAAQX,EAAa,QAAQW,KAAS,GAAG;AAC3D,cAAM,CAACC,GAAOC,CAAW,IAAIb,EAAaW,CAAK;AAE/C,YAAIF,KAAmBG;AACrB,iBAAOH,IAAkBC,IAAmBG;AAAA,MAEhD;AAEA,aAAIN,EAAY,YACd,cAAcA,EAAY,OAAO,GACjCA,EAAY,UAAU,OAGjBE;AAAA,IACT,CAAC;AAAA,EACH,GAAGV,CAAa,IAGX,MAAM;AACX,IAAIQ,EAAY,YACd,cAAcA,EAAY,OAAO,GACjCA,EAAY,UAAU;AAAA,EAE1B,IACC,CAACC,GAAQN,CAAQ,CAAC,GAEdM,IAASJ,IAAcD;AAChC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{@keyframes ds-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ds-theme-provider{--ds-modal-padding: 24px;--ds-modal-edge-padding: 16px;--ds-popup-panel-padding: 16px;--ds-scrollbar-width: auto;--ds-scrollbar-width-legacy: 15;--ds-box-shadow-popover-arrow: 0px 0px 1px 0px var(--ds-modal-color-border), 2px 2px 5px rgba(0, 0, 0, .05);--ds-control-border-radius: 6px;--ds-control-transition: all .2s;--ds-control-padding-small: 1px 8px;--ds-control-padding-middle: 5px 12px;--ds-control-padding-large: 9px 12px;--ds-control-padding-inline-small: 8px;--ds-control-padding-block-small: 1px;--ds-control-padding-inline-middle: 12px;--ds-control-padding-block-middle: 5px;--ds-control-padding-inline-large: 12px;--ds-control-padding-block-large: 9px;--ds-control-min-height-small: 24px;--ds-control-min-height-middle: 32px;--ds-control-min-height-large: 40px;--ds-control-line-height: 20px;--ds-control-color-border-hover: var(--ds-color-primary-hover);--ds-control-color-border-focus: var(--ds-color-primary);--ds-control-color-bg-disabled: var(--ds-color-bg-container-disabled);--ds-control-color-text-disabled: var(--ds-color-text-disabled);--ds-control-icon-size: 12px;--ds-control-color-bg: var(--ds-color-bg-container);--ds-control-color-border: var(--ds-color-border);--ds-control-color-border-active: var(--ds-color-primary);--ds-control-color-border-error-active: var(--ds-color-error);--ds-control-color-border-warning-active: var(--ds-color-warning);--ds-control-color-icon: var(--ds-color-text-quaternary);--ds-control-color-icon-hover: var(--ds-color-icon-hover);--ds-control-border: 1px solid var(--ds-control-color-border);--ds-control-border-active: 1px solid var(--ds-control-color-border-active);--ds-control-border-error-active: 1px solid var(--ds-control-color-border-error-active);--ds-control-border-warning-active: 1px solid var(--ds-control-color-border-warning-active);--ds-control-shadow-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-primary) 20%, transparent);--ds-form-label-required-mark-color: var(--ds-color-error);--ds-control-shadow-error-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-error) 20%, transparent);--ds-control-shadow-warning-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-warning) 20%, transparent);--ds-control-color-text-placeholder: var(--ds-color-text-placeholder);--ds-inter: "Inter", Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--ds-animate-spin: ds-spin 1s linear infinite;--ds-z-index-base: 0;--ds-z-index-sticky-element: 520;--ds-z-index-scrollbar: 530;--ds-z-index-modal: 1000;--ds-z-index-modal-mask: 1000;--ds-z-index-message: 1010;--ds-z-index-notification: 1010;--ds-z-index-popover: 1030;--ds-z-index-dropdown: 1050;--ds-z-index-picker: 1050;--ds-z-index-popconfirm: 1060;--ds-z-index-tooltip: 1070;--ds-z-index-toast: 2000;--ds-segment-color-bg-active: #ffffff;--ds-scrollbar-color-thumb: rgba(0, 0, 0, .2);--ds-scrollbar-color-track: rgba(0, 0, 0, 0);--ds-color-base-solid: #000000;--ds-color-table-fixed-column-shadow: rgb(0 0 0 / 10%);--ds-modal-color-border: rgba(0, 0, 0, .24)}@supports (font-variation-settings: normal){.ds-theme-provider{--ds-inter: "InterVariable", Inter, Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono Variable", Roboto Mono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}}.ds-theme-provider.dark{--ds-modal-color-border: rgba(255, 255, 255, .55);--ds-segment-color-bg-active: #424248;--ds-scrollbar-color-thumb: rgba(255, 255, 255, .2);--ds-scrollbar-color-track: rgba(0, 0, 0, 0);--ds-color-base-solid: #ffffff;--ds-color-table-fixed-column-shadow: rgb(0 0 0 / 20%)}}
|
|
1
|
+
@layer components{@keyframes ds-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ds-theme-provider{--ds-modal-padding: 24px;--ds-modal-edge-padding: 16px;--ds-popup-panel-padding: 16px;--ds-scrollbar-width: auto;--ds-scrollbar-width-legacy: 15;--ds-box-shadow-popover-arrow: 0px 0px 1px 0px var(--ds-modal-color-border), 2px 2px 5px rgba(0, 0, 0, .05);--ds-control-border-radius: 6px;--ds-control-transition: all .2s;--ds-control-padding-small: 1px 8px;--ds-control-padding-middle: 5px 12px;--ds-control-padding-large: 9px 12px;--ds-control-padding-inline-small: 8px;--ds-control-padding-block-small: 1px;--ds-control-padding-inline-middle: 12px;--ds-control-padding-block-middle: 5px;--ds-control-padding-inline-large: 12px;--ds-control-padding-block-large: 9px;--ds-control-min-height-small: 24px;--ds-control-min-height-middle: 32px;--ds-control-min-height-large: 40px;--ds-control-line-height: 20px;--ds-control-color-border-hover: var(--ds-color-primary-hover);--ds-control-color-border-focus: var(--ds-color-primary);--ds-control-color-bg-disabled: var(--ds-color-bg-container-disabled);--ds-control-color-text-disabled: var(--ds-color-text-disabled);--ds-control-icon-size: 12px;--ds-control-color-bg: var(--ds-color-bg-container);--ds-control-color-border: var(--ds-color-border);--ds-control-color-border-active: var(--ds-color-primary);--ds-control-color-border-error-active: var(--ds-color-error);--ds-control-color-border-warning-active: var(--ds-color-warning);--ds-control-color-icon: var(--ds-color-text-quaternary);--ds-control-color-icon-hover: var(--ds-color-icon-hover);--ds-control-border: 1px solid var(--ds-control-color-border);--ds-control-border-active: 1px solid var(--ds-control-color-border-active);--ds-control-border-error-active: 1px solid var(--ds-control-color-border-error-active);--ds-control-border-warning-active: 1px solid var(--ds-control-color-border-warning-active);--ds-control-shadow-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-primary) 20%, transparent);--ds-form-label-required-mark-color: var(--ds-color-error);--ds-control-shadow-error-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-error) 20%, transparent);--ds-control-shadow-warning-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-warning) 20%, transparent);--ds-control-color-text-placeholder: var(--ds-color-text-placeholder);--ds-button-bg-secondary: #fafafa;--ds-button-bg-gradient-top: rgba(0, 0, 0, .02);--ds-button-bg-gradient-bottom: rgba(255, 255, 255, 0);--ds-button-bg-gradient-primary-top: rgba(255, 255, 255, .07);--ds-button-bg-gradient-primary-bottom: rgba(255, 255, 255, 0);--ds-button-shadow-default: 0 1px 1px 0 rgba(0, 0, 0, .05);--ds-button-shadow-default-inner: inset 0 1.5px 0 1px #ffffff;--ds-button-shadow-solid: 0 1px 1px 0 rgba(0, 0, 0, .12);--ds-button-shadow-solid-hover: 0 1px 1px 0 rgba(0, 0, 0, .12);--ds-button-shadow-solid-active: 0 1px 1px 0 rgba(0, 0, 0, .12);--ds-button-shadow-solid-inner: inset 0 1.5px 0 1px rgba(255, 255, 255, .12);--ds-inter: "Inter", Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--ds-animate-spin: ds-spin 1s linear infinite;--ds-z-index-base: 0;--ds-z-index-sticky-element: 520;--ds-z-index-scrollbar: 530;--ds-z-index-modal: 1000;--ds-z-index-modal-mask: 1000;--ds-z-index-message: 1010;--ds-z-index-notification: 1010;--ds-z-index-popover: 1030;--ds-z-index-dropdown: 1050;--ds-z-index-picker: 1050;--ds-z-index-popconfirm: 1060;--ds-z-index-tooltip: 1070;--ds-z-index-toast: 2000;--ds-segment-color-bg-active: #ffffff;--ds-scrollbar-color-thumb: rgba(0, 0, 0, .2);--ds-scrollbar-color-track: rgba(0, 0, 0, 0);--ds-color-base-solid: #000000;--ds-color-table-fixed-column-shadow: rgb(0 0 0 / 10%);--ds-modal-color-border: rgba(0, 0, 0, .24)}@supports (font-variation-settings: normal){.ds-theme-provider{--ds-inter: "InterVariable", Inter, Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono Variable", Roboto Mono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}}.ds-theme-provider.dark{--ds-modal-color-border: rgba(255, 255, 255, .55);--ds-segment-color-bg-active: #424248;--ds-scrollbar-color-thumb: rgba(255, 255, 255, .2);--ds-scrollbar-color-track: rgba(0, 0, 0, 0);--ds-color-base-solid: #ffffff;--ds-color-table-fixed-column-shadow: rgb(0 0 0 / 20%);--ds-button-bg-secondary: hsl(240, 6.5%, 17%);--ds-button-bg-gradient-top: rgba(255, 255, 255, .06);--ds-button-bg-gradient-bottom: rgba(255, 255, 255, 0);--ds-button-bg-gradient-primary-top: rgba(255, 255, 255, .12);--ds-button-bg-gradient-primary-bottom: rgba(255, 255, 255, 0);--ds-button-shadow-default: 0 1px 1px 0 rgba(0, 0, 0, .05);--ds-button-shadow-default-inner: none;--ds-button-shadow-solid: 0 1px 1px 0 rgba(0, 0, 0, .12);--ds-button-shadow-solid-hover: 0 1px 1px 0 rgba(0, 0, 0, .12);--ds-button-shadow-solid-active: 0 1px 1px 0 rgba(0, 0, 0, .12);--ds-button-shadow-solid-inner: inset 0 1.5px 0 1px rgba(255, 255, 255, .16)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-tour .ds-tour-header{padding-top:1rem;padding-bottom:.75rem}.ds-tour .ds-tour-title{font-size:var(--ds-font-size-heading-5);font-weight:600;line-height:var(--ds-line-height-heading-5)}.ds-tour .ds-tour-description{font-size:var(--ds-font-size);font-weight:400;line-height:var(--ds-line-height)}.ds-tour .ds-tour-description p:not(:first-child),.ds-tour .ds-tour-description ul:not(:first-child),.ds-tour .ds-tour-description ol:not(:first-child){margin-top:.875rem}.ds-tour .ds-tour-description strong{font-weight:600}.ds-tour .ds-tour-description ul{list-style:disc;padding-left:1rem}.ds-tour .ds-tour-description ol{list-style:decimal;padding-left:1rem}.ds-tour .ds-tour-description li{padding-left:.5rem}.ds-tour .ds-tour-description li:not(:first-child){margin-top:.5rem}.ds-tour .ds-tour-description li svg{display:inline-block;font-size:1.25rem;margin-bottom:-.25rem}.ds-tour .ds-tour-footer{padding-top:1rem}.ds-tour .ds-tour-indicator-wrapper{display:inline-flex;align-items:center;width:100%;height:100%;gap:.5rem}.ds-tour .ds-tour-indicator-summary-text{font-size:var(--ds-font-size-sm);font-weight:400;line-height:var(--ds-font-height-sm);color:var(--ds-color-text-tertiary);display:inline-flex;align-items:center;padding-top:.25rem}}
|
|
1
|
+
@layer components{.ds-tour .ds-tour-header{padding-top:1rem;padding-bottom:.75rem}.ds-tour .ds-tour-title{font-size:var(--ds-font-size-heading-5);font-weight:600;line-height:var(--ds-line-height-heading-5)}.ds-tour .ds-tour-description{font-size:var(--ds-font-size);font-weight:400;line-height:var(--ds-line-height)}.ds-tour .ds-tour-description p:not(:first-child),.ds-tour .ds-tour-description ul:not(:first-child),.ds-tour .ds-tour-description ol:not(:first-child){margin-top:.875rem}.ds-tour .ds-tour-description strong{font-weight:600}.ds-tour .ds-tour-description ul{list-style:disc;padding-left:1rem}.ds-tour .ds-tour-description ol{list-style:decimal;padding-left:1rem}.ds-tour .ds-tour-description li{padding-left:.5rem}.ds-tour .ds-tour-description li:not(:first-child){margin-top:.5rem}.ds-tour .ds-tour-description li svg{display:inline-block;font-size:1.25rem;margin-bottom:-.25rem}.ds-tour .ds-tour-footer{padding-top:1rem}.ds-tour .ds-tour-indicator-wrapper{display:inline-flex;align-items:center;width:100%;height:100%;gap:.5rem}.ds-tour .ds-tour-indicator-summary-text{font-size:var(--ds-font-size-sm);font-weight:400;line-height:var(--ds-font-height-sm);color:var(--ds-color-text-tertiary);display:inline-flex;align-items:center;padding-top:.25rem}.ds-tour .ds-tour-close{border-radius:9999px}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/components/utils/cn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/components/utils/cn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAqG1C,wBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,CAkBlD;AAED,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAElD;AAED,wBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAEhD"}
|
|
@@ -1,27 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { extendTailwindMerge as t } from "tailwind-merge";
|
|
2
|
+
const l = [
|
|
3
|
+
"ds-color-primary",
|
|
4
|
+
"ds-color-primary-hover",
|
|
5
|
+
"ds-color-primary-active",
|
|
6
|
+
"ds-color-primary-text",
|
|
7
|
+
"ds-color-primary-text-hover",
|
|
8
|
+
"ds-color-primary-text-active",
|
|
9
|
+
"ds-color-primary-bg",
|
|
10
|
+
"ds-color-primary-bg-hover",
|
|
11
|
+
"ds-color-primary-border",
|
|
12
|
+
"ds-color-primary-border-hover",
|
|
13
|
+
"ds-color-warning",
|
|
14
|
+
"ds-color-warning-hover",
|
|
15
|
+
"ds-color-warning-active",
|
|
16
|
+
"ds-color-warning-text",
|
|
17
|
+
"ds-color-warning-text-hover",
|
|
18
|
+
"ds-color-warning-text-active",
|
|
19
|
+
"ds-color-warning-bg",
|
|
20
|
+
"ds-color-warning-bg-hover",
|
|
21
|
+
"ds-color-warning-border",
|
|
22
|
+
"ds-color-warning-border-hover",
|
|
23
|
+
"ds-color-success",
|
|
24
|
+
"ds-color-success-hover",
|
|
25
|
+
"ds-color-success-active",
|
|
26
|
+
"ds-color-success-text",
|
|
27
|
+
"ds-color-success-text-hover",
|
|
28
|
+
"ds-color-success-text-active",
|
|
29
|
+
"ds-color-success-bg",
|
|
30
|
+
"ds-color-success-bg-hover",
|
|
31
|
+
"ds-color-success-border",
|
|
32
|
+
"ds-color-success-border-hover",
|
|
33
|
+
"ds-color-error",
|
|
34
|
+
"ds-color-error-hover",
|
|
35
|
+
"ds-color-error-active",
|
|
36
|
+
"ds-color-error-text",
|
|
37
|
+
"ds-color-error-text-hover",
|
|
38
|
+
"ds-color-error-text-active",
|
|
39
|
+
"ds-color-error-bg",
|
|
40
|
+
"ds-color-error-bg-hover",
|
|
41
|
+
"ds-color-error-border",
|
|
42
|
+
"ds-color-error-border-hover",
|
|
43
|
+
"ds-color-text-base",
|
|
44
|
+
"ds-color-text",
|
|
45
|
+
"ds-color-text-secondary",
|
|
46
|
+
"ds-color-text-tertiary",
|
|
47
|
+
"ds-color-text-quaternary",
|
|
48
|
+
"ds-color-bg-base",
|
|
49
|
+
"ds-color-bg-container",
|
|
50
|
+
"ds-color-bg-elevated",
|
|
51
|
+
"ds-color-bg-layout",
|
|
52
|
+
"ds-color-bg-spotlight",
|
|
53
|
+
"ds-color-bg-mask",
|
|
54
|
+
"ds-color-fill",
|
|
55
|
+
"ds-color-fill-secondary",
|
|
56
|
+
"ds-color-fill-tertiary",
|
|
57
|
+
"ds-color-fill-quaternary",
|
|
58
|
+
"ds-color-fill-alter",
|
|
59
|
+
"ds-color-border",
|
|
60
|
+
"ds-color-border-secondary",
|
|
61
|
+
"ds-color-split",
|
|
62
|
+
"ds-color-text-placeholder",
|
|
63
|
+
"ds-color-text-disabled",
|
|
64
|
+
"ds-color-text-heading",
|
|
65
|
+
"ds-color-text-label",
|
|
66
|
+
"ds-color-text-description",
|
|
67
|
+
"ds-color-text-light-solid",
|
|
68
|
+
"ds-color-highlight",
|
|
69
|
+
"ds-color-bg-text-hover",
|
|
70
|
+
"ds-color-bg-text-active",
|
|
71
|
+
"ds-color-icon",
|
|
72
|
+
"ds-color-icon-hover",
|
|
73
|
+
"ds-segment-color-bg-active"
|
|
74
|
+
], i = [
|
|
75
|
+
"ds-sm",
|
|
76
|
+
"ds-md",
|
|
77
|
+
"ds-lg",
|
|
78
|
+
"ds-xl",
|
|
79
|
+
"ds-h1",
|
|
80
|
+
"ds-h2",
|
|
81
|
+
"ds-h3",
|
|
82
|
+
"ds-h4",
|
|
83
|
+
"ds-h5",
|
|
84
|
+
"ds-subheading",
|
|
85
|
+
"ds-subheading2"
|
|
86
|
+
], n = t({
|
|
87
|
+
extend: {
|
|
88
|
+
theme: {
|
|
89
|
+
color: l,
|
|
90
|
+
text: i
|
|
13
91
|
}
|
|
14
|
-
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
function e(...r) {
|
|
95
|
+
const s = [];
|
|
96
|
+
for (const o of r)
|
|
97
|
+
if (o) {
|
|
98
|
+
if (typeof o == "string" || typeof o == "number")
|
|
99
|
+
s.push(String(o));
|
|
100
|
+
else if (Array.isArray(o))
|
|
101
|
+
s.push(...e(...o));
|
|
102
|
+
else if (typeof o == "object")
|
|
103
|
+
for (const [c, d] of Object.entries(o))
|
|
104
|
+
d && s.push(c);
|
|
105
|
+
}
|
|
106
|
+
return s;
|
|
15
107
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
108
|
+
function g(...r) {
|
|
109
|
+
return e(...r).join(" ");
|
|
18
110
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
111
|
+
function b(...r) {
|
|
112
|
+
return n(e(...r));
|
|
21
113
|
}
|
|
22
114
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
115
|
+
g as clsx,
|
|
116
|
+
b as cn,
|
|
117
|
+
e as cx
|
|
26
118
|
};
|
|
27
119
|
//# sourceMappingURL=cn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.js","sources":["../../../src/components/utils/cn.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"cn.js","sources":["../../../src/components/utils/cn.ts"],"sourcesContent":["import { extendTailwindMerge } from \"tailwind-merge\";\nimport type { ClassValue } from \"./types\";\n\n// Copied from `src/tokens/tailwind.css` by converting the base `--color-*`\n// and `--text-*` theme variable names into Tailwind theme scale keys.\nconst DS_TAILWIND_COLOR_THEME_SCALE = [\n \"ds-color-primary\",\n \"ds-color-primary-hover\",\n \"ds-color-primary-active\",\n \"ds-color-primary-text\",\n \"ds-color-primary-text-hover\",\n \"ds-color-primary-text-active\",\n \"ds-color-primary-bg\",\n \"ds-color-primary-bg-hover\",\n \"ds-color-primary-border\",\n \"ds-color-primary-border-hover\",\n \"ds-color-warning\",\n \"ds-color-warning-hover\",\n \"ds-color-warning-active\",\n \"ds-color-warning-text\",\n \"ds-color-warning-text-hover\",\n \"ds-color-warning-text-active\",\n \"ds-color-warning-bg\",\n \"ds-color-warning-bg-hover\",\n \"ds-color-warning-border\",\n \"ds-color-warning-border-hover\",\n \"ds-color-success\",\n \"ds-color-success-hover\",\n \"ds-color-success-active\",\n \"ds-color-success-text\",\n \"ds-color-success-text-hover\",\n \"ds-color-success-text-active\",\n \"ds-color-success-bg\",\n \"ds-color-success-bg-hover\",\n \"ds-color-success-border\",\n \"ds-color-success-border-hover\",\n \"ds-color-error\",\n \"ds-color-error-hover\",\n \"ds-color-error-active\",\n \"ds-color-error-text\",\n \"ds-color-error-text-hover\",\n \"ds-color-error-text-active\",\n \"ds-color-error-bg\",\n \"ds-color-error-bg-hover\",\n \"ds-color-error-border\",\n \"ds-color-error-border-hover\",\n \"ds-color-text-base\",\n \"ds-color-text\",\n \"ds-color-text-secondary\",\n \"ds-color-text-tertiary\",\n \"ds-color-text-quaternary\",\n \"ds-color-bg-base\",\n \"ds-color-bg-container\",\n \"ds-color-bg-elevated\",\n \"ds-color-bg-layout\",\n \"ds-color-bg-spotlight\",\n \"ds-color-bg-mask\",\n \"ds-color-fill\",\n \"ds-color-fill-secondary\",\n \"ds-color-fill-tertiary\",\n \"ds-color-fill-quaternary\",\n \"ds-color-fill-alter\",\n \"ds-color-border\",\n \"ds-color-border-secondary\",\n \"ds-color-split\",\n \"ds-color-text-placeholder\",\n \"ds-color-text-disabled\",\n \"ds-color-text-heading\",\n \"ds-color-text-label\",\n \"ds-color-text-description\",\n \"ds-color-text-light-solid\",\n \"ds-color-highlight\",\n \"ds-color-bg-text-hover\",\n \"ds-color-bg-text-active\",\n \"ds-color-icon\",\n \"ds-color-icon-hover\",\n \"ds-segment-color-bg-active\",\n] as const;\n\nconst DS_TAILWIND_TEXT_THEME_SCALE = [\n \"ds-sm\",\n \"ds-md\",\n \"ds-lg\",\n \"ds-xl\",\n \"ds-h1\",\n \"ds-h2\",\n \"ds-h3\",\n \"ds-h4\",\n \"ds-h5\",\n \"ds-subheading\",\n \"ds-subheading2\",\n] as const;\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n color: DS_TAILWIND_COLOR_THEME_SCALE,\n text: DS_TAILWIND_TEXT_THEME_SCALE,\n },\n },\n});\n\nexport function cx(...args: ClassValue[]): string[] {\n const classes: string[] = [];\n\n for (const arg of args) {\n if (!arg) continue;\n\n if (typeof arg === \"string\" || typeof arg === \"number\") {\n classes.push(String(arg));\n } else if (Array.isArray(arg)) {\n classes.push(...cx(...arg));\n } else if (typeof arg === \"object\") {\n for (const [key, value] of Object.entries(arg)) {\n if (value) classes.push(key);\n }\n }\n }\n\n return classes;\n}\n\nexport function clsx(...args: ClassValue[]): string {\n return cx(...args).join(\" \");\n}\n\nexport function cn(...args: ClassValue[]): string {\n return twMerge(cx(...args));\n}\n"],"names":["DS_TAILWIND_COLOR_THEME_SCALE","DS_TAILWIND_TEXT_THEME_SCALE","twMerge","extendTailwindMerge","cx","args","classes","arg","key","value","clsx","cn"],"mappings":";AAKA,MAAMA,IAAgC;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAA+B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAUC,EAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,OAAOH;AAAA,MACP,MAAMC;AAAA,IAAA;AAAA,EACR;AAEJ,CAAC;AAEM,SAASG,KAAMC,GAA8B;AAClD,QAAMC,IAAoB,CAAA;AAE1B,aAAWC,KAAOF;AAChB,QAAKE;AAEL,UAAI,OAAOA,KAAQ,YAAY,OAAOA,KAAQ;AAC5C,QAAAD,EAAQ,KAAK,OAAOC,CAAG,CAAC;AAAA,eACf,MAAM,QAAQA,CAAG;AAC1B,QAAAD,EAAQ,KAAK,GAAGF,EAAG,GAAGG,CAAG,CAAC;AAAA,eACjB,OAAOA,KAAQ;AACxB,mBAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQF,CAAG;AAC3C,UAAIE,KAAOH,EAAQ,KAAKE,CAAG;AAAA;AAKjC,SAAOF;AACT;AAEO,SAASI,KAAQL,GAA4B;AAClD,SAAOD,EAAG,GAAGC,CAAI,EAAE,KAAK,GAAG;AAC7B;AAEO,SAASM,KAAMN,GAA4B;AAChD,SAAOH,EAAQE,EAAG,GAAGC,CAAI,CAAC;AAC5B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/components/utils/theme.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,IAAI,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/components/utils/theme.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,IAAI,MAAM,IAAI,SAuB1D,CAAC"}
|