@mesob/ui 0.2.1 → 0.2.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/components/alert-dialog.js +14 -14
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/app-header-actions.js +70 -70
- package/dist/components/app-header-actions.js.map +1 -1
- package/dist/components/app-sidebar.js +57 -52
- package/dist/components/app-sidebar.js.map +1 -1
- package/dist/components/button.js +4 -4
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +12 -12
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/carousel.js +14 -14
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/data-table/index.js +57 -57
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/entity/index.js +177 -177
- package/dist/components/entity/index.js.map +1 -1
- package/dist/components/input-group.js +15 -15
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/page/index.js +21 -21
- package/dist/components/page/index.js.map +1 -1
- package/dist/components/pagination.js +12 -12
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/section/index.js +15 -15
- package/dist/components/section/index.js.map +1 -1
- package/dist/components/shell.js +47 -42
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sidebar-context.d.ts +19 -0
- package/dist/components/sidebar-context.js +17 -0
- package/dist/components/sidebar-context.js.map +1 -0
- package/dist/components/sidebar.d.ts +2 -15
- package/dist/components/sidebar.js +82 -77
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/spotlight-search.js +38 -38
- package/dist/components/spotlight-search.js.map +1 -1
- package/dist/components/theme-toggle.js +8 -8
- package/dist/components/theme-toggle.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ function cn(...inputs) {
|
|
|
10
10
|
// src/components/button.tsx
|
|
11
11
|
import { Slot } from "@radix-ui/react-slot";
|
|
12
12
|
import { cva } from "class-variance-authority";
|
|
13
|
-
import { jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
var buttonVariants = cva(
|
|
15
15
|
"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",
|
|
16
16
|
{
|
|
@@ -49,17 +49,17 @@ function Button({
|
|
|
49
49
|
...props
|
|
50
50
|
}) {
|
|
51
51
|
const Comp = asChild ? Slot : "button";
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
53
|
Comp,
|
|
54
54
|
{
|
|
55
55
|
"data-slot": "button",
|
|
56
56
|
className: cn(buttonVariants({ variant, size, className })),
|
|
57
57
|
...props,
|
|
58
|
-
children: [
|
|
58
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
59
|
leftIcon,
|
|
60
60
|
children,
|
|
61
61
|
rightIcon
|
|
62
|
-
]
|
|
62
|
+
] })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
}
|
|
@@ -68,7 +68,7 @@ function Button({
|
|
|
68
68
|
import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
|
|
69
69
|
import useEmblaCarousel from "embla-carousel-react";
|
|
70
70
|
import * as React from "react";
|
|
71
|
-
import { jsx, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
71
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
72
72
|
var CarouselContext = React.createContext(null);
|
|
73
73
|
function useCarousel() {
|
|
74
74
|
const context = React.useContext(CarouselContext);
|
|
@@ -135,7 +135,7 @@ function Carousel({
|
|
|
135
135
|
api.off("reInit", handleSelect);
|
|
136
136
|
};
|
|
137
137
|
}, [api]);
|
|
138
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ jsx2(
|
|
139
139
|
CarouselContext.Provider,
|
|
140
140
|
{
|
|
141
141
|
value: {
|
|
@@ -148,7 +148,7 @@ function Carousel({
|
|
|
148
148
|
canScrollPrev,
|
|
149
149
|
canScrollNext
|
|
150
150
|
},
|
|
151
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ jsx2(
|
|
152
152
|
"section",
|
|
153
153
|
{
|
|
154
154
|
onKeyDownCapture: handleKeyDown,
|
|
@@ -163,13 +163,13 @@ function Carousel({
|
|
|
163
163
|
}
|
|
164
164
|
function CarouselContent({ className, ...props }) {
|
|
165
165
|
const { carouselRef, orientation } = useCarousel();
|
|
166
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ jsx2(
|
|
167
167
|
"div",
|
|
168
168
|
{
|
|
169
169
|
ref: carouselRef,
|
|
170
170
|
className: "overflow-hidden",
|
|
171
171
|
"data-slot": "carousel-content",
|
|
172
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ jsx2(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
175
|
className: cn(
|
|
@@ -188,7 +188,7 @@ function CarouselItem({
|
|
|
188
188
|
...props
|
|
189
189
|
}) {
|
|
190
190
|
const { orientation } = useCarousel();
|
|
191
|
-
return /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ jsx2(
|
|
192
192
|
"fieldset",
|
|
193
193
|
{
|
|
194
194
|
"aria-roledescription": "slide",
|
|
@@ -224,8 +224,8 @@ function CarouselPrevious({
|
|
|
224
224
|
onClick: scrollPrev,
|
|
225
225
|
...props,
|
|
226
226
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ jsx2(IconChevronLeft, {}),
|
|
228
|
+
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Previous slide" })
|
|
229
229
|
]
|
|
230
230
|
}
|
|
231
231
|
);
|
|
@@ -252,8 +252,8 @@ function CarouselNext({
|
|
|
252
252
|
onClick: scrollNext,
|
|
253
253
|
...props,
|
|
254
254
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ jsx2(IconChevronRight, {}),
|
|
256
|
+
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Next slide" })
|
|
257
257
|
]
|
|
258
258
|
}
|
|
259
259
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/carousel.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n outline:\n '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',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\ntype ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n };\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n leftIcon,\n rightIcon,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n >\n {leftIcon}\n {children}\n {rightIcon}\n </Comp>\n );\n}\n\nexport { Button, buttonVariants };\n","'use client';\n\nimport { Button } from '@mesob/ui/components/button';\nimport { cn } from '@mesob/ui/lib/utils';\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from 'embla-carousel-react';\nimport * as React from 'react';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const scrollPrev = () => {\n api?.scrollPrev();\n };\n\n const scrollNext = () => {\n api?.scrollNext();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n };\n\n React.useEffect(() => {\n if (!(api && setApi)) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n const handleSelect = (carouselApi: CarouselApi) => {\n if (!carouselApi) {\n return;\n }\n setCanScrollPrev(carouselApi.canScrollPrev());\n setCanScrollNext(carouselApi.canScrollNext());\n };\n\n handleSelect(api);\n api.on('reInit', handleSelect);\n api.on('select', handleSelect);\n\n return () => {\n api.off('select', handleSelect);\n api.off('reInit', handleSelect);\n };\n }, [api]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <section\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({\n className,\n ...props\n}: React.ComponentProps<'fieldset'>) {\n const { orientation } = useCarousel();\n\n return (\n <fieldset\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full border-0 p-0 m-0',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n"],"mappings":";;;AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,SAAS,YAAY;AACrB,SAAS,WAA8B;AAwDnC;AArDJ,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AASA,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAgB;AACd,QAAM,OAAO,UAAU,OAAO;AAE9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,MACzD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;;;AChEA,SAAS,iBAAiB,wBAAwB;AAClD,OAAO,sBAEA;AACP,YAAY,WAAW;AAoHjB,cA8DF,QAAAA,aA9DE;AA7FN,IAAM,kBAAwB,oBAA2C,IAAI;AAE7E,SAAS,cAAc;AACrB,QAAM,UAAgB,iBAAW,eAAe;AAEhD,MAAI,CAAC,SAAS;AACZ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U;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eACZ,sCACA;AAAA,QACJ;AAAA,MACF;AAAA,MACA,UAAU,CAAC;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA,MAEJ;AAAA,4BAAC,mBAAgB;AAAA,QACjB,oBAAC,UAAK,WAAU,WAAU,4BAAc;AAAA;AAAA;AAAA,EAC1C;AAEJ;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,GAAG;AACL,GAAwC;AACtC,QAAM,EAAE,aAAa,YAAY,cAAc,IAAI,YAAY;AAE/D,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eACZ,uCACA;AAAA,QACJ;AAAA,MACF;AAAA,MACA,UAAU,CAAC;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA,MAEJ;AAAA,4BAAC,oBAAiB;AAAA,QAClB,oBAAC,UAAK,WAAU,WAAU,wBAAU;AAAA;AAAA;AAAA,EACtC;AAEJ;","names":["jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/carousel.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n outline:\n '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',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\ntype ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n };\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n leftIcon,\n rightIcon,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {leftIcon}\n {children}\n {rightIcon}\n </>\n )}\n </Comp>\n );\n}\n\nexport { Button, buttonVariants };\n","'use client';\n\nimport { Button } from '@mesob/ui/components/button';\nimport { cn } from '@mesob/ui/lib/utils';\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from 'embla-carousel-react';\nimport * as React from 'react';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const scrollPrev = () => {\n api?.scrollPrev();\n };\n\n const scrollNext = () => {\n api?.scrollNext();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n };\n\n React.useEffect(() => {\n if (!(api && setApi)) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n const handleSelect = (carouselApi: CarouselApi) => {\n if (!carouselApi) {\n return;\n }\n setCanScrollPrev(carouselApi.canScrollPrev());\n setCanScrollNext(carouselApi.canScrollNext());\n };\n\n handleSelect(api);\n api.on('reInit', handleSelect);\n api.on('select', handleSelect);\n\n return () => {\n api.off('select', handleSelect);\n api.off('reInit', handleSelect);\n };\n }, [api]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <section\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({\n className,\n ...props\n}: React.ComponentProps<'fieldset'>) {\n const { orientation } = useCarousel();\n\n return (\n <fieldset\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full border-0 p-0 m-0',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n"],"mappings":";;;AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,SAAS,YAAY;AACrB,SAAS,WAA8B;AAwDnC,SAQI,UARJ,KAQI,YARJ;AArDJ,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AASA,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,E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A,QAClB,gBAAAA,KAAC,UAAK,WAAU,WAAU,wBAAU;AAAA;AAAA;AAAA,EACtC;AAEJ;","names":["jsx","jsxs"]}
|
|
@@ -250,7 +250,7 @@ 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 { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
253
|
+
import { Fragment, jsx as jsx3, 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
|
{
|
|
@@ -289,29 +289,29 @@ function Button({
|
|
|
289
289
|
...props
|
|
290
290
|
}) {
|
|
291
291
|
const Comp = asChild ? Slot : "button";
|
|
292
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ jsx3(
|
|
293
293
|
Comp,
|
|
294
294
|
{
|
|
295
295
|
"data-slot": "button",
|
|
296
296
|
className: cn(buttonVariants({ variant, size, className })),
|
|
297
297
|
...props,
|
|
298
|
-
children: [
|
|
298
|
+
children: asChild ? children : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
299
299
|
leftIcon,
|
|
300
300
|
children,
|
|
301
301
|
rightIcon
|
|
302
|
-
]
|
|
302
|
+
] })
|
|
303
303
|
}
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
// src/components/data-table/data-table-action.tsx
|
|
308
|
-
import { jsx as
|
|
308
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
309
309
|
function DataTableAction({
|
|
310
310
|
onClick,
|
|
311
311
|
disabled,
|
|
312
312
|
"aria-label": ariaLabel = "Open menu"
|
|
313
313
|
}) {
|
|
314
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex justify-end align-center", children: /* @__PURE__ */ jsxs3(
|
|
315
315
|
Button,
|
|
316
316
|
{
|
|
317
317
|
variant: "ghost",
|
|
@@ -319,24 +319,24 @@ function DataTableAction({
|
|
|
319
319
|
onClick,
|
|
320
320
|
disabled,
|
|
321
321
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ jsx4("span", { className: "sr-only", children: ariaLabel }),
|
|
323
|
+
/* @__PURE__ */ jsx4(IconChevronRight, { className: "h-4 w-4" })
|
|
324
324
|
]
|
|
325
325
|
}
|
|
326
326
|
) });
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
// src/components/data-table/data-table-column-header.tsx
|
|
330
|
-
import { jsx as
|
|
330
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
331
331
|
function DataTableColumnHeader({
|
|
332
332
|
column,
|
|
333
333
|
title,
|
|
334
334
|
className
|
|
335
335
|
}) {
|
|
336
336
|
if (!column.getCanSort()) {
|
|
337
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ jsx5("div", { className: cn(className), children: title });
|
|
338
338
|
}
|
|
339
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ jsx5("div", { className: cn("flex items-center gap-2", className), children: /* @__PURE__ */ jsx5("span", { children: title }) });
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
// src/hooks/use-translation.ts
|
|
@@ -345,7 +345,7 @@ import { useMemo as useMemo3 } from "react";
|
|
|
345
345
|
|
|
346
346
|
// src/components/tooltip.tsx
|
|
347
347
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
348
|
-
import { jsx as
|
|
348
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
349
349
|
|
|
350
350
|
// src/components/mesob-context.tsx
|
|
351
351
|
import {
|
|
@@ -353,7 +353,7 @@ import {
|
|
|
353
353
|
useContext,
|
|
354
354
|
useMemo as useMemo2
|
|
355
355
|
} from "react";
|
|
356
|
-
import { jsx as
|
|
356
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
357
357
|
var MesobContext = createContext(null);
|
|
358
358
|
function useMesob() {
|
|
359
359
|
return useContext(MesobContext);
|
|
@@ -383,16 +383,16 @@ import {
|
|
|
383
383
|
// src/components/select.tsx
|
|
384
384
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
385
385
|
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
386
|
-
import { jsx as
|
|
386
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
387
387
|
function Select({
|
|
388
388
|
...props
|
|
389
389
|
}) {
|
|
390
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
391
391
|
}
|
|
392
392
|
function SelectValue({
|
|
393
393
|
...props
|
|
394
394
|
}) {
|
|
395
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
396
396
|
}
|
|
397
397
|
function SelectTrigger({
|
|
398
398
|
className,
|
|
@@ -412,7 +412,7 @@ function SelectTrigger({
|
|
|
412
412
|
...props,
|
|
413
413
|
children: [
|
|
414
414
|
children,
|
|
415
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx8(IconChevronDown, { className: "size-4 opacity-50" }) })
|
|
416
416
|
]
|
|
417
417
|
}
|
|
418
418
|
);
|
|
@@ -424,7 +424,7 @@ function SelectContent({
|
|
|
424
424
|
align = "center",
|
|
425
425
|
...props
|
|
426
426
|
}) {
|
|
427
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
|
|
428
428
|
SelectPrimitive.Content,
|
|
429
429
|
{
|
|
430
430
|
"data-slot": "select-content",
|
|
@@ -437,8 +437,8 @@ function SelectContent({
|
|
|
437
437
|
align,
|
|
438
438
|
...props,
|
|
439
439
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
441
|
+
/* @__PURE__ */ jsx8(
|
|
442
442
|
SelectPrimitive.Viewport,
|
|
443
443
|
{
|
|
444
444
|
className: cn(
|
|
@@ -448,7 +448,7 @@ function SelectContent({
|
|
|
448
448
|
children
|
|
449
449
|
}
|
|
450
450
|
),
|
|
451
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ jsx8(SelectScrollDownButton, {})
|
|
452
452
|
]
|
|
453
453
|
}
|
|
454
454
|
) });
|
|
@@ -468,8 +468,8 @@ function SelectItem({
|
|
|
468
468
|
),
|
|
469
469
|
...props,
|
|
470
470
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__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" }) }) }),
|
|
472
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, { children })
|
|
473
473
|
]
|
|
474
474
|
}
|
|
475
475
|
);
|
|
@@ -478,7 +478,7 @@ function SelectScrollUpButton({
|
|
|
478
478
|
className,
|
|
479
479
|
...props
|
|
480
480
|
}) {
|
|
481
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ jsx8(
|
|
482
482
|
SelectPrimitive.ScrollUpButton,
|
|
483
483
|
{
|
|
484
484
|
"data-slot": "select-scroll-up-button",
|
|
@@ -487,7 +487,7 @@ function SelectScrollUpButton({
|
|
|
487
487
|
className
|
|
488
488
|
),
|
|
489
489
|
...props,
|
|
490
|
-
children: /* @__PURE__ */
|
|
490
|
+
children: /* @__PURE__ */ jsx8(IconChevronUp, { className: "size-4" })
|
|
491
491
|
}
|
|
492
492
|
);
|
|
493
493
|
}
|
|
@@ -495,7 +495,7 @@ function SelectScrollDownButton({
|
|
|
495
495
|
className,
|
|
496
496
|
...props
|
|
497
497
|
}) {
|
|
498
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx8(
|
|
499
499
|
SelectPrimitive.ScrollDownButton,
|
|
500
500
|
{
|
|
501
501
|
"data-slot": "select-scroll-down-button",
|
|
@@ -504,13 +504,13 @@ function SelectScrollDownButton({
|
|
|
504
504
|
className
|
|
505
505
|
),
|
|
506
506
|
...props,
|
|
507
|
-
children: /* @__PURE__ */
|
|
507
|
+
children: /* @__PURE__ */ jsx8(IconChevronDown, { className: "size-4" })
|
|
508
508
|
}
|
|
509
509
|
);
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
// src/components/data-table/data-table-pagination.tsx
|
|
513
|
-
import { jsx as
|
|
513
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
514
514
|
function addRange(pages, start, end) {
|
|
515
515
|
for (let i = start; i <= end; i++) {
|
|
516
516
|
pages.push(i);
|
|
@@ -566,27 +566,27 @@ function DataTablePagination({
|
|
|
566
566
|
const pageText = `${t("page")} ${pageIndex + 1} ${t("of")} ${pageCount || 1}`;
|
|
567
567
|
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-4 px-2 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
568
568
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-center gap-4 sm:justify-start", children: [
|
|
569
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ jsx9("div", { className: "text-muted-foreground text-sm", children: /* @__PURE__ */ jsxs6("span", { children: [
|
|
570
570
|
rowText,
|
|
571
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsx9("span", { className: "mx-2", children: "\xB7" }),
|
|
572
572
|
pageText
|
|
573
573
|
] }) }),
|
|
574
574
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
575
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium whitespace-nowrap", children: t("rowsPerPage") }),
|
|
576
576
|
/* @__PURE__ */ jsxs6(
|
|
577
577
|
Select,
|
|
578
578
|
{
|
|
579
579
|
value: `${pageSize}`,
|
|
580
580
|
onValueChange: (value) => onPageSizeChange(Number(value)),
|
|
581
581
|
children: [
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ jsx9(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx9(SelectValue, { placeholder: pageSize }) }),
|
|
583
|
+
/* @__PURE__ */ jsx9(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx9(SelectItem, { value: `${size}`, children: size }, size)) })
|
|
584
584
|
]
|
|
585
585
|
}
|
|
586
586
|
)
|
|
587
587
|
] })
|
|
588
588
|
] }),
|
|
589
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ jsx9("div", { className: "flex justify-center sm:justify-end", children: /* @__PURE__ */ jsxs6("nav", { "aria-label": "Pagination", className: "flex items-center gap-1", children: [
|
|
590
590
|
/* @__PURE__ */ jsxs6(
|
|
591
591
|
Button,
|
|
592
592
|
{
|
|
@@ -597,8 +597,8 @@ function DataTablePagination({
|
|
|
597
597
|
disabled: !canPreviousPage,
|
|
598
598
|
"aria-label": t("firstPage"),
|
|
599
599
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ jsx9(IconChevronsLeft, { className: "h-4 w-4" }),
|
|
601
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("firstPage") })
|
|
602
602
|
]
|
|
603
603
|
}
|
|
604
604
|
),
|
|
@@ -612,8 +612,8 @@ function DataTablePagination({
|
|
|
612
612
|
disabled: !canPreviousPage,
|
|
613
613
|
"aria-label": t("previousPage"),
|
|
614
614
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ jsx9(IconChevronLeft, { className: "h-4 w-4" }),
|
|
616
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("previousPage") })
|
|
617
617
|
]
|
|
618
618
|
}
|
|
619
619
|
),
|
|
@@ -621,7 +621,7 @@ function DataTablePagination({
|
|
|
621
621
|
if (page === "ellipsis") {
|
|
622
622
|
const prevPage = idx > 0 ? pageNumbers[idx - 1] : null;
|
|
623
623
|
const nextPage = idx < pageNumbers.length - 1 ? pageNumbers[idx + 1] : null;
|
|
624
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ jsx9(
|
|
625
625
|
"span",
|
|
626
626
|
{
|
|
627
627
|
className: "flex h-8 w-8 items-center justify-center text-muted-foreground",
|
|
@@ -633,7 +633,7 @@ function DataTablePagination({
|
|
|
633
633
|
}
|
|
634
634
|
const pageNum = page;
|
|
635
635
|
const isActive = pageNum === pageIndex + 1;
|
|
636
|
-
return /* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ jsx9(
|
|
637
637
|
Button,
|
|
638
638
|
{
|
|
639
639
|
variant: isActive ? "default" : "outline",
|
|
@@ -657,8 +657,8 @@ function DataTablePagination({
|
|
|
657
657
|
disabled: !canNextPage,
|
|
658
658
|
"aria-label": t("nextPage"),
|
|
659
659
|
children: [
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ jsx9(IconChevronRight2, { className: "h-4 w-4" }),
|
|
661
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("nextPage") })
|
|
662
662
|
]
|
|
663
663
|
}
|
|
664
664
|
),
|
|
@@ -672,8 +672,8 @@ function DataTablePagination({
|
|
|
672
672
|
disabled: !canNextPage,
|
|
673
673
|
"aria-label": t("lastPage"),
|
|
674
674
|
children: [
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ jsx9(IconChevronsRight, { className: "h-4 w-4" }),
|
|
676
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: t("lastPage") })
|
|
677
677
|
]
|
|
678
678
|
}
|
|
679
679
|
)
|
|
@@ -687,16 +687,16 @@ import { IconSettings } from "@tabler/icons-react";
|
|
|
687
687
|
// src/components/dropdown-menu.tsx
|
|
688
688
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
689
689
|
import { IconCheck as IconCheck2, IconChevronRight as IconChevronRight3, IconCircle } from "@tabler/icons-react";
|
|
690
|
-
import { jsx as
|
|
690
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
691
691
|
function DropdownMenu({
|
|
692
692
|
...props
|
|
693
693
|
}) {
|
|
694
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
695
695
|
}
|
|
696
696
|
function DropdownMenuTrigger({
|
|
697
697
|
...props
|
|
698
698
|
}) {
|
|
699
|
-
return /* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ jsx10(
|
|
700
700
|
DropdownMenuPrimitive.Trigger,
|
|
701
701
|
{
|
|
702
702
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -709,7 +709,7 @@ function DropdownMenuContent({
|
|
|
709
709
|
sideOffset = 4,
|
|
710
710
|
...props
|
|
711
711
|
}) {
|
|
712
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ jsx10(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
|
|
713
713
|
DropdownMenuPrimitive.Content,
|
|
714
714
|
{
|
|
715
715
|
"data-slot": "dropdown-menu-content",
|
|
@@ -739,7 +739,7 @@ function DropdownMenuCheckboxItem({
|
|
|
739
739
|
checked,
|
|
740
740
|
...props,
|
|
741
741
|
children: [
|
|
742
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__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" }) }) }),
|
|
743
743
|
children
|
|
744
744
|
]
|
|
745
745
|
}
|
|
@@ -750,7 +750,7 @@ function DropdownMenuLabel({
|
|
|
750
750
|
inset,
|
|
751
751
|
...props
|
|
752
752
|
}) {
|
|
753
|
-
return /* @__PURE__ */
|
|
753
|
+
return /* @__PURE__ */ jsx10(
|
|
754
754
|
DropdownMenuPrimitive.Label,
|
|
755
755
|
{
|
|
756
756
|
"data-slot": "dropdown-menu-label",
|
|
@@ -767,7 +767,7 @@ function DropdownMenuSeparator({
|
|
|
767
767
|
className,
|
|
768
768
|
...props
|
|
769
769
|
}) {
|
|
770
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ jsx10(
|
|
771
771
|
DropdownMenuPrimitive.Separator,
|
|
772
772
|
{
|
|
773
773
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -778,29 +778,29 @@ function DropdownMenuSeparator({
|
|
|
778
778
|
}
|
|
779
779
|
|
|
780
780
|
// src/components/data-table/data-table-view-options.tsx
|
|
781
|
-
import { jsx as
|
|
781
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
782
782
|
function DataTableViewOptions({
|
|
783
783
|
table
|
|
784
784
|
}) {
|
|
785
785
|
return /* @__PURE__ */ jsxs8(DropdownMenu, { children: [
|
|
786
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ jsx11(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
|
|
787
787
|
Button,
|
|
788
788
|
{
|
|
789
789
|
variant: "outline",
|
|
790
790
|
size: "sm",
|
|
791
791
|
className: "ml-auto hidden h-8 lg:flex",
|
|
792
792
|
children: [
|
|
793
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ jsx11(IconSettings, { className: "mr-2 h-4 w-4" }),
|
|
794
794
|
"View"
|
|
795
795
|
]
|
|
796
796
|
}
|
|
797
797
|
) }),
|
|
798
798
|
/* @__PURE__ */ jsxs8(DropdownMenuContent, { align: "end", className: "w-[150px]", children: [
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ jsx11(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
800
|
+
/* @__PURE__ */ jsx11(DropdownMenuSeparator, {}),
|
|
801
801
|
table.getAllColumns().filter(
|
|
802
802
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
803
|
-
).map((column) => /* @__PURE__ */
|
|
803
|
+
).map((column) => /* @__PURE__ */ jsx11(
|
|
804
804
|
DropdownMenuCheckboxItem,
|
|
805
805
|
{
|
|
806
806
|
className: "capitalize",
|