@mesob/ui 0.2.0 → 0.2.1

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 (74) hide show
  1. package/dist/components/alert-dialog.js +22 -22
  2. package/dist/components/alert-dialog.js.map +1 -1
  3. package/dist/components/alert.js +1 -1
  4. package/dist/components/alert.js.map +1 -1
  5. package/dist/components/animated-tabs.js +1 -1
  6. package/dist/components/animated-tabs.js.map +1 -1
  7. package/dist/components/app-header-actions.js +118 -103
  8. package/dist/components/app-header-actions.js.map +1 -1
  9. package/dist/components/app-sidebar.js +69 -69
  10. package/dist/components/app-sidebar.js.map +1 -1
  11. package/dist/components/button-group.js +1 -1
  12. package/dist/components/button-group.js.map +1 -1
  13. package/dist/components/button.d.ts +6 -3
  14. package/dist/components/button.js +16 -8
  15. package/dist/components/button.js.map +1 -1
  16. package/dist/components/calendar.js +24 -16
  17. package/dist/components/calendar.js.map +1 -1
  18. package/dist/components/card.js +1 -1
  19. package/dist/components/card.js.map +1 -1
  20. package/dist/components/carousel.js +28 -20
  21. package/dist/components/carousel.js.map +1 -1
  22. package/dist/components/command.js +5 -5
  23. package/dist/components/command.js.map +1 -1
  24. package/dist/components/context-menu.js +2 -2
  25. package/dist/components/context-menu.js.map +1 -1
  26. package/dist/components/data-table/index.js +162 -153
  27. package/dist/components/data-table/index.js.map +1 -1
  28. package/dist/components/dialog.js +2 -2
  29. package/dist/components/dialog.js.map +1 -1
  30. package/dist/components/drawer.js +2 -2
  31. package/dist/components/drawer.js.map +1 -1
  32. package/dist/components/dropdown-menu.js +2 -2
  33. package/dist/components/dropdown-menu.js.map +1 -1
  34. package/dist/components/entity/index.js +261 -256
  35. package/dist/components/entity/index.js.map +1 -1
  36. package/dist/components/hover-card.js +1 -1
  37. package/dist/components/hover-card.js.map +1 -1
  38. package/dist/components/input-group.js +27 -19
  39. package/dist/components/input-group.js.map +1 -1
  40. package/dist/components/item.d.ts +1 -1
  41. package/dist/components/menubar.js +3 -3
  42. package/dist/components/menubar.js.map +1 -1
  43. package/dist/components/navigation-menu.js +1 -1
  44. package/dist/components/navigation-menu.js.map +1 -1
  45. package/dist/components/page/index.js +36 -28
  46. package/dist/components/page/index.js.map +1 -1
  47. package/dist/components/pagination.js +20 -20
  48. package/dist/components/pagination.js.map +1 -1
  49. package/dist/components/popover.js +1 -1
  50. package/dist/components/popover.js.map +1 -1
  51. package/dist/components/section/index.js +29 -21
  52. package/dist/components/section/index.js.map +1 -1
  53. package/dist/components/select.js +1 -1
  54. package/dist/components/select.js.map +1 -1
  55. package/dist/components/sheet.js +2 -2
  56. package/dist/components/sheet.js.map +1 -1
  57. package/dist/components/shell.js +44 -36
  58. package/dist/components/shell.js.map +1 -1
  59. package/dist/components/sidebar.js +83 -75
  60. package/dist/components/sidebar.js.map +1 -1
  61. package/dist/components/spotlight-search.js +67 -59
  62. package/dist/components/spotlight-search.js.map +1 -1
  63. package/dist/components/theme-toggle.js +21 -13
  64. package/dist/components/theme-toggle.js.map +1 -1
  65. package/dist/hooks/use-translation.js +3 -2
  66. package/dist/hooks/use-translation.js.map +1 -1
  67. package/dist/index.d.ts +1 -0
  68. package/dist/index.js +94 -1
  69. package/dist/index.js.map +1 -1
  70. package/dist/lib/theme-schema.d.ts +21 -0
  71. package/dist/lib/theme-schema.js +95 -0
  72. package/dist/lib/theme-schema.js.map +1 -0
  73. package/package.json +2 -5
  74. package/src/styles/globals.css +0 -130
@@ -250,18 +250,18 @@ import { IconChevronRight } from "@tabler/icons-react";
250
250
  // src/components/button.tsx
251
251
  import { Slot } from "@radix-ui/react-slot";
252
252
  import { cva } from "class-variance-authority";
253
- import { jsx as jsx3 } from "react/jsx-runtime";
253
+ import { jsxs as jsxs2 } from "react/jsx-runtime";
254
254
  var buttonVariants = cva(
255
255
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
256
256
  {
257
257
  variants: {
258
258
  variant: {
259
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
260
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
261
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
262
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
259
+ default: "bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400",
260
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
261
+ outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
262
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400",
263
263
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
264
- link: "text-primary underline-offset-4 hover:underline"
264
+ link: "text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline"
265
265
  },
266
266
  size: {
267
267
  default: "h-9 px-4 py-2 has-[>svg]:px-3",
@@ -283,27 +283,35 @@ function Button({
283
283
  variant,
284
284
  size,
285
285
  asChild = false,
286
+ leftIcon,
287
+ rightIcon,
288
+ children,
286
289
  ...props
287
290
  }) {
288
291
  const Comp = asChild ? Slot : "button";
289
- return /* @__PURE__ */ jsx3(
292
+ return /* @__PURE__ */ jsxs2(
290
293
  Comp,
291
294
  {
292
295
  "data-slot": "button",
293
296
  className: cn(buttonVariants({ variant, size, className })),
294
- ...props
297
+ ...props,
298
+ children: [
299
+ leftIcon,
300
+ children,
301
+ rightIcon
302
+ ]
295
303
  }
296
304
  );
297
305
  }
298
306
 
299
307
  // src/components/data-table/data-table-action.tsx
300
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
308
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
301
309
  function DataTableAction({
302
310
  onClick,
303
311
  disabled,
304
312
  "aria-label": ariaLabel = "Open menu"
305
313
  }) {
306
- return /* @__PURE__ */ jsx4("div", { className: "flex justify-end align-center", children: /* @__PURE__ */ jsxs2(
314
+ return /* @__PURE__ */ jsx3("div", { className: "flex justify-end align-center", children: /* @__PURE__ */ jsxs3(
307
315
  Button,
308
316
  {
309
317
  variant: "ghost",
@@ -311,24 +319,24 @@ function DataTableAction({
311
319
  onClick,
312
320
  disabled,
313
321
  children: [
314
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: ariaLabel }),
315
- /* @__PURE__ */ jsx4(IconChevronRight, { className: "h-4 w-4" })
322
+ /* @__PURE__ */ jsx3("span", { className: "sr-only", children: ariaLabel }),
323
+ /* @__PURE__ */ jsx3(IconChevronRight, { className: "h-4 w-4" })
316
324
  ]
317
325
  }
318
326
  ) });
319
327
  }
320
328
 
321
329
  // src/components/data-table/data-table-column-header.tsx
322
- import { jsx as jsx5 } from "react/jsx-runtime";
330
+ import { jsx as jsx4 } from "react/jsx-runtime";
323
331
  function DataTableColumnHeader({
324
332
  column,
325
333
  title,
326
334
  className
327
335
  }) {
328
336
  if (!column.getCanSort()) {
329
- return /* @__PURE__ */ jsx5("div", { className: cn(className), children: title });
337
+ return /* @__PURE__ */ jsx4("div", { className: cn(className), children: title });
330
338
  }
331
- return /* @__PURE__ */ jsx5("div", { className: cn("flex items-center gap-2", className), children: /* @__PURE__ */ jsx5("span", { children: title }) });
339
+ return /* @__PURE__ */ jsx4("div", { className: cn("flex items-center gap-2", className), children: /* @__PURE__ */ jsx4("span", { children: title }) });
332
340
  }
333
341
 
334
342
  // src/hooks/use-translation.ts
@@ -337,7 +345,7 @@ import { useMemo as useMemo3 } from "react";
337
345
 
338
346
  // src/components/tooltip.tsx
339
347
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
340
- import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
348
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
341
349
 
342
350
  // src/components/mesob-context.tsx
343
351
  import {
@@ -345,7 +353,7 @@ import {
345
353
  useContext,
346
354
  useMemo as useMemo2
347
355
  } from "react";
348
- import { jsx as jsx7 } from "react/jsx-runtime";
356
+ import { jsx as jsx6 } from "react/jsx-runtime";
349
357
  var MesobContext = createContext(null);
350
358
  function useMesob() {
351
359
  return useContext(MesobContext);
@@ -356,8 +364,9 @@ function useTranslation(namespace) {
356
364
  const mesob = useMesob();
357
365
  const nextIntlT = useTranslations(namespace);
358
366
  return useMemo3(() => {
359
- if (mesob?.t) {
360
- return (key, params) => mesob.t(namespace ? `${namespace}.${key}` : key, params);
367
+ const t = mesob?.t;
368
+ if (t) {
369
+ return (key, params) => t(namespace ? `${namespace}.${key}` : key, params);
361
370
  }
362
371
  return nextIntlT;
363
372
  }, [mesob?.t, namespace, nextIntlT]);
@@ -374,16 +383,16 @@ import {
374
383
  // src/components/select.tsx
375
384
  import * as SelectPrimitive from "@radix-ui/react-select";
376
385
  import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
377
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
386
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
378
387
  function Select({
379
388
  ...props
380
389
  }) {
381
- return /* @__PURE__ */ jsx8(SelectPrimitive.Root, { "data-slot": "select", ...props });
390
+ return /* @__PURE__ */ jsx7(SelectPrimitive.Root, { "data-slot": "select", ...props });
382
391
  }
383
392
  function SelectValue({
384
393
  ...props
385
394
  }) {
386
- return /* @__PURE__ */ jsx8(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
395
+ return /* @__PURE__ */ jsx7(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
387
396
  }
388
397
  function SelectTrigger({
389
398
  className,
@@ -391,7 +400,7 @@ function SelectTrigger({
391
400
  children,
392
401
  ...props
393
402
  }) {
394
- return /* @__PURE__ */ jsxs4(
403
+ return /* @__PURE__ */ jsxs5(
395
404
  SelectPrimitive.Trigger,
396
405
  {
397
406
  "data-slot": "select-trigger",
@@ -403,7 +412,7 @@ function SelectTrigger({
403
412
  ...props,
404
413
  children: [
405
414
  children,
406
- /* @__PURE__ */ jsx8(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx8(IconChevronDown, { className: "size-4 opacity-50" }) })
415
+ /* @__PURE__ */ jsx7(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx7(IconChevronDown, { className: "size-4 opacity-50" }) })
407
416
  ]
408
417
  }
409
418
  );
@@ -415,12 +424,12 @@ function SelectContent({
415
424
  align = "center",
416
425
  ...props
417
426
  }) {
418
- return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs4(
427
+ return /* @__PURE__ */ jsx7(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
419
428
  SelectPrimitive.Content,
420
429
  {
421
430
  "data-slot": "select-content",
422
431
  className: cn(
423
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
432
+ "bg-popover text-popover-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
424
433
  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",
425
434
  className
426
435
  ),
@@ -428,8 +437,8 @@ function SelectContent({
428
437
  align,
429
438
  ...props,
430
439
  children: [
431
- /* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
432
- /* @__PURE__ */ jsx8(
440
+ /* @__PURE__ */ jsx7(SelectScrollUpButton, {}),
441
+ /* @__PURE__ */ jsx7(
433
442
  SelectPrimitive.Viewport,
434
443
  {
435
444
  className: cn(
@@ -439,7 +448,7 @@ function SelectContent({
439
448
  children
440
449
  }
441
450
  ),
442
- /* @__PURE__ */ jsx8(SelectScrollDownButton, {})
451
+ /* @__PURE__ */ jsx7(SelectScrollDownButton, {})
443
452
  ]
444
453
  }
445
454
  ) });
@@ -449,7 +458,7 @@ function SelectItem({
449
458
  children,
450
459
  ...props
451
460
  }) {
452
- return /* @__PURE__ */ jsxs4(
461
+ return /* @__PURE__ */ jsxs5(
453
462
  SelectPrimitive.Item,
454
463
  {
455
464
  "data-slot": "select-item",
@@ -459,8 +468,8 @@ function SelectItem({
459
468
  ),
460
469
  ...props,
461
470
  children: [
462
- /* @__PURE__ */ jsx8("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx8(IconCheck, { className: "size-4" }) }) }),
463
- /* @__PURE__ */ jsx8(SelectPrimitive.ItemText, { children })
471
+ /* @__PURE__ */ jsx7("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx7(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx7(IconCheck, { className: "size-4" }) }) }),
472
+ /* @__PURE__ */ jsx7(SelectPrimitive.ItemText, { children })
464
473
  ]
465
474
  }
466
475
  );
@@ -469,7 +478,7 @@ function SelectScrollUpButton({
469
478
  className,
470
479
  ...props
471
480
  }) {
472
- return /* @__PURE__ */ jsx8(
481
+ return /* @__PURE__ */ jsx7(
473
482
  SelectPrimitive.ScrollUpButton,
474
483
  {
475
484
  "data-slot": "select-scroll-up-button",
@@ -478,7 +487,7 @@ function SelectScrollUpButton({
478
487
  className
479
488
  ),
480
489
  ...props,
481
- children: /* @__PURE__ */ jsx8(IconChevronUp, { className: "size-4" })
490
+ children: /* @__PURE__ */ jsx7(IconChevronUp, { className: "size-4" })
482
491
  }
483
492
  );
484
493
  }
@@ -486,7 +495,7 @@ function SelectScrollDownButton({
486
495
  className,
487
496
  ...props
488
497
  }) {
489
- return /* @__PURE__ */ jsx8(
498
+ return /* @__PURE__ */ jsx7(
490
499
  SelectPrimitive.ScrollDownButton,
491
500
  {
492
501
  "data-slot": "select-scroll-down-button",
@@ -495,13 +504,13 @@ function SelectScrollDownButton({
495
504
  className
496
505
  ),
497
506
  ...props,
498
- children: /* @__PURE__ */ jsx8(IconChevronDown, { className: "size-4" })
507
+ children: /* @__PURE__ */ jsx7(IconChevronDown, { className: "size-4" })
499
508
  }
500
509
  );
501
510
  }
502
511
 
503
512
  // src/components/data-table/data-table-pagination.tsx
504
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
513
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
505
514
  function addRange(pages, start, end) {
506
515
  for (let i = start; i <= end; i++) {
507
516
  pages.push(i);
@@ -555,120 +564,120 @@ function DataTablePagination({
555
564
  const hasSelection = selectedRows > 0;
556
565
  const rowText = hasSelection ? `${selectedRows} ${t("of")} ${totalRows} ${rowLabel} ${t("selected")}` : `${totalRows} ${rowLabel} ${t("total")}`;
557
566
  const pageText = `${t("page")} ${pageIndex + 1} ${t("of")} ${pageCount || 1}`;
558
- return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between", children: [
559
- /* @__PURE__ */ jsx9("div", { className: "text-muted-foreground text-sm", children: /* @__PURE__ */ jsxs5("span", { children: [
560
- rowText,
561
- /* @__PURE__ */ jsx9("span", { className: "mx-2", children: "\xB7" }),
562
- pageText
563
- ] }) }),
564
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-4 sm:gap-6 lg:gap-8", children: [
565
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
566
- /* @__PURE__ */ jsx9("span", { className: "text-sm font-medium whitespace-nowrap", children: t("rowsPerPage") }),
567
- /* @__PURE__ */ jsxs5(
567
+ return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-4 px-2 sm:flex-row sm:items-center sm:justify-between", children: [
568
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-center gap-4 sm:justify-start", children: [
569
+ /* @__PURE__ */ jsx8("div", { className: "text-muted-foreground text-sm", children: /* @__PURE__ */ jsxs6("span", { children: [
570
+ rowText,
571
+ /* @__PURE__ */ jsx8("span", { className: "mx-2", children: "\xB7" }),
572
+ pageText
573
+ ] }) }),
574
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
575
+ /* @__PURE__ */ jsx8("span", { className: "text-sm font-medium whitespace-nowrap", children: t("rowsPerPage") }),
576
+ /* @__PURE__ */ jsxs6(
568
577
  Select,
569
578
  {
570
579
  value: `${pageSize}`,
571
580
  onValueChange: (value) => onPageSizeChange(Number(value)),
572
581
  children: [
573
- /* @__PURE__ */ jsx9(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx9(SelectValue, { placeholder: pageSize }) }),
574
- /* @__PURE__ */ jsx9(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx9(SelectItem, { value: `${size}`, children: size }, size)) })
582
+ /* @__PURE__ */ jsx8(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx8(SelectValue, { placeholder: pageSize }) }),
583
+ /* @__PURE__ */ jsx8(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx8(SelectItem, { value: `${size}`, children: size }, size)) })
575
584
  ]
576
585
  }
577
586
  )
578
- ] }),
579
- /* @__PURE__ */ jsxs5("nav", { "aria-label": "Pagination", className: "flex items-center gap-1", children: [
580
- /* @__PURE__ */ jsxs5(
581
- Button,
582
- {
583
- variant: "outline",
584
- size: "icon",
585
- className: "hidden h-8 w-8 lg:flex",
586
- onClick: () => onPageChange(0),
587
- disabled: !canPreviousPage,
588
- "aria-label": t("firstPage"),
589
- children: [
590
- /* @__PURE__ */ jsx9(IconChevronsLeft, { className: "h-4 w-4" }),
591
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("firstPage") })
592
- ]
593
- }
594
- ),
595
- /* @__PURE__ */ jsxs5(
596
- Button,
597
- {
598
- variant: "outline",
599
- size: "icon",
600
- className: "h-8 w-8",
601
- onClick: () => onPageChange(pageIndex - 1),
602
- disabled: !canPreviousPage,
603
- "aria-label": t("previousPage"),
604
- children: [
605
- /* @__PURE__ */ jsx9(IconChevronLeft, { className: "h-4 w-4" }),
606
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("previousPage") })
607
- ]
608
- }
609
- ),
610
- pageNumbers.map((page, idx) => {
611
- if (page === "ellipsis") {
612
- const prevPage = idx > 0 ? pageNumbers[idx - 1] : null;
613
- const nextPage = idx < pageNumbers.length - 1 ? pageNumbers[idx + 1] : null;
614
- return /* @__PURE__ */ jsx9(
615
- "span",
616
- {
617
- className: "flex h-8 w-8 items-center justify-center text-muted-foreground",
618
- "aria-hidden": "true",
619
- children: "..."
620
- },
621
- `ellipsis-${prevPage}-${nextPage}`
622
- );
623
- }
624
- const pageNum = page;
625
- const isActive = pageNum === pageIndex + 1;
626
- return /* @__PURE__ */ jsx9(
627
- Button,
587
+ ] })
588
+ ] }),
589
+ /* @__PURE__ */ jsx8("div", { className: "flex justify-center sm:justify-end", children: /* @__PURE__ */ jsxs6("nav", { "aria-label": "Pagination", className: "flex items-center gap-1", children: [
590
+ /* @__PURE__ */ jsxs6(
591
+ Button,
592
+ {
593
+ variant: "outline",
594
+ size: "icon",
595
+ className: "hidden h-8 w-8 lg:flex",
596
+ onClick: () => onPageChange(0),
597
+ disabled: !canPreviousPage,
598
+ "aria-label": t("firstPage"),
599
+ children: [
600
+ /* @__PURE__ */ jsx8(IconChevronsLeft, { className: "h-4 w-4" }),
601
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", children: t("firstPage") })
602
+ ]
603
+ }
604
+ ),
605
+ /* @__PURE__ */ jsxs6(
606
+ Button,
607
+ {
608
+ variant: "outline",
609
+ size: "icon",
610
+ className: "h-8 w-8",
611
+ onClick: () => onPageChange(pageIndex - 1),
612
+ disabled: !canPreviousPage,
613
+ "aria-label": t("previousPage"),
614
+ children: [
615
+ /* @__PURE__ */ jsx8(IconChevronLeft, { className: "h-4 w-4" }),
616
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", children: t("previousPage") })
617
+ ]
618
+ }
619
+ ),
620
+ pageNumbers.map((page, idx) => {
621
+ if (page === "ellipsis") {
622
+ const prevPage = idx > 0 ? pageNumbers[idx - 1] : null;
623
+ const nextPage = idx < pageNumbers.length - 1 ? pageNumbers[idx + 1] : null;
624
+ return /* @__PURE__ */ jsx8(
625
+ "span",
628
626
  {
629
- variant: isActive ? "default" : "outline",
630
- size: "icon",
631
- className: "h-8 w-8",
632
- onClick: () => onPageChange(pageNum - 1),
633
- "aria-label": `${t("goToPage")} ${pageNum}`,
634
- "aria-current": isActive ? "page" : void 0,
635
- children: pageNum
627
+ className: "flex h-8 w-8 items-center justify-center text-muted-foreground",
628
+ "aria-hidden": "true",
629
+ children: "..."
636
630
  },
637
- pageNum
631
+ `ellipsis-${prevPage}-${nextPage}`
638
632
  );
639
- }),
640
- /* @__PURE__ */ jsxs5(
633
+ }
634
+ const pageNum = page;
635
+ const isActive = pageNum === pageIndex + 1;
636
+ return /* @__PURE__ */ jsx8(
641
637
  Button,
642
638
  {
643
- variant: "outline",
639
+ variant: isActive ? "default" : "outline",
644
640
  size: "icon",
645
641
  className: "h-8 w-8",
646
- onClick: () => onPageChange(pageIndex + 1),
647
- disabled: !canNextPage,
648
- "aria-label": t("nextPage"),
649
- children: [
650
- /* @__PURE__ */ jsx9(IconChevronRight2, { className: "h-4 w-4" }),
651
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("nextPage") })
652
- ]
653
- }
654
- ),
655
- /* @__PURE__ */ jsxs5(
656
- Button,
657
- {
658
- variant: "outline",
659
- size: "icon",
660
- className: "hidden h-8 w-8 lg:flex",
661
- onClick: () => onPageChange(pageCount - 1),
662
- disabled: !canNextPage,
663
- "aria-label": t("lastPage"),
664
- children: [
665
- /* @__PURE__ */ jsx9(IconChevronsRight, { className: "h-4 w-4" }),
666
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("lastPage") })
667
- ]
668
- }
669
- )
670
- ] })
671
- ] })
642
+ onClick: () => onPageChange(pageNum - 1),
643
+ "aria-label": `${t("goToPage")} ${pageNum}`,
644
+ "aria-current": isActive ? "page" : void 0,
645
+ children: pageNum
646
+ },
647
+ pageNum
648
+ );
649
+ }),
650
+ /* @__PURE__ */ jsxs6(
651
+ Button,
652
+ {
653
+ variant: "outline",
654
+ size: "icon",
655
+ className: "h-8 w-8",
656
+ onClick: () => onPageChange(pageIndex + 1),
657
+ disabled: !canNextPage,
658
+ "aria-label": t("nextPage"),
659
+ children: [
660
+ /* @__PURE__ */ jsx8(IconChevronRight2, { className: "h-4 w-4" }),
661
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", children: t("nextPage") })
662
+ ]
663
+ }
664
+ ),
665
+ /* @__PURE__ */ jsxs6(
666
+ Button,
667
+ {
668
+ variant: "outline",
669
+ size: "icon",
670
+ className: "hidden h-8 w-8 lg:flex",
671
+ onClick: () => onPageChange(pageCount - 1),
672
+ disabled: !canNextPage,
673
+ "aria-label": t("lastPage"),
674
+ children: [
675
+ /* @__PURE__ */ jsx8(IconChevronsRight, { className: "h-4 w-4" }),
676
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", children: t("lastPage") })
677
+ ]
678
+ }
679
+ )
680
+ ] }) })
672
681
  ] });
673
682
  }
674
683
 
@@ -678,16 +687,16 @@ import { IconSettings } from "@tabler/icons-react";
678
687
  // src/components/dropdown-menu.tsx
679
688
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
680
689
  import { IconCheck as IconCheck2, IconChevronRight as IconChevronRight3, IconCircle } from "@tabler/icons-react";
681
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
690
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
682
691
  function DropdownMenu({
683
692
  ...props
684
693
  }) {
685
- return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
694
+ return /* @__PURE__ */ jsx9(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
686
695
  }
687
696
  function DropdownMenuTrigger({
688
697
  ...props
689
698
  }) {
690
- return /* @__PURE__ */ jsx10(
699
+ return /* @__PURE__ */ jsx9(
691
700
  DropdownMenuPrimitive.Trigger,
692
701
  {
693
702
  "data-slot": "dropdown-menu-trigger",
@@ -700,13 +709,13 @@ function DropdownMenuContent({
700
709
  sideOffset = 4,
701
710
  ...props
702
711
  }) {
703
- return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
712
+ return /* @__PURE__ */ jsx9(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx9(
704
713
  DropdownMenuPrimitive.Content,
705
714
  {
706
715
  "data-slot": "dropdown-menu-content",
707
716
  sideOffset,
708
717
  className: cn(
709
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
718
+ "bg-popover text-popover-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
710
719
  className
711
720
  ),
712
721
  ...props
@@ -719,7 +728,7 @@ function DropdownMenuCheckboxItem({
719
728
  checked,
720
729
  ...props
721
730
  }) {
722
- return /* @__PURE__ */ jsxs6(
731
+ return /* @__PURE__ */ jsxs7(
723
732
  DropdownMenuPrimitive.CheckboxItem,
724
733
  {
725
734
  "data-slot": "dropdown-menu-checkbox-item",
@@ -730,7 +739,7 @@ function DropdownMenuCheckboxItem({
730
739
  checked,
731
740
  ...props,
732
741
  children: [
733
- /* @__PURE__ */ jsx10("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx10(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx10(IconCheck2, { className: "size-4" }) }) }),
742
+ /* @__PURE__ */ jsx9("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx9(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx9(IconCheck2, { className: "size-4" }) }) }),
734
743
  children
735
744
  ]
736
745
  }
@@ -741,7 +750,7 @@ function DropdownMenuLabel({
741
750
  inset,
742
751
  ...props
743
752
  }) {
744
- return /* @__PURE__ */ jsx10(
753
+ return /* @__PURE__ */ jsx9(
745
754
  DropdownMenuPrimitive.Label,
746
755
  {
747
756
  "data-slot": "dropdown-menu-label",
@@ -758,7 +767,7 @@ function DropdownMenuSeparator({
758
767
  className,
759
768
  ...props
760
769
  }) {
761
- return /* @__PURE__ */ jsx10(
770
+ return /* @__PURE__ */ jsx9(
762
771
  DropdownMenuPrimitive.Separator,
763
772
  {
764
773
  "data-slot": "dropdown-menu-separator",
@@ -769,29 +778,29 @@ function DropdownMenuSeparator({
769
778
  }
770
779
 
771
780
  // src/components/data-table/data-table-view-options.tsx
772
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
781
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
773
782
  function DataTableViewOptions({
774
783
  table
775
784
  }) {
776
- return /* @__PURE__ */ jsxs7(DropdownMenu, { children: [
777
- /* @__PURE__ */ jsx11(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
785
+ return /* @__PURE__ */ jsxs8(DropdownMenu, { children: [
786
+ /* @__PURE__ */ jsx10(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
778
787
  Button,
779
788
  {
780
789
  variant: "outline",
781
790
  size: "sm",
782
791
  className: "ml-auto hidden h-8 lg:flex",
783
792
  children: [
784
- /* @__PURE__ */ jsx11(IconSettings, { className: "mr-2 h-4 w-4" }),
793
+ /* @__PURE__ */ jsx10(IconSettings, { className: "mr-2 h-4 w-4" }),
785
794
  "View"
786
795
  ]
787
796
  }
788
797
  ) }),
789
- /* @__PURE__ */ jsxs7(DropdownMenuContent, { align: "end", className: "w-[150px]", children: [
790
- /* @__PURE__ */ jsx11(DropdownMenuLabel, { children: "Toggle columns" }),
791
- /* @__PURE__ */ jsx11(DropdownMenuSeparator, {}),
798
+ /* @__PURE__ */ jsxs8(DropdownMenuContent, { align: "end", className: "w-[150px]", children: [
799
+ /* @__PURE__ */ jsx10(DropdownMenuLabel, { children: "Toggle columns" }),
800
+ /* @__PURE__ */ jsx10(DropdownMenuSeparator, {}),
792
801
  table.getAllColumns().filter(
793
802
  (column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
794
- ).map((column) => /* @__PURE__ */ jsx11(
803
+ ).map((column) => /* @__PURE__ */ jsx10(
795
804
  DropdownMenuCheckboxItem,
796
805
  {
797
806
  className: "capitalize",