@bleakedev/bleake-components 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,36 @@
1
- import { EllipsisVertical, Loader2Icon, Ban, Trash2, CameraOff, XIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CheckIcon, ChevronUpIcon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, ChevronDown } from 'lucide-react';
1
+ import { motion, AnimatePresence } from 'framer-motion';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { merge, useTheme } from '@bleakedev/bleake-core';
3
- import { Slot, DropdownMenu as DropdownMenu$1, AlertDialog as AlertDialog$1, Separator as Separator$1, Dialog as Dialog$1, Tooltip as Tooltip$1, Accordion as Accordion$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Collapsible as Collapsible$1, ContextMenu as ContextMenu$1, HoverCard as HoverCard$1, Label as Label$1, Menubar as Menubar$1, Popover as Popover$1, RadioGroup as RadioGroup$1, Select as Select$1, Switch as Switch$1, Tabs as Tabs$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1 } from 'radix-ui';
4
+ import { Slot, Label as Label$1, Select as Select$1, Tabs as Tabs$1, DropdownMenu as DropdownMenu$1, AlertDialog as AlertDialog$1, Separator as Separator$1, Dialog as Dialog$1, Tooltip as Tooltip$1, Accordion as Accordion$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Collapsible as Collapsible$1, ContextMenu as ContextMenu$1, HoverCard as HoverCard$1, Menubar as Menubar$1, Popover as Popover$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1 } from 'radix-ui';
4
5
  import { cva } from 'class-variance-authority';
5
- import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import { AlertTriangle, ChevronDownIcon, ChevronUpIcon, CheckIcon, PenLine, ArrowLeftCircle, ChevronLeft, ChevronRight, EllipsisVertical, Loader2Icon, Ban, Trash2, CameraOff, XIcon, ChevronLeftIcon, ChevronRightIcon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, ChevronDown } from 'lucide-react';
7
+ import { useNavigate, Link } from 'react-router';
6
8
  import { createContext, useState, Fragment, useRef, useEffect, useContext } from 'react';
7
9
  import { getDefaultClassNames, DayPicker } from 'react-day-picker';
8
10
  import { Combobox as Combobox$1 } from '@base-ui/react';
9
11
  import { Command as Command$1 } from 'cmdk';
10
12
  import { OTPInput } from 'input-otp';
11
- import { AnimatePresence, motion } from 'framer-motion';
12
13
  import { Toaster as Toaster$1 } from 'sonner';
13
14
 
14
- // src/primitives/actions-menu/index.tsx
15
+ // src/patterns/animations/slide-up/index.tsx
16
+ var variants = {
17
+ hidden: { opacity: 0, y: 24 },
18
+ visible: { opacity: 1, y: 0 }
19
+ };
20
+ var transition = { duration: 0.35, ease: "easeOut" };
21
+ var SlideUp = ({ children, className }) => {
22
+ return /* @__PURE__ */ jsx(
23
+ motion.div,
24
+ {
25
+ variants,
26
+ initial: "hidden",
27
+ animate: "visible",
28
+ transition,
29
+ className,
30
+ children
31
+ }
32
+ );
33
+ };
15
34
  var buttonVariants = cva(
16
35
  "group/button inline-flex shrink-0 items-center justify-center rounded-xl border border-transparent bg-clip-padding text-sm/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer gap-2 transition-all duration-300 rounded-lg",
17
36
  {
@@ -57,6 +76,659 @@ var Button = ({
57
76
  }
58
77
  );
59
78
  };
79
+ var Empty = ({
80
+ title = "Sin resultados",
81
+ description = "No hay informaci\xF3n para mostrar.",
82
+ icon: Icon,
83
+ action,
84
+ className = ""
85
+ }) => {
86
+ return /* @__PURE__ */ jsxs(
87
+ "div",
88
+ {
89
+ className: merge(
90
+ "flex h-full w-full flex-col items-center justify-center gap-3 py-16 text-center",
91
+ className
92
+ ),
93
+ children: [
94
+ Icon && /* @__PURE__ */ jsx("div", { className: "flex h-14 w-14 items-center justify-center rounded-full border border-gray-500/15 bg-gray-100", children: /* @__PURE__ */ jsx(Icon, { className: "h-8 w-8 text-gray-500" }) }),
95
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
96
+ title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900", children: title }),
97
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: description })
98
+ ] }),
99
+ action && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxs(
100
+ Button,
101
+ {
102
+ size: "sm",
103
+ onClick: action.onClick,
104
+ children: [
105
+ action.icon && /* @__PURE__ */ jsx(action.icon, { className: "mr-1 h-4 w-4" }),
106
+ action.label
107
+ ]
108
+ }
109
+ ) })
110
+ ]
111
+ }
112
+ );
113
+ };
114
+ function ErrorFallback({ error, resetError }) {
115
+ const errorMessage = error instanceof Error ? error.message : String(error);
116
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-50 w-full flex-col items-center justify-center gap-4 text-center", children: [
117
+ /* @__PURE__ */ jsx("div", { className: "flex h-14 w-14 items-center justify-center rounded-full border border-red-500/15 bg-red-50", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-8 w-8 text-red-500" }) }),
118
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
119
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "Algo sali\xF3 mal" }),
120
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: "Ocurri\xF3 un error inesperado. Intent\xE1 de nuevo." }),
121
+ import.meta.env.DEV && errorMessage && /* @__PURE__ */ jsx("p", { className: "mt-1 max-w-md text-xs text-red-400", children: errorMessage })
122
+ ] }),
123
+ /* @__PURE__ */ jsx(
124
+ Button,
125
+ {
126
+ size: "sm",
127
+ variant: "outline",
128
+ onClick: resetError,
129
+ children: "Reintentar"
130
+ }
131
+ )
132
+ ] });
133
+ }
134
+ var Label = ({
135
+ className,
136
+ ...props
137
+ }) => {
138
+ return /* @__PURE__ */ jsx(
139
+ Label$1.Root,
140
+ {
141
+ "data-slot": "label",
142
+ className: merge(
143
+ "flex items-center gap-2 text-sm/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
144
+ className
145
+ ),
146
+ ...props
147
+ }
148
+ );
149
+ };
150
+ var SelectScrollDownButton = ({
151
+ className,
152
+ ...props
153
+ }) => {
154
+ return /* @__PURE__ */ jsx(
155
+ Select$1.ScrollDownButton,
156
+ {
157
+ "data-slot": "select-scroll-down-button",
158
+ className: merge(
159
+ "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
160
+ className
161
+ ),
162
+ ...props,
163
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
164
+ }
165
+ );
166
+ };
167
+ var SelectScrollUpButton = ({
168
+ className,
169
+ ...props
170
+ }) => {
171
+ return /* @__PURE__ */ jsx(
172
+ Select$1.ScrollUpButton,
173
+ {
174
+ "data-slot": "select-scroll-up-button",
175
+ className: merge(
176
+ "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
177
+ className
178
+ ),
179
+ ...props,
180
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
181
+ }
182
+ );
183
+ };
184
+ var SelectContent = ({
185
+ className,
186
+ children,
187
+ position = "item-aligned",
188
+ align = "center",
189
+ ...props
190
+ }) => {
191
+ return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsxs(
192
+ Select$1.Content,
193
+ {
194
+ "data-slot": "select-content",
195
+ "data-align-trigger": position === "item-aligned",
196
+ className: merge(
197
+ "relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
198
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
199
+ className
200
+ ),
201
+ position,
202
+ align,
203
+ ...props,
204
+ children: [
205
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
206
+ /* @__PURE__ */ jsx(
207
+ Select$1.Viewport,
208
+ {
209
+ "data-position": position,
210
+ className: merge(
211
+ "data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)"
212
+ ),
213
+ children
214
+ }
215
+ ),
216
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
217
+ ]
218
+ }
219
+ ) });
220
+ };
221
+ var SelectGroup = ({
222
+ className,
223
+ ...props
224
+ }) => {
225
+ return /* @__PURE__ */ jsx(
226
+ Select$1.Group,
227
+ {
228
+ "data-slot": "select-group",
229
+ className: merge("scroll-my-1 p-1", className),
230
+ ...props
231
+ }
232
+ );
233
+ };
234
+ var SelectItem = ({
235
+ className,
236
+ children,
237
+ ...props
238
+ }) => {
239
+ return /* @__PURE__ */ jsxs(
240
+ Select$1.Item,
241
+ {
242
+ "data-slot": "select-item",
243
+ className: merge(
244
+ "relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none border border-transparent focus:bg-orange-50 focus:border focus:border-orange-200/50 focus:text-orange-500! focus:cursor-pointer not-data-[variant=destructive]:focus:**:text-orange-500! data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
245
+ className
246
+ ),
247
+ ...props,
248
+ children: [
249
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", children: /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" }) }) }),
250
+ /* @__PURE__ */ jsx(Select$1.ItemText, { children })
251
+ ]
252
+ }
253
+ );
254
+ };
255
+ var SelectLabel = ({
256
+ className,
257
+ ...props
258
+ }) => {
259
+ return /* @__PURE__ */ jsx(
260
+ Select$1.Label,
261
+ {
262
+ "data-slot": "select-label",
263
+ className: merge("px-2 py-1.5 text-xs text-muted-foreground", className),
264
+ ...props
265
+ }
266
+ );
267
+ };
268
+ var SelectSeparator = ({
269
+ className,
270
+ ...props
271
+ }) => {
272
+ return /* @__PURE__ */ jsx(
273
+ Select$1.Separator,
274
+ {
275
+ "data-slot": "select-separator",
276
+ className: merge("pointer-events-none -mx-1 my-1 h-px bg-border/50", className),
277
+ ...props
278
+ }
279
+ );
280
+ };
281
+ var SelectTrigger = ({
282
+ className,
283
+ size = "default",
284
+ children,
285
+ ...props
286
+ }) => {
287
+ return /* @__PURE__ */ jsxs(
288
+ Select$1.Trigger,
289
+ {
290
+ "data-slot": "select-trigger",
291
+ "data-size": size,
292
+ className: merge(
293
+ "flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
294
+ className
295
+ ),
296
+ ...props,
297
+ children: [
298
+ children,
299
+ /* @__PURE__ */ jsx(Select$1.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" }) })
300
+ ]
301
+ }
302
+ );
303
+ };
304
+ var SelectValue = (props) => {
305
+ return /* @__PURE__ */ jsx(
306
+ Select$1.Value,
307
+ {
308
+ "data-slot": "select-value",
309
+ ...props
310
+ }
311
+ );
312
+ };
313
+ var Select = (props) => {
314
+ return /* @__PURE__ */ jsx(
315
+ Select$1.Root,
316
+ {
317
+ "data-slot": "select",
318
+ ...props
319
+ }
320
+ );
321
+ };
322
+ var FilterSelect = ({
323
+ label,
324
+ options,
325
+ value,
326
+ onChange,
327
+ placeholder = "Seleccionar...",
328
+ disabled = false,
329
+ className,
330
+ labelClassName,
331
+ inputClassName
332
+ }) => {
333
+ const isActive = value && value !== "all" && value !== "";
334
+ return /* @__PURE__ */ jsxs("div", { className: merge("flex flex-col gap-2", className), children: [
335
+ label && /* @__PURE__ */ jsx(
336
+ Label,
337
+ {
338
+ className: labelClassName,
339
+ htmlFor: label,
340
+ children: label
341
+ }
342
+ ),
343
+ /* @__PURE__ */ jsxs(
344
+ Select,
345
+ {
346
+ value: value ?? "",
347
+ onValueChange: onChange,
348
+ disabled,
349
+ children: [
350
+ /* @__PURE__ */ jsx(
351
+ SelectTrigger,
352
+ {
353
+ id: label,
354
+ className: merge(
355
+ "min-w-40 bg-white! text-gray-900! cursor-pointer hover:border-gray-500",
356
+ isActive && "bg-orange-50! border-orange-200/50 **:text-orange-500! hover:border-orange-500!",
357
+ disabled && "cursor-not-allowed opacity-50",
358
+ inputClassName
359
+ ),
360
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder })
361
+ }
362
+ ),
363
+ /* @__PURE__ */ jsx(SelectContent, { position: "popper", children: /* @__PURE__ */ jsx(SelectGroup, { children: options.map((option) => /* @__PURE__ */ jsx(
364
+ SelectItem,
365
+ {
366
+ value: option.value,
367
+ children: option.label
368
+ },
369
+ option.value
370
+ )) }) })
371
+ ]
372
+ }
373
+ )
374
+ ] });
375
+ };
376
+ var SectionTitle = ({
377
+ icon: Icon,
378
+ title,
379
+ description,
380
+ action,
381
+ onEdit,
382
+ editLabel = "Editar"
383
+ }) => {
384
+ if (description !== void 0) {
385
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between gap-2 px-4", children: [
386
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-4", children: [
387
+ /* @__PURE__ */ jsx(Icon, { className: "text-orange-500 shrink-0 h-8 w-8" }),
388
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
389
+ /* @__PURE__ */ jsx("h2", { className: "text-base text-gray-900 font-medium", children: title }),
390
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 font-medium", children: description })
391
+ ] })
392
+ ] }),
393
+ action
394
+ ] });
395
+ }
396
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between mb-3", children: [
397
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2", children: [
398
+ /* @__PURE__ */ jsx(Icon, { className: "size-4 text-orange-500" }),
399
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900", children: title })
400
+ ] }),
401
+ onEdit && /* @__PURE__ */ jsx(
402
+ Button,
403
+ {
404
+ type: "button",
405
+ variant: "ghost",
406
+ size: "sm",
407
+ className: "size-7 p-0 text-orange-500 hover:text-orange-600 hover:bg-orange-50",
408
+ onClick: onEdit,
409
+ title: editLabel,
410
+ children: /* @__PURE__ */ jsx(PenLine, { className: "size-3.5" })
411
+ }
412
+ ),
413
+ action
414
+ ] });
415
+ };
416
+ var Breadcrumb = ({
417
+ className,
418
+ ...props
419
+ }) => {
420
+ return /* @__PURE__ */ jsx(
421
+ "nav",
422
+ {
423
+ "aria-label": "breadcrumb",
424
+ "data-slot": "breadcrumb",
425
+ className: merge(className),
426
+ ...props
427
+ }
428
+ );
429
+ };
430
+ var BreadcrumbItem = ({
431
+ className,
432
+ ...props
433
+ }) => {
434
+ return /* @__PURE__ */ jsx(
435
+ "li",
436
+ {
437
+ "data-slot": "breadcrumb-item",
438
+ className: merge("inline-flex items-center gap-1", className),
439
+ ...props
440
+ }
441
+ );
442
+ };
443
+ var BreadcrumbList = ({
444
+ className,
445
+ ...props
446
+ }) => {
447
+ return /* @__PURE__ */ jsx(
448
+ "ol",
449
+ {
450
+ "data-slot": "breadcrumb-list",
451
+ className: merge(
452
+ "flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground",
453
+ className
454
+ ),
455
+ ...props
456
+ }
457
+ );
458
+ };
459
+ var BreadcrumbPage = ({
460
+ className,
461
+ ...props
462
+ }) => {
463
+ return /* @__PURE__ */ jsx(
464
+ "span",
465
+ {
466
+ "data-slot": "breadcrumb-page",
467
+ "aria-disabled": "true",
468
+ "aria-current": "page",
469
+ className: merge("font-normal text-foreground", className),
470
+ ...props
471
+ }
472
+ );
473
+ };
474
+ var BreadcrumbSeparator = ({
475
+ children,
476
+ className,
477
+ ...props
478
+ }) => {
479
+ return /* @__PURE__ */ jsx(
480
+ "li",
481
+ {
482
+ "data-slot": "breadcrumb-separator",
483
+ role: "presentation",
484
+ "aria-hidden": "true",
485
+ className: merge("[&>svg]:size-3.5", className),
486
+ ...props,
487
+ children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
488
+ }
489
+ );
490
+ };
491
+ var BreadcrumbList2 = ({ items }) => {
492
+ return /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, { children: items.map((item, index) => {
493
+ const isLast = index === items.length - 1;
494
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
495
+ /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(Link, { to: item.href, children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) }),
496
+ !isLast && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
497
+ ] }, `${item.label}-${index}`);
498
+ }) }) });
499
+ };
500
+ var AppBreadcrumbs = ({ backRoute, config }) => {
501
+ const navigate = useNavigate();
502
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-3", children: [
503
+ /* @__PURE__ */ jsx(
504
+ Button,
505
+ {
506
+ type: "button",
507
+ variant: "link",
508
+ className: "px-0 w-fit h-fit",
509
+ onClick: () => navigate(backRoute),
510
+ "aria-label": "Volver",
511
+ children: /* @__PURE__ */ jsx(ArrowLeftCircle, {})
512
+ }
513
+ ),
514
+ /* @__PURE__ */ jsx(BreadcrumbList2, { items: config })
515
+ ] });
516
+ };
517
+ var Tabs = ({
518
+ className,
519
+ orientation = "horizontal",
520
+ ...props
521
+ }) => {
522
+ return /* @__PURE__ */ jsx(
523
+ Tabs$1.Root,
524
+ {
525
+ "data-slot": "tabs",
526
+ "data-orientation": orientation,
527
+ className: merge("group/tabs flex gap-3 data-horizontal:flex-col", className),
528
+ ...props
529
+ }
530
+ );
531
+ };
532
+ var TabsContent = ({
533
+ className,
534
+ ...props
535
+ }) => {
536
+ return /* @__PURE__ */ jsx(
537
+ Tabs$1.Content,
538
+ {
539
+ "data-slot": "tabs-content",
540
+ className: merge("flex-1 text-xs/relaxed outline-none", className),
541
+ ...props
542
+ }
543
+ );
544
+ };
545
+ var VARIANT_CLASSES = {
546
+ default: "bg-white border border-gray-200 rounded-xl p-1 gap-0.5 w-fit",
547
+ line: "gap-1 bg-transparent border-b border-gray-200 w-full rounded-none"
548
+ };
549
+ var TabsList = ({
550
+ className,
551
+ variant = "default",
552
+ size = "default",
553
+ ...props
554
+ }) => {
555
+ const variantClass = VARIANT_CLASSES[variant ?? "default"] ?? VARIANT_CLASSES.default;
556
+ return /* @__PURE__ */ jsx(
557
+ Tabs$1.List,
558
+ {
559
+ "data-slot": "tabs-list",
560
+ "data-variant": variant,
561
+ "data-size": size,
562
+ className: merge(
563
+ "group/tabs-list flex items-center overflow-x-auto max-w-full",
564
+ variantClass,
565
+ className
566
+ ),
567
+ ...props
568
+ }
569
+ );
570
+ };
571
+ var TabsTrigger = ({
572
+ className,
573
+ ...props
574
+ }) => {
575
+ return /* @__PURE__ */ jsx(
576
+ Tabs$1.Trigger,
577
+ {
578
+ "data-slot": "tabs-trigger",
579
+ className: merge(
580
+ // Base
581
+ "relative inline-flex items-center justify-center gap-1.5 font-medium whitespace-nowrap transition-all cursor-pointer",
582
+ "disabled:pointer-events-none disabled:opacity-50",
583
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0",
584
+ // === SIZE — inherited from parent TabsList data-size ===
585
+ // default size
586
+ "group-data-[size=default]/tabs-list:px-4 group-data-[size=default]/tabs-list:py-2 group-data-[size=default]/tabs-list:text-sm",
587
+ "group-data-[size=default]/tabs-list:[&_svg:not([class*='size-'])]:size-4",
588
+ // sm size
589
+ "group-data-[size=sm]/tabs-list:px-3 group-data-[size=sm]/tabs-list:py-1.5 group-data-[size=sm]/tabs-list:text-xs",
590
+ "group-data-[size=sm]/tabs-list:[&_svg:not([class*='size-'])]:size-3.5",
591
+ // xs size
592
+ "group-data-[size=xs]/tabs-list:px-2 group-data-[size=xs]/tabs-list:py-1 group-data-[size=xs]/tabs-list:text-[0.65rem]",
593
+ "group-data-[size=xs]/tabs-list:[&_svg:not([class*='size-'])]:size-3",
594
+ // === VARIANT: default (pill) — inherited from parent ===
595
+ "group-data-[variant=default]/tabs-list:rounded-lg group-data-[variant=default]/tabs-list:text-gray-500",
596
+ "group-data-[variant=default]/tabs-list:hover:text-gray-700",
597
+ "group-data-[variant=default]/tabs-list:data-[state=active]:bg-orange-50",
598
+ "group-data-[variant=default]/tabs-list:data-[state=active]:text-orange-600",
599
+ "group-data-[variant=default]/tabs-list:data-[state=active]:ring-1",
600
+ "group-data-[variant=default]/tabs-list:data-[state=active]:ring-orange-200",
601
+ // === VARIANT: line (underline) — inherited from parent ===
602
+ "group-data-[variant=line]/tabs-list:rounded-none group-data-[variant=line]/tabs-list:text-gray-400",
603
+ "group-data-[variant=line]/tabs-list:border-b-2 group-data-[variant=line]/tabs-list:border-transparent",
604
+ "group-data-[variant=line]/tabs-list:hover:text-orange-500",
605
+ "group-data-[variant=line]/tabs-list:data-[state=active]:border-orange-500",
606
+ "group-data-[variant=line]/tabs-list:data-[state=active]:text-orange-600",
607
+ "group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
608
+ className
609
+ ),
610
+ ...props
611
+ }
612
+ );
613
+ };
614
+ var AppTabs = ({
615
+ config,
616
+ data,
617
+ defaultValue,
618
+ className,
619
+ tabListClassname,
620
+ variant = "default",
621
+ size = "default"
622
+ }) => {
623
+ return /* @__PURE__ */ jsxs(
624
+ Tabs,
625
+ {
626
+ defaultValue: defaultValue ?? config[0]?.value,
627
+ className,
628
+ children: [
629
+ /* @__PURE__ */ jsx(
630
+ TabsList,
631
+ {
632
+ className: merge("", tabListClassname),
633
+ variant,
634
+ size,
635
+ children: config.map((tab) => {
636
+ const Icon = tab.icon;
637
+ return /* @__PURE__ */ jsxs(
638
+ TabsTrigger,
639
+ {
640
+ value: tab.value,
641
+ className: merge(
642
+ "",
643
+ variant === "line" && "text-sm text-gray-400 data-[state=active]:text-orange-600 data-[state=active]:shadow-none pb-5 after:bg-orange-600!"
644
+ ),
645
+ children: [
646
+ Icon && /* @__PURE__ */ jsx(Icon, {}),
647
+ /* @__PURE__ */ jsx("span", { children: tab.label })
648
+ ]
649
+ },
650
+ tab.value
651
+ );
652
+ })
653
+ }
654
+ ),
655
+ config.map((tab) => /* @__PURE__ */ jsx(
656
+ TabsContent,
657
+ {
658
+ value: tab.value,
659
+ children: tab.content(data)
660
+ },
661
+ tab.value
662
+ ))
663
+ ]
664
+ }
665
+ );
666
+ };
667
+ var PAGE_SIZE_OPTIONS = [10, 20, 50];
668
+ var ARROW_CLASSES = "inline-flex items-center justify-center size-8 rounded-md border border-gray-200 bg-white shadow-xs cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed hover:bg-orange-50 hover:border-orange-400 hover:text-orange-600 active:bg-orange-100 transition-colors";
669
+ var TablePagination = ({
670
+ page,
671
+ totalPages,
672
+ onPageChange,
673
+ pageSize,
674
+ onPageSizeChange
675
+ }) => {
676
+ const showPageSizeSelector = pageSize !== void 0 && onPageSizeChange !== void 0;
677
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-2", children: [
678
+ showPageSizeSelector ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
679
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Mostrar" }),
680
+ /* @__PURE__ */ jsxs(
681
+ Select,
682
+ {
683
+ value: String(pageSize),
684
+ onValueChange: (value) => onPageSizeChange(Number(value)),
685
+ children: [
686
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 w-17.5 text-xs", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
687
+ /* @__PURE__ */ jsx(SelectContent, { children: PAGE_SIZE_OPTIONS.map((size) => /* @__PURE__ */ jsx(
688
+ SelectItem,
689
+ {
690
+ value: String(size),
691
+ children: size
692
+ },
693
+ size
694
+ )) })
695
+ ]
696
+ }
697
+ ),
698
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "por p\xE1gina" })
699
+ ] }) : /* @__PURE__ */ jsx("div", {}),
700
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
701
+ /* @__PURE__ */ jsx(
702
+ "button",
703
+ {
704
+ type: "button",
705
+ onClick: () => onPageChange(page - 1),
706
+ disabled: page <= 1,
707
+ className: ARROW_CLASSES,
708
+ "aria-label": "P\xE1gina anterior",
709
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
710
+ }
711
+ ),
712
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground px-1 select-none", children: [
713
+ "P\xE1gina ",
714
+ page,
715
+ " de ",
716
+ totalPages
717
+ ] }),
718
+ /* @__PURE__ */ jsx(
719
+ "button",
720
+ {
721
+ type: "button",
722
+ onClick: () => onPageChange(page + 1),
723
+ disabled: page >= totalPages,
724
+ className: ARROW_CLASSES,
725
+ "aria-label": "P\xE1gina siguiente",
726
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
727
+ }
728
+ )
729
+ ] })
730
+ ] });
731
+ };
60
732
  var DropdownMenu = ({
61
733
  ...props
62
734
  }) => {
@@ -989,20 +1661,6 @@ var Badge = ({
989
1661
  }
990
1662
  );
991
1663
  };
992
- var Breadcrumb = ({
993
- className,
994
- ...props
995
- }) => {
996
- return /* @__PURE__ */ jsx(
997
- "nav",
998
- {
999
- "aria-label": "breadcrumb",
1000
- "data-slot": "breadcrumb",
1001
- className: merge(className),
1002
- ...props
1003
- }
1004
- );
1005
- };
1006
1664
  var buttonGroupVariants = cva(
1007
1665
  "flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
1008
1666
  {
@@ -1534,22 +2192,6 @@ var Item = ({
1534
2192
  }
1535
2193
  );
1536
2194
  };
1537
- var Label = ({
1538
- className,
1539
- ...props
1540
- }) => {
1541
- return /* @__PURE__ */ jsx(
1542
- Label$1.Root,
1543
- {
1544
- "data-slot": "label",
1545
- className: merge(
1546
- "flex items-center gap-2 text-sm/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
1547
- className
1548
- ),
1549
- ...props
1550
- }
1551
- );
1552
- };
1553
2195
  var Menubar = ({
1554
2196
  className,
1555
2197
  ...props
@@ -1731,178 +2373,6 @@ var SectionCard = ({
1731
2373
  ) })
1732
2374
  ] });
1733
2375
  };
1734
- var SelectScrollDownButton = ({
1735
- className,
1736
- ...props
1737
- }) => {
1738
- return /* @__PURE__ */ jsx(
1739
- Select$1.ScrollDownButton,
1740
- {
1741
- "data-slot": "select-scroll-down-button",
1742
- className: merge(
1743
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
1744
- className
1745
- ),
1746
- ...props,
1747
- children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
1748
- }
1749
- );
1750
- };
1751
- var SelectScrollUpButton = ({
1752
- className,
1753
- ...props
1754
- }) => {
1755
- return /* @__PURE__ */ jsx(
1756
- Select$1.ScrollUpButton,
1757
- {
1758
- "data-slot": "select-scroll-up-button",
1759
- className: merge(
1760
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
1761
- className
1762
- ),
1763
- ...props,
1764
- children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
1765
- }
1766
- );
1767
- };
1768
- var SelectContent = ({
1769
- className,
1770
- children,
1771
- position = "item-aligned",
1772
- align = "center",
1773
- ...props
1774
- }) => {
1775
- return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsxs(
1776
- Select$1.Content,
1777
- {
1778
- "data-slot": "select-content",
1779
- "data-align-trigger": position === "item-aligned",
1780
- className: merge(
1781
- "relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
1782
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1783
- className
1784
- ),
1785
- position,
1786
- align,
1787
- ...props,
1788
- children: [
1789
- /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
1790
- /* @__PURE__ */ jsx(
1791
- Select$1.Viewport,
1792
- {
1793
- "data-position": position,
1794
- className: merge(
1795
- "data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)"
1796
- ),
1797
- children
1798
- }
1799
- ),
1800
- /* @__PURE__ */ jsx(SelectScrollDownButton, {})
1801
- ]
1802
- }
1803
- ) });
1804
- };
1805
- var SelectGroup = ({
1806
- className,
1807
- ...props
1808
- }) => {
1809
- return /* @__PURE__ */ jsx(
1810
- Select$1.Group,
1811
- {
1812
- "data-slot": "select-group",
1813
- className: merge("scroll-my-1 p-1", className),
1814
- ...props
1815
- }
1816
- );
1817
- };
1818
- var SelectItem = ({
1819
- className,
1820
- children,
1821
- ...props
1822
- }) => {
1823
- return /* @__PURE__ */ jsxs(
1824
- Select$1.Item,
1825
- {
1826
- "data-slot": "select-item",
1827
- className: merge(
1828
- "relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none border border-transparent focus:bg-orange-50 focus:border focus:border-orange-200/50 focus:text-orange-500! focus:cursor-pointer not-data-[variant=destructive]:focus:**:text-orange-500! data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
1829
- className
1830
- ),
1831
- ...props,
1832
- children: [
1833
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", children: /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" }) }) }),
1834
- /* @__PURE__ */ jsx(Select$1.ItemText, { children })
1835
- ]
1836
- }
1837
- );
1838
- };
1839
- var SelectLabel = ({
1840
- className,
1841
- ...props
1842
- }) => {
1843
- return /* @__PURE__ */ jsx(
1844
- Select$1.Label,
1845
- {
1846
- "data-slot": "select-label",
1847
- className: merge("px-2 py-1.5 text-xs text-muted-foreground", className),
1848
- ...props
1849
- }
1850
- );
1851
- };
1852
- var SelectSeparator = ({
1853
- className,
1854
- ...props
1855
- }) => {
1856
- return /* @__PURE__ */ jsx(
1857
- Select$1.Separator,
1858
- {
1859
- "data-slot": "select-separator",
1860
- className: merge("pointer-events-none -mx-1 my-1 h-px bg-border/50", className),
1861
- ...props
1862
- }
1863
- );
1864
- };
1865
- var SelectTrigger = ({
1866
- className,
1867
- size = "default",
1868
- children,
1869
- ...props
1870
- }) => {
1871
- return /* @__PURE__ */ jsxs(
1872
- Select$1.Trigger,
1873
- {
1874
- "data-slot": "select-trigger",
1875
- "data-size": size,
1876
- className: merge(
1877
- "flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
1878
- className
1879
- ),
1880
- ...props,
1881
- children: [
1882
- children,
1883
- /* @__PURE__ */ jsx(Select$1.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" }) })
1884
- ]
1885
- }
1886
- );
1887
- };
1888
- var SelectValue = (props) => {
1889
- return /* @__PURE__ */ jsx(
1890
- Select$1.Value,
1891
- {
1892
- "data-slot": "select-value",
1893
- ...props
1894
- }
1895
- );
1896
- };
1897
- var Select = (props) => {
1898
- return /* @__PURE__ */ jsx(
1899
- Select$1.Root,
1900
- {
1901
- "data-slot": "select",
1902
- ...props
1903
- }
1904
- );
1905
- };
1906
2376
  var Sheet = (props) => {
1907
2377
  return /* @__PURE__ */ jsx(
1908
2378
  Dialog$1.Root,
@@ -2223,21 +2693,6 @@ var Table = ({
2223
2693
  }
2224
2694
  );
2225
2695
  };
2226
- var Tabs = ({
2227
- className,
2228
- orientation = "horizontal",
2229
- ...props
2230
- }) => {
2231
- return /* @__PURE__ */ jsx(
2232
- Tabs$1.Root,
2233
- {
2234
- "data-slot": "tabs",
2235
- "data-orientation": orientation,
2236
- className: merge("group/tabs flex gap-3 data-horizontal:flex-col", className),
2237
- ...props
2238
- }
2239
- );
2240
- };
2241
2696
  var toggleVariants = cva(
2242
2697
  "group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
2243
2698
  {
@@ -2307,4 +2762,4 @@ var ToggleGroup = ({
2307
2762
  );
2308
2763
  };
2309
2764
 
2310
- export { Accordion, ActionsMenu, AlertDialog, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Checkbox, Collapsible, Combobox, Command, ConfirmDialog, ContextMenu, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, Glow, HoverCard, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, Item, Label, Menubar, Modal, Pagination, Popover, Progress, RadioGroup, SectionCard, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Sidebar, Skeleton, Spinner, Steps, Switch, Table, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, TruncatedText, WaveLayer };
2765
+ export { Accordion, ActionsMenu, AlertDialog, AppBreadcrumbs, AppTabs, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Checkbox, Collapsible, Combobox, Command, ConfirmDialog, ContextMenu, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, Empty, ErrorFallback, FilterSelect, Glow, HoverCard, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, Item, Label, Menubar, Modal, Pagination, Popover, Progress, RadioGroup, SectionCard, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Sidebar, Skeleton, SlideUp, Spinner, Steps, Switch, Table, TablePagination, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, TruncatedText, WaveLayer };