asterui 0.12.0 → 0.12.2
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/README.md +1 -1
- package/dist/components/Calendar.d.ts +23 -0
- package/dist/components/Checkbox.d.ts +10 -0
- package/dist/components/Dock.d.ts +38 -0
- package/dist/components/Form.d.ts +27 -2
- package/dist/components/Mask.d.ts +14 -0
- package/dist/components/Radio.d.ts +7 -1
- package/dist/components/Status.d.ts +18 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +203 -192
- package/dist/index.js.map +1 -1
- package/dist/index10.js +85 -59
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +44 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +11 -29
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +13 -16
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +7 -10792
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +13 -5
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +30 -41
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +18 -2
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +174 -7
- package/dist/index107.js.map +1 -1
- package/dist/index109.js +10788 -25
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +5 -30
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +42 -2
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +2 -72
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +6 -38
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +150 -24
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +29 -20
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +29 -23
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -20
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +71 -99
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +37 -358
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +23 -22
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +20 -72
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +23 -15
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +19 -65
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +92 -136
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +360 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +23 -54
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +73 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +16 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +66 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +35 -95
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +144 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index132.js +56 -2
- package/dist/index132.js.map +1 -1
- package/dist/index135.js +2 -32
- package/dist/index135.js.map +1 -1
- package/dist/index137.js +2 -8
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -2
- package/dist/index139.js +2 -2
- package/dist/index14.js +90 -153
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +2 -21
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +32 -2
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +2 -24
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +7 -70
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +2 -21
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +2 -34
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +20 -69
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +2 -2
- package/dist/index148.js +23 -21
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +71 -2
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +154 -146
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +21 -2
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +34 -2
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +70 -2
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +2 -4
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +25 -0
- package/dist/index154.js.map +1 -0
- package/dist/index155.js +5 -0
- package/dist/index155.js.map +1 -0
- package/dist/index156.js +5 -0
- package/dist/index156.js.map +1 -0
- package/dist/index157.js +5 -0
- package/dist/index157.js.map +1 -0
- package/dist/index158.js +5 -0
- package/dist/index158.js.map +1 -0
- package/dist/index159.js +7 -0
- package/dist/index159.js.map +1 -0
- 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 +71 -17
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +15 -96
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +89 -105
- 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 +19 -32
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +42 -40
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +31 -11
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +41 -33
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +12 -63
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +33 -80
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +63 -18
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +78 -159
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +16 -1080
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +218 -16
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +1081 -121
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +17 -39
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +121 -190
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +37 -94
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +186 -157
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +89 -138
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +161 -14
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +146 -18
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +14 -20
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +15 -116
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +18 -10
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +119 -35
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +12 -115
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +33 -174
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +10 -147
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +116 -12
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +176 -22
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +147 -14
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +10 -5
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +21 -265
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +10 -13
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +7 -122
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +262 -106
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +14 -167
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +121 -31
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +107 -119
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +161 -77
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +31 -19
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +117 -69
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +82 -53
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +19 -44
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +70 -48
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +55 -60
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +39 -101
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +52 -41
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +58 -64
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +105 -19
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +41 -46
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +63 -129
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +19 -50
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +46 -22
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +134 -22
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +51 -328
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +19 -53
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +31 -40
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +22 -23
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +319 -85
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +52 -126
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +39 -160
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +23 -65
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +95 -35
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +126 -230
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +159 -32
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +60 -205
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +34 -212
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +229 -290
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +32 -176
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +199 -247
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +211 -12
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +290 -28
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +177 -5
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +257 -13
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +13 -45
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +32 -12
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -14
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +13 -7
- package/dist/index99.js.map +1 -1
- package/package.json +2 -1
- package/dist/index108.js +0 -155
- package/dist/index108.js.map +0 -1
package/dist/index83.js
CHANGED
|
@@ -1,68 +1,26 @@
|
|
|
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
|
-
}) : s);
|
|
24
|
-
return /* @__PURE__ */ e("ul", { className: h, ...t, children: f });
|
|
25
|
-
}
|
|
26
|
-
function p({
|
|
27
|
-
start: n,
|
|
28
|
-
end: l,
|
|
29
|
-
icon: i,
|
|
30
|
-
startBox: o = !1,
|
|
31
|
-
endBox: a = !1,
|
|
32
|
-
className: r = "",
|
|
33
|
-
_index: t = 0,
|
|
34
|
-
_compact: h = !1,
|
|
35
|
-
_vertical: f = !1,
|
|
36
|
-
...s
|
|
37
|
-
}) {
|
|
38
|
-
const m = ["timeline-start", o && "timeline-box"].filter(Boolean).join(" "), c = ["timeline-end", a && "timeline-box"].filter(Boolean).join(" "), u = t % 2 === 0;
|
|
39
|
-
return h ? /* @__PURE__ */ d("li", { className: r, ...s, children: [
|
|
40
|
-
/* @__PURE__ */ e("hr", {}),
|
|
41
|
-
i && /* @__PURE__ */ e("div", { className: "timeline-middle", children: i }),
|
|
42
|
-
l && /* @__PURE__ */ e("div", { className: c, children: l }),
|
|
43
|
-
t !== void 0 && /* @__PURE__ */ e("hr", {})
|
|
44
|
-
] }) : f ? /* @__PURE__ */ d("li", { className: r, ...s, children: [
|
|
45
|
-
/* @__PURE__ */ e("hr", {}),
|
|
46
|
-
n && /* @__PURE__ */ e("div", { className: m, children: n }),
|
|
47
|
-
i && /* @__PURE__ */ e("div", { className: "timeline-middle", children: i }),
|
|
48
|
-
l && /* @__PURE__ */ e("div", { className: c, children: l }),
|
|
49
|
-
/* @__PURE__ */ e("hr", {})
|
|
50
|
-
] }) : u ? /* @__PURE__ */ d("li", { className: r, ...s, children: [
|
|
51
|
-
n && /* @__PURE__ */ e("div", { className: m, children: n }),
|
|
52
|
-
i && /* @__PURE__ */ e("div", { className: "timeline-middle", children: i }),
|
|
53
|
-
l && /* @__PURE__ */ e("div", { className: c, children: l }),
|
|
54
|
-
/* @__PURE__ */ e("hr", {})
|
|
55
|
-
] }) : /* @__PURE__ */ d("li", { className: r, ...s, children: [
|
|
56
|
-
/* @__PURE__ */ e("hr", {}),
|
|
57
|
-
i && /* @__PURE__ */ e("div", { className: "timeline-middle", children: i }),
|
|
58
|
-
n && /* @__PURE__ */ e("div", { className: m, children: n }),
|
|
59
|
-
l && /* @__PURE__ */ e("div", { className: c, children: l })
|
|
60
|
-
] });
|
|
61
|
-
}
|
|
62
|
-
const b = Object.assign(N, {
|
|
63
|
-
Item: p
|
|
64
|
-
});
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
const c = {
|
|
3
|
+
6e3: "duration-6000",
|
|
4
|
+
9e3: "duration-9000",
|
|
5
|
+
12e3: "duration-12000",
|
|
6
|
+
15e3: "duration-15000",
|
|
7
|
+
18e3: "duration-18000"
|
|
8
|
+
}, l = ({
|
|
9
|
+
items: s,
|
|
10
|
+
duration: e,
|
|
11
|
+
centered: a = !1,
|
|
12
|
+
className: n = ""
|
|
13
|
+
}) => {
|
|
14
|
+
const r = e ? c[e] : "";
|
|
15
|
+
return /* @__PURE__ */ t(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: `text-rotate ${r} ${a ? "justify-items-center" : ""} ${n}`.trim(),
|
|
19
|
+
children: /* @__PURE__ */ t("span", { children: s.slice(0, 6).map((i, o) => /* @__PURE__ */ t("span", { children: i }, o)) })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
65
23
|
export {
|
|
66
|
-
|
|
24
|
+
l as TextRotate
|
|
67
25
|
};
|
|
68
26
|
//# sourceMappingURL=index83.js.map
|
package/dist/index83.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index83.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index83.js","sources":["../src/components/TextRotate.tsx"],"sourcesContent":["import React from 'react'\n\nexport type TextRotateDuration = 6000 | 9000 | 12000 | 15000 | 18000\n\nconst durationClasses: Record<TextRotateDuration, string> = {\n 6000: 'duration-6000',\n 9000: 'duration-9000',\n 12000: 'duration-12000',\n 15000: 'duration-15000',\n 18000: 'duration-18000',\n}\n\nexport interface TextRotateProps {\n /** Text items to rotate through (max 6) */\n items: React.ReactNode[]\n /** Animation duration in ms (default 10000) */\n duration?: TextRotateDuration\n /** Center text horizontally */\n centered?: boolean\n /** Additional CSS classes */\n className?: string\n}\n\nexport const TextRotate: React.FC<TextRotateProps> = ({\n items,\n duration,\n centered = false,\n className = '',\n}) => {\n const durationClass = duration ? durationClasses[duration] : ''\n\n return (\n <span\n className={`text-rotate ${durationClass} ${centered ? 'justify-items-center' : ''} ${className}`.trim()}\n >\n <span>\n {items.slice(0, 6).map((item, index) => (\n <span key={index}>{item}</span>\n ))}\n </span>\n </span>\n )\n}\n"],"names":["durationClasses","TextRotate","items","duration","centered","className","durationClass","jsx","item","index"],"mappings":";AAIA,MAAMA,IAAsD;AAAA,EAC1D,KAAM;AAAA,EACN,KAAM;AAAA,EACN,MAAO;AAAA,EACP,MAAO;AAAA,EACP,MAAO;AACT,GAaaC,IAAwC,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAAgBH,IAAWH,EAAgBG,CAAQ,IAAI;AAE7D,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,eAAeD,CAAa,IAAIF,IAAW,yBAAyB,EAAE,IAAIC,CAAS,GAAG,KAAA;AAAA,MAEjG,4BAAC,QAAA,EACE,UAAAH,EAAM,MAAM,GAAG,CAAC,EAAE,IAAI,CAACM,GAAMC,MAC5B,gBAAAF,EAAC,QAAA,EAAkB,UAAAC,EAAA,GAARC,CAAa,CACzB,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/index84.js
CHANGED
|
@@ -1,38 +1,98 @@
|
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { jsxs as g, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C } from "react";
|
|
3
|
+
const v = ({
|
|
4
|
+
closable: s = !1,
|
|
5
|
+
closeIcon: t,
|
|
6
|
+
onClose: n,
|
|
7
|
+
color: e,
|
|
8
|
+
icon: r,
|
|
9
|
+
size: o = "md",
|
|
10
|
+
children: l,
|
|
11
|
+
className: i = "",
|
|
12
|
+
...b
|
|
13
|
+
}) => {
|
|
14
|
+
const [m, u] = C(!0), h = () => {
|
|
15
|
+
u(!1), n?.();
|
|
16
|
+
};
|
|
17
|
+
if (!m) return null;
|
|
18
|
+
const d = () => {
|
|
19
|
+
if (!e) return "";
|
|
20
|
+
const c = {
|
|
21
|
+
primary: "badge-primary",
|
|
22
|
+
secondary: "badge-secondary",
|
|
23
|
+
accent: "badge-accent",
|
|
24
|
+
neutral: "badge-neutral",
|
|
25
|
+
info: "badge-info",
|
|
26
|
+
success: "badge-success",
|
|
27
|
+
warning: "badge-warning",
|
|
28
|
+
error: "badge-error",
|
|
29
|
+
ghost: "badge-ghost"
|
|
30
|
+
};
|
|
31
|
+
return c[e] ? c[e] : "";
|
|
32
|
+
}, p = {
|
|
33
|
+
xs: "badge-xs text-xs",
|
|
34
|
+
sm: "badge-sm text-sm",
|
|
35
|
+
md: "badge-md",
|
|
36
|
+
lg: "badge-lg text-lg"
|
|
37
|
+
}, f = [
|
|
38
|
+
"badge gap-1 inline-flex items-center",
|
|
39
|
+
d(),
|
|
40
|
+
p[o],
|
|
41
|
+
i
|
|
42
|
+
].filter(Boolean).join(" "), x = e && !d() ? { backgroundColor: e, borderColor: e } : void 0;
|
|
43
|
+
return /* @__PURE__ */ g("span", { className: f, style: x, ...b, children: [
|
|
44
|
+
r && /* @__PURE__ */ a("span", { className: "inline-flex", children: r }),
|
|
45
|
+
l,
|
|
46
|
+
s && /* @__PURE__ */ a(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: h,
|
|
51
|
+
className: "btn btn-ghost btn-xs p-0 min-h-0 h-auto hover:bg-transparent",
|
|
52
|
+
"aria-label": "Close",
|
|
53
|
+
children: t || /* @__PURE__ */ a(
|
|
54
|
+
"svg",
|
|
55
|
+
{
|
|
56
|
+
className: "w-3 h-3",
|
|
57
|
+
fill: "none",
|
|
58
|
+
stroke: "currentColor",
|
|
59
|
+
viewBox: "0 0 24 24",
|
|
60
|
+
children: /* @__PURE__ */ a(
|
|
61
|
+
"path",
|
|
62
|
+
{
|
|
63
|
+
strokeLinecap: "round",
|
|
64
|
+
strokeLinejoin: "round",
|
|
65
|
+
strokeWidth: 2,
|
|
66
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] });
|
|
74
|
+
}, N = ({
|
|
75
|
+
checked: s = !1,
|
|
76
|
+
onChange: t,
|
|
77
|
+
icon: n,
|
|
78
|
+
children: e,
|
|
79
|
+
className: r = "",
|
|
80
|
+
...o
|
|
81
|
+
}) => {
|
|
82
|
+
const l = () => {
|
|
83
|
+
t?.(!s);
|
|
84
|
+
}, i = [
|
|
85
|
+
"badge badge-md gap-1 cursor-pointer transition-colors",
|
|
86
|
+
s ? "badge-primary" : "badge-outline hover:badge-primary hover:badge-outline",
|
|
87
|
+
r
|
|
88
|
+
].filter(Boolean).join(" ");
|
|
89
|
+
return /* @__PURE__ */ g("span", { className: i, onClick: l, role: "checkbox", "aria-checked": s, ...o, children: [
|
|
90
|
+
n && /* @__PURE__ */ a("span", { className: "inline-flex", children: n }),
|
|
91
|
+
e
|
|
92
|
+
] });
|
|
93
|
+
};
|
|
35
94
|
export {
|
|
36
|
-
|
|
95
|
+
N as CheckableTag,
|
|
96
|
+
v as Tag
|
|
37
97
|
};
|
|
38
98
|
//# sourceMappingURL=index84.js.map
|
package/dist/index84.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index84.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index84.js","sources":["../src/components/Tag.tsx"],"sourcesContent":["import React, { useState } from 'react'\n\nexport interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> {\n closable?: boolean\n closeIcon?: React.ReactNode\n onClose?: () => void\n color?: string\n icon?: React.ReactNode\n size?: 'xs' | 'sm' | 'md' | 'lg'\n children?: React.ReactNode\n}\n\nexport interface CheckableTagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onChange'> {\n checked?: boolean\n onChange?: (checked: boolean) => void\n icon?: React.ReactNode\n children?: React.ReactNode\n}\n\nexport const Tag: React.FC<TagProps> = ({\n closable = false,\n closeIcon,\n onClose,\n color,\n icon,\n size = 'md',\n children,\n className = '',\n ...rest\n}) => {\n const [visible, setVisible] = useState(true)\n\n const handleClose = () => {\n setVisible(false)\n onClose?.()\n }\n\n if (!visible) return null\n\n // Map color to daisyUI badge classes\n const getColorClass = () => {\n if (!color) return ''\n\n const colorMap: Record<string, string> = {\n primary: 'badge-primary',\n secondary: 'badge-secondary',\n accent: 'badge-accent',\n neutral: 'badge-neutral',\n info: 'badge-info',\n success: 'badge-success',\n warning: 'badge-warning',\n error: 'badge-error',\n ghost: 'badge-ghost',\n }\n\n // Check if it's a preset color\n if (colorMap[color]) {\n return colorMap[color]\n }\n\n // Assume it's a custom hex/color\n return ''\n }\n\n const sizeClasses = {\n xs: 'badge-xs text-xs',\n sm: 'badge-sm text-sm',\n md: 'badge-md',\n lg: 'badge-lg text-lg',\n }\n\n const tagClasses = [\n 'badge gap-1 inline-flex items-center',\n getColorClass(),\n sizeClasses[size],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const customColorStyle = color && !getColorClass() ? { backgroundColor: color, borderColor: color } : undefined\n\n return (\n <span className={tagClasses} style={customColorStyle} {...rest}>\n {icon && <span className=\"inline-flex\">{icon}</span>}\n {children}\n {closable && (\n <button\n type=\"button\"\n onClick={handleClose}\n className=\"btn btn-ghost btn-xs p-0 min-h-0 h-auto hover:bg-transparent\"\n aria-label=\"Close\"\n >\n {closeIcon || (\n <svg\n className=\"w-3 h-3\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n )}\n </button>\n )}\n </span>\n )\n}\n\nexport const CheckableTag: React.FC<CheckableTagProps> = ({\n checked = false,\n onChange,\n icon,\n children,\n className = '',\n ...rest\n}) => {\n const handleClick = () => {\n onChange?.(!checked)\n }\n\n const tagClasses = [\n 'badge badge-md gap-1 cursor-pointer transition-colors',\n checked ? 'badge-primary' : 'badge-outline hover:badge-primary hover:badge-outline',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <span className={tagClasses} onClick={handleClick} role=\"checkbox\" aria-checked={checked} {...rest}>\n {icon && <span className=\"inline-flex\">{icon}</span>}\n {children}\n </span>\n )\n}\n"],"names":["Tag","closable","closeIcon","onClose","color","icon","size","children","className","rest","visible","setVisible","useState","handleClose","getColorClass","colorMap","sizeClasses","tagClasses","customColorStyle","jsx","CheckableTag","checked","onChange","handleClick","jsxs"],"mappings":";;AAmBO,MAAMA,IAA0B,CAAC;AAAA,EACtC,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAI,GAErCC,IAAc,MAAM;AACxB,IAAAF,EAAW,EAAK,GAChBR,IAAA;AAAA,EACF;AAEA,MAAI,CAACO,EAAS,QAAO;AAGrB,QAAMI,IAAgB,MAAM;AAC1B,QAAI,CAACV,EAAO,QAAO;AAEnB,UAAMW,IAAmC;AAAA,MACvC,SAAS;AAAA,MACT,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,MACT,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAIT,WAAIA,EAASX,CAAK,IACTW,EAASX,CAAK,IAIhB;AAAA,EACT,GAEMY,IAAc;AAAA,IAClB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,GAGAC,IAAa;AAAA,IACjB;AAAA,IACAH,EAAA;AAAA,IACAE,EAAYV,CAAI;AAAA,IAChBE;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELU,IAAmBd,KAAS,CAACU,EAAA,IAAkB,EAAE,iBAAiBV,GAAO,aAAaA,EAAA,IAAU;AAEtG,2BACG,QAAA,EAAK,WAAWa,GAAY,OAAOC,GAAmB,GAAGT,GACvD,UAAA;AAAA,IAAAJ,KAAQ,gBAAAc,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAd,GAAK;AAAA,IAC5CE;AAAA,IACAN,KACC,gBAAAkB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAASN;AAAA,QACT,WAAU;AAAA,QACV,cAAW;AAAA,QAEV,UAAAX,KACC,gBAAAiB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,QAAO;AAAA,YACP,SAAQ;AAAA,YAER,UAAA,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,eAAc;AAAA,gBACd,gBAAe;AAAA,gBACf,aAAa;AAAA,gBACb,GAAE;AAAA,cAAA;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ,GAEJ;AAEJ,GAEaC,IAA4C,CAAC;AAAA,EACxD,SAAAC,IAAU;AAAA,EACV,UAAAC;AAAA,EACA,MAAAjB;AAAA,EACA,UAAAE;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMc,IAAc,MAAM;AACxB,IAAAD,IAAW,CAACD,CAAO;AAAA,EACrB,GAEMJ,IAAa;AAAA,IACjB;AAAA,IACAI,IAAU,kBAAkB;AAAA,IAC5Bb;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAgB,EAAC,QAAA,EAAK,WAAWP,GAAY,SAASM,GAAa,MAAK,YAAW,gBAAcF,GAAU,GAAGZ,GAC3F,UAAA;AAAA,IAAAJ,KAAQ,gBAAAc,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAd,GAAK;AAAA,IAC5CE;AAAA,EAAA,GACH;AAEJ;"}
|