@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.
- package/dist/components/alert-dialog.js +22 -22
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/animated-tabs.js +1 -1
- package/dist/components/animated-tabs.js.map +1 -1
- package/dist/components/app-header-actions.js +118 -103
- package/dist/components/app-header-actions.js.map +1 -1
- package/dist/components/app-sidebar.js +69 -69
- package/dist/components/app-sidebar.js.map +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.d.ts +6 -3
- package/dist/components/button.js +16 -8
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +24 -16
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.js +28 -20
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/command.js +5 -5
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +2 -2
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table/index.js +162 -153
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/dialog.js +2 -2
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/entity/index.js +261 -256
- package/dist/components/entity/index.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.js +27 -19
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/menubar.js +3 -3
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/page/index.js +36 -28
- package/dist/components/page/index.js.map +1 -1
- package/dist/components/pagination.js +20 -20
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/section/index.js +29 -21
- package/dist/components/section/index.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/shell.js +44 -36
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sidebar.js +83 -75
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/spotlight-search.js +67 -59
- package/dist/components/spotlight-search.js.map +1 -1
- package/dist/components/theme-toggle.js +21 -13
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/hooks/use-translation.js +3 -2
- package/dist/hooks/use-translation.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +94 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/theme-schema.d.ts +21 -0
- package/dist/lib/theme-schema.js +95 -0
- package/dist/lib/theme-schema.js.map +1 -0
- package/package.json +2 -5
- 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 {
|
|
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
|
|
260
|
-
destructive: "bg-destructive text-
|
|
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
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
315
|
-
/* @__PURE__ */
|
|
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
|
|
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__ */
|
|
337
|
+
return /* @__PURE__ */ jsx4("div", { className: cn(className), children: title });
|
|
330
338
|
}
|
|
331
|
-
return /* @__PURE__ */
|
|
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
|
|
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
|
|
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
|
-
|
|
360
|
-
|
|
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
|
|
386
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
378
387
|
function Select({
|
|
379
388
|
...props
|
|
380
389
|
}) {
|
|
381
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsx7(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
382
391
|
}
|
|
383
392
|
function SelectValue({
|
|
384
393
|
...props
|
|
385
394
|
}) {
|
|
386
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
432
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
463
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
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__ */
|
|
574
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
-
|
|
630
|
-
|
|
631
|
-
|
|
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
|
-
|
|
631
|
+
`ellipsis-${prevPage}-${nextPage}`
|
|
638
632
|
);
|
|
639
|
-
}
|
|
640
|
-
|
|
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(
|
|
647
|
-
|
|
648
|
-
"aria-
|
|
649
|
-
children:
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
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
|
|
690
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
682
691
|
function DropdownMenu({
|
|
683
692
|
...props
|
|
684
693
|
}) {
|
|
685
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
781
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
773
782
|
function DataTableViewOptions({
|
|
774
783
|
table
|
|
775
784
|
}) {
|
|
776
|
-
return /* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
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__ */
|
|
793
|
+
/* @__PURE__ */ jsx10(IconSettings, { className: "mr-2 h-4 w-4" }),
|
|
785
794
|
"View"
|
|
786
795
|
]
|
|
787
796
|
}
|
|
788
797
|
) }),
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
/* @__PURE__ */
|
|
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__ */
|
|
803
|
+
).map((column) => /* @__PURE__ */ jsx10(
|
|
795
804
|
DropdownMenuCheckboxItem,
|
|
796
805
|
{
|
|
797
806
|
className: "capitalize",
|