@customafk/lunas-ui 0.1.87 → 0.1.89
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/{button-70p_rB81.d.cts → button-CiLsnjev.d.mts} +7 -7
- package/dist/{button-BMzPKC0-.d.mts → button-Dphc1TZp.d.cts} +7 -7
- package/dist/cards/simple-card.d.cts +2 -2
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/data-display/empty.d.cts +2 -2
- package/dist/data-display/empty.d.mts +2 -2
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/{dialog-IGmKIrTb.d.mts → dialog-CwGD6AJw.d.cts} +12 -12
- package/dist/{dialog-B5NbVD73.d.cts → dialog-DwkejzpS.d.mts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +2 -2
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +2 -2
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.cjs.map +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +1 -1
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.cjs.map +1 -1
- package/dist/features/tanstack-form/index.d.cts +48 -48
- package/dist/features/tanstack-form/index.d.mts +48 -48
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/tanstack-form/index.mjs.map +1 -1
- package/dist/{input-RNF3AtQx.d.mts → input-DqCWojD4.d.cts} +6 -6
- package/dist/{input-C4zZ2I8W.d.cts → input-mq2wP0OC.d.mts} +5 -5
- package/dist/layouts/flex.d.cts +5 -5
- package/dist/layouts/flex.d.mts +7 -7
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.mts +2 -2
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +7 -7
- package/dist/ui/alert.d.mts +7 -7
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +5 -5
- package/dist/ui/badge.d.mts +5 -5
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +6 -6
- package/dist/ui/button-group.d.mts +6 -6
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.d.cts +24 -24
- package/dist/ui/field.d.mts +24 -24
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +11 -11
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.mts +15 -15
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +11 -11
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.mts +5 -5
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.mts +4 -4
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.mts +11 -11
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sidebar.d.cts +29 -29
- package/dist/ui/sidebar.d.mts +29 -29
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +18 -18
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +5 -5
- package/dist/ui/toggle.d.mts +5 -5
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as class_variance_authority_types11 from "class-variance-authority/types";
|
|
1
|
+
import * as react_jsx_runtime176 from "react/jsx-runtime";
|
|
3
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as class_variance_authority_types12 from "class-variance-authority/types";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/ui/button.variants.d.ts
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ import { VariantProps } from "class-variance-authority";
|
|
|
9
9
|
*/
|
|
10
10
|
declare const buttonVariants: (props?: ({
|
|
11
11
|
variant?: "default" | "outline" | "link" | "ghost" | "soft" | "subtle" | null | undefined;
|
|
12
|
-
color?: "muted" | "
|
|
13
|
-
size?: "
|
|
14
|
-
} &
|
|
12
|
+
color?: "muted" | "warning" | "success" | "info" | "primary" | "secondary" | "important" | "danger" | null | undefined;
|
|
13
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types12.ClassProp) | undefined) => string;
|
|
15
15
|
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region packages/components/ui/button.d.ts
|
|
@@ -51,7 +51,7 @@ declare function Button({
|
|
|
51
51
|
disabled,
|
|
52
52
|
type,
|
|
53
53
|
...props
|
|
54
|
-
}: ButtonProps):
|
|
54
|
+
}: ButtonProps): react_jsx_runtime176.JSX.Element;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { ButtonProps as n, Button as t };
|
|
57
|
-
//# sourceMappingURL=button-
|
|
57
|
+
//# sourceMappingURL=button-CiLsnjev.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime260 from "react/jsx-runtime";
|
|
2
|
+
import * as class_variance_authority_types10 from "class-variance-authority/types";
|
|
2
3
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as class_variance_authority_types11 from "class-variance-authority/types";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/ui/button.variants.d.ts
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ import * as class_variance_authority_types11 from "class-variance-authority/type
|
|
|
9
9
|
*/
|
|
10
10
|
declare const buttonVariants: (props?: ({
|
|
11
11
|
variant?: "default" | "outline" | "link" | "ghost" | "soft" | "subtle" | null | undefined;
|
|
12
|
-
color?: "muted" | "
|
|
13
|
-
size?: "
|
|
14
|
-
} &
|
|
12
|
+
color?: "muted" | "warning" | "success" | "info" | "primary" | "secondary" | "important" | "danger" | null | undefined;
|
|
13
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types10.ClassProp) | undefined) => string;
|
|
15
15
|
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region packages/components/ui/button.d.ts
|
|
@@ -51,7 +51,7 @@ declare function Button({
|
|
|
51
51
|
disabled,
|
|
52
52
|
type,
|
|
53
53
|
...props
|
|
54
|
-
}: ButtonProps):
|
|
54
|
+
}: ButtonProps): react_jsx_runtime260.JSX.Element;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { ButtonProps as n, Button as t };
|
|
57
|
-
//# sourceMappingURL=button-
|
|
57
|
+
//# sourceMappingURL=button-Dphc1TZp.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/cards/simple-card.d.ts
|
|
4
4
|
type Props = {
|
|
@@ -13,7 +13,7 @@ declare const SimpleCard: ({
|
|
|
13
13
|
action,
|
|
14
14
|
footer,
|
|
15
15
|
children
|
|
16
|
-
}: React.PropsWithChildren<Props>) =>
|
|
16
|
+
}: React.PropsWithChildren<Props>) => react_jsx_runtime0.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SimpleCard };
|
|
19
19
|
//# sourceMappingURL=simple-card.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/cards/simple-card.d.ts
|
|
4
4
|
type Props = {
|
|
@@ -13,7 +13,7 @@ declare const SimpleCard: ({
|
|
|
13
13
|
action,
|
|
14
14
|
footer,
|
|
15
15
|
children
|
|
16
|
-
}: React.PropsWithChildren<Props>) =>
|
|
16
|
+
}: React.PropsWithChildren<Props>) => react_jsx_runtime25.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SimpleCard };
|
|
19
19
|
//# sourceMappingURL=simple-card.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/data-display/empty.d.ts
|
|
4
|
-
declare const EmptyDisplay: () =>
|
|
4
|
+
declare const EmptyDisplay: () => react_jsx_runtime1.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { EmptyDisplay };
|
|
7
7
|
//# sourceMappingURL=empty.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/data-display/empty.d.ts
|
|
4
|
-
declare const EmptyDisplay: () =>
|
|
4
|
+
declare const EmptyDisplay: () => react_jsx_runtime22.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { EmptyDisplay };
|
|
7
7
|
//# sourceMappingURL=empty.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/data-display/statistic.d.ts
|
|
@@ -23,7 +23,7 @@ declare const Statistic: react0.MemoExoticComponent<({
|
|
|
23
23
|
showTrailingZeros,
|
|
24
24
|
size,
|
|
25
25
|
value
|
|
26
|
-
}: Props) =>
|
|
26
|
+
}: Props) => react_jsx_runtime0.JSX.Element>;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Statistic };
|
|
29
29
|
//# sourceMappingURL=statistic.d.mts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime206 from "react/jsx-runtime";
|
|
2
2
|
import { Dialog } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/dialog.d.ts
|
|
5
5
|
declare function Dialog$1({
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<typeof Dialog.Root>):
|
|
7
|
+
}: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime206.JSX.Element;
|
|
8
8
|
declare function DialogTrigger({
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof Dialog.Trigger>):
|
|
10
|
+
}: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime206.JSX.Element;
|
|
11
11
|
declare function DialogPortal({
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof Dialog.Portal>):
|
|
13
|
+
}: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime206.JSX.Element;
|
|
14
14
|
declare function DialogClose({
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Dialog.Close>):
|
|
16
|
+
}: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime206.JSX.Element;
|
|
17
17
|
declare function DialogOverlay({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Dialog.Overlay>):
|
|
20
|
+
}: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime206.JSX.Element;
|
|
21
21
|
declare function DialogContent({
|
|
22
22
|
className,
|
|
23
23
|
children,
|
|
@@ -25,23 +25,23 @@ declare function DialogContent({
|
|
|
25
25
|
...props
|
|
26
26
|
}: React.ComponentProps<typeof Dialog.Content> & {
|
|
27
27
|
showCloseButton?: boolean;
|
|
28
|
-
}):
|
|
28
|
+
}): react_jsx_runtime206.JSX.Element;
|
|
29
29
|
declare function DialogHeader({
|
|
30
30
|
className,
|
|
31
31
|
...props
|
|
32
|
-
}: React.ComponentProps<'div'>):
|
|
32
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime206.JSX.Element;
|
|
33
33
|
declare function DialogFooter({
|
|
34
34
|
className,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<'div'>):
|
|
36
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime206.JSX.Element;
|
|
37
37
|
declare function DialogTitle({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof Dialog.Title>):
|
|
40
|
+
}: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime206.JSX.Element;
|
|
41
41
|
declare function DialogDescription({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: React.ComponentProps<typeof Dialog.Description>):
|
|
44
|
+
}: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime206.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { DialogFooter as a, DialogPortal as c, DialogDescription as i, DialogTitle as l, DialogClose as n, DialogHeader as o, DialogContent as r, DialogOverlay as s, Dialog$1 as t, DialogTrigger as u };
|
|
47
|
-
//# sourceMappingURL=dialog-
|
|
47
|
+
//# sourceMappingURL=dialog-CwGD6AJw.d.cts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime158 from "react/jsx-runtime";
|
|
2
2
|
import { Dialog } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/dialog.d.ts
|
|
5
5
|
declare function Dialog$1({
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<typeof Dialog.Root>):
|
|
7
|
+
}: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime158.JSX.Element;
|
|
8
8
|
declare function DialogTrigger({
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof Dialog.Trigger>):
|
|
10
|
+
}: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime158.JSX.Element;
|
|
11
11
|
declare function DialogPortal({
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof Dialog.Portal>):
|
|
13
|
+
}: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime158.JSX.Element;
|
|
14
14
|
declare function DialogClose({
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Dialog.Close>):
|
|
16
|
+
}: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime158.JSX.Element;
|
|
17
17
|
declare function DialogOverlay({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Dialog.Overlay>):
|
|
20
|
+
}: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime158.JSX.Element;
|
|
21
21
|
declare function DialogContent({
|
|
22
22
|
className,
|
|
23
23
|
children,
|
|
@@ -25,23 +25,23 @@ declare function DialogContent({
|
|
|
25
25
|
...props
|
|
26
26
|
}: React.ComponentProps<typeof Dialog.Content> & {
|
|
27
27
|
showCloseButton?: boolean;
|
|
28
|
-
}):
|
|
28
|
+
}): react_jsx_runtime158.JSX.Element;
|
|
29
29
|
declare function DialogHeader({
|
|
30
30
|
className,
|
|
31
31
|
...props
|
|
32
|
-
}: React.ComponentProps<'div'>):
|
|
32
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime158.JSX.Element;
|
|
33
33
|
declare function DialogFooter({
|
|
34
34
|
className,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<'div'>):
|
|
36
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime158.JSX.Element;
|
|
37
37
|
declare function DialogTitle({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof Dialog.Title>):
|
|
40
|
+
}: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime158.JSX.Element;
|
|
41
41
|
declare function DialogDescription({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: React.ComponentProps<typeof Dialog.Description>):
|
|
44
|
+
}: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime158.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { DialogFooter as a, DialogPortal as c, DialogDescription as i, DialogTitle as l, DialogClose as n, DialogHeader as o, DialogContent as r, DialogOverlay as s, Dialog$1 as t, DialogTrigger as u };
|
|
47
|
-
//# sourceMappingURL=dialog-
|
|
47
|
+
//# sourceMappingURL=dialog-DwkejzpS.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
1
|
+
import { t as Button } from "../../../button-Dphc1TZp.cjs";
|
|
2
2
|
import { Separator } from "../../../ui/separator.cjs";
|
|
3
3
|
import { TooltipContent } from "../../../ui/tooltip.cjs";
|
|
4
4
|
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
@@ -103,7 +103,7 @@ declare function DetailDialogSidebarMenuItem({
|
|
|
103
103
|
}: React.ComponentProps<'li'>): react_jsx_runtime3.JSX.Element;
|
|
104
104
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
105
105
|
variant?: "default" | "outline" | null | undefined;
|
|
106
|
-
size?: "
|
|
106
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
107
107
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
108
108
|
declare function DetailDialogSidebarMenuButton({
|
|
109
109
|
asChild,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
1
|
+
import { t as Button } from "../../../button-CiLsnjev.mjs";
|
|
2
2
|
import { Separator } from "../../../ui/separator.mjs";
|
|
3
3
|
import { TooltipContent } from "../../../ui/tooltip.mjs";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -103,7 +103,7 @@ declare function DetailDialogSidebarMenuItem({
|
|
|
103
103
|
}: React.ComponentProps<'li'>): react_jsx_runtime0.JSX.Element;
|
|
104
104
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
105
105
|
variant?: "default" | "outline" | null | undefined;
|
|
106
|
-
size?: "
|
|
106
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
107
107
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
108
108
|
declare function DetailDialogSidebarMenuButton({
|
|
109
109
|
asChild,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime243 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/features/search-modal/index.d.ts
|
|
4
|
-
declare const SearchModal: () =>
|
|
4
|
+
declare const SearchModal: () => react_jsx_runtime243.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { SearchModal };
|
|
7
7
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime174 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/features/search-modal/index.d.ts
|
|
4
|
-
declare const SearchModal: () =>
|
|
4
|
+
declare const SearchModal: () => react_jsx_runtime174.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { SearchModal };
|
|
7
7
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-Bo2vzQp5.cjs`);const t=require(`../../button-BLYTfCyl.cjs`),n=require(`../../flex-DGPQRbN6.cjs`),r=require(`../../paragraph-B9_-MKH8.cjs`),i=require(`../../date-CuRT4hmU.cjs`),a=require(`../../badge-CsDmp3ys.cjs`),o=require(`../../tooltip-DMFoP_sB.cjs`),s=require(`../../avatar-dAu1c0bC.cjs`),c=require(`../../separator-DSZyCT2g.cjs`),l=require(`../../dropdown-menu-5Zyw5t_J.cjs`),u=require(`../../checkbox-DDuYFG0R.cjs`),d=require(`../../resizable-BS63Xwia.cjs`),f=require(`../../input-dAoEznUI.cjs`);let p=require(`@customafk/react-toolkit/utils`),m=require(`react/jsx-runtime`),h=require(`lucide-react`),g=require(`react`),_=require(`@customafk/react-toolkit/color-hash`),v=require(`@tanstack/react-table`),y=require(`@tanstack/react-virtual`),b=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const x=()=>(0,m.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,m.jsx)(h.MinusIcon,{size:16}),(0,m.jsx)(h.MinusIcon,{size:16})]}),S=({label:e,onClick:t,onRemove:n})=>e?n?(0,m.jsxs)(`div`,{className:`flex w-fit gap-x-0.5 rounded-full border border-border py-1 pr-2 pl-3 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:[e,(0,m.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.XIcon,{size:12})})]}):(0,m.jsx)(`button`,{className:`w-fit rounded-full border border-border px-3 py-1 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:e}):(0,m.jsx)(x,{}),C=({value:e})=>e==null?(0,m.jsx)(x,{}):e===!1?(0,m.jsx)(`div`,{className:`text-danger-strong`,children:(0,m.jsx)(h.XIcon,{})}):(0,m.jsx)(`div`,{className:`text-success-strong`,children:(0,m.jsx)(h.CheckIcon,{})}),w=({date:e})=>e==null?(0,m.jsx)(x,{}):(0,m.jsx)(o.r,{children:(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(a.t,{className:`h-fit`,children:(0,m.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,m.jsx)(o.n,{className:`rounded`,children:(0,m.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),T=({content:e})=>e==null?(0,m.jsx)(x,{}):(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(`div`,{className:`line-clamp-2 whitespace-pre-line break-all text-start text-[13px] text-text-positive-weak`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),E=({items:e=[]})=>(0,m.jsxs)(l.t,{children:[(0,m.jsx)(l.h,{asChild:!0,children:(0,m.jsx)(t.t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:(0,m.jsx)(h.MoreVerticalIcon,{})})}),(0,m.jsx)(l.r,{children:(0,m.jsx)(l.i,{children:e.map(e=>(0,m.jsx)(l.a,{className:`px-3`,onSelect:()=>e.onClick(e.id),children:e.label},e.id))})})]}),D=({name:e})=>e?(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.jsx)(r.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start text-sm`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,m.jsx)(x,{}),O=({href:e,label:t})=>(0,m.jsxs)(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,m.jsx)(`span`,{children:t||e}),(0,m.jsx)(h.ExternalLinkIcon,{size:14})]}),k=({value:e})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(`p`,{className:`font-number text-secondary-foreground text-sm tabular-nums`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,m.jsx)(o.n,{align:`start`,children:(0,m.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),A=({title:e,onClick:n})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.jsx)(t.t,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:(0,g.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),await n?.()},[n]),children:(0,m.jsx)(h.Trash2Icon,{})})}),(0,m.jsx)(o.n,{children:(0,m.jsx)(`p`,{children:e||`Remove item from list table`})})]}),j=(e,t,n)=>{let r=10**t;switch(n){case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:return Math.round(e*r)/r}},M=(0,g.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=(0,g.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=(0,g.useCallback)(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=j(e,a,o)),t.toLocaleString(`en-US`,u)},[o,u,a]),f=(0,g.useMemo)(()=>{if(typeof l==`number`)return Number.isNaN(l)||!Number.isFinite(l)?`N/A`:d(l);if(typeof l==`string`){let e=l.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:d(t)}return`N/A`},[l,d]),h=(0,g.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return h===`0`||h===`N/A`||!h?(0,m.jsx)(x,{}):(0,m.jsxs)(n.t,{padding:`none`,className:(0,p.cn)(`font-number text-lg text-secondary-foreground tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[r,(0,m.jsx)(`p`,{children:h}),i]})});M.displayName=`UITableStatisticDisplay`;const N=({uuid:e,username:t,email:i})=>(0,m.jsxs)(n.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{className:`bg-muted-weak`,children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{style:{backgroundColor:_.colorHashLight.hex(e)},children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-white`})})}),(0,m.jsxs)(n.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,m.jsx)(r.t,{className:`font-medium text-sm text-text-positive-weak`,children:t??`Unknown User`}),(0,m.jsx)(r.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),P=(0,g.createContext)(null),F=()=>{let e=(0,g.use)(P);if(!e)throw Error(`useUITableClickRowContext must be used within a TableClickRowProvider`);return e},I=(0,g.createContext)(null),L=()=>{let e=(0,g.use)(I);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},ee=60,te=20,ne=20,R=e=>{let t=e.getIsPinned();return{zIndex:t?20:void 0,left:t===`left`?`${e.getStart(`left`)}px`:void 0,right:t===`right`?`${e.getAfter(`right`)}px`:void 0}},z=({className:e,children:t,...n})=>(0,m.jsx)(`div`,{"data-slot":`table-wrapper`,className:`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2 py-2.5 text-sm`,...n,children:t}),B=(0,g.memo)(({children:e})=>(0,m.jsx)(`thead`,{"data-slot":`table-header`,style:{zIndex:20},className:(0,p.cn)(`sticky top-0 grid bg-muted-bg-subtle text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:flex`,`[&_th]:h-9`,`[&_th]:select-none`,`[&_th]:items-center`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:font-medium`,`[&_th]:text-left`,`[&_th]:align-middle`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_th]:data-[pinned=right]:border-l`,`[&_th]:data-[pinned=right]:border-r-0`,`[&_th]:data-[pinned=left]:border-r`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`),children:e}));B.displayName=`TableHeader`;const V=(0,g.memo)(({children:e})=>(0,m.jsx)(`tr`,{"data-slot":`table-header-row`,className:`flex w-full border-border border-b shadow`,children:e}));V.displayName=`TableHeaderRow`;const H=({header:e,isPinned:t,isResizing:n,isAllRowsSelected:r,children:i,...a})=>{let o=R(e.column),s=`calc(var(--header-${e.id}-size) * 1px)`;return e.id===`select`?(0,m.jsx)(`th`,{"data-slot":`table-header-cell`,style:{...o,width:60},className:(0,p.cn)(t?`sticky`:`relative`),...a,children:(0,m.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,m.jsx)(u.t,{"aria-label":`Select All Rows`,checked:r,onCheckedChange:t=>{e.getContext().table.toggleAllRowsSelected(!!t)}})})}):(0,m.jsxs)(`th`,{"data-slot":`table-header-cell`,"data-pinned":t,style:{...o,width:s},colSpan:e.colSpan,className:(0,p.cn)(`group relative`,t?`sticky`:`relative`),...a,children:[(0,m.jsx)(`div`,{className:`absolute inset-0 gap-1 truncate`,children:(0,m.jsx)(`div`,{className:`flex h-full flex-1 cursor-pointer select-none items-center justify-between`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-1 items-center truncate pl-4`,children:(0,v.flexRender)(e.column.columnDef.header,e.getContext())})})}),![`select`,`actions`].includes(e.id)&&(0,m.jsx)(U,{isPinned:t,isVisible:e.column.getIsVisible(),className:`invisible absolute right-2 z-10 group-hover:visible`,onLeftPin:e.column.pin,onRightPin:e.column.pin,onUnpin:e.column.pin,onToggleVisibilityHandler:e.column.toggleVisibility}),(0,m.jsx)(g.Activity,{mode:t?`hidden`:`visible`,children:(0,m.jsx)(`div`,{onDoubleClick:e.column.resetSize,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:(0,p.cn)(`absolute inset-y-0 -right-0.5 w-1 cursor-e-resize bg-transparent hover:bg-border`,n&&`bg-border`)})})]})},U=({isPinned:e,className:t,onLeftPin:n,onRightPin:r,onUnpin:i,onToggleVisibilityHandler:a})=>{let o=(0,g.useCallback)(()=>{n(`left`)},[n]),s=(0,g.useCallback)(()=>{r(`right`)},[r]),c=(0,g.useCallback)(()=>{i(!1)},[i]);return(0,m.jsxs)(l.t,{children:[(0,m.jsx)(l.h,{asChild:!0,children:(0,m.jsx)(`button`,{className:(0,p.cn)(`cursor-pointer rounded-full p-0.5 text-text-positive-weak hover:bg-muted-muted hover:text-text-positive [&>svg]:size-4`,t),children:(0,m.jsx)(h.EllipsisVerticalIcon,{})})}),(0,m.jsxs)(l.r,{align:`end`,className:`w-64 p-4`,children:[(0,m.jsxs)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,m.jsx)(g.Activity,{mode:e?`visible`:`hidden`,children:(0,m.jsxs)(l.a,{onClick:c,children:[!!e&&`Unpin`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.PinOffIcon,{className:`size-4`})})]})}),(0,m.jsxs)(g.Activity,{mode:e?`hidden`:`visible`,children:[(0,m.jsxs)(l.a,{onClick:o,children:[e?`Unpin`:`Pin to Left`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.MoveLeftIcon,{className:`size-4`})})]}),(0,m.jsxs)(l.a,{onClick:s,children:[e?`Unpin`:`Pin to Right`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.MoveRightIcon,{className:`size-4`})})]})]})]}),(0,m.jsx)(l.u,{}),(0,m.jsx)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:(0,m.jsxs)(l.a,{onClick:()=>a(!1),children:[`Hide Field`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.EyeOffIcon,{className:`size-4`})})]})})]})]})},W=({height:e,children:t,...n})=>(0,m.jsx)(`tbody`,{"data-slot":`table-body`,style:{height:`${e}px`},className:(0,p.cn)(`relative grid w-full bg-card`,`[&_tr]:absolute [&_tr]:flex [&_tr]:w-full [&_tr]:cursor-pointer [&_tr]:border-b [&_tr]:border-b-border [&_tr]:focus:outline-none`,`[&_td]:z-10`,`[&_td]:flex`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[pinned=right]:border-l`,`[&_td]:data-[pinned=left]:border-r`,`[&_td:not([data-pinned=false])]:bg-card`,`[&_td:not([data-pinned=false])]:shadow-xs`),...n,children:t}),G=(0,g.memo)(({children:e,keyOfClickRow:t,row:n,virtualRow:r,rowVirtualizer:i,onClickRow:a,className:o,...s})=>{let{columnPinning:c}=L(),l=(0,g.useCallback)(e=>{let i=t?n.original?.[t]:void 0;typeof i==`string`||typeof i==`number`?a?.(r.index,i):a?.(r.index),e.preventDefault(),e.stopPropagation()},[t,a,n.original,r.index]);return(0,m.jsx)(`tr`,{"data-slot":`table-row`,"data-index":r.index,ref:e=>i.measureElement(e),style:{transform:`translateY(${r.start}px)`},className:(0,p.cn)(`group`,o),onClick:l,...s,children:n.getVisibleCells().map(e=>(0,m.jsx)(K,{cell:e,className:`group-hover:bg-muted-bg-subtle!`},e.id))})});G.displayName=`TableRow`;const K=(0,g.memo)(({cell:e,children:t,className:n,...r})=>{let{rowSelection:i}=L(),a=e.column.getIsPinned(),o=R(e.column),s=`calc(var(--col-${e.column.id}-size) * 1px)`,c=e.column.columnDef.meta?.position??`start`;return e.column.id===`select`?(0,m.jsx)(`td`,{"data-slot":`table-cell`,style:{...o,width:60},className:(0,p.cn)(`border-none! bg-transparent! shadow-none!`,a?`sticky`:`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`inline-flex w-full items-center justify-center bg-transparent text-center align-middle`,children:(0,m.jsx)(u.t,{"aria-label":`Select Row`,checked:e.row.getIsSelected(),onCheckedChange:t=>{e.row.toggleSelected(!!t)}})})}):(0,m.jsx)(`td`,{"data-slot":`table-cell`,"data-pinned":a,style:{...o,width:s},className:(0,p.cn)(a&&e.column.getPinnedIndex()===0&&`shadow!`,a&&`sticky`,!a&&`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:(0,p.cn)(`inline-flex w-full items-center bg-transparent text-center align-middle`,c===`start`&&`justify-start`,c===`center`&&`justify-center`,c===`end`&&`justify-end`),children:(0,v.flexRender)(e.column.columnDef.cell,e.getContext())})})});K.displayName=`TableCell`;const q=(0,g.memo)(()=>(0,m.jsx)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:(0,m.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,m.jsx)(h.BoxIcon,{strokeWidth:1,size:48}),(0,m.jsx)(`p`,{children:`No data available`})]})}));q.displayName=`EmptyDisplay`;const J=(0,g.memo)(()=>(0,m.jsx)(`div`,{className:`absolute top-0 z-30 flex size-full items-center justify-center bg-black/10`,children:(0,m.jsx)(h.LoaderIcon,{className:`animate-spin text-text-positive`})}));J.displayName=`RefetchingDisplay`;const Y=({children:e})=>(0,m.jsx)(`tfoot`,{"data-slot":`table-footer`,className:`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,children:e}),X=({children:e})=>{let{table:t,isEmpty:n,isRefetching:r,isFetching:i,data:a,totalRows:o,fetchMoreData:s}=L(),{keyOfClickRow:c,onClickRow:l}=F(),u=(0,g.useRef)(null),f=(0,g.useMemo)(()=>{let e=t.getFlatHeaders(),n={};return e.forEach(e=>{n[`--header-${e.id}-size`]=e.getSize()||0,n[`--col-${e.column.id}-size`]=e.column.getSize()||0}),n},[t.getState().columnSizingInfo,t.getState().columnSizing]),h=(0,g.useCallback)(async e=>{if(!e)return null;let{scrollHeight:t,scrollTop:n,clientHeight:r}=e;t-n-r<500&&!i&&o&&a.length<o&&s?.()},[i,a.length,o,s]);(0,g.useEffect)(()=>{h(u.current)},[h]);let{rows:_}=t.getRowModel(),v=(0,y.useVirtualizer)({count:_.length,estimateSize:()=>40,getScrollElement:()=>u.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2});return(0,m.jsxs)(d.r,{direction:`horizontal`,style:{direction:t.options.columnResizeDirection},className:(0,p.cn)(`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border bg-slate-50 p-0 text-sm`,!e&&`border-r border-r-border`),children:[(0,m.jsxs)(d.n,{className:`relative overflow-auto`,children:[(0,m.jsxs)(`div`,{ref:u,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border`,onScroll:e=>h(e.currentTarget),children:[(0,m.jsxs)(`table`,{"data-slot":`table`,style:{...f,width:t.getTotalSize()},className:`grid w-full max-w-full caption-bottom border-collapse border-spacing-0 flex-col content-start bg-card text-sm tabular-nums [&_tfoot_td]:border-t`,children:[(0,m.jsx)(B,{children:t.getHeaderGroups().map(e=>(0,m.jsx)(V,{children:e.headers.map(e=>(0,m.jsx)(H,{header:e,isPinned:e.column.getIsPinned(),isResizing:e.column.getIsResizing(),isAllRowsSelected:t.getIsAllRowsSelected()},e.id))},e.id))}),(0,m.jsx)(W,{"data-slot":`table-body`,height:v.getTotalSize(),children:v.getVirtualItems().map(e=>{let t=_[e.index];return(0,m.jsx)(G,{"data-index":e.index,keyOfClickRow:c,row:t,virtualRow:e,rowVirtualizer:v,onClickRow:l},t.id)})})]}),n&&(0,m.jsx)(q,{})]}),r&&(0,m.jsx)(J,{})]}),!!e&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.t,{}),e]})]})},Z=({checked:e,title:t,onCheckedChange:n})=>(0,m.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,m.jsx)(u.t,{checked:e,onCheckedChange:n}),(0,m.jsx)(`p`,{className:`text-sm`,children:t})]}),re=()=>{let{table:e}=L(),[n,r]=(0,g.useState)(null);return(0,m.jsx)(d.n,{defaultSize:25,className:(0,p.cn)(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:(0,m.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,m.jsxs)(`div`,{className:`flex-1`,children:[(0,m.jsx)(g.Activity,{mode:n===`columns`?`visible`:`hidden`,children:(0,m.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,m.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,m.jsx)(c.t,{}),(0,m.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,m.jsx)(Z,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,m.jsx)(g.Activity,{mode:n===`filters`?`visible`:`hidden`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,m.jsxs)(t.t,{variant:`outline`,color:`muted`,children:[(0,m.jsx)(h.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,m.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,m.jsxs)(`button`,{className:(0,p.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`columns`&&`bg-card`),onClick:()=>r(n===`columns`?null:`columns`),children:[(0,m.jsx)(h.Columns4Icon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,m.jsx)(c.t,{}),(0,m.jsxs)(`button`,{className:(0,p.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`filters`&&`bg-card`),onClick:()=>r(n===`filters`?null:`filters`),children:[(0,m.jsx)(h.ListFilterIcon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,m.jsx)(c.t,{})]})]})})},ie=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o,rightPinnedColumns:s,keyOfClickRow:c,onClickRow:l,fetchMoreData:u,children:d})=>{let[f,p]=(0,g.useState)({}),[h,_]=(0,g.useState)({right:s,left:o}),[y,b]=(0,g.useState)({}),x=(0,v.useReactTable)({data:r,columns:i,state:{rowSelection:f,columnPinning:h,columnVisibility:y},defaultColumn:{minSize:40,size:150,maxSize:800},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,getCoreRowModel:(0,v.getCoreRowModel)(),onRowSelectionChange:p,onColumnPinningChange:_,onColumnVisibilityChange:b}),S=(0,g.useMemo)(()=>{let{rows:e}=x.getRowModel();return e},[x.getRowModel().rows,x.getState().columnPinning]),C=(0,g.useMemo)(()=>!t&&S.length===0,[S,t]),w=(0,g.useMemo)(()=>({title:e,table:x,data:r,isEmpty:C,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:u,rowSelection:x.getState().rowSelection,columnPinning:x.getState().columnPinning}),[e,x,r,C,n,t,a,u,x.getState().columnVisibility,x.getState().rowSelection,x.getState().columnPinning]),T=(0,g.useMemo)(()=>({keyOfClickRow:c,onClickRow:l}),[c,l]);return(0,m.jsx)(I.Provider,{value:w,children:(0,m.jsx)(P.Provider,{value:T,children:d})})},ae=({onSearch:e,onChange:t,...n})=>{let r=(0,b.useDebounceCallback)(t=>{e?.(t)},500);return(0,m.jsxs)(`div`,{className:`relative w-full max-w-80 flex-1`,children:[(0,m.jsx)(f.t,{...n,size:`lg`,type:`search`,placeholder:`Search records...`,className:`flex-1 ps-9 pe-9`,onChange:e=>{t?.(e),r(e.target.value??``)}}),(0,m.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:(0,m.jsx)(h.SearchIcon,{size:16})}),(0,m.jsx)(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:(0,m.jsx)(h.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]})},Q=({children:e,disabled:t,onClick:n})=>(0,m.jsx)(`button`,{type:`button`,disabled:t,className:`flex cursor-pointer items-center gap-x-1 rounded-sm border border-border bg-background p-2.5 text-sm text-text-positive-weak outline-none transition-all hover:shadow-card focus:border-border-emphasis focus:bg-muted-muted active:border-border-emphasis active:bg-muted-muted active:text-text-positive disabled:pointer-events-none disabled:cursor-default disabled:opacity-60 [&_svg]:size-3.5`,onClick:n,children:e}),oe=({onCreate:e,onDownload:t,onRefresh:n})=>(0,m.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,m.jsx)(Q,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,m.jsx)(h.CirclePlus,{})}),(0,m.jsx)(Q,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.RefreshCwIcon,{})}),(0,m.jsx)(Q,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=L();return(0,m.jsxs)(`div`,{"data-slot":`table-tooltip`,className:`relative m-0 flex w-full flex-0 flex-col flex-wrap items-start space-y-2 p-0 px-2 text-sm`,children:[(0,m.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,m.jsx)(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};$.displayName=`TableTooltip`,exports.UITableBadgeDisplay=S,exports.UITableBooleanDisplay=C,exports.UITableContainer=X,exports.UITableDateDisplay=w,exports.UITableDescriptionDisplay=T,exports.UITableFilter=re,exports.UITableFooter=Y,exports.UITableMoreButton=E,exports.UITableNameDisplay=D,exports.UITablePermalink=O,exports.UITablePhoneNumberDisplay=k,exports.UITableProvider=ie,exports.UITableRemoveButton=A,exports.UITableStatisticDisplay=M,exports.UITableTooltip=$,exports.UITableTooltipActions=oe,exports.UITableTooltipFilter=ae,exports.UITableUserDataDisplay=N,exports.UITableWrapper=z;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-Bo2vzQp5.cjs`);const t=require(`../../button-BLYTfCyl.cjs`),n=require(`../../flex-DGPQRbN6.cjs`),r=require(`../../paragraph-B9_-MKH8.cjs`),i=require(`../../date-CuRT4hmU.cjs`),a=require(`../../badge-CsDmp3ys.cjs`),o=require(`../../tooltip-DMFoP_sB.cjs`),s=require(`../../avatar-dAu1c0bC.cjs`),c=require(`../../separator-DSZyCT2g.cjs`),l=require(`../../dropdown-menu-5Zyw5t_J.cjs`),u=require(`../../checkbox-DDuYFG0R.cjs`),d=require(`../../resizable-BS63Xwia.cjs`),f=require(`../../input-dAoEznUI.cjs`);let p=require(`@customafk/react-toolkit/utils`),m=require(`react/jsx-runtime`),h=require(`lucide-react`),g=require(`react`),_=require(`@customafk/react-toolkit/color-hash`),v=require(`@tanstack/react-table`),y=require(`@tanstack/react-virtual`),b=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const x=()=>(0,m.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,m.jsx)(h.MinusIcon,{size:16}),(0,m.jsx)(h.MinusIcon,{size:16})]}),S=({label:e,onClick:t,onRemove:n})=>e?n?(0,m.jsxs)(`div`,{className:`flex w-fit gap-x-0.5 rounded-full border border-border py-1 pr-2 pl-3 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:[e,(0,m.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.XIcon,{size:12})})]}):(0,m.jsx)(`button`,{className:`w-fit rounded-full border border-border px-3 py-1 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:e}):(0,m.jsx)(x,{}),C=({value:e})=>e==null?(0,m.jsx)(x,{}):e===!1?(0,m.jsx)(`div`,{className:`text-danger-strong`,children:(0,m.jsx)(h.XIcon,{})}):(0,m.jsx)(`div`,{className:`text-success-strong`,children:(0,m.jsx)(h.CheckIcon,{})}),w=({date:e})=>e==null?(0,m.jsx)(x,{}):(0,m.jsx)(o.r,{children:(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(a.t,{className:`h-fit`,children:(0,m.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,m.jsx)(o.n,{className:`rounded`,children:(0,m.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),T=({content:e})=>e==null?(0,m.jsx)(x,{}):(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(`div`,{className:`line-clamp-2 whitespace-pre-line break-all text-start text-[13px] text-text-positive-weak`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),E=({items:e=[]})=>(0,m.jsxs)(l.t,{children:[(0,m.jsx)(l.h,{asChild:!0,children:(0,m.jsx)(t.t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:(0,m.jsx)(h.MoreVerticalIcon,{})})}),(0,m.jsx)(l.r,{children:(0,m.jsx)(l.i,{children:e.map(e=>(0,m.jsx)(l.a,{className:`px-3`,onSelect:()=>e.onClick(e.id),children:e.label},e.id))})})]}),D=({name:e})=>e?(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.jsx)(r.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start text-sm`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,m.jsx)(x,{}),O=({href:e,label:t})=>(0,m.jsxs)(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,m.jsx)(`span`,{children:t||e}),(0,m.jsx)(h.ExternalLinkIcon,{size:14})]}),k=({value:e})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(`p`,{className:`font-number text-secondary-foreground text-sm tabular-nums`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,m.jsx)(o.n,{align:`start`,children:(0,m.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),A=({title:e,onClick:n})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.jsx)(t.t,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:(0,g.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),await n?.()},[n]),children:(0,m.jsx)(h.Trash2Icon,{})})}),(0,m.jsx)(o.n,{children:(0,m.jsx)(`p`,{children:e||`Remove item from list table`})})]}),j=(e,t,n)=>{let r=10**t;switch(n){case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:return Math.round(e*r)/r}},M=(0,g.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=(0,g.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=(0,g.useCallback)(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=j(e,a,o)),t.toLocaleString(`en-US`,u)},[o,u,a]),f=(0,g.useMemo)(()=>{if(typeof l==`number`)return Number.isNaN(l)||!Number.isFinite(l)?`N/A`:d(l);if(typeof l==`string`){let e=l.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:d(t)}return`N/A`},[l,d]),h=(0,g.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return h===`0`||h===`N/A`||!h?(0,m.jsx)(x,{}):(0,m.jsxs)(n.t,{padding:`none`,className:(0,p.cn)(`font-number text-lg text-secondary-foreground tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[r,(0,m.jsx)(`p`,{children:h}),i]})});M.displayName=`UITableStatisticDisplay`;const N=({uuid:e,username:t,email:i})=>(0,m.jsxs)(n.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{className:`bg-muted-weak`,children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{style:{backgroundColor:_.colorHashLight.hex(e)},children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-white`})})}),(0,m.jsxs)(n.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,m.jsx)(r.t,{className:`font-medium text-sm text-text-positive-weak`,children:t??`Unknown User`}),(0,m.jsx)(r.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),P=(0,g.createContext)(null),F=()=>{let e=(0,g.use)(P);if(!e)throw Error(`useUITableClickRowContext must be used within a TableClickRowProvider`);return e},I=(0,g.createContext)(null),L=()=>{let e=(0,g.use)(I);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},ee=60,te=20,ne=20,R=e=>{let t=e.getIsPinned();return{zIndex:t?20:void 0,left:t===`left`?`${e.getStart(`left`)}px`:void 0,right:t===`right`?`${e.getAfter(`right`)}px`:void 0}},z=({className:e,children:t,...n})=>(0,m.jsx)(`div`,{"data-slot":`table-wrapper`,className:`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2 py-2.5 text-sm`,...n,children:t}),B=(0,g.memo)(({children:e})=>(0,m.jsx)(`thead`,{"data-slot":`table-header`,style:{zIndex:20},className:(0,p.cn)(`sticky top-0 grid bg-muted-bg-subtle text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:flex`,`[&_th]:h-9`,`[&_th]:select-none`,`[&_th]:items-center`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:font-medium`,`[&_th]:text-left`,`[&_th]:align-middle`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`),children:e}));B.displayName=`TableHeader`;const V=(0,g.memo)(({children:e})=>(0,m.jsx)(`tr`,{"data-slot":`table-header-row`,className:`flex w-full border-border border-b shadow`,children:e}));V.displayName=`TableHeaderRow`;const H=({header:e,isPinned:t,isResizing:n,isAllRowsSelected:r,children:i,...a})=>{let o=e.getContext().table.getLeftHeaderGroups()[0].headers,s=e.getContext().table.getRightHeaderGroups()[0].headers,c=o[o.length-1]?.id,l=s[0]?.id,d=R(e.column),f=`calc(var(--header-${e.id}-size) * 1px)`;return e.id===`select`?(0,m.jsx)(`th`,{"data-slot":`table-header-cell`,style:{...d,width:60},className:(0,p.cn)(t?`sticky`:`relative`),...a,children:(0,m.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,m.jsx)(u.t,{"aria-label":`Select All Rows`,checked:r,onCheckedChange:t=>{e.getContext().table.toggleAllRowsSelected(!!t)}})})}):(0,m.jsxs)(`th`,{"data-slot":`table-header-cell`,"data-pinned":t,style:{...d,width:f},colSpan:e.colSpan,className:(0,p.cn)(`group relative`,t?`sticky`:`relative`,t===`left`&&e.id===c&&`border-r border-r-border`,t===`right`&&e.id===l&&`border-l border-l-border`),...a,children:[(0,m.jsx)(`div`,{className:`absolute inset-0 gap-1 truncate`,children:(0,m.jsx)(`div`,{className:`flex h-full flex-1 cursor-pointer select-none items-center justify-between`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-1 items-center truncate pl-4`,children:(0,v.flexRender)(e.column.columnDef.header,e.getContext())})})}),![`select`,`actions`].includes(e.id)&&(0,m.jsx)(U,{isPinned:t,isVisible:e.column.getIsVisible(),className:`invisible absolute right-2 z-10 group-hover:visible`,onLeftPin:e.column.pin,onRightPin:e.column.pin,onUnpin:e.column.pin,onToggleVisibilityHandler:e.column.toggleVisibility}),(0,m.jsx)(g.Activity,{mode:t?`hidden`:`visible`,children:(0,m.jsx)(`div`,{onDoubleClick:e.column.resetSize,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:(0,p.cn)(`absolute inset-y-0 -right-0.5 w-1 cursor-e-resize bg-transparent hover:bg-border`,n&&`bg-border`)})})]})},U=({isPinned:e,className:t,onLeftPin:n,onRightPin:r,onUnpin:i,onToggleVisibilityHandler:a})=>{let o=(0,g.useCallback)(()=>{n(`left`)},[n]),s=(0,g.useCallback)(()=>{r(`right`)},[r]),c=(0,g.useCallback)(()=>{i(!1)},[i]);return(0,m.jsxs)(l.t,{children:[(0,m.jsx)(l.h,{asChild:!0,children:(0,m.jsx)(`button`,{className:(0,p.cn)(`cursor-pointer rounded-full p-0.5 text-text-positive-weak hover:bg-muted-muted hover:text-text-positive [&>svg]:size-4`,t),children:(0,m.jsx)(h.EllipsisVerticalIcon,{})})}),(0,m.jsxs)(l.r,{align:`end`,className:`w-64 p-4`,children:[(0,m.jsxs)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,m.jsx)(g.Activity,{mode:e?`visible`:`hidden`,children:(0,m.jsxs)(l.a,{onClick:c,children:[!!e&&`Unpin`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.PinOffIcon,{className:`size-4`})})]})}),(0,m.jsxs)(g.Activity,{mode:e?`hidden`:`visible`,children:[(0,m.jsxs)(l.a,{onClick:o,children:[e?`Unpin`:`Pin to Left`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.MoveLeftIcon,{className:`size-4`})})]}),(0,m.jsxs)(l.a,{onClick:s,children:[e?`Unpin`:`Pin to Right`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.MoveRightIcon,{className:`size-4`})})]})]})]}),(0,m.jsx)(l.u,{}),(0,m.jsx)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:(0,m.jsxs)(l.a,{onClick:()=>a(!1),children:[`Hide Field`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.EyeOffIcon,{className:`size-4`})})]})})]})]})},W=({height:e,children:t,...n})=>(0,m.jsx)(`tbody`,{"data-slot":`table-body`,style:{height:`${e}px`},className:(0,p.cn)(`relative grid w-full bg-card`,`[&_tr]:absolute [&_tr]:flex [&_tr]:w-full [&_tr]:cursor-pointer [&_tr]:border-b [&_tr]:border-b-border [&_tr]:focus:outline-none`,`[&_td]:z-10`,`[&_td]:flex`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td:not([data-pinned=false])]:bg-card`),...n,children:t}),G=(0,g.memo)(({children:e,keyOfClickRow:t,row:n,virtualRow:r,rowVirtualizer:i,onClickRow:a,className:o,...s})=>{let{columnPinning:c}=L(),l=(0,g.useCallback)(e=>{let i=t?n.original?.[t]:void 0;typeof i==`string`||typeof i==`number`?a?.(r.index,i):a?.(r.index),e.preventDefault(),e.stopPropagation()},[t,a,n.original,r.index]);return(0,m.jsx)(`tr`,{"data-slot":`table-row`,"data-index":r.index,ref:e=>i.measureElement(e),style:{transform:`translateY(${r.start}px)`},className:(0,p.cn)(`group`,o),onClick:l,...s,children:n.getVisibleCells().map(e=>(0,m.jsx)(K,{cell:e,className:`group-hover:bg-muted-bg-subtle!`},e.id))})});G.displayName=`TableRow`;const K=(0,g.memo)(({cell:e,children:t,className:n,...r})=>{let{rowSelection:i}=L(),a=e.column.getIsPinned(),o=e.getContext().table.getLeftHeaderGroups()[0].headers,s=e.getContext().table.getRightHeaderGroups()[0].headers,c=o[o.length-1]?.id,l=s[0]?.id,d=R(e.column),f=`calc(var(--col-${e.column.id}-size) * 1px)`,h=e.column.columnDef.meta?.position??`start`;return e.column.id===`select`?(0,m.jsx)(`td`,{"data-slot":`table-cell`,style:{...d,width:60},className:(0,p.cn)(`border-none! bg-transparent! shadow-none!`,a?`sticky`:`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`inline-flex w-full items-center justify-center bg-transparent text-center align-middle`,children:(0,m.jsx)(u.t,{"aria-label":`Select Row`,checked:e.row.getIsSelected(),onCheckedChange:t=>{e.row.toggleSelected(!!t)}})})}):(0,m.jsx)(`td`,{"data-slot":`table-cell`,"data-pinned":a,style:{...d,width:f},className:(0,p.cn)(a&&`sticky`,!a&&`relative`,a===`left`&&e.column.id===c&&`border-r border-r-border`,a===`right`&&e.column.id===l&&`border-l border-l-border`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:(0,p.cn)(`inline-flex w-full items-center bg-transparent text-center align-middle`,h===`start`&&`justify-start`,h===`center`&&`justify-center`,h===`end`&&`justify-end`),children:(0,v.flexRender)(e.column.columnDef.cell,e.getContext())})})});K.displayName=`TableCell`;const q=(0,g.memo)(()=>(0,m.jsx)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:(0,m.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,m.jsx)(h.BoxIcon,{strokeWidth:1,size:48}),(0,m.jsx)(`p`,{children:`No data available`})]})}));q.displayName=`EmptyDisplay`;const J=(0,g.memo)(()=>(0,m.jsx)(`div`,{className:`absolute top-0 z-30 flex size-full items-center justify-center bg-black/10`,children:(0,m.jsx)(h.LoaderIcon,{className:`animate-spin text-text-positive`})}));J.displayName=`RefetchingDisplay`;const Y=({children:e})=>(0,m.jsx)(`tfoot`,{"data-slot":`table-footer`,className:`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,children:e}),X=({children:e})=>{let{table:t,isEmpty:n,isRefetching:r,isFetching:i,data:a,totalRows:o,fetchMoreData:s}=L(),{keyOfClickRow:c,onClickRow:l}=F(),u=(0,g.useRef)(null),f=(0,g.useMemo)(()=>{let e=t.getFlatHeaders(),n={};return e.forEach(e=>{n[`--header-${e.id}-size`]=e.getSize()||0,n[`--col-${e.column.id}-size`]=e.column.getSize()||0}),n},[t.getState().columnSizingInfo,t.getState().columnSizing]),h=(0,g.useCallback)(async e=>{if(!e)return null;let{scrollHeight:t,scrollTop:n,clientHeight:r}=e;t-n-r<500&&!i&&o&&a.length<o&&s?.()},[i,a.length,o,s]);(0,g.useEffect)(()=>{h(u.current)},[h]);let{rows:_}=t.getRowModel(),v=(0,y.useVirtualizer)({count:_.length,estimateSize:()=>40,getScrollElement:()=>u.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2});return(0,m.jsxs)(d.r,{direction:`horizontal`,style:{direction:t.options.columnResizeDirection},className:(0,p.cn)(`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border bg-slate-50 p-0 text-sm`,!e&&`border-r border-r-border`),children:[(0,m.jsxs)(d.n,{className:`relative overflow-auto`,children:[(0,m.jsxs)(`div`,{ref:u,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border`,onScroll:e=>h(e.currentTarget),children:[(0,m.jsxs)(`table`,{"data-slot":`table`,style:{...f,width:t.getTotalSize()},className:`grid w-full max-w-full caption-bottom border-collapse border-spacing-0 flex-col content-start bg-card text-sm tabular-nums [&_tfoot_td]:border-t`,children:[(0,m.jsx)(B,{children:t.getHeaderGroups().map(e=>(0,m.jsx)(V,{children:e.headers.map(e=>(0,m.jsx)(H,{header:e,isPinned:e.column.getIsPinned(),isResizing:e.column.getIsResizing(),isAllRowsSelected:t.getIsAllRowsSelected()},e.id))},e.id))}),(0,m.jsx)(W,{"data-slot":`table-body`,height:v.getTotalSize(),children:v.getVirtualItems().map(e=>{let t=_[e.index];return(0,m.jsx)(G,{"data-index":e.index,keyOfClickRow:c,row:t,virtualRow:e,rowVirtualizer:v,onClickRow:l},t.id)})})]}),n&&(0,m.jsx)(q,{})]}),r&&(0,m.jsx)(J,{})]}),!!e&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.t,{}),e]})]})},Z=({checked:e,title:t,onCheckedChange:n})=>(0,m.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,m.jsx)(u.t,{checked:e,onCheckedChange:n}),(0,m.jsx)(`p`,{className:`text-sm`,children:t})]}),re=()=>{let{table:e}=L(),[n,r]=(0,g.useState)(null);return(0,m.jsx)(d.n,{defaultSize:25,className:(0,p.cn)(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:(0,m.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,m.jsxs)(`div`,{className:`flex-1`,children:[(0,m.jsx)(g.Activity,{mode:n===`columns`?`visible`:`hidden`,children:(0,m.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,m.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,m.jsx)(c.t,{}),(0,m.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,m.jsx)(Z,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,m.jsx)(g.Activity,{mode:n===`filters`?`visible`:`hidden`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,m.jsxs)(t.t,{variant:`outline`,color:`muted`,children:[(0,m.jsx)(h.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,m.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,m.jsxs)(`button`,{className:(0,p.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`columns`&&`bg-card`),onClick:()=>r(n===`columns`?null:`columns`),children:[(0,m.jsx)(h.Columns4Icon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,m.jsx)(c.t,{}),(0,m.jsxs)(`button`,{className:(0,p.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`filters`&&`bg-card`),onClick:()=>r(n===`filters`?null:`filters`),children:[(0,m.jsx)(h.ListFilterIcon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,m.jsx)(c.t,{})]})]})})},ie=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o,rightPinnedColumns:s,keyOfClickRow:c,onClickRow:l,fetchMoreData:u,children:d})=>{let[f,p]=(0,g.useState)({}),[h,_]=(0,g.useState)({right:s,left:o}),[y,b]=(0,g.useState)({}),x=(0,v.useReactTable)({data:r,columns:i,state:{rowSelection:f,columnPinning:h,columnVisibility:y},defaultColumn:{minSize:40,size:150,maxSize:800},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,getCoreRowModel:(0,v.getCoreRowModel)(),getGroupedRowModel:(0,v.getGroupedRowModel)(),getExpandedRowModel:(0,v.getExpandedRowModel)(),onRowSelectionChange:p,onColumnPinningChange:_,onColumnVisibilityChange:b}),S=(0,g.useMemo)(()=>{let{rows:e}=x.getRowModel();return e},[x.getRowModel().rows,x.getState().columnPinning]),C=(0,g.useMemo)(()=>!t&&S.length===0,[S,t]),w=(0,g.useMemo)(()=>({title:e,table:x,data:r,isEmpty:C,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:u,rowSelection:x.getState().rowSelection,columnPinning:x.getState().columnPinning}),[e,x,r,C,n,t,a,u,x.getState().columnVisibility,x.getState().rowSelection,x.getState().columnPinning]),T=(0,g.useMemo)(()=>({keyOfClickRow:c,onClickRow:l}),[c,l]);return(0,m.jsx)(I.Provider,{value:w,children:(0,m.jsx)(P.Provider,{value:T,children:d})})},ae=({onSearch:e,onChange:t,...n})=>{let r=(0,b.useDebounceCallback)(t=>{e?.(t)},500);return(0,m.jsxs)(`div`,{className:`relative w-full max-w-80 flex-1`,children:[(0,m.jsx)(f.t,{...n,size:`lg`,type:`search`,placeholder:`Search records...`,className:`flex-1 ps-9 pe-9`,onChange:e=>{t?.(e),r(e.target.value??``)}}),(0,m.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:(0,m.jsx)(h.SearchIcon,{size:16})}),(0,m.jsx)(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:(0,m.jsx)(h.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]})},Q=({children:e,disabled:t,onClick:n})=>(0,m.jsx)(`button`,{type:`button`,disabled:t,className:`flex cursor-pointer items-center gap-x-1 rounded-sm border border-border bg-background p-2.5 text-sm text-text-positive-weak outline-none transition-all hover:shadow-card focus:border-border-emphasis focus:bg-muted-muted active:border-border-emphasis active:bg-muted-muted active:text-text-positive disabled:pointer-events-none disabled:cursor-default disabled:opacity-60 [&_svg]:size-3.5`,onClick:n,children:e}),oe=({onCreate:e,onDownload:t,onRefresh:n})=>(0,m.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,m.jsx)(Q,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,m.jsx)(h.CirclePlus,{})}),(0,m.jsx)(Q,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.RefreshCwIcon,{})}),(0,m.jsx)(Q,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=L();return(0,m.jsxs)(`div`,{"data-slot":`table-tooltip`,className:`relative m-0 flex w-full flex-0 flex-col flex-wrap items-start space-y-2 p-0 px-2 text-sm`,children:[(0,m.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,m.jsx)(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};$.displayName=`TableTooltip`,exports.UITableBadgeDisplay=S,exports.UITableBooleanDisplay=C,exports.UITableContainer=X,exports.UITableDateDisplay=w,exports.UITableDescriptionDisplay=T,exports.UITableFilter=re,exports.UITableFooter=Y,exports.UITableMoreButton=E,exports.UITableNameDisplay=D,exports.UITablePermalink=O,exports.UITablePhoneNumberDisplay=k,exports.UITableProvider=ie,exports.UITableRemoveButton=A,exports.UITableStatisticDisplay=M,exports.UITableTooltip=$,exports.UITableTooltipActions=oe,exports.UITableTooltipFilter=ae,exports.UITableUserDataDisplay=N,exports.UITableWrapper=z;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|