asterui 0.12.7 → 0.12.9

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 (179) hide show
  1. package/dist/components/Container.d.ts +7 -1
  2. package/dist/components/Fieldset.d.ts +6 -0
  3. package/dist/components/Filter.d.ts +27 -0
  4. package/dist/components/Grid.d.ts +1 -1
  5. package/dist/components/Hero.d.ts +14 -5
  6. package/dist/components/Join.d.ts +2 -2
  7. package/dist/components/Layout.d.ts +1 -1
  8. package/dist/components/Masonry.d.ts +1 -1
  9. package/dist/components/Modal.d.ts +7 -2
  10. package/dist/components/ThemeController.d.ts +12 -4
  11. package/dist/index.d.ts +4 -2
  12. package/dist/index.js +167 -165
  13. package/dist/index.js.map +1 -1
  14. package/dist/index100.js +44 -11
  15. package/dist/index100.js.map +1 -1
  16. package/dist/index101.js +10 -12
  17. package/dist/index101.js.map +1 -1
  18. package/dist/index102.js +14 -7
  19. package/dist/index102.js.map +1 -1
  20. package/dist/index103.js +7 -12
  21. package/dist/index103.js.map +1 -1
  22. package/dist/index104.js +11 -29
  23. package/dist/index104.js.map +1 -1
  24. package/dist/index105.js +29 -16
  25. package/dist/index105.js.map +1 -1
  26. package/dist/index106.js +21 -0
  27. package/dist/index106.js.map +1 -0
  28. package/dist/index18.js +23 -15
  29. package/dist/index18.js.map +1 -1
  30. package/dist/index2.js +41 -34
  31. package/dist/index2.js.map +1 -1
  32. package/dist/index21.js +1 -1
  33. package/dist/index25.js +8 -8
  34. package/dist/index25.js.map +1 -1
  35. package/dist/index27.js +13 -8
  36. package/dist/index27.js.map +1 -1
  37. package/dist/index29.js +50 -61
  38. package/dist/index29.js.map +1 -1
  39. package/dist/index30.js +60 -181
  40. package/dist/index30.js.map +1 -1
  41. package/dist/index31.js +184 -18
  42. package/dist/index31.js.map +1 -1
  43. package/dist/index32.js +15 -217
  44. package/dist/index32.js.map +1 -1
  45. package/dist/index33.js +216 -1078
  46. package/dist/index33.js.map +1 -1
  47. package/dist/index34.js +1086 -17
  48. package/dist/index34.js.map +1 -1
  49. package/dist/index35.js +30 -122
  50. package/dist/index35.js.map +1 -1
  51. package/dist/index36.js +119 -37
  52. package/dist/index36.js.map +1 -1
  53. package/dist/index37.js +34 -208
  54. package/dist/index37.js.map +1 -1
  55. package/dist/index38.js +214 -97
  56. package/dist/index38.js.map +1 -1
  57. package/dist/index39.js +93 -158
  58. package/dist/index39.js.map +1 -1
  59. package/dist/index40.js +155 -139
  60. package/dist/index40.js.map +1 -1
  61. package/dist/index41.js +146 -15
  62. package/dist/index41.js.map +1 -1
  63. package/dist/index42.js +15 -17
  64. package/dist/index42.js.map +1 -1
  65. package/dist/index43.js +17 -21
  66. package/dist/index43.js.map +1 -1
  67. package/dist/index44.js +18 -116
  68. package/dist/index44.js.map +1 -1
  69. package/dist/index45.js +134 -10
  70. package/dist/index45.js.map +1 -1
  71. package/dist/index46.js +13 -35
  72. package/dist/index46.js.map +1 -1
  73. package/dist/index47.js +35 -34
  74. package/dist/index47.js.map +1 -1
  75. package/dist/index48.js +34 -116
  76. package/dist/index48.js.map +1 -1
  77. package/dist/index49.js +71 -166
  78. package/dist/index49.js.map +1 -1
  79. package/dist/index50.js +165 -136
  80. package/dist/index50.js.map +1 -1
  81. package/dist/index51.js +146 -11
  82. package/dist/index51.js.map +1 -1
  83. package/dist/index52.js +10 -20
  84. package/dist/index52.js.map +1 -1
  85. package/dist/index53.js +22 -14
  86. package/dist/index53.js.map +1 -1
  87. package/dist/index54.js +14 -7
  88. package/dist/index54.js.map +1 -1
  89. package/dist/index55.js +6 -268
  90. package/dist/index55.js.map +1 -1
  91. package/dist/index56.js +311 -17
  92. package/dist/index56.js.map +1 -1
  93. package/dist/index57.js +17 -122
  94. package/dist/index57.js.map +1 -1
  95. package/dist/index58.js +120 -108
  96. package/dist/index58.js.map +1 -1
  97. package/dist/index59.js +107 -167
  98. package/dist/index59.js.map +1 -1
  99. package/dist/index60.js +167 -29
  100. package/dist/index60.js.map +1 -1
  101. package/dist/index61.js +30 -120
  102. package/dist/index61.js.map +1 -1
  103. package/dist/index62.js +116 -80
  104. package/dist/index62.js.map +1 -1
  105. package/dist/index63.js +85 -19
  106. package/dist/index63.js.map +1 -1
  107. package/dist/index64.js +19 -73
  108. package/dist/index64.js.map +1 -1
  109. package/dist/index65.js +71 -54
  110. package/dist/index65.js.map +1 -1
  111. package/dist/index66.js +56 -44
  112. package/dist/index66.js.map +1 -1
  113. package/dist/index67.js +42 -49
  114. package/dist/index67.js.map +1 -1
  115. package/dist/index68.js +52 -62
  116. package/dist/index68.js.map +1 -1
  117. package/dist/index69.js +56 -101
  118. package/dist/index69.js.map +1 -1
  119. package/dist/index70.js +107 -41
  120. package/dist/index70.js.map +1 -1
  121. package/dist/index71.js +41 -68
  122. package/dist/index71.js.map +1 -1
  123. package/dist/index72.js +66 -19
  124. package/dist/index72.js.map +1 -1
  125. package/dist/index73.js +18 -43
  126. package/dist/index73.js.map +1 -1
  127. package/dist/index74.js +44 -132
  128. package/dist/index74.js.map +1 -1
  129. package/dist/index75.js +132 -50
  130. package/dist/index75.js.map +1 -1
  131. package/dist/index76.js +51 -21
  132. package/dist/index76.js.map +1 -1
  133. package/dist/index77.js +22 -31
  134. package/dist/index77.js.map +1 -1
  135. package/dist/index78.js +31 -22
  136. package/dist/index78.js.map +1 -1
  137. package/dist/index79.js +20 -327
  138. package/dist/index79.js.map +1 -1
  139. package/dist/index80.js +323 -50
  140. package/dist/index80.js.map +1 -1
  141. package/dist/index81.js +56 -40
  142. package/dist/index81.js.map +1 -1
  143. package/dist/index82.js +40 -23
  144. package/dist/index82.js.map +1 -1
  145. package/dist/index83.js +21 -93
  146. package/dist/index83.js.map +1 -1
  147. package/dist/index84.js +88 -123
  148. package/dist/index84.js.map +1 -1
  149. package/dist/index85.js +147 -152
  150. package/dist/index85.js.map +1 -1
  151. package/dist/index86.js +159 -63
  152. package/dist/index86.js.map +1 -1
  153. package/dist/index87.js +65 -35
  154. package/dist/index87.js.map +1 -1
  155. package/dist/index88.js +35 -234
  156. package/dist/index88.js.map +1 -1
  157. package/dist/index89.js +231 -31
  158. package/dist/index89.js.map +1 -1
  159. package/dist/index90.js +34 -210
  160. package/dist/index90.js.map +1 -1
  161. package/dist/index91.js +195 -198
  162. package/dist/index91.js.map +1 -1
  163. package/dist/index92.js +159 -241
  164. package/dist/index92.js.map +1 -1
  165. package/dist/index93.js +283 -166
  166. package/dist/index93.js.map +1 -1
  167. package/dist/index94.js +173 -253
  168. package/dist/index94.js.map +1 -1
  169. package/dist/index95.js +258 -14
  170. package/dist/index95.js.map +1 -1
  171. package/dist/index96.js +12 -31
  172. package/dist/index96.js.map +1 -1
  173. package/dist/index97.js +32 -5
  174. package/dist/index97.js.map +1 -1
  175. package/dist/index98.js +5 -13
  176. package/dist/index98.js.map +1 -1
  177. package/dist/index99.js +11 -43
  178. package/dist/index99.js.map +1 -1
  179. package/package.json +1 -1
package/dist/index43.js CHANGED
@@ -1,24 +1,20 @@
1
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
- function c({ children: l, className: n = "", ...s }) {
3
- return /* @__PURE__ */ a("span", { className: `label ${n}`, ...s, children: l });
4
- }
5
- function r({ children: l, label: n, size: s, className: e = "", ...t }) {
6
- const i = ["floating-label", s && {
7
- xs: "input-xs",
8
- sm: "input-sm",
9
- md: "input-md",
10
- lg: "input-lg",
11
- xl: "input-xl"
12
- }[s], e].filter(Boolean).join(" ");
13
- return /* @__PURE__ */ o("label", { className: i, ...t, children: [
14
- l,
15
- /* @__PURE__ */ a("span", { children: n })
16
- ] });
17
- }
18
- const m = Object.assign(c, {
19
- Floating: r
20
- });
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ const k = {
3
+ xs: "kbd-xs",
4
+ sm: "kbd-sm",
5
+ md: "kbd-md",
6
+ lg: "kbd-lg",
7
+ xl: "kbd-xl"
8
+ }, t = ({
9
+ size: s,
10
+ children: d,
11
+ className: l = "",
12
+ ...o
13
+ }) => {
14
+ const b = ["kbd", s ? k[s] : "", l].filter(Boolean).join(" ");
15
+ return /* @__PURE__ */ e("kbd", { className: b, ...o, children: d });
16
+ };
21
17
  export {
22
- m as Label
18
+ t as Kbd
23
19
  };
24
20
  //# sourceMappingURL=index43.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index43.js","sources":["../src/components/Label.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface LabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode\n}\n\nexport interface FloatingLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children: React.ReactNode\n label: string\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n}\n\nfunction LabelRoot({ children, className = '', ...rest }: LabelProps) {\n return <span className={`label ${className}`} {...rest}>{children}</span>\n}\n\nfunction FloatingLabel({ children, label, size, className = '', ...rest }: FloatingLabelProps) {\n const sizeClasses = {\n xs: 'input-xs',\n sm: 'input-sm',\n md: 'input-md',\n lg: 'input-lg',\n xl: 'input-xl',\n }\n\n const classes = ['floating-label', size && sizeClasses[size], className].filter(Boolean).join(' ')\n\n return (\n <label className={classes} {...rest}>\n {children}\n <span>{label}</span>\n </label>\n )\n}\n\nexport const Label = Object.assign(LabelRoot, {\n Floating: FloatingLabel,\n})\n"],"names":["LabelRoot","children","className","rest","jsx","FloatingLabel","label","size","classes","jsxs","Label"],"mappings":";AAYA,SAASA,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAAoB;AACpE,SAAO,gBAAAC,EAAC,UAAK,WAAW,SAASF,CAAS,IAAK,GAAGC,GAAO,UAAAF,GAAS;AACpE;AAEA,SAASI,EAAc,EAAE,UAAAJ,GAAU,OAAAK,GAAO,MAAAC,GAAM,WAAAL,IAAY,IAAI,GAAGC,KAA4B;AAS7F,QAAMK,IAAU,CAAC,kBAAkBD,KARf;AAAA,IAClB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,EAGiDA,CAAI,GAAGL,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEjG,SACE,gBAAAO,EAAC,SAAA,EAAM,WAAWD,GAAU,GAAGL,GAC5B,UAAA;AAAA,IAAAF;AAAA,IACD,gBAAAG,EAAC,UAAM,UAAAE,EAAA,CAAM;AAAA,EAAA,GACf;AAEJ;AAEO,MAAMI,IAAQ,OAAO,OAAOV,GAAW;AAAA,EAC5C,UAAUK;AACZ,CAAC;"}
1
+ {"version":3,"file":"index43.js","sources":["../src/components/Kbd.tsx"],"sourcesContent":["import React from 'react'\n\nexport type KbdSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface KbdProps extends React.HTMLAttributes<HTMLElement> {\n /** Size of the kbd */\n size?: KbdSize\n /** Key content */\n children?: React.ReactNode\n}\n\nconst sizeClasses: Record<KbdSize, string> = {\n xs: 'kbd-xs',\n sm: 'kbd-sm',\n md: 'kbd-md',\n lg: 'kbd-lg',\n xl: 'kbd-xl',\n}\n\nexport const Kbd: React.FC<KbdProps> = ({\n size,\n children,\n className = '',\n ...rest\n}) => {\n const classes = ['kbd', size ? sizeClasses[size] : '', className]\n .filter(Boolean)\n .join(' ')\n\n return (\n <kbd className={classes} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"names":["sizeClasses","Kbd","size","children","className","rest","classes"],"mappings":";AAWA,MAAMA,IAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAA0B,CAAC;AAAA,EACtC,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAU,CAAC,OAAOJ,IAAOF,EAAYE,CAAI,IAAI,IAAIE,CAAS,EAC7D,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BACG,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAC1B,UAAAF,GACH;AAEJ;"}
package/dist/index44.js CHANGED
@@ -1,122 +1,24 @@
1
- import { jsx as a, jsxs as v } from "react/jsx-runtime";
2
- import u, { useContext as k, createContext as S, useState as w, useCallback as g } from "react";
3
- const p = S(null);
4
- function F() {
5
- return k(p);
1
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ function c({ children: l, className: n = "", ...s }) {
3
+ return /* @__PURE__ */ a("span", { className: `label ${n}`, ...s, children: l });
6
4
  }
7
- function m({ children: o, className: n = "", style: s }) {
8
- const t = u.Children.toArray(o), l = t.some(
9
- (e) => u.isValidElement(e) && e.type.displayName === "LayoutSider"
10
- ), f = [
11
- "flex",
12
- "min-h-0",
13
- l ? "flex-row" : "flex-col",
14
- n
15
- ].filter(Boolean).join(" "), i = l ? t.map((e) => {
16
- if (u.isValidElement(e) && (e.type === m || e.type.displayName === "LayoutRoot") && e.type.displayName !== "LayoutSider") {
17
- const c = e.props.className || "";
18
- if (!c.includes("flex-1"))
19
- return u.cloneElement(e, {
20
- className: `flex-1 ${c}`.trim()
21
- });
22
- }
23
- return e;
24
- }) : o;
25
- return /* @__PURE__ */ a("div", { className: f, style: s, children: i });
5
+ function r({ children: l, label: n, size: s, className: e = "", ...t }) {
6
+ const i = ["floating-label", s && {
7
+ xs: "input-xs",
8
+ sm: "input-sm",
9
+ md: "input-md",
10
+ lg: "input-lg",
11
+ xl: "input-xl"
12
+ }[s], e].filter(Boolean).join(" ");
13
+ return /* @__PURE__ */ o("label", { className: i, ...t, children: [
14
+ l,
15
+ /* @__PURE__ */ a("span", { children: n })
16
+ ] });
26
17
  }
27
- m.displayName = "LayoutRoot";
28
- function B({ children: o, className: n = "", style: s }) {
29
- const t = [
30
- "flex",
31
- "items-center",
32
- "px-6",
33
- "h-16",
34
- "bg-base-300",
35
- "flex-shrink-0",
36
- n
37
- ].filter(Boolean).join(" ");
38
- return /* @__PURE__ */ a("header", { className: t, style: s, children: o });
39
- }
40
- function E({ children: o, className: n = "", style: s }) {
41
- const t = [
42
- "px-6",
43
- "py-4",
44
- "text-center",
45
- "bg-base-300",
46
- "flex-shrink-0",
47
- n
48
- ].filter(Boolean).join(" ");
49
- return /* @__PURE__ */ a("footer", { className: t, style: s, children: o });
50
- }
51
- function R({ children: o, className: n = "", style: s }) {
52
- const t = ["flex-1", "min-h-0", "overflow-auto", n].filter(Boolean).join(" ");
53
- return /* @__PURE__ */ a("main", { className: t, style: s, children: o });
54
- }
55
- function y({
56
- children: o,
57
- width: n = 200,
58
- collapsedWidth: s = 80,
59
- collapsed: t,
60
- defaultCollapsed: l = !1,
61
- collapsible: f = !1,
62
- onCollapse: i,
63
- trigger: e,
64
- className: c = "",
65
- style: C
66
- }) {
67
- const [b, N] = w(l), r = t ?? b, h = g(() => {
68
- const x = !r;
69
- t === void 0 && N(x), i?.(x);
70
- }, [r, t, i]), d = r ? s : n, L = [
71
- "flex",
72
- "flex-col",
73
- "bg-base-200",
74
- "flex-shrink-0",
75
- "transition-all",
76
- "duration-200",
77
- c
78
- ].filter(Boolean).join(" "), j = f && e !== null && /* @__PURE__ */ a(
79
- "button",
80
- {
81
- onClick: h,
82
- className: "flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors",
83
- "aria-label": r ? "Expand sidebar" : "Collapse sidebar",
84
- children: /* @__PURE__ */ a(
85
- "svg",
86
- {
87
- className: `w-4 h-4 transition-transform ${r ? "rotate-180" : ""}`,
88
- fill: "none",
89
- viewBox: "0 0 24 24",
90
- stroke: "currentColor",
91
- children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
92
- }
93
- )
94
- }
95
- );
96
- return /* @__PURE__ */ a(p.Provider, { value: { collapsed: r, collapsedWidth: s, width: n }, children: /* @__PURE__ */ v(
97
- "aside",
98
- {
99
- className: L,
100
- style: {
101
- width: typeof d == "number" ? `${d}px` : d,
102
- ...C
103
- },
104
- children: [
105
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-auto", children: o }),
106
- e !== null && (e ?? j)
107
- ]
108
- }
109
- ) });
110
- }
111
- y.displayName = "LayoutSider";
112
- const H = Object.assign(m, {
113
- Header: B,
114
- Footer: E,
115
- Content: R,
116
- Sider: y
18
+ const m = Object.assign(c, {
19
+ Floating: r
117
20
  });
118
21
  export {
119
- H as Layout,
120
- F as useSiderContext
22
+ m as Label
121
23
  };
122
24
  //# sourceMappingURL=index44.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index44.js","sources":["../src/components/Layout.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useCallback } from 'react'\n\nexport interface LayoutProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutHeaderProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutFooterProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutContentProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutSiderProps {\n children: React.ReactNode\n width?: number | string\n collapsedWidth?: number | string\n collapsed?: boolean\n defaultCollapsed?: boolean\n collapsible?: boolean\n onCollapse?: (collapsed: boolean) => void\n trigger?: React.ReactNode | null\n breakpoint?: 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n onBreakpoint?: (broken: boolean) => void\n className?: string\n style?: React.CSSProperties\n}\n\ninterface SiderContextValue {\n collapsed: boolean\n collapsedWidth: number | string\n width: number | string\n}\n\nconst SiderContext = createContext<SiderContextValue | null>(null)\n\nexport function useSiderContext() {\n return useContext(SiderContext)\n}\n\nfunction LayoutRoot({ children, className = '', style }: LayoutProps) {\n // Check if any child is a Sider to determine flex direction\n const childArray = React.Children.toArray(children)\n const hasSider = childArray.some(\n (child) => React.isValidElement(child) && (child.type as any).displayName === 'LayoutSider'\n )\n\n const layoutClasses = [\n 'flex',\n 'min-h-0',\n hasSider ? 'flex-row' : 'flex-col',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // If we have a Sider, auto-add flex-1 to non-Sider Layout children\n const processedChildren = hasSider\n ? childArray.map((child) => {\n if (\n React.isValidElement(child) &&\n (child.type === LayoutRoot || (child.type as any).displayName === 'LayoutRoot') &&\n (child.type as any).displayName !== 'LayoutSider'\n ) {\n // Clone the Layout child and add flex-1 if not already present\n const existingClassName = (child.props as any).className || ''\n if (!existingClassName.includes('flex-1')) {\n return React.cloneElement(child as React.ReactElement<any>, {\n className: `flex-1 ${existingClassName}`.trim(),\n })\n }\n }\n return child\n })\n : children\n\n return (\n <div className={layoutClasses} style={style}>\n {processedChildren}\n </div>\n )\n}\n\nLayoutRoot.displayName = 'LayoutRoot'\n\nfunction LayoutHeader({ children, className = '', style }: LayoutHeaderProps) {\n const headerClasses = [\n 'flex',\n 'items-center',\n 'px-6',\n 'h-16',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <header className={headerClasses} style={style}>\n {children}\n </header>\n )\n}\n\nfunction LayoutFooter({ children, className = '', style }: LayoutFooterProps) {\n const footerClasses = [\n 'px-6',\n 'py-4',\n 'text-center',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <footer className={footerClasses} style={style}>\n {children}\n </footer>\n )\n}\n\nfunction LayoutContent({ children, className = '', style }: LayoutContentProps) {\n // flex-1 by default so Content fills available space\n const contentClasses = ['flex-1', 'min-h-0', 'overflow-auto', className].filter(Boolean).join(' ')\n\n return (\n <main className={contentClasses} style={style}>\n {children}\n </main>\n )\n}\n\nfunction LayoutSider({\n children,\n width = 200,\n collapsedWidth = 80,\n collapsed: controlledCollapsed,\n defaultCollapsed = false,\n collapsible = false,\n onCollapse,\n trigger,\n className = '',\n style,\n}: LayoutSiderProps) {\n const [internalCollapsed, setInternalCollapsed] = useState(defaultCollapsed)\n\n const collapsed = controlledCollapsed ?? internalCollapsed\n\n const handleCollapse = useCallback(() => {\n const newCollapsed = !collapsed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(newCollapsed)\n }\n onCollapse?.(newCollapsed)\n }, [collapsed, controlledCollapsed, onCollapse])\n\n const currentWidth = collapsed ? collapsedWidth : width\n\n const siderClasses = [\n 'flex',\n 'flex-col',\n 'bg-base-200',\n 'flex-shrink-0',\n 'transition-all',\n 'duration-200',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const defaultTrigger = collapsible && trigger !== null && (\n <button\n onClick={handleCollapse}\n className=\"flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors\"\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n >\n <svg\n className={`w-4 h-4 transition-transform ${collapsed ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )\n\n return (\n <SiderContext.Provider value={{ collapsed, collapsedWidth, width }}>\n <aside\n className={siderClasses}\n style={{\n width: typeof currentWidth === 'number' ? `${currentWidth}px` : currentWidth,\n ...style,\n }}\n >\n <div className=\"flex-1 overflow-auto\">{children}</div>\n {trigger !== null && (trigger ?? defaultTrigger)}\n </aside>\n </SiderContext.Provider>\n )\n}\n\nLayoutSider.displayName = 'LayoutSider'\n\nexport const Layout = Object.assign(LayoutRoot, {\n Header: LayoutHeader,\n Footer: LayoutFooter,\n Content: LayoutContent,\n Sider: LayoutSider,\n})\n"],"names":["SiderContext","createContext","useSiderContext","useContext","LayoutRoot","children","className","style","childArray","React","hasSider","child","layoutClasses","processedChildren","existingClassName","jsx","LayoutHeader","headerClasses","LayoutFooter","footerClasses","LayoutContent","contentClasses","LayoutSider","width","collapsedWidth","controlledCollapsed","defaultCollapsed","collapsible","onCollapse","trigger","internalCollapsed","setInternalCollapsed","useState","collapsed","handleCollapse","useCallback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AAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELiC,IAAiBZ,KAAeE,MAAY,QAChD,gBAAAd;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAASmB;AAAA,MACT,WAAU;AAAA,MACV,cAAYD,IAAY,mBAAmB;AAAA,MAE3C,UAAA,gBAAAlB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,gCAAgCkB,IAAY,eAAe,EAAE;AAAA,UACxE,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,QAAO;AAAA,UAEP,UAAA,gBAAAlB,EAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,kBAAA,CAAkB;AAAA,QAAA;AAAA,MAAA;AAAA,IACzF;AAAA,EAAA;AAIJ,SACE,gBAAAA,EAACf,EAAa,UAAb,EAAsB,OAAO,EAAE,WAAAiC,GAAW,gBAAAT,GAAgB,OAAAD,KACzD,UAAA,gBAAAiB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,MACX,OAAO;AAAA,QACL,OAAO,OAAOD,KAAiB,WAAW,GAAGA,CAAY,OAAOA;AAAA,QAChE,GAAG9B;AAAA,MAAA;AAAA,MAGL,UAAA;AAAA,QAAA,gBAAAQ,EAAC,OAAA,EAAI,WAAU,wBAAwB,UAAAV,EAAA,CAAS;AAAA,QAC/CwB,MAAY,SAASA,KAAWU;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAErC;AAEJ;AAEAjB,EAAY,cAAc;AAEnB,MAAMmB,IAAS,OAAO,OAAOrC,GAAY;AAAA,EAC9C,QAAQY;AAAA,EACR,QAAQE;AAAA,EACR,SAASE;AAAA,EACT,OAAOE;AACT,CAAC;"}
1
+ {"version":3,"file":"index44.js","sources":["../src/components/Label.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface LabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode\n}\n\nexport interface FloatingLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children: React.ReactNode\n label: string\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n}\n\nfunction LabelRoot({ children, className = '', ...rest }: LabelProps) {\n return <span className={`label ${className}`} {...rest}>{children}</span>\n}\n\nfunction FloatingLabel({ children, label, size, className = '', ...rest }: FloatingLabelProps) {\n const sizeClasses = {\n xs: 'input-xs',\n sm: 'input-sm',\n md: 'input-md',\n lg: 'input-lg',\n xl: 'input-xl',\n }\n\n const classes = ['floating-label', size && sizeClasses[size], className].filter(Boolean).join(' ')\n\n return (\n <label className={classes} {...rest}>\n {children}\n <span>{label}</span>\n </label>\n )\n}\n\nexport const Label = Object.assign(LabelRoot, {\n Floating: FloatingLabel,\n})\n"],"names":["LabelRoot","children","className","rest","jsx","FloatingLabel","label","size","classes","jsxs","Label"],"mappings":";AAYA,SAASA,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAAoB;AACpE,SAAO,gBAAAC,EAAC,UAAK,WAAW,SAASF,CAAS,IAAK,GAAGC,GAAO,UAAAF,GAAS;AACpE;AAEA,SAASI,EAAc,EAAE,UAAAJ,GAAU,OAAAK,GAAO,MAAAC,GAAM,WAAAL,IAAY,IAAI,GAAGC,KAA4B;AAS7F,QAAMK,IAAU,CAAC,kBAAkBD,KARf;AAAA,IAClB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,EAGiDA,CAAI,GAAGL,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEjG,SACE,gBAAAO,EAAC,SAAA,EAAM,WAAWD,GAAU,GAAGL,GAC5B,UAAA;AAAA,IAAAF;AAAA,IACD,gBAAAG,EAAC,UAAM,UAAAE,EAAA,CAAM;AAAA,EAAA,GACf;AAEJ;AAEO,MAAMI,IAAQ,OAAO,OAAOV,GAAW;AAAA,EAC5C,UAAUK;AACZ,CAAC;"}
package/dist/index45.js CHANGED
@@ -1,16 +1,140 @@
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 });
1
+ import { jsx as o, jsxs as A } from "react/jsx-runtime";
2
+ import d, { useContext as M, createContext as P, useState as C, useEffect as $, useCallback as F } from "react";
3
+ const L = P(null);
4
+ function Q() {
5
+ return M(L);
5
6
  }
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 });
7
+ function h({ children: n, className: s = "", style: a }) {
8
+ const e = d.Children.toArray(n), f = e.some(
9
+ (t) => d.isValidElement(t) && t.type.displayName === "LayoutSider"
10
+ ), m = [
11
+ "flex",
12
+ "min-h-0",
13
+ f ? "flex-row" : "flex-col",
14
+ s
15
+ ].filter(Boolean).join(" "), r = f ? e.map((t) => {
16
+ if (d.isValidElement(t) && (t.type === h || t.type.displayName === "LayoutRoot") && t.type.displayName !== "LayoutSider") {
17
+ const i = t.props.className || "";
18
+ if (!i.includes("flex-1"))
19
+ return d.cloneElement(t, {
20
+ className: `flex-1 ${i}`.trim()
21
+ });
22
+ }
23
+ return t;
24
+ }) : n;
25
+ return /* @__PURE__ */ o("div", { className: m, style: a, children: r });
9
26
  }
10
- const r = Object.assign(e, {
11
- Row: l
27
+ h.displayName = "LayoutRoot";
28
+ function H({ children: n, className: s = "", style: a }) {
29
+ const e = [
30
+ "flex",
31
+ "items-center",
32
+ "px-6",
33
+ "h-16",
34
+ "bg-base-300",
35
+ "flex-shrink-0",
36
+ s
37
+ ].filter(Boolean).join(" ");
38
+ return /* @__PURE__ */ o("header", { className: e, style: a, children: n });
39
+ }
40
+ function I({ children: n, className: s = "", style: a }) {
41
+ const e = [
42
+ "px-6",
43
+ "py-4",
44
+ "text-center",
45
+ "bg-base-300",
46
+ "flex-shrink-0",
47
+ s
48
+ ].filter(Boolean).join(" ");
49
+ return /* @__PURE__ */ o("footer", { className: e, style: a, children: n });
50
+ }
51
+ function O({ children: n, className: s = "", style: a }) {
52
+ const e = ["flex-1", "min-h-0", "overflow-auto", s].filter(Boolean).join(" ");
53
+ return /* @__PURE__ */ o("main", { className: e, style: a, children: n });
54
+ }
55
+ const T = {
56
+ sm: "(max-width: 639px)",
57
+ md: "(max-width: 767px)",
58
+ lg: "(max-width: 1023px)",
59
+ xl: "(max-width: 1279px)",
60
+ "2xl": "(max-width: 1535px)"
61
+ };
62
+ function v({
63
+ children: n,
64
+ width: s = 200,
65
+ collapsedWidth: a = 80,
66
+ collapsed: e,
67
+ defaultCollapsed: f = !1,
68
+ collapsible: m = !1,
69
+ onCollapse: r,
70
+ trigger: t,
71
+ breakpoint: i,
72
+ onBreakpoint: p,
73
+ className: w = "",
74
+ style: g
75
+ }) {
76
+ const [j, N] = C(f), [b, k] = C(!1), l = e ?? j;
77
+ $(() => {
78
+ if (!i) return;
79
+ const c = window.matchMedia(T[i]), y = (R) => {
80
+ const u = R.matches;
81
+ k(u), p?.(u), e === void 0 && N(u), u !== b && r?.(u);
82
+ };
83
+ return y(c), c.addEventListener("change", y), () => c.removeEventListener("change", y);
84
+ }, [i, p, e, r, b]);
85
+ const S = F(() => {
86
+ const c = !l;
87
+ e === void 0 && N(c), r?.(c);
88
+ }, [l, e, r]), x = l ? a : s, B = [
89
+ "flex",
90
+ "flex-col",
91
+ "bg-base-200",
92
+ "flex-shrink-0",
93
+ "transition-all",
94
+ "duration-200",
95
+ w
96
+ ].filter(Boolean).join(" "), E = m && t !== null && /* @__PURE__ */ o(
97
+ "button",
98
+ {
99
+ onClick: S,
100
+ className: "flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors",
101
+ "aria-label": l ? "Expand sidebar" : "Collapse sidebar",
102
+ children: /* @__PURE__ */ o(
103
+ "svg",
104
+ {
105
+ className: `w-4 h-4 transition-transform ${l ? "rotate-180" : ""}`,
106
+ fill: "none",
107
+ viewBox: "0 0 24 24",
108
+ stroke: "currentColor",
109
+ children: /* @__PURE__ */ o("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
110
+ }
111
+ )
112
+ }
113
+ );
114
+ return /* @__PURE__ */ o(L.Provider, { value: { collapsed: l, collapsedWidth: a, width: s }, children: /* @__PURE__ */ A(
115
+ "aside",
116
+ {
117
+ className: B,
118
+ style: {
119
+ width: typeof x == "number" ? `${x}px` : x,
120
+ ...g
121
+ },
122
+ children: [
123
+ /* @__PURE__ */ o("div", { className: "flex-1 overflow-auto", children: n }),
124
+ t !== null && (t ?? E)
125
+ ]
126
+ }
127
+ ) });
128
+ }
129
+ v.displayName = "LayoutSider";
130
+ const W = Object.assign(h, {
131
+ Header: H,
132
+ Footer: I,
133
+ Content: O,
134
+ Sider: v
12
135
  });
13
136
  export {
14
- r as List
137
+ W as Layout,
138
+ Q as useSiderContext
15
139
  };
16
140
  //# sourceMappingURL=index45.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index45.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;"}
1
+ {"version":3,"file":"index45.js","sources":["../src/components/Layout.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useCallback, useEffect } from 'react'\n\nexport interface LayoutProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutHeaderProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutFooterProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutContentProps {\n children: React.ReactNode\n className?: string\n style?: React.CSSProperties\n}\n\nexport interface LayoutSiderProps {\n children: React.ReactNode\n width?: number | string\n collapsedWidth?: number | string\n collapsed?: boolean\n defaultCollapsed?: boolean\n collapsible?: boolean\n onCollapse?: (collapsed: boolean) => void\n trigger?: React.ReactNode | null\n breakpoint?: 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n onBreakpoint?: (broken: boolean) => void\n className?: string\n style?: React.CSSProperties\n}\n\ninterface SiderContextValue {\n collapsed: boolean\n collapsedWidth: number | string\n width: number | string\n}\n\nconst SiderContext = createContext<SiderContextValue | null>(null)\n\nexport function useSiderContext() {\n return useContext(SiderContext)\n}\n\nfunction LayoutRoot({ children, className = '', style }: LayoutProps) {\n // Check if any child is a Sider to determine flex direction\n const childArray = React.Children.toArray(children)\n const hasSider = childArray.some(\n (child) => React.isValidElement(child) && (child.type as any).displayName === 'LayoutSider'\n )\n\n const layoutClasses = [\n 'flex',\n 'min-h-0',\n hasSider ? 'flex-row' : 'flex-col',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // If we have a Sider, auto-add flex-1 to non-Sider Layout children\n const processedChildren = hasSider\n ? childArray.map((child) => {\n if (\n React.isValidElement(child) &&\n (child.type === LayoutRoot || (child.type as any).displayName === 'LayoutRoot') &&\n (child.type as any).displayName !== 'LayoutSider'\n ) {\n // Clone the Layout child and add flex-1 if not already present\n const existingClassName = (child.props as any).className || ''\n if (!existingClassName.includes('flex-1')) {\n return React.cloneElement(child as React.ReactElement<any>, {\n className: `flex-1 ${existingClassName}`.trim(),\n })\n }\n }\n return child\n })\n : children\n\n return (\n <div className={layoutClasses} style={style}>\n {processedChildren}\n </div>\n )\n}\n\nLayoutRoot.displayName = 'LayoutRoot'\n\nfunction LayoutHeader({ children, className = '', style }: LayoutHeaderProps) {\n const headerClasses = [\n 'flex',\n 'items-center',\n 'px-6',\n 'h-16',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <header className={headerClasses} style={style}>\n {children}\n </header>\n )\n}\n\nfunction LayoutFooter({ children, className = '', style }: LayoutFooterProps) {\n const footerClasses = [\n 'px-6',\n 'py-4',\n 'text-center',\n 'bg-base-300',\n 'flex-shrink-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <footer className={footerClasses} style={style}>\n {children}\n </footer>\n )\n}\n\nfunction LayoutContent({ children, className = '', style }: LayoutContentProps) {\n // flex-1 by default so Content fills available space\n const contentClasses = ['flex-1', 'min-h-0', 'overflow-auto', className].filter(Boolean).join(' ')\n\n return (\n <main className={contentClasses} style={style}>\n {children}\n </main>\n )\n}\n\nconst BREAKPOINT_MAP: Record<string, string> = {\n sm: '(max-width: 639px)',\n md: '(max-width: 767px)',\n lg: '(max-width: 1023px)',\n xl: '(max-width: 1279px)',\n '2xl': '(max-width: 1535px)',\n}\n\nfunction LayoutSider({\n children,\n width = 200,\n collapsedWidth = 80,\n collapsed: controlledCollapsed,\n defaultCollapsed = false,\n collapsible = false,\n onCollapse,\n trigger,\n breakpoint,\n onBreakpoint,\n className = '',\n style,\n}: LayoutSiderProps) {\n const [internalCollapsed, setInternalCollapsed] = useState(defaultCollapsed)\n const [broken, setBroken] = useState(false)\n\n const collapsed = controlledCollapsed ?? internalCollapsed\n\n // Handle responsive breakpoint\n useEffect(() => {\n if (!breakpoint) return\n\n const mediaQuery = window.matchMedia(BREAKPOINT_MAP[breakpoint])\n\n const handleChange = (e: MediaQueryListEvent | MediaQueryList) => {\n const isBroken = e.matches\n setBroken(isBroken)\n onBreakpoint?.(isBroken)\n\n // Auto-collapse when breakpoint is crossed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(isBroken)\n }\n if (isBroken !== broken) {\n onCollapse?.(isBroken)\n }\n }\n\n // Check initial state\n handleChange(mediaQuery)\n\n // Listen for changes\n mediaQuery.addEventListener('change', handleChange)\n return () => mediaQuery.removeEventListener('change', handleChange)\n }, [breakpoint, onBreakpoint, controlledCollapsed, onCollapse, broken])\n\n const handleCollapse = useCallback(() => {\n const newCollapsed = !collapsed\n if (controlledCollapsed === undefined) {\n setInternalCollapsed(newCollapsed)\n }\n onCollapse?.(newCollapsed)\n }, [collapsed, controlledCollapsed, onCollapse])\n\n const currentWidth = collapsed ? collapsedWidth : width\n\n const siderClasses = [\n 'flex',\n 'flex-col',\n 'bg-base-200',\n 'flex-shrink-0',\n 'transition-all',\n 'duration-200',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const defaultTrigger = collapsible && trigger !== null && (\n <button\n onClick={handleCollapse}\n className=\"flex items-center justify-center h-10 w-full bg-base-300 hover:bg-base-content/10 transition-colors\"\n aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n >\n <svg\n className={`w-4 h-4 transition-transform ${collapsed ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )\n\n return (\n <SiderContext.Provider value={{ collapsed, collapsedWidth, width }}>\n <aside\n className={siderClasses}\n style={{\n width: typeof currentWidth === 'number' ? `${currentWidth}px` : currentWidth,\n ...style,\n }}\n >\n <div className=\"flex-1 overflow-auto\">{children}</div>\n {trigger !== null && (trigger ?? defaultTrigger)}\n </aside>\n </SiderContext.Provider>\n )\n}\n\nLayoutSider.displayName = 'LayoutSider'\n\nexport const Layout = Object.assign(LayoutRoot, {\n Header: LayoutHeader,\n Footer: LayoutFooter,\n Content: LayoutContent,\n Sider: LayoutSider,\n})\n"],"names":["SiderContext","createContext","useSiderContext","useContext","LayoutRoot","children","className","style","childArray","React","hasSider","child","layoutClasses","processedChildren","existingClassName","jsx","LayoutHeader","headerClasses","LayoutFooter","footerClasses","LayoutContent","contentClasses","BREAKPOINT_MAP","LayoutSider","width","collapsedWidth","controlledCollapsed","defaultCollapsed","collapsible","onCollapse","trigger","breakpoint","onBreakpoint","internalCollapsed","setInternalCollapsed","useState","broken","setBroken","collapsed","useEffect","mediaQuery","handleChange","e","isBroken","handleCollapse","useCallback","newCollapsed","currentWidth","siderClasses","defaultTrigger","jsxs","Layout"],"mappings":";;AA+CA,MAAMA,IAAeC,EAAwC,IAAI;AAE1D,SAASC,IAAkB;AAChC,SAAOC,EAAWH,CAAY;AAChC;AAEA,SAASI,EAAW,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,OAAAC,KAAsB;AAEpE,QAAMC,IAAaC,EAAM,SAAS,QAAQJ,CAAQ,GAC5CK,IAAWF,EAAW;AAAA,IAC1B,CAACG,MAAUF,EAAM,eAAeE,CAAK,KAAMA,EAAM,KAAa,gBAAgB;AAAA,EAAA,GAG1EC,IAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACAF,IAAW,aAAa;AAAA,I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AAA,EAC9C,QAAQY;AAAA,EACR,QAAQE;AAAA,EACR,SAASE;AAAA,EACT,OAAOG;AACT,CAAC;"}
package/dist/index46.js CHANGED
@@ -1,38 +1,16 @@
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
- };
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
- f as Loading
14
+ r as List
37
15
  };
38
16
  //# sourceMappingURL=index46.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index46.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;"}
1
+ {"version":3,"file":"index46.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/index47.js CHANGED
@@ -1,37 +1,38 @@
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";
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
- g as Mask
36
+ f as Loading
36
37
  };
37
38
  //# sourceMappingURL=index47.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index47.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;"}
1
+ {"version":3,"file":"index47.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;"}