@agroshine/ags-web-ui-kit 1.0.0

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 (109) hide show
  1. package/README.md +75 -0
  2. package/dist/atoms/index.cjs +134 -0
  3. package/dist/atoms/index.cjs.map +1 -0
  4. package/dist/atoms/index.d.cts +583 -0
  5. package/dist/atoms/index.d.ts +583 -0
  6. package/dist/atoms/index.js +9 -0
  7. package/dist/atoms/index.js.map +1 -0
  8. package/dist/chunk-2KRMLIJQ.cjs +52 -0
  9. package/dist/chunk-2KRMLIJQ.cjs.map +1 -0
  10. package/dist/chunk-2TBYPKQ3.cjs +79 -0
  11. package/dist/chunk-2TBYPKQ3.cjs.map +1 -0
  12. package/dist/chunk-5FWELSEZ.js +1296 -0
  13. package/dist/chunk-5FWELSEZ.js.map +1 -0
  14. package/dist/chunk-5PEOJVY7.cjs +1502 -0
  15. package/dist/chunk-5PEOJVY7.cjs.map +1 -0
  16. package/dist/chunk-6LUGTNMH.js +259 -0
  17. package/dist/chunk-6LUGTNMH.js.map +1 -0
  18. package/dist/chunk-6O2IDBTX.js +112 -0
  19. package/dist/chunk-6O2IDBTX.js.map +1 -0
  20. package/dist/chunk-6YUNWKT3.js +26 -0
  21. package/dist/chunk-6YUNWKT3.js.map +1 -0
  22. package/dist/chunk-7R6OXNES.cjs +321 -0
  23. package/dist/chunk-7R6OXNES.cjs.map +1 -0
  24. package/dist/chunk-A3A7PJWG.cjs +13 -0
  25. package/dist/chunk-A3A7PJWG.cjs.map +1 -0
  26. package/dist/chunk-A7TDGQAB.js +557 -0
  27. package/dist/chunk-A7TDGQAB.js.map +1 -0
  28. package/dist/chunk-C4LX3XTN.cjs +1187 -0
  29. package/dist/chunk-C4LX3XTN.cjs.map +1 -0
  30. package/dist/chunk-DZW4GS2T.cjs +1340 -0
  31. package/dist/chunk-DZW4GS2T.cjs.map +1 -0
  32. package/dist/chunk-E3BTK736.cjs +174 -0
  33. package/dist/chunk-E3BTK736.cjs.map +1 -0
  34. package/dist/chunk-ERGKCXM2.cjs +267 -0
  35. package/dist/chunk-ERGKCXM2.cjs.map +1 -0
  36. package/dist/chunk-FOA46NSG.cjs +574 -0
  37. package/dist/chunk-FOA46NSG.cjs.map +1 -0
  38. package/dist/chunk-JTFCE6RA.js +1156 -0
  39. package/dist/chunk-JTFCE6RA.js.map +1 -0
  40. package/dist/chunk-KINOE57L.js +225 -0
  41. package/dist/chunk-KINOE57L.js.map +1 -0
  42. package/dist/chunk-MOED3QPY.js +11 -0
  43. package/dist/chunk-MOED3QPY.js.map +1 -0
  44. package/dist/chunk-NVR34DY2.cjs +4 -0
  45. package/dist/chunk-NVR34DY2.cjs.map +1 -0
  46. package/dist/chunk-PI3IJWBG.js +79 -0
  47. package/dist/chunk-PI3IJWBG.js.map +1 -0
  48. package/dist/chunk-PXAMTGYY.js +3 -0
  49. package/dist/chunk-PXAMTGYY.js.map +1 -0
  50. package/dist/chunk-QAZMI5VH.js +151 -0
  51. package/dist/chunk-QAZMI5VH.js.map +1 -0
  52. package/dist/chunk-QEG27NX6.js +30 -0
  53. package/dist/chunk-QEG27NX6.js.map +1 -0
  54. package/dist/chunk-THTOUSMG.cjs +52 -0
  55. package/dist/chunk-THTOUSMG.cjs.map +1 -0
  56. package/dist/chunk-UAXKB6IH.cjs +32 -0
  57. package/dist/chunk-UAXKB6IH.cjs.map +1 -0
  58. package/dist/chunk-W5IHWAMM.js +48 -0
  59. package/dist/chunk-W5IHWAMM.js.map +1 -0
  60. package/dist/chunk-X2UJQVZJ.cjs +139 -0
  61. package/dist/chunk-X2UJQVZJ.cjs.map +1 -0
  62. package/dist/chunk-X43C5OJD.js +1460 -0
  63. package/dist/chunk-X43C5OJD.js.map +1 -0
  64. package/dist/chunk-XCYSBWV4.js +56 -0
  65. package/dist/chunk-XCYSBWV4.js.map +1 -0
  66. package/dist/chunk-XX4CBCEB.cjs +102 -0
  67. package/dist/chunk-XX4CBCEB.cjs.map +1 -0
  68. package/dist/hooks/index.cjs +33 -0
  69. package/dist/hooks/index.cjs.map +1 -0
  70. package/dist/hooks/index.d.cts +59 -0
  71. package/dist/hooks/index.d.ts +59 -0
  72. package/dist/hooks/index.js +4 -0
  73. package/dist/hooks/index.js.map +1 -0
  74. package/dist/index.cjs +366 -0
  75. package/dist/index.cjs.map +1 -0
  76. package/dist/index.d.cts +13 -0
  77. package/dist/index.d.ts +13 -0
  78. package/dist/index.js +17 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/interface-DnK5S6ww.d.cts +51 -0
  81. package/dist/interface-DnK5S6ww.d.ts +51 -0
  82. package/dist/lib/index.cjs +13 -0
  83. package/dist/lib/index.cjs.map +1 -0
  84. package/dist/lib/index.d.cts +5 -0
  85. package/dist/lib/index.d.ts +5 -0
  86. package/dist/lib/index.js +4 -0
  87. package/dist/lib/index.js.map +1 -0
  88. package/dist/molecules/index.cjs +123 -0
  89. package/dist/molecules/index.cjs.map +1 -0
  90. package/dist/molecules/index.d.cts +449 -0
  91. package/dist/molecules/index.d.ts +449 -0
  92. package/dist/molecules/index.js +10 -0
  93. package/dist/molecules/index.js.map +1 -0
  94. package/dist/organisms/index.cjs +102 -0
  95. package/dist/organisms/index.cjs.map +1 -0
  96. package/dist/organisms/index.d.cts +396 -0
  97. package/dist/organisms/index.d.ts +396 -0
  98. package/dist/organisms/index.js +9 -0
  99. package/dist/organisms/index.js.map +1 -0
  100. package/dist/tooltip-Bl2ZTtfg.d.cts +16 -0
  101. package/dist/tooltip-Bl2ZTtfg.d.ts +16 -0
  102. package/dist/ui/index.cjs +955 -0
  103. package/dist/ui/index.cjs.map +1 -0
  104. package/dist/ui/index.d.cts +252 -0
  105. package/dist/ui/index.d.ts +252 -0
  106. package/dist/ui/index.js +642 -0
  107. package/dist/ui/index.js.map +1 -0
  108. package/package.json +200 -0
  109. package/tailwind.preset.cjs +134 -0
@@ -0,0 +1,1340 @@
1
+ 'use strict';
2
+
3
+ var chunkFOA46NSG_cjs = require('./chunk-FOA46NSG.cjs');
4
+ var chunkE3BTK736_cjs = require('./chunk-E3BTK736.cjs');
5
+ var chunk7R6OXNES_cjs = require('./chunk-7R6OXNES.cjs');
6
+ var chunk2KRMLIJQ_cjs = require('./chunk-2KRMLIJQ.cjs');
7
+ var chunk2TBYPKQ3_cjs = require('./chunk-2TBYPKQ3.cjs');
8
+ var chunkXX4CBCEB_cjs = require('./chunk-XX4CBCEB.cjs');
9
+ var chunkA3A7PJWG_cjs = require('./chunk-A3A7PJWG.cjs');
10
+ var React5 = require('react');
11
+ var lucideReact = require('lucide-react');
12
+ var classVarianceAuthority = require('class-variance-authority');
13
+ var jsxRuntime = require('react/jsx-runtime');
14
+ var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
15
+ var reactFontawesome = require('@fortawesome/react-fontawesome');
16
+ var clsx2 = require('clsx');
17
+
18
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
19
+
20
+ function _interopNamespace(e) {
21
+ if (e && e.__esModule) return e;
22
+ var n = Object.create(null);
23
+ if (e) {
24
+ Object.keys(e).forEach(function (k) {
25
+ if (k !== 'default') {
26
+ var d = Object.getOwnPropertyDescriptor(e, k);
27
+ Object.defineProperty(n, k, d.get ? d : {
28
+ enumerable: true,
29
+ get: function () { return e[k]; }
30
+ });
31
+ }
32
+ });
33
+ }
34
+ n.default = e;
35
+ return Object.freeze(n);
36
+ }
37
+
38
+ var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
39
+ var clsx2__default = /*#__PURE__*/_interopDefault(clsx2);
40
+
41
+ var alertVariants = classVarianceAuthority.cva(
42
+ "relative grid w-full grid-cols-[18px_1fr] items-start gap-3 rounded-md border px-4 py-3.5",
43
+ {
44
+ variants: {
45
+ variant: {
46
+ // Canon default: neutral, sin tinte.
47
+ default: "border-border bg-background text-foreground",
48
+ // Canon extra (compat AgroShine — primary-tinted).
49
+ info: "border-primary-200 bg-primary-50 text-primary-700",
50
+ success: "border-success-200 bg-success-50 text-success-700",
51
+ warning: "border-warning-100 bg-warning-50 text-warning-800",
52
+ destructive: "border-destructive bg-destructive/[0.05] text-destructive",
53
+ // Alias compat.
54
+ danger: "border-destructive bg-destructive/[0.05] text-destructive"
55
+ }
56
+ },
57
+ defaultVariants: { variant: "default" }
58
+ }
59
+ );
60
+ var alertIconVariants = classVarianceAuthority.cva(
61
+ "flex h-[18px] w-[18px] shrink-0 items-center justify-center text-[16px] leading-none [&_svg]:h-[18px] [&_svg]:w-[18px]",
62
+ {
63
+ variants: {
64
+ variant: {
65
+ default: "text-foreground",
66
+ info: "text-primary-700",
67
+ success: "text-success-700",
68
+ warning: "text-warning-800",
69
+ destructive: "text-destructive",
70
+ danger: "text-destructive"
71
+ }
72
+ },
73
+ defaultVariants: { variant: "default" }
74
+ }
75
+ );
76
+ var ICON_MAP = {
77
+ default: lucideReact.Info,
78
+ info: lucideReact.Info,
79
+ success: lucideReact.CheckCircle2,
80
+ warning: lucideReact.AlertCircle,
81
+ destructive: lucideReact.XCircle,
82
+ danger: lucideReact.XCircle
83
+ };
84
+ var Alert = React5__namespace.forwardRef(
85
+ ({
86
+ variant = "default",
87
+ title,
88
+ description,
89
+ icon = true,
90
+ closable,
91
+ onClose,
92
+ className,
93
+ children
94
+ }, ref) => {
95
+ const renderIcon = () => {
96
+ if (icon === false) return null;
97
+ if (icon === true) {
98
+ const IconComponent = ICON_MAP[variant];
99
+ return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {});
100
+ }
101
+ return icon;
102
+ };
103
+ const iconNode = renderIcon();
104
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, role: "alert", className: chunkA3A7PJWG_cjs.cn(alertVariants({ variant }), className), children: [
105
+ iconNode !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: alertIconVariants({ variant }), children: iconNode }),
106
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
107
+ title && // .at: font-weight 600, font-size 14px, margin 0 0 4px
108
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "m-0 mb-1 text-sm font-semibold leading-tight", children: title }),
109
+ description && // .ad: font-size 13px, color muted-foreground, line-height 1.5
110
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 text-[13px] leading-normal text-muted-foreground", children: description }),
111
+ children
112
+ ] }),
113
+ closable && /* @__PURE__ */ jsxRuntime.jsx(
114
+ "button",
115
+ {
116
+ type: "button",
117
+ "aria-label": "Cerrar",
118
+ onClick: onClose,
119
+ className: "-mr-1 -mt-1 shrink-0 rounded-sm p-1 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring",
120
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
121
+ }
122
+ )
123
+ ] });
124
+ }
125
+ );
126
+ Alert.displayName = "Alert";
127
+ var ELLIPSIS_KEY = "__ellipsis__";
128
+ function collapseItems(items, maxItems) {
129
+ if (!maxItems || items.length <= maxItems) return items;
130
+ const first = items[0];
131
+ const lastTwo = items.slice(-2);
132
+ return [first, null, ...lastTwo];
133
+ }
134
+ var Breadcrumb = React5__namespace.forwardRef(
135
+ ({ items, separator, maxItems, className, onItemClick }, ref) => {
136
+ const sep = separator ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3.5 w-3.5 text-default-500" });
137
+ const visible = collapseItems(items, maxItems);
138
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "Breadcrumb", className: chunkA3A7PJWG_cjs.cn("w-full", className), children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex flex-wrap items-center gap-1.5 text-sm", children: visible.map((item, idx) => {
139
+ const isLast = idx === visible.length - 1;
140
+ const key = item === null ? `${ELLIPSIS_KEY}-${idx}` : `${idx}-${String(item.label)}`;
141
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-1.5", children: [
142
+ item === null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-default-500 px-1", children: "\u2026" }) : isLast ? /* @__PURE__ */ jsxRuntime.jsxs(
143
+ "span",
144
+ {
145
+ "aria-current": "page",
146
+ className: "flex items-center gap-1 font-medium text-default-900",
147
+ children: [
148
+ item.icon,
149
+ item.label
150
+ ]
151
+ }
152
+ ) : item.href ? /* @__PURE__ */ jsxRuntime.jsxs(
153
+ "a",
154
+ {
155
+ href: item.href,
156
+ onClick: onItemClick ? () => onItemClick(item, idx) : void 0,
157
+ className: "flex items-center gap-1 text-default-700 hover:text-primary transition-colors",
158
+ children: [
159
+ item.icon,
160
+ item.label
161
+ ]
162
+ }
163
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
164
+ "button",
165
+ {
166
+ type: "button",
167
+ onClick: onItemClick ? () => onItemClick(item, idx) : void 0,
168
+ className: "flex items-center gap-1 text-default-700 hover:text-primary transition-colors",
169
+ children: [
170
+ item.icon,
171
+ item.label
172
+ ]
173
+ }
174
+ ),
175
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-default-400", children: sep })
176
+ ] }, key);
177
+ }) }) });
178
+ }
179
+ );
180
+ Breadcrumb.displayName = "Breadcrumb";
181
+ var variantClasses = {
182
+ default: "",
183
+ flush: "overflow-hidden",
184
+ interactive: "cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
185
+ };
186
+ var Card2 = React5.forwardRef(function Card3({ variant = "default", className, onClick, children, ...rest }, ref) {
187
+ const isInteractive = variant === "interactive" || Boolean(onClick);
188
+ return /* @__PURE__ */ jsxRuntime.jsx(
189
+ chunk7R6OXNES_cjs.Card,
190
+ {
191
+ ref,
192
+ onClick,
193
+ role: isInteractive ? "button" : void 0,
194
+ tabIndex: isInteractive ? 0 : void 0,
195
+ className: chunkA3A7PJWG_cjs.cn(variantClasses[variant], className),
196
+ ...rest,
197
+ children
198
+ }
199
+ );
200
+ });
201
+ var sizeMap = {
202
+ xs: "sm:max-w-xs",
203
+ sm: "sm:max-w-sm",
204
+ md: "sm:max-w-md",
205
+ lg: "sm:max-w-lg",
206
+ xl: "sm:max-w-xl"
207
+ };
208
+ var Drawer = ({
209
+ visible,
210
+ onClose,
211
+ title,
212
+ description,
213
+ children,
214
+ size = "xl",
215
+ placement = "right",
216
+ footer,
217
+ extra
218
+ }) => {
219
+ const isHorizontal = placement === "left" || placement === "right";
220
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.Sheet, { open: visible, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(
221
+ chunk7R6OXNES_cjs.SheetContent,
222
+ {
223
+ side: placement,
224
+ hideCloseButton: true,
225
+ className: chunkA3A7PJWG_cjs.cn(
226
+ "p-0 flex flex-col rounded-none",
227
+ isHorizontal ? sizeMap[size] : "",
228
+ isHorizontal ? "w-full" : "h-auto"
229
+ ),
230
+ children: [
231
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-8 py-8 border-b", children: [
232
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
233
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[20px] font-bold", children: title }),
234
+ description && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[14px] font-medium text-[#00000080]", children: description })
235
+ ] }),
236
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
237
+ extra && Array.isArray(extra) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: extra.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: item }, index)) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: extra }),
238
+ /* @__PURE__ */ jsxRuntime.jsx(
239
+ "div",
240
+ {
241
+ className: "flex p-[10px] rounded-[6px] hover:cursor-pointer hover:bg-primary-50",
242
+ onClick: onClose,
243
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { size: "xl", icon: freeSolidSvgIcons.faTimes })
244
+ }
245
+ )
246
+ ] })
247
+ ] }),
248
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto px-8 py-8", children }),
249
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end px-8 py-[15px] border-t", children: footer })
250
+ ]
251
+ }
252
+ ) });
253
+ };
254
+ var Drawer_default = Drawer;
255
+ var Empty = React5__namespace.forwardRef(
256
+ ({ title = "Sin datos", description, icon, action, className }, ref) => {
257
+ const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Inbox, { className: "h-12 w-12" });
258
+ return /* @__PURE__ */ jsxRuntime.jsxs(
259
+ "div",
260
+ {
261
+ ref,
262
+ className: chunkA3A7PJWG_cjs.cn(
263
+ "flex flex-col items-center justify-center px-5 py-12 text-center text-muted-foreground",
264
+ className
265
+ ),
266
+ children: [
267
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 flex items-center justify-center text-muted-foreground opacity-40", children: iconNode }),
268
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-foreground", children: title }),
269
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 max-w-sm text-[13px] text-muted-foreground", children: description }),
270
+ action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3.5 flex items-center justify-center gap-2", children: action })
271
+ ]
272
+ }
273
+ );
274
+ }
275
+ );
276
+ Empty.displayName = "Empty";
277
+ var HoverCard2 = React5__namespace.forwardRef(
278
+ ({
279
+ trigger,
280
+ children,
281
+ side = "bottom",
282
+ align = "center",
283
+ openDelay = 200,
284
+ closeDelay = 150,
285
+ open,
286
+ defaultOpen,
287
+ onOpenChange,
288
+ className,
289
+ asChild = true
290
+ }, ref) => {
291
+ return /* @__PURE__ */ jsxRuntime.jsxs(
292
+ chunk7R6OXNES_cjs.HoverCard,
293
+ {
294
+ openDelay,
295
+ closeDelay,
296
+ open,
297
+ defaultOpen,
298
+ onOpenChange,
299
+ children: [
300
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.HoverCardTrigger, { asChild, children: trigger }),
301
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.HoverCardContent, { ref, side, align, className: chunkA3A7PJWG_cjs.cn(className), children })
302
+ ]
303
+ }
304
+ );
305
+ }
306
+ );
307
+ HoverCard2.displayName = "HoverCard";
308
+ var ListSizeContext = React5.createContext("default");
309
+ var SIZE_CLASSES = {
310
+ // .list-sm .list-item { padding:8px 12px; gap:10px; }
311
+ small: "gap-2.5 px-3 py-2 [&_.li-title]:text-[13px]",
312
+ // canon default: padding 14px 16px; gap 14px
313
+ default: "gap-3.5 px-4 py-3.5",
314
+ // .list-lg .list-item { padding:18px 18px; }
315
+ large: "gap-4 px-4 py-4"
316
+ };
317
+ var ListItem = React5.forwardRef(function ListItem2({ avatar, title, description, extra, actions, children, className, ...rest }, ref) {
318
+ const hasSlots = Boolean(avatar || title || description || extra || actions);
319
+ const size = React5.useContext(ListSizeContext);
320
+ return /* @__PURE__ */ jsxRuntime.jsx(
321
+ "div",
322
+ {
323
+ ref,
324
+ "data-list-item": true,
325
+ className: chunkA3A7PJWG_cjs.cn(
326
+ "flex items-center border-b border-border transition-colors last:border-b-0 hover:bg-muted/40",
327
+ SIZE_CLASSES[size],
328
+ className
329
+ ),
330
+ ...rest,
331
+ children: hasSlots ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
332
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
333
+ avatar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: avatar }),
334
+ (title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
335
+ title && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "li-title m-0 truncate text-sm font-semibold text-foreground", children: title }),
336
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 mt-0.5 text-[12.5px] leading-snug text-muted-foreground", children: description })
337
+ ] })
338
+ ] }),
339
+ extra !== void 0 && extra !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 text-[13px] text-muted-foreground", children: extra }),
340
+ actions !== void 0 && actions !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-1.5", children: actions })
341
+ ] }) : (
342
+ // Modo libre: el consumer renderiza lo que quiera
343
+ children
344
+ )
345
+ }
346
+ );
347
+ });
348
+ ListItem.displayName = "List.Item";
349
+ var ListBase = React5.forwardRef(function List({
350
+ data,
351
+ renderItem,
352
+ children,
353
+ header,
354
+ footer,
355
+ bordered = false,
356
+ size = "default",
357
+ maxVisibleItems,
358
+ readMoreLabel = "",
359
+ onReadMoreClick,
360
+ className,
361
+ ...rest
362
+ }, ref) {
363
+ const visibleItems = data && maxVisibleItems ? data.slice(0, maxVisibleItems) : data;
364
+ const hiddenCount = data && maxVisibleItems && data.length > maxVisibleItems ? data.length - maxVisibleItems : 0;
365
+ return /* @__PURE__ */ jsxRuntime.jsx(ListSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsxs(
366
+ "div",
367
+ {
368
+ ref,
369
+ className: chunkA3A7PJWG_cjs.cn(
370
+ "flex w-full flex-col bg-card text-card-foreground",
371
+ bordered && "overflow-hidden rounded-md border border-border",
372
+ className
373
+ ),
374
+ ...rest,
375
+ children: [
376
+ header !== void 0 && header !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border bg-muted/40 px-4 py-3 text-[13px] text-muted-foreground", children: header }),
377
+ children,
378
+ visibleItems?.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(ListItem, { children: renderItem ? renderItem(item, index) : item.label ?? item.name ?? item.value }, item.key ?? index)),
379
+ hiddenCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
380
+ "button",
381
+ {
382
+ type: "button",
383
+ onClick: onReadMoreClick,
384
+ className: "border-b border-border px-4 py-3 text-left text-[13px] text-muted-foreground transition-colors last:border-b-0 hover:bg-muted/40 hover:text-foreground",
385
+ children: [
386
+ "+",
387
+ hiddenCount,
388
+ readMoreLabel ? `, ${readMoreLabel}` : ""
389
+ ]
390
+ }
391
+ ),
392
+ footer !== void 0 && footer !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border bg-muted/40 px-4 py-3 text-[13px] text-muted-foreground", children: footer })
393
+ ]
394
+ }
395
+ ) });
396
+ });
397
+ ListBase.displayName = "List";
398
+ var List2 = ListBase;
399
+ List2.Item = ListItem;
400
+ var DeleteModal = ({ isOpen, setIsOpen, deleteData }) => {
401
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.Dialog, { open: isOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(chunk7R6OXNES_cjs.DialogContent, { className: "bg-white rounded-md", children: [
402
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.DialogTitle, { children: "Eliminar" }) }),
403
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Esta seguro que desea eliminar ese registro?" }) }),
404
+ /* @__PURE__ */ jsxRuntime.jsxs(chunk7R6OXNES_cjs.DialogFooter, { children: [
405
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE3BTK736_cjs.Button, { variant: "light", onPress: () => setIsOpen(false), children: "Cancelar" }),
406
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE3BTK736_cjs.Button, { color: "primary", onPress: deleteData, children: "Eliminar" })
407
+ ] })
408
+ ] }) });
409
+ };
410
+ var DeleteModal_default = DeleteModal;
411
+ var sizeMap2 = {
412
+ xs: "max-w-xs",
413
+ sm: "max-w-sm",
414
+ md: "max-w-md",
415
+ lg: "max-w-lg",
416
+ xl: "max-w-xl",
417
+ "5xl": "max-w-5xl"
418
+ };
419
+ var Modal = ({
420
+ visible,
421
+ onClose,
422
+ title,
423
+ children,
424
+ size = "xl",
425
+ footer
426
+ }) => {
427
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.Dialog, { open: visible, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(chunk7R6OXNES_cjs.DialogContent, { hideCloseButton: true, className: chunkA3A7PJWG_cjs.cn("w-full", sizeMap2[size]), children: [
428
+ title && /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.DialogTitle, { children: title }) }),
429
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2", children }),
430
+ /* @__PURE__ */ jsxRuntime.jsxs(chunk7R6OXNES_cjs.DialogFooter, { children: [
431
+ footer,
432
+ /* @__PURE__ */ jsxRuntime.jsx(chunkE3BTK736_cjs.Button, { color: "danger", variant: "light", onPress: onClose, children: "Cerrar" })
433
+ ] })
434
+ ] }) });
435
+ };
436
+ var Modal_default = Modal;
437
+ var Popconfirm = React5__namespace.forwardRef(
438
+ ({
439
+ title,
440
+ description,
441
+ okText = "Confirmar",
442
+ cancelText = "Cancelar",
443
+ okVariant = "primary",
444
+ onConfirm,
445
+ onCancel,
446
+ icon,
447
+ children,
448
+ side = "top",
449
+ align = "center",
450
+ className,
451
+ asChild = true,
452
+ disabled
453
+ }, ref) => {
454
+ const [open, setOpen] = React5__namespace.useState(false);
455
+ const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4 text-warning-600 shrink-0 mt-0.5" });
456
+ const handleConfirm = async () => {
457
+ await onConfirm();
458
+ setOpen(false);
459
+ };
460
+ const handleCancel = () => {
461
+ onCancel?.();
462
+ setOpen(false);
463
+ };
464
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk2KRMLIJQ_cjs.Popover, { open, onOpenChange: disabled ? void 0 : setOpen, children: [
465
+ /* @__PURE__ */ jsxRuntime.jsx(chunk2KRMLIJQ_cjs.PopoverTrigger, { asChild, children }),
466
+ /* @__PURE__ */ jsxRuntime.jsxs(chunk2KRMLIJQ_cjs.PopoverContent, { ref, side, align, className: chunkA3A7PJWG_cjs.cn("w-72 p-3", className), children: [
467
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 mb-3", children: [
468
+ iconNode,
469
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
470
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-default-900", children: title }),
471
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-default-700 mt-1", children: description })
472
+ ] })
473
+ ] }),
474
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
475
+ /* @__PURE__ */ jsxRuntime.jsx(chunk2TBYPKQ3_cjs.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: cancelText }),
476
+ /* @__PURE__ */ jsxRuntime.jsx(
477
+ chunk2TBYPKQ3_cjs.Button,
478
+ {
479
+ variant: okVariant === "danger" ? "destructive" : "default",
480
+ size: "sm",
481
+ onClick: () => {
482
+ void handleConfirm();
483
+ },
484
+ children: okText
485
+ }
486
+ )
487
+ ] })
488
+ ] })
489
+ ] });
490
+ }
491
+ );
492
+ Popconfirm.displayName = "Popconfirm";
493
+ var Popover2 = React5__namespace.forwardRef(
494
+ ({
495
+ trigger,
496
+ children,
497
+ side = "bottom",
498
+ align = "center",
499
+ open,
500
+ defaultOpen,
501
+ onOpenChange,
502
+ className,
503
+ sideOffset = 4,
504
+ asChild = true
505
+ }, ref) => {
506
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk2KRMLIJQ_cjs.Popover, { open, defaultOpen, onOpenChange, children: [
507
+ /* @__PURE__ */ jsxRuntime.jsx(chunk2KRMLIJQ_cjs.PopoverTrigger, { asChild, children: trigger }),
508
+ /* @__PURE__ */ jsxRuntime.jsx(
509
+ chunk2KRMLIJQ_cjs.PopoverContent,
510
+ {
511
+ ref,
512
+ side,
513
+ align,
514
+ sideOffset,
515
+ className: chunkA3A7PJWG_cjs.cn(className),
516
+ children
517
+ }
518
+ )
519
+ ] });
520
+ }
521
+ );
522
+ Popover2.displayName = "Popover";
523
+ var segmentedRootVariants = classVarianceAuthority.cva(
524
+ "inline-flex items-center bg-muted rounded-md p-1 gap-0.5",
525
+ {
526
+ variants: {
527
+ size: { sm: "h-8", md: "h-10", lg: "h-12" },
528
+ fullWidth: { true: "flex w-full", false: "" }
529
+ },
530
+ defaultVariants: { size: "md", fullWidth: false }
531
+ }
532
+ );
533
+ var segmentedItemVariants = classVarianceAuthority.cva(
534
+ "inline-flex items-center justify-center gap-1.5 rounded-sm font-medium transition-all whitespace-nowrap focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",
535
+ {
536
+ variants: {
537
+ size: {
538
+ sm: "h-6 px-2.5 text-xs",
539
+ md: "h-8 px-3 text-sm",
540
+ lg: "h-10 px-4 text-base"
541
+ },
542
+ active: {
543
+ true: "bg-background text-foreground shadow-sm",
544
+ false: "text-muted-foreground hover:text-foreground"
545
+ },
546
+ fullWidth: { true: "flex-1", false: "" }
547
+ },
548
+ defaultVariants: { size: "md", active: false, fullWidth: false }
549
+ }
550
+ );
551
+ function SegmentedInner({
552
+ value,
553
+ onChange,
554
+ options,
555
+ size = "md",
556
+ disabled,
557
+ fullWidth = false,
558
+ className
559
+ }, ref) {
560
+ return /* @__PURE__ */ jsxRuntime.jsx(
561
+ "div",
562
+ {
563
+ ref,
564
+ role: "radiogroup",
565
+ className: chunkA3A7PJWG_cjs.cn(segmentedRootVariants({ size, fullWidth }), className),
566
+ children: options.map((option) => {
567
+ const isActive = option.value === value;
568
+ const isDisabled = disabled || option.disabled;
569
+ return /* @__PURE__ */ jsxRuntime.jsxs(
570
+ "button",
571
+ {
572
+ type: "button",
573
+ role: "radio",
574
+ "aria-checked": isActive,
575
+ disabled: isDisabled,
576
+ onClick: () => onChange(option.value),
577
+ className: segmentedItemVariants({ size, active: isActive, fullWidth }),
578
+ children: [
579
+ option.icon,
580
+ option.label
581
+ ]
582
+ },
583
+ option.value
584
+ );
585
+ })
586
+ }
587
+ );
588
+ }
589
+ var Segmented = React5__namespace.forwardRef(SegmentedInner);
590
+ Segmented.displayName = "Segmented";
591
+ function formatValue(value, precision, formatter) {
592
+ if (formatter) return formatter(value);
593
+ if (typeof value === "number" && precision !== void 0) {
594
+ return value.toFixed(precision);
595
+ }
596
+ return String(value);
597
+ }
598
+ var Statistic = React5__namespace.forwardRef(
599
+ ({
600
+ title,
601
+ value,
602
+ prefix,
603
+ suffix,
604
+ precision,
605
+ trend,
606
+ trendValue,
607
+ loading,
608
+ formatter,
609
+ className,
610
+ valueClassName
611
+ }, ref) => {
612
+ const formatted = formatValue(value, precision, formatter);
613
+ const trendColor = trend === "up" ? "text-success-600" : trend === "down" ? "text-danger-600" : "";
614
+ const TrendIcon = trend === "up" ? lucideReact.TrendingUp : trend === "down" ? lucideReact.TrendingDown : null;
615
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkA3A7PJWG_cjs.cn("flex flex-col gap-1", className), children: [
616
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-default-700", children: title }),
617
+ loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-24 rounded bg-default-100 animate-pulse" }) : /* @__PURE__ */ jsxRuntime.jsxs(
618
+ "div",
619
+ {
620
+ className: chunkA3A7PJWG_cjs.cn(
621
+ "text-3xl font-bold text-default-900 flex items-baseline gap-1",
622
+ valueClassName
623
+ ),
624
+ children: [
625
+ prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl text-default-700", children: prefix }),
626
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: formatted }),
627
+ suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base text-default-700 font-normal", children: suffix })
628
+ ]
629
+ }
630
+ ),
631
+ trend && trendValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkA3A7PJWG_cjs.cn("flex items-center gap-1 text-xs font-medium", trendColor), children: [
632
+ TrendIcon && /* @__PURE__ */ jsxRuntime.jsx(TrendIcon, { className: "h-3 w-3" }),
633
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: trendValue })
634
+ ] })
635
+ ] });
636
+ }
637
+ );
638
+ Statistic.displayName = "Statistic";
639
+ var snumVariants = classVarianceAuthority.cva(
640
+ "inline-flex items-center justify-center rounded-full border-2 font-semibold shrink-0 transition-colors",
641
+ {
642
+ variants: {
643
+ size: {
644
+ sm: "w-6 h-6 text-[11px]",
645
+ md: "w-7 h-7 text-[13px]",
646
+ lg: "w-9 h-9 text-[14px]"
647
+ },
648
+ status: {
649
+ wait: "border-default-300 bg-white text-default-500",
650
+ process: "border-primary-500 bg-white text-primary-500",
651
+ finish: "border-primary-500 bg-primary-500 text-white",
652
+ error: "border-destructive bg-white text-destructive"
653
+ }
654
+ },
655
+ defaultVariants: { size: "md", status: "wait" }
656
+ }
657
+ );
658
+ var sttlVariants = classVarianceAuthority.cva("text-sm font-medium leading-tight", {
659
+ variants: {
660
+ status: {
661
+ wait: "text-default-500",
662
+ process: "text-foreground font-semibold",
663
+ finish: "text-foreground",
664
+ error: "text-destructive"
665
+ }
666
+ },
667
+ defaultVariants: { status: "wait" }
668
+ });
669
+ var connectorVariants = classVarianceAuthority.cva("shrink-0 transition-colors", {
670
+ variants: {
671
+ direction: {
672
+ horizontal: "flex-1 h-px mx-3",
673
+ vertical: "w-px self-stretch mx-auto my-1"
674
+ },
675
+ /** El connector toma color del paso *anterior*: si está finish, va en primary. */
676
+ active: {
677
+ true: "bg-primary-500",
678
+ false: "bg-default-300"
679
+ }
680
+ },
681
+ defaultVariants: { direction: "horizontal", active: false }
682
+ });
683
+ var stepIconSize = {
684
+ sm: "w-3 h-3",
685
+ md: "w-3.5 h-3.5",
686
+ lg: "w-4 h-4"
687
+ };
688
+ var CheckIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
689
+ "svg",
690
+ {
691
+ className,
692
+ viewBox: "0 0 16 16",
693
+ fill: "none",
694
+ stroke: "currentColor",
695
+ strokeWidth: 2.5,
696
+ strokeLinecap: "round",
697
+ strokeLinejoin: "round",
698
+ "aria-hidden": "true",
699
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8.5l3 3 6-6" })
700
+ }
701
+ );
702
+ var ErrorIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsxs(
703
+ "svg",
704
+ {
705
+ className,
706
+ viewBox: "0 0 16 16",
707
+ fill: "none",
708
+ stroke: "currentColor",
709
+ strokeWidth: 2.5,
710
+ strokeLinecap: "round",
711
+ "aria-hidden": "true",
712
+ children: [
713
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 4v5" }),
714
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "12", r: "0.6", fill: "currentColor", stroke: "none" })
715
+ ]
716
+ }
717
+ );
718
+ var Step = ({ item, index, status, size, clickable, onSelect }) => {
719
+ const disabled = item.disabled === true;
720
+ const interactive = clickable && !disabled;
721
+ const renderSnumContent = () => {
722
+ if (item.icon) return item.icon;
723
+ if (status === "finish") return /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: stepIconSize[size] });
724
+ if (status === "error") return /* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, { className: stepIconSize[size] });
725
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { children: index + 1 });
726
+ };
727
+ const handleClick = () => {
728
+ if (interactive) onSelect?.(index);
729
+ };
730
+ return /* @__PURE__ */ jsxRuntime.jsxs(
731
+ "div",
732
+ {
733
+ role: interactive ? "button" : void 0,
734
+ tabIndex: interactive ? 0 : void 0,
735
+ onClick: interactive ? handleClick : void 0,
736
+ onKeyDown: interactive ? (e) => {
737
+ if (e.key === "Enter" || e.key === " ") {
738
+ e.preventDefault();
739
+ handleClick();
740
+ }
741
+ } : void 0,
742
+ "aria-current": status === "process" ? "step" : void 0,
743
+ "aria-disabled": disabled || void 0,
744
+ className: chunkA3A7PJWG_cjs.cn(
745
+ "flex items-center gap-2.5 min-w-0",
746
+ interactive && "cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded-md",
747
+ disabled && "opacity-50 pointer-events-none"
748
+ ),
749
+ children: [
750
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: snumVariants({ size, status }), children: renderSnumContent() }),
751
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex flex-col", children: [
752
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: sttlVariants({ status }), children: item.title }),
753
+ item.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-default-500 mt-0.5 leading-tight", children: item.description })
754
+ ] })
755
+ ]
756
+ }
757
+ );
758
+ };
759
+ function resolveStatus(item, index, current) {
760
+ if (item.status) return item.status;
761
+ if (index < current) return "finish";
762
+ if (index === current) return "process";
763
+ return "wait";
764
+ }
765
+ var Steps = React5__namespace.forwardRef(
766
+ ({ items, current = 0, onChange, direction = "horizontal", size = "md", className }, ref) => {
767
+ const isHorizontal = direction === "horizontal";
768
+ const clickable = typeof onChange === "function";
769
+ return /* @__PURE__ */ jsxRuntime.jsx(
770
+ "div",
771
+ {
772
+ ref,
773
+ role: "list",
774
+ "aria-label": "Progress steps",
775
+ className: chunkA3A7PJWG_cjs.cn(
776
+ "flex w-full",
777
+ isHorizontal ? "items-center" : "flex-col items-stretch",
778
+ className
779
+ ),
780
+ children: items.map((item, idx) => {
781
+ const status = resolveStatus(item, idx, current);
782
+ const isLast = idx === items.length - 1;
783
+ const connectorActive = status === "finish";
784
+ return /* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.Fragment, { children: [
785
+ /* @__PURE__ */ jsxRuntime.jsx(
786
+ "div",
787
+ {
788
+ role: "listitem",
789
+ className: chunkA3A7PJWG_cjs.cn(
790
+ "min-w-0",
791
+ isHorizontal ? "flex items-center shrink-0" : "flex flex-row items-start"
792
+ ),
793
+ children: /* @__PURE__ */ jsxRuntime.jsx(
794
+ Step,
795
+ {
796
+ item,
797
+ index: idx,
798
+ status,
799
+ size,
800
+ clickable,
801
+ onSelect: onChange
802
+ }
803
+ )
804
+ }
805
+ ),
806
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx(
807
+ "span",
808
+ {
809
+ "aria-hidden": "true",
810
+ className: connectorVariants({
811
+ direction,
812
+ active: connectorActive
813
+ })
814
+ }
815
+ )
816
+ ] }, item.key);
817
+ })
818
+ }
819
+ );
820
+ }
821
+ );
822
+ Steps.displayName = "Steps";
823
+
824
+ // src/molecules/Table/Column.tsx
825
+ var Column = () => null;
826
+ var Column_default = Column;
827
+ var TablePagination = (props) => {
828
+ const {
829
+ totalItems = 0,
830
+ currentPage = 1,
831
+ onPageChange,
832
+ onPageSizeChange,
833
+ pageSize = 10,
834
+ pageSizeOptions = [10, 15, 20]
835
+ } = props;
836
+ const hasSizeOptions = pageSizeOptions && pageSizeOptions.length > 1;
837
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-content1 flex justify-between items-center min-h-[48px] rounded-lg py-3 px-4", children: /* @__PURE__ */ jsxRuntime.jsx(
838
+ chunkFOA46NSG_cjs.Pagination,
839
+ {
840
+ total: totalItems,
841
+ current: currentPage,
842
+ defaultCurrent: 1,
843
+ pageSize,
844
+ defaultPageSize: pageSize,
845
+ pageSizeOptions: pageSizeOptions ?? [10, 15, 20],
846
+ showSizeChanger: Boolean(hasSizeOptions && onPageSizeChange),
847
+ showTotal: (total, [from, to]) => `Mostrando ${from}-${to} de ${total}`,
848
+ onChange: (page, size) => {
849
+ onPageChange?.(page);
850
+ if (size !== pageSize) onPageSizeChange?.(page, size);
851
+ },
852
+ onShowSizeChange: onPageSizeChange,
853
+ responsive: true,
854
+ size: "small"
855
+ }
856
+ ) });
857
+ };
858
+ function MobileCards({
859
+ data,
860
+ columns,
861
+ rowKey,
862
+ onRow,
863
+ selectedRowKeys = []
864
+ }) {
865
+ const visibleColumns = columns.filter((col) => col.dataIndex !== "expanden");
866
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: data.map((record, rowIndex) => {
867
+ const rawKey = rowKey(record);
868
+ const key = rawKey === void 0 || rawKey === null || rawKey === "" ? rowIndex : rawKey;
869
+ const rowProps = onRow?.(record, rowIndex) || {};
870
+ const isSelected = selectedRowKeys.includes(rawKey);
871
+ return /* @__PURE__ */ jsxRuntime.jsx(
872
+ "div",
873
+ {
874
+ role: rowProps.onClick ? "button" : void 0,
875
+ tabIndex: rowProps.onClick ? 0 : void 0,
876
+ onClick: () => rowProps.onClick?.(),
877
+ onKeyDown: (e) => {
878
+ if (!rowProps.onClick) return;
879
+ if (e.key === "Enter" || e.key === " ") rowProps.onClick();
880
+ },
881
+ className: clsx2__default.default(
882
+ "w-full border border-border bg-background p-4 transition-colors",
883
+ isSelected && "bg-primary-50",
884
+ rowProps.onClick && "hover:bg-default-100/60 cursor-pointer"
885
+ ),
886
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: visibleColumns.map((col, colIndex) => {
887
+ const value = col.dataIndex ? record[col.dataIndex] : void 0;
888
+ const content = col.render?.(value, record, rowIndex) ?? value;
889
+ return /* @__PURE__ */ jsxRuntime.jsxs(
890
+ "div",
891
+ {
892
+ className: clsx2__default.default(
893
+ "flex gap-4",
894
+ !col.title && (col.align === "center" ? "justify-center" : "justify-end")
895
+ ),
896
+ children: [
897
+ col.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[110px] text-xs font-semibold text-muted-foreground", children: col.title }),
898
+ /* @__PURE__ */ jsxRuntime.jsx(
899
+ "div",
900
+ {
901
+ className: clsx2__default.default(
902
+ "text-xs text-foreground break-words",
903
+ col.align === "center" && "text-center",
904
+ col.align === "right" && "text-right"
905
+ ),
906
+ children: content
907
+ }
908
+ )
909
+ ]
910
+ },
911
+ `${key}-${col.key}-${colIndex}`
912
+ );
913
+ }) })
914
+ },
915
+ key
916
+ );
917
+ }) });
918
+ }
919
+ var MobileCards_default = MobileCards;
920
+
921
+ // src/molecules/Table/utils.ts
922
+ function cycleSort(current) {
923
+ if (current === null) return "asc";
924
+ if (current === "asc") return "desc";
925
+ return null;
926
+ }
927
+ function compareValues(a, b) {
928
+ if (a === b) return 0;
929
+ if (a === null || a === void 0) return -1;
930
+ if (b === null || b === void 0) return 1;
931
+ if (typeof a === "number" && typeof b === "number") return a - b;
932
+ if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime();
933
+ return String(a).localeCompare(String(b));
934
+ }
935
+ function sortData(data, sortState, columns) {
936
+ if (!sortState.key || !sortState.direction) return data;
937
+ const column = columns.find((c) => c.key === sortState.key);
938
+ if (!column?.dataIndex) return data;
939
+ const dataIndex = column.dataIndex;
940
+ const factor = sortState.direction === "asc" ? 1 : -1;
941
+ return [...data].sort((a, b) => {
942
+ const va = a[dataIndex];
943
+ const vb = b[dataIndex];
944
+ return compareValues(va, vb) * factor;
945
+ });
946
+ }
947
+ var DENSITY_TH = {
948
+ compact: "px-3 py-1.5",
949
+ default: "px-4 py-3",
950
+ comfortable: "px-4 py-4"
951
+ };
952
+ var DENSITY_TD = {
953
+ compact: "px-3 py-1.5",
954
+ default: "px-4 py-3",
955
+ comfortable: "px-4 py-4"
956
+ };
957
+ function alignClass(align) {
958
+ return align === "center" ? "text-center" : align === "right" ? "text-right" : "text-left";
959
+ }
960
+ var TableHead = ({ columns, density, sortState, onSort }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((col) => {
961
+ const isSorted = sortState.key === col.key;
962
+ const dir = isSorted ? sortState.direction : null;
963
+ const SortIcon = dir === "asc" ? lucideReact.ArrowUp : dir === "desc" ? lucideReact.ArrowDown : lucideReact.ArrowUpDown;
964
+ return /* @__PURE__ */ jsxRuntime.jsx(
965
+ "th",
966
+ {
967
+ scope: "col",
968
+ style: { width: col.width },
969
+ className: clsx2__default.default(
970
+ DENSITY_TH[density],
971
+ "bg-muted text-foreground border-b border-border whitespace-nowrap",
972
+ "text-[12.5px] font-semibold tracking-wide",
973
+ alignClass(col.align),
974
+ col.sortable && "cursor-pointer select-none group"
975
+ ),
976
+ onClick: col.sortable ? () => onSort(col.key) : void 0,
977
+ "aria-sort": isSorted && dir ? dir === "asc" ? "ascending" : "descending" : void 0,
978
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 align-middle", children: [
979
+ col.title,
980
+ col.sortable && /* @__PURE__ */ jsxRuntime.jsx(
981
+ SortIcon,
982
+ {
983
+ className: clsx2__default.default(
984
+ "h-3.5 w-3.5",
985
+ isSorted ? "text-foreground opacity-100" : "text-muted-foreground opacity-0 group-hover:opacity-100"
986
+ ),
987
+ "aria-hidden": true
988
+ }
989
+ )
990
+ ] })
991
+ },
992
+ col.key
993
+ );
994
+ }) }) });
995
+ function TableBody({
996
+ data,
997
+ columns,
998
+ density,
999
+ variant,
1000
+ rowKey,
1001
+ selectedRowKeys,
1002
+ onRow
1003
+ }) {
1004
+ return /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.map((record, rowIndex) => {
1005
+ const k = rowKey(record);
1006
+ const rowProps = onRow?.(record, rowIndex) ?? {};
1007
+ const isSelected = selectedRowKeys.includes(k);
1008
+ const striped = variant === "striped" && rowIndex % 2 === 0 ? "bg-default-50" : "bg-background";
1009
+ return /* @__PURE__ */ jsxRuntime.jsx(
1010
+ "tr",
1011
+ {
1012
+ onClick: () => rowProps.onClick?.(),
1013
+ className: clsx2__default.default(
1014
+ "transition-colors border-b border-border last:border-b-0",
1015
+ isSelected ? "bg-primary-50" : striped,
1016
+ "hover:bg-default-100/60",
1017
+ rowProps.onClick && "cursor-pointer"
1018
+ ),
1019
+ children: columns.map((col) => {
1020
+ const value = col.dataIndex ? record[col.dataIndex] : void 0;
1021
+ const content = col.render?.(value, record, rowIndex) ?? value;
1022
+ return /* @__PURE__ */ jsxRuntime.jsx(
1023
+ "td",
1024
+ {
1025
+ style: { width: col.width },
1026
+ className: clsx2__default.default(
1027
+ DENSITY_TD[density],
1028
+ "text-foreground align-middle",
1029
+ alignClass(col.align),
1030
+ col.ellipsis && "truncate max-w-0"
1031
+ ),
1032
+ children: content
1033
+ },
1034
+ `${k}-${col.key}`
1035
+ );
1036
+ })
1037
+ },
1038
+ k
1039
+ );
1040
+ }) });
1041
+ }
1042
+ function TableUI({
1043
+ dataSource,
1044
+ children,
1045
+ pagination,
1046
+ loading,
1047
+ variant,
1048
+ density = "default",
1049
+ emptyText = "No hay registros",
1050
+ rowKey = (record) => record.key,
1051
+ ariaLabel = "Table",
1052
+ selectedRowKeys = [],
1053
+ onRow,
1054
+ bordered = false
1055
+ }) {
1056
+ const { isMobile, isTablet } = chunkXX4CBCEB_cjs.useResponsive();
1057
+ const [sortState, setSortState] = React5.useState({ key: null, direction: null });
1058
+ const columns = React5__namespace.default.Children.toArray(children).filter((child) => {
1059
+ return React5__namespace.default.isValidElement(child) && child.type === Column_default;
1060
+ }).map((child) => child.props).filter((c) => c.dataIndex !== "expanden");
1061
+ const sortedData = React5.useMemo(
1062
+ () => sortData(dataSource, sortState, columns),
1063
+ [dataSource, sortState, columns]
1064
+ );
1065
+ const pageSizeProp = pagination?.pageSize || sortedData.length || 1;
1066
+ const { currentPage, paginatedData, total, totalPages, pageSize, onPageChange } = chunkXX4CBCEB_cjs.usePagination({
1067
+ data: sortedData,
1068
+ pageSize: pageSizeProp,
1069
+ initialPage: 1
1070
+ });
1071
+ const handleSort = (key) => {
1072
+ setSortState((prev) => ({
1073
+ key,
1074
+ direction: prev.key === key ? cycleSort(prev.direction) : "asc"
1075
+ }));
1076
+ };
1077
+ const emptyNode = /* @__PURE__ */ jsxRuntime.jsx(Empty, { title: typeof emptyText === "string" ? emptyText : "Sin datos" });
1078
+ const isEmpty = sortedData.length === 0 && !loading;
1079
+ if (isMobile || isTablet) {
1080
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1081
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkE3BTK736_cjs.Spinner, { label: "Cargando..." }) : isEmpty ? emptyNode : /* @__PURE__ */ jsxRuntime.jsx(
1082
+ MobileCards_default,
1083
+ {
1084
+ data: paginatedData,
1085
+ columns,
1086
+ rowKey,
1087
+ onRow,
1088
+ selectedRowKeys
1089
+ }
1090
+ ),
1091
+ pagination && /* @__PURE__ */ jsxRuntime.jsx(
1092
+ TablePagination,
1093
+ {
1094
+ totalItems: total,
1095
+ totalPages,
1096
+ paginatedData,
1097
+ currentPage,
1098
+ pageSize,
1099
+ pageSizeOptions: pagination.pageSizeOptions,
1100
+ onPageChange
1101
+ }
1102
+ )
1103
+ ] });
1104
+ }
1105
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1106
+ /* @__PURE__ */ jsxRuntime.jsxs(
1107
+ "div",
1108
+ {
1109
+ className: chunkA3A7PJWG_cjs.cn(
1110
+ "w-full overflow-x-auto relative",
1111
+ bordered && "border border-border rounded-lg overflow-hidden"
1112
+ ),
1113
+ "aria-label": ariaLabel,
1114
+ children: [
1115
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full border-collapse text-sm", children: [
1116
+ /* @__PURE__ */ jsxRuntime.jsx(
1117
+ TableHead,
1118
+ {
1119
+ columns,
1120
+ density,
1121
+ sortState,
1122
+ onSort: handleSort
1123
+ }
1124
+ ),
1125
+ isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns.length, className: "p-0", children: emptyNode }) }) }) : /* @__PURE__ */ jsxRuntime.jsx(
1126
+ TableBody,
1127
+ {
1128
+ data: paginatedData,
1129
+ columns,
1130
+ density,
1131
+ variant,
1132
+ rowKey,
1133
+ selectedRowKeys,
1134
+ onRow
1135
+ }
1136
+ )
1137
+ ] }),
1138
+ loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-background/60 backdrop-blur-[1px]", children: /* @__PURE__ */ jsxRuntime.jsx(chunkE3BTK736_cjs.Spinner, { label: "Cargando..." }) })
1139
+ ]
1140
+ }
1141
+ ),
1142
+ pagination && /* @__PURE__ */ jsxRuntime.jsx(
1143
+ TablePagination,
1144
+ {
1145
+ totalItems: total,
1146
+ totalPages,
1147
+ paginatedData,
1148
+ currentPage,
1149
+ pageSize,
1150
+ pageSizeOptions: pagination.pageSizeOptions,
1151
+ onPageChange
1152
+ }
1153
+ )
1154
+ ] });
1155
+ }
1156
+ var Table_default = TableUI;
1157
+ var tabsListVariants = classVarianceAuthority.cva("inline-flex items-center", {
1158
+ variants: {
1159
+ variant: {
1160
+ line: "border-b border-default-200 bg-transparent rounded-none p-0 gap-1",
1161
+ card: "bg-muted rounded-md p-[3px] gap-[2px]",
1162
+ pill: "bg-muted rounded-full p-[3px] gap-[2px]"
1163
+ },
1164
+ size: {
1165
+ sm: "text-xs",
1166
+ md: "text-sm",
1167
+ lg: "text-base"
1168
+ }
1169
+ },
1170
+ defaultVariants: { variant: "card", size: "md" }
1171
+ });
1172
+ var tabsTriggerVariants = classVarianceAuthority.cva(
1173
+ "inline-flex items-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
1174
+ {
1175
+ variants: {
1176
+ variant: {
1177
+ line: "rounded-none border-b-2 border-transparent px-3 py-2 text-muted-foreground hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-primary data-[state=active]:font-semibold",
1178
+ card: "rounded-sm px-3.5 py-1.5 text-muted-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:font-semibold data-[state=active]:shadow-sm",
1179
+ pill: "rounded-full px-4 py-1.5 text-muted-foreground data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:font-semibold"
1180
+ },
1181
+ size: {
1182
+ sm: "text-xs px-2.5 py-1",
1183
+ md: "text-sm",
1184
+ lg: "text-base px-4 py-2"
1185
+ }
1186
+ },
1187
+ defaultVariants: { variant: "card", size: "md" }
1188
+ }
1189
+ );
1190
+ var Tabs2 = React5__namespace.forwardRef(
1191
+ ({
1192
+ items,
1193
+ defaultValue,
1194
+ value,
1195
+ onChange,
1196
+ variant = "card",
1197
+ size = "md",
1198
+ className,
1199
+ listClassName,
1200
+ contentClassName
1201
+ }, ref) => {
1202
+ const initialValue = defaultValue ?? items[0]?.key;
1203
+ const rootProps = value !== void 0 ? { value, onValueChange: onChange } : { defaultValue: initialValue, onValueChange: onChange };
1204
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk7R6OXNES_cjs.Tabs, { ref, className: chunkA3A7PJWG_cjs.cn("w-full", className), ...rootProps, children: [
1205
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.TabsList, { className: chunkA3A7PJWG_cjs.cn(tabsListVariants({ variant, size }), listClassName), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
1206
+ chunk7R6OXNES_cjs.TabsTrigger,
1207
+ {
1208
+ value: item.key,
1209
+ disabled: item.disabled,
1210
+ className: tabsTriggerVariants({ variant, size }),
1211
+ children: [
1212
+ item.icon,
1213
+ item.label
1214
+ ]
1215
+ },
1216
+ item.key
1217
+ )) }),
1218
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
1219
+ chunk7R6OXNES_cjs.TabsContent,
1220
+ {
1221
+ value: item.key,
1222
+ className: chunkA3A7PJWG_cjs.cn("text-default-700", contentClassName),
1223
+ children: item.content
1224
+ },
1225
+ item.key
1226
+ ))
1227
+ ] });
1228
+ }
1229
+ );
1230
+ Tabs2.displayName = "Tabs";
1231
+ var timelineDotVariants = classVarianceAuthority.cva(
1232
+ "relative z-10 h-3 w-3 rounded-full border-2 bg-white shrink-0",
1233
+ {
1234
+ variants: {
1235
+ status: {
1236
+ pending: "border-primary-500",
1237
+ "in-progress": "border-primary",
1238
+ done: "border-primary-500 bg-primary-500",
1239
+ error: "border-danger-600 bg-danger-600"
1240
+ }
1241
+ },
1242
+ defaultVariants: { status: "pending" }
1243
+ }
1244
+ );
1245
+ function getAlignment(mode, index) {
1246
+ if (mode === "left") return "left";
1247
+ if (mode === "right") return "right";
1248
+ return index % 2 === 0 ? "left" : "right";
1249
+ }
1250
+ var TimelineItemRow = ({ item, isLast, mode, index }) => {
1251
+ const align = getAlignment(mode, index);
1252
+ const isAlternate = mode === "alternate";
1253
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "relative flex gap-3 pb-5 last:pb-0", children: [
1254
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col items-center", children: [
1255
+ item.icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10 shrink-0", children: item.icon }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: timelineDotVariants({ status: item.status ?? "pending" }) }),
1256
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-3 left-1/2 -translate-x-1/2 h-full w-0.5 bg-default-200" })
1257
+ ] }),
1258
+ /* @__PURE__ */ jsxRuntime.jsxs(
1259
+ "div",
1260
+ {
1261
+ className: chunkA3A7PJWG_cjs.cn("flex-1 min-w-0 -mt-0.5", isAlternate && align === "right" && "text-right"),
1262
+ children: [
1263
+ item.time && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-default-700 mb-0.5", children: item.time }),
1264
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-default-900", children: item.content })
1265
+ ]
1266
+ }
1267
+ )
1268
+ ] });
1269
+ };
1270
+ var Timeline = React5__namespace.forwardRef(
1271
+ ({ items, mode = "left", className }, ref) => {
1272
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { ref, className: chunkA3A7PJWG_cjs.cn("flex flex-col w-full", className), children: items.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsx(
1273
+ TimelineItemRow,
1274
+ {
1275
+ item,
1276
+ isLast: idx === items.length - 1,
1277
+ mode,
1278
+ index: idx
1279
+ },
1280
+ item.key
1281
+ )) });
1282
+ }
1283
+ );
1284
+ Timeline.displayName = "Timeline";
1285
+ var Tooltip2 = React5__namespace.forwardRef(
1286
+ ({
1287
+ content,
1288
+ children,
1289
+ side = "top",
1290
+ align = "center",
1291
+ delayDuration = 200,
1292
+ open,
1293
+ defaultOpen,
1294
+ onOpenChange,
1295
+ className,
1296
+ asChild = true,
1297
+ withProvider = true
1298
+ }, ref) => {
1299
+ const tooltip = /* @__PURE__ */ jsxRuntime.jsxs(
1300
+ chunk7R6OXNES_cjs.Tooltip,
1301
+ {
1302
+ open,
1303
+ defaultOpen,
1304
+ onOpenChange,
1305
+ delayDuration,
1306
+ children: [
1307
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.TooltipTrigger, { asChild, children }),
1308
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.TooltipContent, { ref, side, align, className: chunkA3A7PJWG_cjs.cn(className), children: content })
1309
+ ]
1310
+ }
1311
+ );
1312
+ if (!withProvider) return tooltip;
1313
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk7R6OXNES_cjs.TooltipProvider, { delayDuration, children: tooltip });
1314
+ }
1315
+ );
1316
+ Tooltip2.displayName = "Tooltip";
1317
+
1318
+ exports.Alert = Alert;
1319
+ exports.Breadcrumb = Breadcrumb;
1320
+ exports.Card = Card2;
1321
+ exports.Column_default = Column_default;
1322
+ exports.DeleteModal_default = DeleteModal_default;
1323
+ exports.Drawer_default = Drawer_default;
1324
+ exports.Empty = Empty;
1325
+ exports.HoverCard = HoverCard2;
1326
+ exports.List = List2;
1327
+ exports.Modal_default = Modal_default;
1328
+ exports.Popconfirm = Popconfirm;
1329
+ exports.Popover = Popover2;
1330
+ exports.Segmented = Segmented;
1331
+ exports.Statistic = Statistic;
1332
+ exports.Step = Step;
1333
+ exports.Steps = Steps;
1334
+ exports.TablePagination = TablePagination;
1335
+ exports.Table_default = Table_default;
1336
+ exports.Tabs = Tabs2;
1337
+ exports.Timeline = Timeline;
1338
+ exports.Tooltip = Tooltip2;
1339
+ //# sourceMappingURL=chunk-DZW4GS2T.cjs.map
1340
+ //# sourceMappingURL=chunk-DZW4GS2T.cjs.map