asterui 0.12.10 → 0.12.11

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.
Files changed (73) hide show
  1. package/dist/components/Space.d.ts +1 -0
  2. package/dist/components/Splitter.d.ts +2 -0
  3. package/dist/index.d.ts +0 -2
  4. package/dist/index.js +63 -65
  5. package/dist/index.js.map +1 -1
  6. package/dist/index100.js +11 -44
  7. package/dist/index100.js.map +1 -1
  8. package/dist/index101.js +12 -10
  9. package/dist/index101.js.map +1 -1
  10. package/dist/index102.js +7 -14
  11. package/dist/index102.js.map +1 -1
  12. package/dist/index103.js +12 -7
  13. package/dist/index103.js.map +1 -1
  14. package/dist/index104.js +29 -11
  15. package/dist/index104.js.map +1 -1
  16. package/dist/index105.js +16 -29
  17. package/dist/index105.js.map +1 -1
  18. package/dist/index74.js +37 -25
  19. package/dist/index74.js.map +1 -1
  20. package/dist/index75.js +223 -103
  21. package/dist/index75.js.map +1 -1
  22. package/dist/index76.js +21 -51
  23. package/dist/index76.js.map +1 -1
  24. package/dist/index77.js +31 -22
  25. package/dist/index77.js.map +1 -1
  26. package/dist/index78.js +22 -31
  27. package/dist/index78.js.map +1 -1
  28. package/dist/index79.js +327 -20
  29. package/dist/index79.js.map +1 -1
  30. package/dist/index80.js +50 -323
  31. package/dist/index80.js.map +1 -1
  32. package/dist/index81.js +40 -56
  33. package/dist/index81.js.map +1 -1
  34. package/dist/index82.js +23 -40
  35. package/dist/index82.js.map +1 -1
  36. package/dist/index83.js +93 -21
  37. package/dist/index83.js.map +1 -1
  38. package/dist/index84.js +148 -87
  39. package/dist/index84.js.map +1 -1
  40. package/dist/index85.js +152 -147
  41. package/dist/index85.js.map +1 -1
  42. package/dist/index86.js +63 -159
  43. package/dist/index86.js.map +1 -1
  44. package/dist/index87.js +35 -65
  45. package/dist/index87.js.map +1 -1
  46. package/dist/index88.js +234 -35
  47. package/dist/index88.js.map +1 -1
  48. package/dist/index89.js +31 -231
  49. package/dist/index89.js.map +1 -1
  50. package/dist/index90.js +210 -34
  51. package/dist/index90.js.map +1 -1
  52. package/dist/index91.js +198 -195
  53. package/dist/index91.js.map +1 -1
  54. package/dist/index92.js +241 -159
  55. package/dist/index92.js.map +1 -1
  56. package/dist/index93.js +166 -283
  57. package/dist/index93.js.map +1 -1
  58. package/dist/index94.js +253 -173
  59. package/dist/index94.js.map +1 -1
  60. package/dist/index95.js +14 -258
  61. package/dist/index95.js.map +1 -1
  62. package/dist/index96.js +31 -12
  63. package/dist/index96.js.map +1 -1
  64. package/dist/index97.js +5 -32
  65. package/dist/index97.js.map +1 -1
  66. package/dist/index98.js +13 -5
  67. package/dist/index98.js.map +1 -1
  68. package/dist/index99.js +43 -11
  69. package/dist/index99.js.map +1 -1
  70. package/package.json +1 -1
  71. package/dist/components/Stack.d.ts +0 -10
  72. package/dist/index106.js +0 -21
  73. package/dist/index106.js.map +0 -1
package/dist/index76.js CHANGED
@@ -1,55 +1,25 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- const j = ({
3
- children: s,
4
- direction: a = "vertical",
5
- spacing: n = 4,
6
- align: e,
7
- justify: t,
8
- wrap: r = !1,
9
- className: c = "",
10
- ...i
11
- }) => {
12
- const l = {
13
- vertical: "flex-col",
14
- horizontal: "flex-row"
15
- }, o = {
16
- 0: "gap-0",
17
- 1: "gap-1",
18
- 2: "gap-2",
19
- 3: "gap-3",
20
- 4: "gap-4",
21
- 5: "gap-5",
22
- 6: "gap-6",
23
- 8: "gap-8",
24
- 10: "gap-10",
25
- 12: "gap-12",
26
- 16: "gap-16",
27
- 20: "gap-20",
28
- 24: "gap-24"
29
- }, p = e && {
30
- start: "items-start",
31
- center: "items-center",
32
- end: "items-end",
33
- stretch: "items-stretch"
34
- }[e], g = t && {
35
- start: "justify-start",
36
- center: "justify-center",
37
- end: "justify-end",
38
- between: "justify-between",
39
- around: "justify-around",
40
- evenly: "justify-evenly"
41
- }[t], f = [
42
- "flex",
43
- l[a],
44
- o[n],
45
- p,
46
- g,
47
- r && "flex-wrap",
48
- c
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ function o({ children: s, className: a = "", vertical: e = !1, ...i }) {
3
+ const c = [
4
+ "stats",
5
+ e ? "stats-vertical" : "stats-horizontal",
6
+ a
49
7
  ].filter(Boolean).join(" ");
50
- return /* @__PURE__ */ u("div", { className: f, ...i, children: s });
51
- };
8
+ return /* @__PURE__ */ t("div", { className: c, ...i, children: s });
9
+ }
10
+ function d({ title: s, value: a, desc: e, figure: i, actions: c, className: l = "", ...n }) {
11
+ return /* @__PURE__ */ r("div", { className: `stat ${l}`, ...n, children: [
12
+ i && /* @__PURE__ */ t("div", { className: "stat-figure", children: i }),
13
+ s && /* @__PURE__ */ t("div", { className: "stat-title", children: s }),
14
+ a && /* @__PURE__ */ t("div", { className: "stat-value", children: a }),
15
+ e && /* @__PURE__ */ t("div", { className: "stat-desc", children: e }),
16
+ c && /* @__PURE__ */ t("div", { className: "stat-actions", children: c })
17
+ ] });
18
+ }
19
+ const v = Object.assign(o, {
20
+ Stat: d
21
+ });
52
22
  export {
53
- j as Stack
23
+ v as Stats
54
24
  };
55
25
  //# sourceMappingURL=index76.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index76.js","sources":["../src/components/Stack.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n direction?: 'vertical' | 'horizontal'\n spacing?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24\n align?: 'start' | 'center' | 'end' | 'stretch'\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'\n wrap?: boolean\n}\n\nexport const Stack: React.FC<StackProps> = ({\n children,\n direction = 'vertical',\n spacing = 4,\n align,\n justify,\n wrap = false,\n className = '',\n ...rest\n}) => {\n const directionClasses = {\n vertical: 'flex-col',\n horizontal: 'flex-row',\n }\n\n const spacingClasses = {\n 0: 'gap-0',\n 1: 'gap-1',\n 2: 'gap-2',\n 3: 'gap-3',\n 4: 'gap-4',\n 5: 'gap-5',\n 6: 'gap-6',\n 8: 'gap-8',\n 10: 'gap-10',\n 12: 'gap-12',\n 16: 'gap-16',\n 20: 'gap-20',\n 24: 'gap-24',\n }\n\n const alignClasses = align && {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n }[align]\n\n const justifyClasses = justify && {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n }[justify]\n\n const classes = [\n 'flex',\n directionClasses[direction],\n spacingClasses[spacing],\n alignClasses,\n justifyClasses,\n wrap && 'flex-wrap',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n"],"names":["Stack","children","direction","spacing","align","justify","wrap","className","rest","directionClasses","spacingClasses","alignClasses","justifyClasses","classes"],"mappings":";AAWO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAmB;AAAA,IACvB,UAAU;AAAA,IACV,YAAY;AAAA,EAAA,GAGRC,IAAiB;AAAA,IACrB,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,GAGAC,IAAeP,KAAS;AAAA,IAC5B,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,SAAS;AAAA,EAAA,EACTA,CAAK,GAEDQ,IAAiBP,KAAW;AAAA,IAChC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EAAA,EACRA,CAAO,GAEHQ,IAAU;AAAA,IACd;AAAA,IACAJ,EAAiBP,CAAS;AAAA,IAC1BQ,EAAeP,CAAO;AAAA,IACtBQ;AAAA,IACAC;AAAA,IACAN,KAAQ;AAAA,IACRC;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWM,GAAU,GAAGL,GAAO,UAAAP,GAAS;AACtD;"}
1
+ {"version":3,"file":"index76.js","sources":["../src/components/Stat.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n vertical?: boolean\n}\n\nexport interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: React.ReactNode\n value?: React.ReactNode\n desc?: React.ReactNode\n figure?: React.ReactNode\n actions?: React.ReactNode\n}\n\nfunction StatsRoot({ children, className = '', vertical = false, ...rest }: StatsProps) {\n const classes = [\n 'stats',\n vertical ? 'stats-vertical' : 'stats-horizontal',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n\nfunction StatItem({ title, value, desc, figure, actions, className = '', ...rest }: StatProps) {\n return (\n <div className={`stat ${className}`} {...rest}>\n {figure && <div className=\"stat-figure\">{figure}</div>}\n {title && <div className=\"stat-title\">{title}</div>}\n {value && <div className=\"stat-value\">{value}</div>}\n {desc && <div className=\"stat-desc\">{desc}</div>}\n {actions && <div className=\"stat-actions\">{actions}</div>}\n </div>\n )\n}\n\nexport const Stats = Object.assign(StatsRoot, {\n Stat: StatItem,\n})\n"],"names":["StatsRoot","children","className","vertical","rest","classes","StatItem","title","value","desc","figure","actions","jsx","Stats"],"mappings":";AAeA,SAASA,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,UAAAC,IAAW,IAAO,GAAGC,KAAoB;AACtF,QAAMC,IAAU;AAAA,IACd;AAAA,IACAF,IAAW,mBAAmB;AAAA,IAC9BD;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWG,GAAU,GAAGD,GAAO,UAAAH,GAAS;AACtD;AAEA,SAASK,EAAS,EAAE,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,SAAAC,GAAS,WAAAT,IAAY,IAAI,GAAGE,KAAmB;AAC7F,2BACG,OAAA,EAAI,WAAW,QAAQF,CAAS,IAAK,GAAGE,GACtC,UAAA;AAAA,IAAAM,KAAU,gBAAAE,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAF,GAAO;AAAA,IAC/CH,KAAS,gBAAAK,EAAC,OAAA,EAAI,WAAU,cAAc,UAAAL,GAAM;AAAA,IAC5CC,KAAS,gBAAAI,EAAC,OAAA,EAAI,WAAU,cAAc,UAAAJ,GAAM;AAAA,IAC5CC,KAAQ,gBAAAG,EAAC,OAAA,EAAI,WAAU,aAAa,UAAAH,GAAK;AAAA,IACzCE,KAAW,gBAAAC,EAAC,OAAA,EAAI,WAAU,gBAAgB,UAAAD,EAAA,CAAQ;AAAA,EAAA,GACrD;AAEJ;AAEO,MAAME,IAAQ,OAAO,OAAOb,GAAW;AAAA,EAC5C,MAAMM;AACR,CAAC;"}
package/dist/index77.js CHANGED
@@ -1,25 +1,34 @@
1
- import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
- function o({ children: s, className: a = "", vertical: e = !1, ...i }) {
3
- const c = [
4
- "stats",
5
- e ? "stats-vertical" : "stats-horizontal",
6
- a
7
- ].filter(Boolean).join(" ");
8
- return /* @__PURE__ */ t("div", { className: c, ...i, children: s });
9
- }
10
- function d({ title: s, value: a, desc: e, figure: i, actions: c, className: l = "", ...n }) {
11
- return /* @__PURE__ */ r("div", { className: `stat ${l}`, ...n, children: [
12
- i && /* @__PURE__ */ t("div", { className: "stat-figure", children: i }),
13
- s && /* @__PURE__ */ t("div", { className: "stat-title", children: s }),
14
- a && /* @__PURE__ */ t("div", { className: "stat-value", children: a }),
15
- e && /* @__PURE__ */ t("div", { className: "stat-desc", children: e }),
16
- c && /* @__PURE__ */ t("div", { className: "stat-actions", children: c })
17
- ] });
18
- }
19
- const v = Object.assign(o, {
20
- Stat: d
21
- });
1
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
+ const l = {
3
+ neutral: "status-neutral",
4
+ primary: "status-primary",
5
+ secondary: "status-secondary",
6
+ accent: "status-accent",
7
+ info: "status-info",
8
+ success: "status-success",
9
+ warning: "status-warning",
10
+ error: "status-error"
11
+ }, m = {
12
+ xs: "status-xs",
13
+ sm: "status-sm",
14
+ md: "status-md",
15
+ lg: "status-lg",
16
+ xl: "status-xl"
17
+ }, d = ({
18
+ type: e = "neutral",
19
+ size: r = "md",
20
+ ping: n = !1,
21
+ bounce: i = !1,
22
+ label: t,
23
+ className: u = ""
24
+ }) => {
25
+ const s = `status ${l[e]} ${m[r]} ${i ? "animate-bounce" : ""} ${u}`.trim();
26
+ return n ? /* @__PURE__ */ c("div", { className: "inline-grid *:[grid-area:1/1]", "aria-label": t, children: [
27
+ /* @__PURE__ */ a("div", { className: `${s} animate-ping` }),
28
+ /* @__PURE__ */ a("div", { className: s })
29
+ ] }) : /* @__PURE__ */ a("div", { className: s, "aria-label": t });
30
+ };
22
31
  export {
23
- v as Stats
32
+ d as Status
24
33
  };
25
34
  //# sourceMappingURL=index77.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index77.js","sources":["../src/components/Stat.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n vertical?: boolean\n}\n\nexport interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: React.ReactNode\n value?: React.ReactNode\n desc?: React.ReactNode\n figure?: React.ReactNode\n actions?: React.ReactNode\n}\n\nfunction StatsRoot({ children, className = '', vertical = false, ...rest }: StatsProps) {\n const classes = [\n 'stats',\n vertical ? 'stats-vertical' : 'stats-horizontal',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n\nfunction StatItem({ title, value, desc, figure, actions, className = '', ...rest }: StatProps) {\n return (\n <div className={`stat ${className}`} {...rest}>\n {figure && <div className=\"stat-figure\">{figure}</div>}\n {title && <div className=\"stat-title\">{title}</div>}\n {value && <div className=\"stat-value\">{value}</div>}\n {desc && <div className=\"stat-desc\">{desc}</div>}\n {actions && <div className=\"stat-actions\">{actions}</div>}\n </div>\n )\n}\n\nexport const Stats = Object.assign(StatsRoot, {\n Stat: StatItem,\n})\n"],"names":["StatsRoot","children","className","vertical","rest","classes","StatItem","title","value","desc","figure","actions","jsx","Stats"],"mappings":";AAeA,SAASA,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,UAAAC,IAAW,IAAO,GAAGC,KAAoB;AACtF,QAAMC,IAAU;AAAA,IACd;AAAA,IACAF,IAAW,mBAAmB;AAAA,IAC9BD;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWG,GAAU,GAAGD,GAAO,UAAAH,GAAS;AACtD;AAEA,SAASK,EAAS,EAAE,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,SAAAC,GAAS,WAAAT,IAAY,IAAI,GAAGE,KAAmB;AAC7F,2BACG,OAAA,EAAI,WAAW,QAAQF,CAAS,IAAK,GAAGE,GACtC,UAAA;AAAA,IAAAM,KAAU,gBAAAE,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAF,GAAO;AAAA,IAC/CH,KAAS,gBAAAK,EAAC,OAAA,EAAI,WAAU,cAAc,UAAAL,GAAM;AAAA,IAC5CC,KAAS,gBAAAI,EAAC,OAAA,EAAI,WAAU,cAAc,UAAAJ,GAAM;AAAA,IAC5CC,KAAQ,gBAAAG,EAAC,OAAA,EAAI,WAAU,aAAa,UAAAH,GAAK;AAAA,IACzCE,KAAW,gBAAAC,EAAC,OAAA,EAAI,WAAU,gBAAgB,UAAAD,EAAA,CAAQ;AAAA,EAAA,GACrD;AAEJ;AAEO,MAAME,IAAQ,OAAO,OAAOb,GAAW;AAAA,EAC5C,MAAMM;AACR,CAAC;"}
1
+ {"version":3,"file":"index77.js","sources":["../src/components/Status.tsx"],"sourcesContent":["import React from 'react'\n\nexport type StatusType = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\nexport type StatusSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface StatusProps {\n /** Status color type */\n type?: StatusType\n /** Status size */\n size?: StatusSize\n /** Ping animation effect */\n ping?: boolean\n /** Bounce animation effect */\n bounce?: boolean\n /** Accessibility label */\n label?: string\n /** Additional CSS classes */\n className?: string\n}\n\nconst typeClasses: Record<StatusType, string> = {\n neutral: 'status-neutral',\n primary: 'status-primary',\n secondary: 'status-secondary',\n accent: 'status-accent',\n info: 'status-info',\n success: 'status-success',\n warning: 'status-warning',\n error: 'status-error',\n}\n\nconst sizeClasses: Record<StatusSize, string> = {\n xs: 'status-xs',\n sm: 'status-sm',\n md: 'status-md',\n lg: 'status-lg',\n xl: 'status-xl',\n}\n\nexport const Status: React.FC<StatusProps> = ({\n type = 'neutral',\n size = 'md',\n ping = false,\n bounce = false,\n label,\n className = '',\n}) => {\n const baseClasses = `status ${typeClasses[type]} ${sizeClasses[size]} ${bounce ? 'animate-bounce' : ''} ${className}`.trim()\n\n if (ping) {\n return (\n <div className=\"inline-grid *:[grid-area:1/1]\" aria-label={label}>\n <div className={`${baseClasses} animate-ping`} />\n <div className={baseClasses} />\n </div>\n )\n }\n\n return <div className={baseClasses} aria-label={label} />\n}\n"],"names":["typeClasses","sizeClasses","Status","type","size","ping","bounce","label","className","baseClasses","jsxs","jsx"],"mappings":";AAoBA,MAAMA,IAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAA0C;AAAA,EAC9C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAgC,CAAC;AAAA,EAC5C,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAAc,UAAUT,EAAYG,CAAI,CAAC,IAAIF,EAAYG,CAAI,CAAC,IAAIE,IAAS,mBAAmB,EAAE,IAAIE,CAAS,GAAG,KAAA;AAEtH,SAAIH,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,iCAAgC,cAAYH,GACzD,UAAA;AAAA,IAAA,gBAAAI,EAAC,OAAA,EAAI,WAAW,GAAGF,CAAW,iBAAiB;AAAA,IAC/C,gBAAAE,EAAC,OAAA,EAAI,WAAWF,EAAA,CAAa;AAAA,EAAA,GAC/B,IAIG,gBAAAE,EAAC,OAAA,EAAI,WAAWF,GAAa,cAAYF,GAAO;AACzD;"}
package/dist/index78.js CHANGED
@@ -1,34 +1,25 @@
1
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
- const l = {
3
- neutral: "status-neutral",
4
- primary: "status-primary",
5
- secondary: "status-secondary",
6
- accent: "status-accent",
7
- info: "status-info",
8
- success: "status-success",
9
- warning: "status-warning",
10
- error: "status-error"
11
- }, m = {
12
- xs: "status-xs",
13
- sm: "status-sm",
14
- md: "status-md",
15
- lg: "status-lg",
16
- xl: "status-xl"
17
- }, d = ({
18
- type: e = "neutral",
19
- size: r = "md",
20
- ping: n = !1,
21
- bounce: i = !1,
22
- label: t,
23
- className: u = ""
24
- }) => {
25
- const s = `status ${l[e]} ${m[r]} ${i ? "animate-bounce" : ""} ${u}`.trim();
26
- return n ? /* @__PURE__ */ c("div", { className: "inline-grid *:[grid-area:1/1]", "aria-label": t, children: [
27
- /* @__PURE__ */ a("div", { className: `${s} animate-ping` }),
28
- /* @__PURE__ */ a("div", { className: s })
29
- ] }) : /* @__PURE__ */ a("div", { className: s, "aria-label": t });
30
- };
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ function c({ children: e, vertical: s = !1, className: t = "", ...n }) {
3
+ const r = ["steps", s && "steps-vertical", t].filter(Boolean).join(" ");
4
+ return /* @__PURE__ */ o("ul", { className: r, ...n, children: e });
5
+ }
6
+ function p({ children: e, color: s, dataContent: t, className: n = "", ...r }) {
7
+ const a = ["step", s && {
8
+ neutral: "step-neutral",
9
+ primary: "step-primary",
10
+ secondary: "step-secondary",
11
+ accent: "step-accent",
12
+ info: "step-info",
13
+ success: "step-success",
14
+ warning: "step-warning",
15
+ error: "step-error"
16
+ }[s], n].filter(Boolean).join(" ");
17
+ return /* @__PURE__ */ o("li", { className: a, "data-content": t, ...r, children: e });
18
+ }
19
+ const u = Object.assign(c, {
20
+ Step: p
21
+ });
31
22
  export {
32
- d as Status
23
+ u as Steps
33
24
  };
34
25
  //# sourceMappingURL=index78.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index78.js","sources":["../src/components/Status.tsx"],"sourcesContent":["import React from 'react'\n\nexport type StatusType = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\nexport type StatusSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface StatusProps {\n /** Status color type */\n type?: StatusType\n /** Status size */\n size?: StatusSize\n /** Ping animation effect */\n ping?: boolean\n /** Bounce animation effect */\n bounce?: boolean\n /** Accessibility label */\n label?: string\n /** Additional CSS classes */\n className?: string\n}\n\nconst typeClasses: Record<StatusType, string> = {\n neutral: 'status-neutral',\n primary: 'status-primary',\n secondary: 'status-secondary',\n accent: 'status-accent',\n info: 'status-info',\n success: 'status-success',\n warning: 'status-warning',\n error: 'status-error',\n}\n\nconst sizeClasses: Record<StatusSize, string> = {\n xs: 'status-xs',\n sm: 'status-sm',\n md: 'status-md',\n lg: 'status-lg',\n xl: 'status-xl',\n}\n\nexport const Status: React.FC<StatusProps> = ({\n type = 'neutral',\n size = 'md',\n ping = false,\n bounce = false,\n label,\n className = '',\n}) => {\n const baseClasses = `status ${typeClasses[type]} ${sizeClasses[size]} ${bounce ? 'animate-bounce' : ''} ${className}`.trim()\n\n if (ping) {\n return (\n <div className=\"inline-grid *:[grid-area:1/1]\" aria-label={label}>\n <div className={`${baseClasses} animate-ping`} />\n <div className={baseClasses} />\n </div>\n )\n }\n\n return <div className={baseClasses} aria-label={label} />\n}\n"],"names":["typeClasses","sizeClasses","Status","type","size","ping","bounce","label","className","baseClasses","jsxs","jsx"],"mappings":";AAoBA,MAAMA,IAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAA0C;AAAA,EAC9C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAgC,CAAC;AAAA,EAC5C,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAAc,UAAUT,EAAYG,CAAI,CAAC,IAAIF,EAAYG,CAAI,CAAC,IAAIE,IAAS,mBAAmB,EAAE,IAAIE,CAAS,GAAG,KAAA;AAEtH,SAAIH,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,iCAAgC,cAAYH,GACzD,UAAA;AAAA,IAAA,gBAAAI,EAAC,OAAA,EAAI,WAAW,GAAGF,CAAW,iBAAiB;AAAA,IAC/C,gBAAAE,EAAC,OAAA,EAAI,WAAWF,EAAA,CAAa;AAAA,EAAA,GAC/B,IAIG,gBAAAE,EAAC,OAAA,EAAI,WAAWF,GAAa,cAAYF,GAAO;AACzD;"}
1
+ {"version":3,"file":"index78.js","sources":["../src/components/Steps.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface StepsProps extends React.HTMLAttributes<HTMLUListElement> {\n children: React.ReactNode\n vertical?: boolean\n}\n\nexport interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'color'> {\n children: React.ReactNode\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n dataContent?: string\n}\n\nfunction StepsRoot({ children, vertical = false, className = '', ...rest }: StepsProps) {\n const classes = ['steps', vertical && 'steps-vertical', className].filter(Boolean).join(' ')\n\n return <ul className={classes} {...rest}>{children}</ul>\n}\n\nfunction Step({ children, color, dataContent, className = '', ...rest }: StepProps) {\n const colorClasses = {\n neutral: 'step-neutral',\n primary: 'step-primary',\n secondary: 'step-secondary',\n accent: 'step-accent',\n info: 'step-info',\n success: 'step-success',\n warning: 'step-warning',\n error: 'step-error',\n }\n\n const classes = ['step', color && colorClasses[color], className].filter(Boolean).join(' ')\n\n return (\n <li className={classes} data-content={dataContent} {...rest}>\n {children}\n </li>\n )\n}\n\nexport const Steps = Object.assign(StepsRoot, {\n Step,\n})\n"],"names":["StepsRoot","children","vertical","className","rest","classes","Step","color","dataContent","jsx","Steps"],"mappings":";AAaA,SAASA,EAAU,EAAE,UAAAC,GAAU,UAAAC,IAAW,IAAO,WAAAC,IAAY,IAAI,GAAGC,KAAoB;AACtF,QAAMC,IAAU,CAAC,SAASH,KAAY,kBAAkBC,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE3F,2BAAQ,MAAA,EAAG,WAAWE,GAAU,GAAGD,GAAO,UAAAH,GAAS;AACrD;AAEA,SAASK,EAAK,EAAE,UAAAL,GAAU,OAAAM,GAAO,aAAAC,GAAa,WAAAL,IAAY,IAAI,GAAGC,KAAmB;AAYlF,QAAMC,IAAU,CAAC,QAAQE,KAXJ;AAAA,IACnB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,EAAA,EAGsCA,CAAK,GAAGJ,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1F,SACE,gBAAAM,EAAC,QAAG,WAAWJ,GAAS,gBAAcG,GAAc,GAAGJ,GACpD,UAAAH,GACH;AAEJ;AAEO,MAAMS,IAAQ,OAAO,OAAOV,GAAW;AAAA,EAC5C,MAAAM;AACF,CAAC;"}
package/dist/index79.js CHANGED
@@ -1,25 +1,332 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- function c({ children: e, vertical: s = !1, className: t = "", ...n }) {
3
- const r = ["steps", s && "steps-vertical", t].filter(Boolean).join(" ");
4
- return /* @__PURE__ */ o("ul", { className: r, ...n, children: e });
1
+ import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
+ import { useState as v } from "react";
3
+ function te({
4
+ filters: l,
5
+ selectedValues: p,
6
+ onChange: k
7
+ }) {
8
+ const [w, m] = v(!1), I = (c) => {
9
+ const S = p.includes(c) ? p.filter(($) => $ !== c) : [...p, c];
10
+ k(S);
11
+ }, P = () => {
12
+ k([]), m(!1);
13
+ };
14
+ return /* @__PURE__ */ f("div", { className: "dropdown dropdown-end", children: [
15
+ /* @__PURE__ */ s(
16
+ "button",
17
+ {
18
+ tabIndex: 0,
19
+ className: `btn btn-ghost btn-xs ${p.length > 0 ? "text-primary" : ""}`,
20
+ onClick: () => m(!w),
21
+ children: /* @__PURE__ */ s("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" }) })
22
+ }
23
+ ),
24
+ w && /* @__PURE__ */ f(
25
+ "div",
26
+ {
27
+ tabIndex: 0,
28
+ className: "dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 border border-base-content/10",
29
+ children: [
30
+ /* @__PURE__ */ s("div", { className: "space-y-2", children: l.map((c) => /* @__PURE__ */ f("label", { className: "flex items-center gap-2 cursor-pointer p-2 hover:bg-base-200 rounded", children: [
31
+ /* @__PURE__ */ s(
32
+ "input",
33
+ {
34
+ type: "checkbox",
35
+ className: "checkbox checkbox-xs",
36
+ checked: p.includes(c.value),
37
+ onChange: () => I(c.value)
38
+ }
39
+ ),
40
+ /* @__PURE__ */ s("span", { className: "text-sm", children: c.text })
41
+ ] }, String(c.value))) }),
42
+ /* @__PURE__ */ s("div", { className: "divider my-1" }),
43
+ /* @__PURE__ */ s(
44
+ "button",
45
+ {
46
+ className: "btn btn-ghost btn-xs w-full",
47
+ onClick: P,
48
+ children: "Clear"
49
+ }
50
+ )
51
+ ]
52
+ }
53
+ )
54
+ ] });
5
55
  }
6
- function p({ children: e, color: s, dataContent: t, className: n = "", ...r }) {
7
- const a = ["step", s && {
8
- neutral: "step-neutral",
9
- primary: "step-primary",
10
- secondary: "step-secondary",
11
- accent: "step-accent",
12
- info: "step-info",
13
- success: "step-success",
14
- warning: "step-warning",
15
- error: "step-error"
16
- }[s], n].filter(Boolean).join(" ");
17
- return /* @__PURE__ */ o("li", { className: a, "data-content": t, ...r, children: e });
56
+ function ne({
57
+ columns: l,
58
+ dataSource: p,
59
+ rowKey: k = "id",
60
+ loading: w = !1,
61
+ size: m = "md",
62
+ bordered: I = !1,
63
+ hoverable: P = !0,
64
+ striped: c = !1,
65
+ pinRows: S = !1,
66
+ pinCols: $ = !1,
67
+ pagination: h,
68
+ rowSelection: o,
69
+ className: E = "",
70
+ onRow: W
71
+ }) {
72
+ const [N, K] = v(
73
+ h !== !1 && h?.current ? h.current : 1
74
+ ), j = h !== !1 && h?.pageSize ? h.pageSize : 10, [x, T] = v(() => {
75
+ const e = l.find((t) => t.defaultSortOrder);
76
+ return {
77
+ columnKey: e?.key || null,
78
+ order: e?.defaultSortOrder || null
79
+ };
80
+ }), [V, _] = v(() => {
81
+ const e = {};
82
+ return l.forEach((t) => {
83
+ t.defaultFilteredValue && (e[t.key] = t.defaultFilteredValue);
84
+ }), e;
85
+ }), [z, O] = v(
86
+ o?.selectedRowKeys || []
87
+ ), R = h !== !1;
88
+ let y = [...p];
89
+ if (Object.entries(V).forEach(([e, t]) => {
90
+ if (t.length > 0) {
91
+ const n = l.find((r) => r.key === e);
92
+ n?.onFilter && (y = y.filter(
93
+ (r) => t.some((i) => n.onFilter(i, r))
94
+ ));
95
+ }
96
+ }), x.columnKey && x.order) {
97
+ const e = l.find((t) => t.key === x.columnKey);
98
+ e?.sorter && y.sort((t, n) => {
99
+ let r = 0;
100
+ if (typeof e.sorter == "function")
101
+ r = e.sorter(t, n);
102
+ else if (e.dataIndex) {
103
+ const i = t[e.dataIndex], d = n[e.dataIndex];
104
+ i < d && (r = -1), i > d && (r = 1);
105
+ }
106
+ return x.order === "ascend" ? r : -r;
107
+ });
108
+ }
109
+ const L = Math.ceil(y.length / j), A = (N - 1) * j, q = A + j, C = R ? y.slice(A, q) : y, B = (e) => {
110
+ K(e), h !== !1 && h?.onChange && h.onChange(e, j);
111
+ }, G = (e) => {
112
+ T((t) => {
113
+ if (t.columnKey === e) {
114
+ if (t.order === "ascend") return { columnKey: e, order: "descend" };
115
+ if (t.order === "descend") return { columnKey: null, order: null };
116
+ }
117
+ return { columnKey: e, order: "ascend" };
118
+ }), K(1);
119
+ }, J = (e, t) => {
120
+ _((n) => ({
121
+ ...n,
122
+ [e]: t
123
+ })), K(1);
124
+ }, Q = (e) => {
125
+ const t = e ? C.map((n, r) => F(n, r)) : [];
126
+ if (O(t), o?.onChange) {
127
+ const n = e ? C : [];
128
+ o.onChange(t, n);
129
+ }
130
+ }, U = (e, t, n) => {
131
+ const r = F(e, t), i = n ? [...z, r] : z.filter((d) => d !== r);
132
+ if (O(i), o?.onChange) {
133
+ const d = y.filter(
134
+ (u, a) => i.includes(F(u, a))
135
+ );
136
+ o.onChange(i, d);
137
+ }
138
+ }, F = (e, t) => typeof k == "function" ? k(e) : e[k] ?? t.toString(), X = (e, t, n) => e.render ? e.render(
139
+ e.dataIndex ? t[e.dataIndex] : void 0,
140
+ t,
141
+ n
142
+ ) : e.dataIndex ? t[e.dataIndex] : "", M = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", D = (e, t = !1) => {
143
+ const n = l[e];
144
+ if (!n.fixed) return { className: "" };
145
+ const r = ["sticky", "bg-base-100"];
146
+ let i = 0;
147
+ const d = {
148
+ boxSizing: "border-box"
149
+ };
150
+ if (n.fixed === "left") {
151
+ for (let a = 0; a < e; a++)
152
+ if (l[a].fixed === "left" && l[a].width) {
153
+ const b = l[a].width, g = typeof b == "number" ? b : parseInt(String(b));
154
+ isNaN(g) || (i += g);
155
+ }
156
+ i === 0 ? r.push("left-0") : d.left = `${i}px`, r.push(t ? "z-30" : "z-20");
157
+ let u = -1;
158
+ for (let a = l.length - 1; a >= 0; a--)
159
+ if (l[a].fixed === "left") {
160
+ u = a;
161
+ break;
162
+ }
163
+ e === u && (d.boxShadow = "2px 0 4px rgba(0, 0, 0, 0.1)");
164
+ }
165
+ if (n.fixed === "right") {
166
+ for (let a = e + 1; a < l.length; a++)
167
+ if (l[a].fixed === "right" && l[a].width) {
168
+ const b = l[a].width, g = typeof b == "number" ? b : parseInt(String(b));
169
+ isNaN(g) || (i += g);
170
+ }
171
+ i === 0 ? r.push("right-0") : d.right = `${i}px`, r.push(t ? "z-30" : "z-20"), e === l.findIndex((a) => a.fixed === "right") && (d.boxShadow = "-2px 0 4px rgba(0, 0, 0, 0.1)");
172
+ }
173
+ return {
174
+ className: r.filter(Boolean).join(" "),
175
+ style: Object.keys(d).length > 0 ? d : void 0
176
+ };
177
+ }, Y = [
178
+ "table",
179
+ "bg-base-100",
180
+ m === "xs" && "table-xs",
181
+ m === "sm" && "table-sm",
182
+ m === "lg" && "table-lg",
183
+ c && "table-zebra",
184
+ S && "table-pin-rows",
185
+ $ && "table-pin-cols",
186
+ E
187
+ ].filter(Boolean).join(" "), Z = l.some((e) => e.fixed), H = [
188
+ (!S || Z) && "overflow-x-auto",
189
+ I && "rounded-box border border-base-content/5 bg-base-100"
190
+ ].filter(Boolean).join(" ");
191
+ if (w)
192
+ return /* @__PURE__ */ s("div", { className: "flex justify-center items-center p-8", children: /* @__PURE__ */ s("span", { className: "loading loading-spinner loading-lg" }) });
193
+ const ee = C.length > 0 && z.length === C.length;
194
+ return /* @__PURE__ */ f("div", { className: "space-y-4", children: [
195
+ /* @__PURE__ */ s("div", { className: H, children: /* @__PURE__ */ f("table", { className: Y, style: { borderCollapse: "separate", borderSpacing: 0, tableLayout: "fixed" }, children: [
196
+ /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ f("tr", { children: [
197
+ o && /* @__PURE__ */ s("th", { style: { width: 50 }, className: "sticky left-0 z-20 bg-base-100", children: o.type !== "radio" && /* @__PURE__ */ s(
198
+ "input",
199
+ {
200
+ type: "checkbox",
201
+ className: "checkbox checkbox-sm",
202
+ checked: ee,
203
+ onChange: (e) => Q(e.target.checked)
204
+ }
205
+ ) }),
206
+ l.map((e, t) => {
207
+ const n = D(t, !0);
208
+ return /* @__PURE__ */ s(
209
+ "th",
210
+ {
211
+ className: `${M(e.align)} ${n.className}`,
212
+ style: {
213
+ ...e.width ? { width: e.width } : {},
214
+ ...n.style
215
+ },
216
+ children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
217
+ /* @__PURE__ */ s(
218
+ "span",
219
+ {
220
+ className: e.sorter ? "cursor-pointer select-none" : "",
221
+ onClick: () => e.sorter && G(e.key),
222
+ children: e.title
223
+ }
224
+ ),
225
+ e.sorter && /* @__PURE__ */ f("div", { className: "flex flex-col", children: [
226
+ /* @__PURE__ */ s(
227
+ "svg",
228
+ {
229
+ className: `w-3 h-3 ${x.columnKey === e.key && x.order === "ascend" ? "text-primary" : "text-base-content/30"}`,
230
+ fill: "currentColor",
231
+ viewBox: "0 0 20 20",
232
+ children: /* @__PURE__ */ s("path", { d: "M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z" })
233
+ }
234
+ ),
235
+ /* @__PURE__ */ s(
236
+ "svg",
237
+ {
238
+ className: `w-3 h-3 -mt-1 ${x.columnKey === e.key && x.order === "descend" ? "text-primary" : "text-base-content/30"}`,
239
+ fill: "currentColor",
240
+ viewBox: "0 0 20 20",
241
+ children: /* @__PURE__ */ s("path", { d: "M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z" })
242
+ }
243
+ )
244
+ ] }),
245
+ e.filters && /* @__PURE__ */ s(
246
+ te,
247
+ {
248
+ filters: e.filters,
249
+ selectedValues: V[e.key] || [],
250
+ onChange: (r) => J(e.key, r)
251
+ }
252
+ )
253
+ ] })
254
+ },
255
+ e.key
256
+ );
257
+ })
258
+ ] }) }),
259
+ /* @__PURE__ */ s("tbody", { children: C.map((e, t) => {
260
+ const n = W?.(e, t) || {}, r = F(e, t), i = z.includes(r), d = [
261
+ P && "hover:bg-base-300",
262
+ i && "bg-primary/10"
263
+ ].filter(Boolean).join(" "), u = o?.getCheckboxProps?.(e) || {};
264
+ return /* @__PURE__ */ f(
265
+ "tr",
266
+ {
267
+ className: d,
268
+ ...n,
269
+ children: [
270
+ o && /* @__PURE__ */ s("td", { className: "sticky left-0 z-10 bg-base-100", children: /* @__PURE__ */ s(
271
+ "input",
272
+ {
273
+ type: o.type === "radio" ? "radio" : "checkbox",
274
+ className: o.type === "radio" ? "radio radio-sm" : "checkbox checkbox-sm",
275
+ checked: i,
276
+ onChange: (a) => U(e, t, a.target.checked),
277
+ ...u
278
+ }
279
+ ) }),
280
+ l.map((a, b) => {
281
+ const g = D(b, !1);
282
+ return /* @__PURE__ */ s(
283
+ "td",
284
+ {
285
+ className: `${M(a.align)} ${g.className}`,
286
+ style: g.style,
287
+ children: X(a, e, t)
288
+ },
289
+ a.key
290
+ );
291
+ })
292
+ ]
293
+ },
294
+ r
295
+ );
296
+ }) })
297
+ ] }) }),
298
+ R && L > 1 && /* @__PURE__ */ s("div", { className: "flex justify-end", children: /* @__PURE__ */ f("div", { className: "join", children: [
299
+ /* @__PURE__ */ s(
300
+ "button",
301
+ {
302
+ className: "join-item btn btn-sm",
303
+ onClick: () => B(N - 1),
304
+ disabled: N === 1,
305
+ children: "«"
306
+ }
307
+ ),
308
+ Array.from({ length: L }, (e, t) => t + 1).map((e) => /* @__PURE__ */ s(
309
+ "button",
310
+ {
311
+ className: `join-item btn btn-sm ${N === e ? "btn-active" : ""}`,
312
+ onClick: () => B(e),
313
+ children: e
314
+ },
315
+ e
316
+ )),
317
+ /* @__PURE__ */ s(
318
+ "button",
319
+ {
320
+ className: "join-item btn btn-sm",
321
+ onClick: () => B(N + 1),
322
+ disabled: N === L,
323
+ children: "»"
324
+ }
325
+ )
326
+ ] }) })
327
+ ] });
18
328
  }
19
- const u = Object.assign(c, {
20
- Step: p
21
- });
22
329
  export {
23
- u as Steps
330
+ ne as Table
24
331
  };
25
332
  //# sourceMappingURL=index79.js.map