asterui 0.12.19 → 0.12.20
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/Code.d.ts +2 -0
- package/dist/components/CopyButton.d.ts +34 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +205 -203
- package/dist/index.js.map +1 -1
- package/dist/index10.js +91 -121
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +5 -13
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +11 -43
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +44 -11
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +10 -12
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +14 -7
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +7 -12
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +11 -29
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +29 -16
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +21 -0
- package/dist/index108.js.map +1 -0
- package/dist/index11.js +123 -30
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +28 -263
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +257 -105
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +108 -153
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +154 -146
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +150 -5
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +5 -71
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +70 -24
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +23 -194
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +188 -106
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +107 -177
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +181 -107
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +110 -19
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +17 -41
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +43 -32
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +30 -170
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +171 -40
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +41 -17
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +17 -33
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +33 -52
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +50 -61
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +60 -181
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +184 -18
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +15 -271
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +270 -1083
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +1086 -16
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +17 -17
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +15 -120
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +119 -37
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +40 -398
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +390 -89
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +91 -253
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +249 -145
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +155 -15
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +15 -17
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +16 -136
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +134 -10
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +13 -35
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +35 -34
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +34 -81
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +71 -166
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +167 -144
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +152 -11
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +10 -20
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +55 -12
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +14 -7
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +6 -333
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +334 -47
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +47 -122
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +120 -108
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +107 -167
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +167 -29
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +30 -120
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +116 -80
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +85 -19
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +19 -73
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +71 -54
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +56 -44
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +42 -49
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +50 -121
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +118 -102
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +105 -72
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +73 -67
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +66 -19
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +18 -55
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +55 -251
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +254 -22
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +22 -31
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +30 -93
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +89 -324
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +322 -73
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +79 -39
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +40 -23
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +21 -93
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +87 -148
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +147 -152
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +159 -63
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +65 -35
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +35 -234
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +231 -31
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +34 -210
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +195 -198
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +159 -241
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +283 -166
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +173 -253
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +253 -121
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +126 -14
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +12 -31
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +32 -5
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index48.js
CHANGED
|
@@ -1,38 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
sm: "loading-sm",
|
|
14
|
-
md: "loading-md",
|
|
15
|
-
lg: "loading-lg"
|
|
16
|
-
}, o = ["loading", {
|
|
17
|
-
spinner: "loading-spinner",
|
|
18
|
-
dots: "loading-dots",
|
|
19
|
-
ring: "loading-ring",
|
|
20
|
-
ball: "loading-ball",
|
|
21
|
-
bars: "loading-bars",
|
|
22
|
-
infinity: "loading-infinity"
|
|
23
|
-
}[t], c[r], d].filter(Boolean).join(" ");
|
|
24
|
-
return n ? /* @__PURE__ */ a("div", { className: "relative", ...i, children: [
|
|
25
|
-
l && /* @__PURE__ */ a("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-base-100/50 backdrop-blur-sm z-10", children: [
|
|
26
|
-
/* @__PURE__ */ s("span", { className: o }),
|
|
27
|
-
e && /* @__PURE__ */ s("p", { className: "mt-2 text-sm", children: e })
|
|
28
|
-
] }),
|
|
29
|
-
/* @__PURE__ */ s("div", { className: l ? "pointer-events-none" : "", children: n })
|
|
30
|
-
] }) : l ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", ...i, children: [
|
|
31
|
-
/* @__PURE__ */ s("span", { className: o }),
|
|
32
|
-
e && /* @__PURE__ */ s("p", { className: "text-sm", children: e })
|
|
33
|
-
] }) : null;
|
|
34
|
-
};
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
function e({ children: s, className: o = "", ...t }) {
|
|
3
|
+
const i = ["list", o].filter(Boolean).join(" ");
|
|
4
|
+
return /* @__PURE__ */ n("ul", { className: i, ...t, children: s });
|
|
5
|
+
}
|
|
6
|
+
function l({ children: s, className: o = "", ...t }) {
|
|
7
|
+
const i = ["list-row", o].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ n("li", { className: i, ...t, children: s });
|
|
9
|
+
}
|
|
10
|
+
const r = Object.assign(e, {
|
|
11
|
+
Row: l
|
|
12
|
+
});
|
|
35
13
|
export {
|
|
36
|
-
|
|
14
|
+
r as List
|
|
37
15
|
};
|
|
38
16
|
//# sourceMappingURL=index48.js.map
|
package/dist/index48.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index48.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index48.js","sources":["../src/components/List.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ListProps extends React.HTMLAttributes<HTMLUListElement> {\n children: React.ReactNode\n}\n\nexport interface ListRowProps extends React.LiHTMLAttributes<HTMLLIElement> {\n children: React.ReactNode\n}\n\nfunction ListRoot({ children, className = '', ...rest }: ListProps) {\n const classes = ['list', className].filter(Boolean).join(' ')\n return <ul className={classes} {...rest}>{children}</ul>\n}\n\nfunction ListRow({ children, className = '', ...rest }: ListRowProps) {\n const classes = ['list-row', className].filter(Boolean).join(' ')\n return <li className={classes} {...rest}>{children}</li>\n}\n\nexport const List = Object.assign(ListRoot, {\n Row: ListRow,\n})\n"],"names":["ListRoot","children","className","rest","classes","ListRow","List"],"mappings":";AAUA,SAASA,EAAS,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAAmB;AAClE,QAAMC,IAAU,CAAC,QAAQF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAC5D,2BAAQ,MAAA,EAAG,WAAWE,GAAU,GAAGD,GAAO,UAAAF,GAAS;AACrD;AAEA,SAASI,EAAQ,EAAE,UAAAJ,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAAsB;AACpE,QAAMC,IAAU,CAAC,YAAYF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAChE,2BAAQ,MAAA,EAAG,WAAWE,GAAU,GAAGD,GAAO,UAAAF,GAAS;AACrD;AAEO,MAAMK,IAAO,OAAO,OAAON,GAAU;AAAA,EAC1C,KAAKK;AACP,CAAC;"}
|
package/dist/index49.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
|
|
1
|
+
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
const f = ({
|
|
3
|
+
size: r = "md",
|
|
4
|
+
type: t = "spinner",
|
|
5
|
+
className: d = "",
|
|
6
|
+
spinning: l = !0,
|
|
7
|
+
children: n,
|
|
8
|
+
tip: e,
|
|
9
|
+
...i
|
|
10
|
+
}) => {
|
|
11
|
+
const c = {
|
|
12
|
+
xs: "loading-xs",
|
|
13
|
+
sm: "loading-sm",
|
|
14
|
+
md: "loading-md",
|
|
15
|
+
lg: "loading-lg"
|
|
16
|
+
}, o = ["loading", {
|
|
17
|
+
spinner: "loading-spinner",
|
|
18
|
+
dots: "loading-dots",
|
|
19
|
+
ring: "loading-ring",
|
|
20
|
+
ball: "loading-ball",
|
|
21
|
+
bars: "loading-bars",
|
|
22
|
+
infinity: "loading-infinity"
|
|
23
|
+
}[t], c[r], d].filter(Boolean).join(" ");
|
|
24
|
+
return n ? /* @__PURE__ */ a("div", { className: "relative", ...i, children: [
|
|
25
|
+
l && /* @__PURE__ */ a("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-base-100/50 backdrop-blur-sm z-10", children: [
|
|
26
|
+
/* @__PURE__ */ s("span", { className: o }),
|
|
27
|
+
e && /* @__PURE__ */ s("p", { className: "mt-2 text-sm", children: e })
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ s("div", { className: l ? "pointer-events-none" : "", children: n })
|
|
30
|
+
] }) : l ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", ...i, children: [
|
|
31
|
+
/* @__PURE__ */ s("span", { className: o }),
|
|
32
|
+
e && /* @__PURE__ */ s("p", { className: "text-sm", children: e })
|
|
33
|
+
] }) : null;
|
|
34
|
+
};
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
f as Loading
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=index49.js.map
|
package/dist/index49.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index49.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index49.js","sources":["../src/components/Loading.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface LoadingProps extends React.HTMLAttributes<HTMLDivElement> {\n size?: 'xs' | 'sm' | 'md' | 'lg'\n type?: 'spinner' | 'dots' | 'ring' | 'ball' | 'bars' | 'infinity'\n spinning?: boolean\n children?: React.ReactNode\n tip?: string\n}\n\nexport const Loading: React.FC<LoadingProps> = ({\n size = 'md',\n type = 'spinner',\n className = '',\n spinning = true,\n children,\n tip,\n ...rest\n}) => {\n const sizeClasses = {\n xs: 'loading-xs',\n sm: 'loading-sm',\n md: 'loading-md',\n lg: 'loading-lg',\n }\n\n const typeClasses = {\n spinner: 'loading-spinner',\n dots: 'loading-dots',\n ring: 'loading-ring',\n ball: 'loading-ball',\n bars: 'loading-bars',\n infinity: 'loading-infinity',\n }\n\n const spinnerClasses = ['loading', typeClasses[type], sizeClasses[size], className]\n .filter(Boolean)\n .join(' ')\n\n if (children) {\n return (\n <div className=\"relative\" {...rest}>\n {spinning && (\n <div className=\"absolute inset-0 flex flex-col items-center justify-center bg-base-100/50 backdrop-blur-sm z-10\">\n <span className={spinnerClasses}></span>\n {tip && <p className=\"mt-2 text-sm\">{tip}</p>}\n </div>\n )}\n <div className={spinning ? 'pointer-events-none' : ''}>{children}</div>\n </div>\n )\n }\n\n if (!spinning) {\n return null\n }\n\n return (\n <div className=\"flex flex-col items-center gap-2\" {...rest}>\n <span className={spinnerClasses}></span>\n {tip && <p className=\"text-sm\">{tip}</p>}\n </div>\n )\n}\n"],"names":["Loading","size","type","className","spinning","children","tip","rest","sizeClasses","spinnerClasses","jsxs","jsx"],"mappings":";AAUO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,KAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAc;AAAA,IAClB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,GAYAC,IAAiB,CAAC,WATJ;AAAA,IAClB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,EAAA,EAGmCP,CAAI,GAAGM,EAAYP,CAAI,GAAGE,CAAS,EAC/E,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SAAIE,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,YAAY,GAAGH,GAC3B,UAAA;AAAA,IAAAH,KACC,gBAAAM,EAAC,OAAA,EAAI,WAAU,mGACb,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWF,EAAA,CAAgB;AAAA,MAChCH,KAAO,gBAAAK,EAAC,KAAA,EAAE,WAAU,gBAAgB,UAAAL,EAAA,CAAI;AAAA,IAAA,GAC3C;AAAA,sBAED,OAAA,EAAI,WAAWF,IAAW,wBAAwB,IAAK,UAAAC,EAAA,CAAS;AAAA,EAAA,GACnE,IAICD,IAKH,gBAAAM,EAAC,OAAA,EAAI,WAAU,oCAAoC,GAAGH,GACpD,UAAA;AAAA,IAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWF,EAAA,CAAgB;AAAA,IAChCH,KAAO,gBAAAK,EAAC,KAAA,EAAE,WAAU,WAAW,UAAAL,EAAA,CAAI;AAAA,EAAA,GACtC,IAPO;AASX;"}
|
package/dist/index50.js
CHANGED
|
@@ -1,84 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
o[h] += F + r;
|
|
35
|
-
}), T(W), N(Math.max(...o) - r);
|
|
36
|
-
}, [t, e, r, c.length]);
|
|
37
|
-
A(() => {
|
|
38
|
-
s();
|
|
39
|
-
const i = () => {
|
|
40
|
-
s();
|
|
41
|
-
};
|
|
42
|
-
return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
|
43
|
-
}, [s]), A(() => {
|
|
44
|
-
const i = setTimeout(s, 0);
|
|
45
|
-
return () => clearTimeout(i);
|
|
46
|
-
}, [t, s]);
|
|
47
|
-
const v = u.current?.offsetWidth ?? 0, S = typeof window < "u" ? window.innerWidth : v, g = L(e, S), p = v > 0 ? (v - r * (g - 1)) / g : 0;
|
|
48
|
-
return /* @__PURE__ */ H(
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
ref: u,
|
|
52
|
-
className: z,
|
|
53
|
-
style: {
|
|
54
|
-
position: "relative",
|
|
55
|
-
height: y > 0 ? y : void 0,
|
|
56
|
-
...M
|
|
57
|
-
},
|
|
58
|
-
...P,
|
|
59
|
-
children: c.map((i, n) => /* @__PURE__ */ H(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
ref: (m) => {
|
|
63
|
-
w.current[n] = m;
|
|
64
|
-
},
|
|
65
|
-
style: {
|
|
66
|
-
position: l.length > 0 ? "absolute" : "relative",
|
|
67
|
-
left: l[n]?.left ?? 0,
|
|
68
|
-
top: l[n]?.top ?? 0,
|
|
69
|
-
width: p > 0 ? p : "100%",
|
|
70
|
-
visibility: l.length > 0 ? "visible" : "hidden"
|
|
71
|
-
},
|
|
72
|
-
children: i
|
|
73
|
-
},
|
|
74
|
-
n
|
|
75
|
-
))
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
O.displayName = "Masonry";
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
const i = {
|
|
4
|
+
squircle: "mask-squircle",
|
|
5
|
+
heart: "mask-heart",
|
|
6
|
+
hexagon: "mask-hexagon",
|
|
7
|
+
"hexagon-2": "mask-hexagon-2",
|
|
8
|
+
decagon: "mask-decagon",
|
|
9
|
+
pentagon: "mask-pentagon",
|
|
10
|
+
diamond: "mask-diamond",
|
|
11
|
+
square: "mask-square",
|
|
12
|
+
circle: "mask-circle",
|
|
13
|
+
star: "mask-star",
|
|
14
|
+
"star-2": "mask-star-2",
|
|
15
|
+
triangle: "mask-triangle",
|
|
16
|
+
"triangle-2": "mask-triangle-2",
|
|
17
|
+
"triangle-3": "mask-triangle-3",
|
|
18
|
+
"triangle-4": "mask-triangle-4"
|
|
19
|
+
}, k = {
|
|
20
|
+
"half-1": "mask-half-1",
|
|
21
|
+
"half-2": "mask-half-2"
|
|
22
|
+
}, g = o(
|
|
23
|
+
({ shape: s, half: a, children: e, className: r = "", ...n }, m) => {
|
|
24
|
+
const t = [
|
|
25
|
+
"mask",
|
|
26
|
+
i[s],
|
|
27
|
+
a ? k[a] : "",
|
|
28
|
+
r
|
|
29
|
+
].filter(Boolean).join(" ");
|
|
30
|
+
return /* @__PURE__ */ l("div", { ref: m, className: t, ...n, children: e });
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
g.displayName = "Mask";
|
|
80
34
|
export {
|
|
81
|
-
|
|
82
|
-
O as default
|
|
35
|
+
g as Mask
|
|
83
36
|
};
|
|
84
37
|
//# sourceMappingURL=index50.js.map
|
package/dist/index50.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index50.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index50.js","sources":["../src/components/Mask.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nexport type MaskShape =\n | 'squircle'\n | 'heart'\n | 'hexagon'\n | 'hexagon-2'\n | 'decagon'\n | 'pentagon'\n | 'diamond'\n | 'square'\n | 'circle'\n | 'star'\n | 'star-2'\n | 'triangle'\n | 'triangle-2'\n | 'triangle-3'\n | 'triangle-4'\n\nexport type MaskHalf = 'half-1' | 'half-2'\n\nexport interface MaskProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Shape of the mask */\n shape: MaskShape\n /** Show only half of the mask */\n half?: MaskHalf\n /** Content to mask (typically an image) */\n children: React.ReactNode\n /** Additional CSS classes */\n className?: string\n}\n\nconst shapeClasses: Record<MaskShape, string> = {\n squircle: 'mask-squircle',\n heart: 'mask-heart',\n hexagon: 'mask-hexagon',\n 'hexagon-2': 'mask-hexagon-2',\n decagon: 'mask-decagon',\n pentagon: 'mask-pentagon',\n diamond: 'mask-diamond',\n square: 'mask-square',\n circle: 'mask-circle',\n star: 'mask-star',\n 'star-2': 'mask-star-2',\n triangle: 'mask-triangle',\n 'triangle-2': 'mask-triangle-2',\n 'triangle-3': 'mask-triangle-3',\n 'triangle-4': 'mask-triangle-4',\n}\n\nconst halfClasses: Record<MaskHalf, string> = {\n 'half-1': 'mask-half-1',\n 'half-2': 'mask-half-2',\n}\n\nexport const Mask = forwardRef<HTMLDivElement, MaskProps>(\n ({ shape, half, children, className = '', ...props }, ref) => {\n const classes = [\n 'mask',\n shapeClasses[shape],\n half ? halfClasses[half] : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div ref={ref} className={classes} {...props}>\n {children}\n </div>\n )\n }\n)\n\nMask.displayName = 'Mask'\n"],"names":["shapeClasses","halfClasses","Mask","forwardRef","shape","half","children","className","props","ref","classes"],"mappings":";;AAgCA,MAAMA,IAA0C;AAAA,EAC9C,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAChB,GAEMC,IAAwC;AAAA,EAC5C,UAAU;AAAA,EACV,UAAU;AACZ,GAEaC,IAAOC;AAAA,EAClB,CAAC,EAAE,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,EAAA,GAASC,MAAQ;AAC5D,UAAMC,IAAU;AAAA,MACd;AAAA,MACAV,EAAaI,CAAK;AAAA,MAClBC,IAAOJ,EAAYI,CAAI,IAAI;AAAA,MAC3BE;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,6BACG,OAAA,EAAI,KAAAE,GAAU,WAAWC,GAAU,GAAGF,GACpC,UAAAF,GACH;AAAA,EAEJ;AACF;AAEAJ,EAAK,cAAc;"}
|
package/dist/index51.js
CHANGED
|
@@ -1,179 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
filterOption: x = !0,
|
|
21
|
-
className: Z = "",
|
|
22
|
-
dropdownClassName: _ = "",
|
|
23
|
-
...z
|
|
1
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import I, { useRef as R, useState as b, useCallback as K, useLayoutEffect as A } from "react";
|
|
3
|
+
const d = {
|
|
4
|
+
sm: 640,
|
|
5
|
+
md: 768,
|
|
6
|
+
lg: 1024,
|
|
7
|
+
xl: 1280,
|
|
8
|
+
"2xl": 1536
|
|
9
|
+
};
|
|
10
|
+
function L(t, e) {
|
|
11
|
+
return typeof t == "number" ? t : t ? t["2xl"] !== void 0 && e >= d["2xl"] ? t["2xl"] : t.xl !== void 0 && e >= d.xl ? t.xl : t.lg !== void 0 && e >= d.lg ? t.lg : t.md !== void 0 && e >= d.md ? t.md : t.sm !== void 0 && e >= d.sm ? t.sm : t.xs !== void 0 ? t.xs : 3 : 3;
|
|
12
|
+
}
|
|
13
|
+
const O = ({
|
|
14
|
+
children: t,
|
|
15
|
+
columns: e = 3,
|
|
16
|
+
gap: r = 16,
|
|
17
|
+
className: z = "",
|
|
18
|
+
style: M,
|
|
19
|
+
...P
|
|
24
20
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (!e || !t || g === null) return;
|
|
46
|
-
const n = h.substring(0, g);
|
|
47
|
-
t.textContent = n;
|
|
48
|
-
const r = e.getBoundingClientRect(), s = t.getBoundingClientRect(), w = parseInt(getComputedStyle(e).lineHeight) || 20;
|
|
49
|
-
te({
|
|
50
|
-
top: r.top + window.scrollY + w + 4,
|
|
51
|
-
left: r.left + window.scrollX + Math.min(s.width % r.width, r.width - 200)
|
|
52
|
-
});
|
|
53
|
-
}, [h, g]);
|
|
54
|
-
C(() => {
|
|
55
|
-
u && O();
|
|
56
|
-
}, [u, O, D]);
|
|
57
|
-
const re = (e) => {
|
|
58
|
-
const t = e.target.value, n = e.target.selectionStart;
|
|
59
|
-
p === void 0 && T(t), E?.(t), se(t, n);
|
|
60
|
-
}, se = (e, t) => {
|
|
61
|
-
let n = null, r = null;
|
|
62
|
-
for (const s of ne) {
|
|
63
|
-
const i = e.substring(0, t).lastIndexOf(s);
|
|
64
|
-
if (i !== -1) {
|
|
65
|
-
const S = i > 0 ? e[i - 1] : v;
|
|
66
|
-
if (S === v || S === `
|
|
67
|
-
` || i === 0) {
|
|
68
|
-
const F = e.substring(i + s.length, t);
|
|
69
|
-
if (!F.includes(v) && !F.includes(`
|
|
70
|
-
`)) {
|
|
71
|
-
n = s, r = i;
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (n !== null && r !== null) {
|
|
78
|
-
const s = e.substring(r + n.length, t);
|
|
79
|
-
N(n), M(s), H(r), m(!0), y(0), W?.(s, n);
|
|
80
|
-
} else
|
|
81
|
-
m(!1), N(null), M(""), H(null);
|
|
82
|
-
}, P = (e) => {
|
|
83
|
-
if (e.disabled || g === null || I === null) return;
|
|
84
|
-
const t = l.current;
|
|
85
|
-
if (!t) return;
|
|
86
|
-
const n = h.substring(0, g), r = h.substring(t.selectionStart), s = `${I}${e.value}${v}`, w = n + s + r;
|
|
87
|
-
p === void 0 && T(w), E?.(w), U?.(e, I), m(!1), N(null), M(""), H(null), setTimeout(() => {
|
|
88
|
-
const i = n.length + s.length;
|
|
89
|
-
t.focus(), t.setSelectionRange(i, i);
|
|
90
|
-
}, 0);
|
|
91
|
-
}, ae = (e) => {
|
|
92
|
-
if (u)
|
|
93
|
-
switch (e.key) {
|
|
94
|
-
case "ArrowDown":
|
|
95
|
-
e.preventDefault(), y((t) => (t + 1) % Math.max(c.length, 1));
|
|
96
|
-
break;
|
|
97
|
-
case "ArrowUp":
|
|
98
|
-
e.preventDefault(), y((t) => (t - 1 + c.length) % Math.max(c.length, 1));
|
|
99
|
-
break;
|
|
100
|
-
case "Enter":
|
|
101
|
-
c[d] && (e.preventDefault(), P(c[d]));
|
|
102
|
-
break;
|
|
103
|
-
case "Escape":
|
|
104
|
-
e.preventDefault(), m(!1);
|
|
105
|
-
break;
|
|
106
|
-
case "Tab":
|
|
107
|
-
c[d] && (e.preventDefault(), P(c[d]));
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
C(() => {
|
|
112
|
-
const e = (t) => {
|
|
113
|
-
b.current && !b.current.contains(t.target) && l.current && !l.current.contains(t.target) && m(!1);
|
|
21
|
+
const u = R(null), [l, T] = b([]), [y, N] = b(0), w = R([]), c = I.Children.toArray(t), s = K(() => {
|
|
22
|
+
const i = u.current;
|
|
23
|
+
if (!i || c.length === 0) return;
|
|
24
|
+
const n = i.offsetWidth, m = typeof window < "u" ? window.innerWidth : n, a = L(e, m), j = (n - r * (a - 1)) / a, o = new Array(a).fill(0), W = [];
|
|
25
|
+
c.forEach((_, x) => {
|
|
26
|
+
const C = w.current[x];
|
|
27
|
+
if (!C) return;
|
|
28
|
+
let h = 0, E = o[0];
|
|
29
|
+
for (let f = 1; f < a; f++)
|
|
30
|
+
o[f] < E && (E = o[f], h = f);
|
|
31
|
+
const k = h * (j + r), B = o[h];
|
|
32
|
+
W[x] = { left: k, top: B };
|
|
33
|
+
const F = C.offsetHeight;
|
|
34
|
+
o[h] += F + r;
|
|
35
|
+
}), T(W), N(Math.max(...o) - r);
|
|
36
|
+
}, [t, e, r, c.length]);
|
|
37
|
+
A(() => {
|
|
38
|
+
s();
|
|
39
|
+
const i = () => {
|
|
40
|
+
s();
|
|
114
41
|
};
|
|
115
|
-
return
|
|
116
|
-
}, []),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
42
|
+
return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
|
43
|
+
}, [s]), A(() => {
|
|
44
|
+
const i = setTimeout(s, 0);
|
|
45
|
+
return () => clearTimeout(i);
|
|
46
|
+
}, [t, s]);
|
|
47
|
+
const v = u.current?.offsetWidth ?? 0, S = typeof window < "u" ? window.innerWidth : v, g = L(e, S), p = v > 0 ? (v - r * (g - 1)) / g : 0;
|
|
48
|
+
return /* @__PURE__ */ H(
|
|
120
49
|
"div",
|
|
121
50
|
{
|
|
122
|
-
ref:
|
|
123
|
-
className:
|
|
124
|
-
min-w-48 max-h-60 overflow-auto ${_}`,
|
|
51
|
+
ref: u,
|
|
52
|
+
className: z,
|
|
125
53
|
style: {
|
|
126
|
-
|
|
127
|
-
|
|
54
|
+
position: "relative",
|
|
55
|
+
height: y > 0 ? y : void 0,
|
|
56
|
+
...M
|
|
128
57
|
},
|
|
129
|
-
|
|
130
|
-
|
|
58
|
+
...P,
|
|
59
|
+
children: c.map((i, n) => /* @__PURE__ */ H(
|
|
60
|
+
"div",
|
|
131
61
|
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
62
|
+
ref: (m) => {
|
|
63
|
+
w.current[n] = m;
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
position: l.length > 0 ? "absolute" : "relative",
|
|
67
|
+
left: l[n]?.left ?? 0,
|
|
68
|
+
top: l[n]?.top ?? 0,
|
|
69
|
+
width: p > 0 ? p : "100%",
|
|
70
|
+
visibility: l.length > 0 ? "visible" : "hidden"
|
|
71
|
+
},
|
|
72
|
+
children: i
|
|
73
|
+
},
|
|
74
|
+
n
|
|
75
|
+
))
|
|
143
76
|
}
|
|
144
77
|
);
|
|
145
|
-
return /* @__PURE__ */ K("div", { className: `relative ${Z}`, "data-state": u ? "open" : "closed", ...z, children: [
|
|
146
|
-
/* @__PURE__ */ a(
|
|
147
|
-
"div",
|
|
148
|
-
{
|
|
149
|
-
ref: B,
|
|
150
|
-
className: "invisible absolute whitespace-pre-wrap break-words",
|
|
151
|
-
style: {
|
|
152
|
-
font: l.current ? getComputedStyle(l.current).font : void 0,
|
|
153
|
-
width: l.current?.clientWidth,
|
|
154
|
-
padding: l.current ? getComputedStyle(l.current).padding : void 0
|
|
155
|
-
},
|
|
156
|
-
"aria-hidden": "true"
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
/* @__PURE__ */ a(
|
|
160
|
-
"textarea",
|
|
161
|
-
{
|
|
162
|
-
ref: l,
|
|
163
|
-
value: h,
|
|
164
|
-
onChange: re,
|
|
165
|
-
onKeyDown: ae,
|
|
166
|
-
placeholder: Y,
|
|
167
|
-
disabled: G,
|
|
168
|
-
readOnly: J,
|
|
169
|
-
rows: typeof o == "object" ? o.minRows || V : o ? 1 : V,
|
|
170
|
-
className: "textarea textarea-bordered w-full resize-none"
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
oe(le, document.body)
|
|
174
|
-
] });
|
|
175
78
|
};
|
|
79
|
+
O.displayName = "Masonry";
|
|
176
80
|
export {
|
|
177
|
-
|
|
81
|
+
O as Masonry,
|
|
82
|
+
O as default
|
|
178
83
|
};
|
|
179
84
|
//# sourceMappingURL=index51.js.map
|