@customafk/lunas-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/{button-DXPSlb3I.mjs → button-B2FJrOBP.mjs} +2 -2
- package/dist/{button-DXPSlb3I.mjs.map → button-B2FJrOBP.mjs.map} +1 -1
- package/dist/{button-Bji_SqMI.d.cts → button-BnFROtRM.d.cts} +4 -4
- package/dist/{button-C58TS8Pc.cjs → button-CYw2AqT0.cjs} +2 -2
- package/dist/{button-C58TS8Pc.cjs.map → button-CYw2AqT0.cjs.map} +1 -1
- package/dist/{button-PV-Xnryv.d.mts → button-IfNjnUO-.d.mts} +6 -6
- package/dist/{calendar-CEF9LSd4.mjs → calendar-Bt6qXSZb.mjs} +2 -2
- package/dist/{calendar-CEF9LSd4.mjs.map → calendar-Bt6qXSZb.mjs.map} +1 -1
- package/dist/{calendar-DT0NPRhB.cjs → calendar-BwWfk_Zk.cjs} +2 -2
- package/dist/{calendar-DT0NPRhB.cjs.map → calendar-BwWfk_Zk.cjs.map} +1 -1
- package/dist/cards/grid-product-card.cjs +1 -1
- package/dist/cards/grid-product-card.mjs +1 -1
- package/dist/cards/product-card.cjs +1 -1
- package/dist/cards/product-card.mjs +1 -1
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/{dialog-DKZ8BLxc.d.mts → dialog-CyLgmqny.d.cts} +12 -12
- package/dist/{dialog-7127ChM2.d.cts → dialog-lFDfcYPP.d.mts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +24 -24
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +24 -24
- package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +23 -23
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +51 -51
- package/dist/features/tanstack-form/index.d.mts +224 -224
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/{input-D0enZTLC.d.cts → input-Bm0YXroi.d.cts} +6 -6
- package/dist/{input-DkvHV_UU.d.mts → input-CLlVXOR2.d.mts} +6 -6
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/flex.d.mts +4 -4
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.cjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureDeveloping.mjs +1 -1
- package/dist/pages/FeatureFixing.cjs +1 -1
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/FeatureFixing.mjs +1 -1
- package/dist/pages/NotAuthorized.cjs +1 -1
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.mjs +1 -1
- package/dist/pages/NotFound.cjs +1 -1
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/pages/NotFound.mjs +1 -1
- package/dist/typography/paragraph.d.cts +3 -3
- package/dist/typography/paragraph.d.mts +5 -5
- package/dist/typography/title.d.cts +2 -2
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +5 -5
- 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 +2 -2
- package/dist/ui/badge.d.mts +4 -4
- 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.cjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/button.mjs +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.mjs +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.mjs +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.mjs +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.mjs +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.mjs +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/calendar.mjs +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/carousel.mjs +1 -1
- 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 +13 -13
- package/dist/ui/file-uploader.cjs +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/file-uploader.mjs +1 -1
- 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 +14 -14
- package/dist/ui/item.d.mts +14 -14
- 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.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/multi-select.mjs +1 -1
- 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 +6 -6
- package/dist/ui/popover.d.mts +6 -6
- 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 +9 -9
- package/dist/ui/resizable.d.mts +9 -9
- package/dist/ui/scroll-area.d.cts +6 -6
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.mts +9 -9
- 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.cjs +1 -1
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +26 -26
- package/dist/ui/sidebar.mjs +1 -1
- 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 +4 -4
- package/dist/ui/toggle.d.mts +2 -2
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
1
|
+
import { t as Button } from "../../../button-BnFROtRM.cjs";
|
|
2
2
|
import { Separator } from "../../../ui/separator.cjs";
|
|
3
3
|
import { TooltipContent } from "../../../ui/tooltip.cjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
5
5
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
7
7
|
|
|
@@ -28,7 +28,7 @@ declare function SidebarProvider({
|
|
|
28
28
|
defaultOpen?: boolean;
|
|
29
29
|
open?: boolean;
|
|
30
30
|
onOpenChange?: (open: boolean) => void;
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
32
32
|
declare function Sidebar({
|
|
33
33
|
side,
|
|
34
34
|
variant,
|
|
@@ -40,67 +40,67 @@ declare function Sidebar({
|
|
|
40
40
|
side?: 'left' | 'right';
|
|
41
41
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
42
42
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
43
|
-
}):
|
|
43
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
44
44
|
declare function DetailDialogSidebarTrigger({
|
|
45
45
|
className,
|
|
46
46
|
onClick,
|
|
47
47
|
...props
|
|
48
|
-
}: React.ComponentProps<typeof Button>):
|
|
48
|
+
}: React.ComponentProps<typeof Button>): react_jsx_runtime2.JSX.Element;
|
|
49
49
|
declare function DetailDialogSidebarRail({
|
|
50
50
|
className,
|
|
51
51
|
...props
|
|
52
|
-
}: React.ComponentProps<'button'>):
|
|
52
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
|
|
53
53
|
declare function SidebarInset({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<'main'>):
|
|
56
|
+
}: React.ComponentProps<'main'>): react_jsx_runtime2.JSX.Element;
|
|
57
57
|
declare function DetailDialogSidebarHeader({
|
|
58
58
|
className,
|
|
59
59
|
...props
|
|
60
|
-
}: React.ComponentProps<'div'>):
|
|
60
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
61
61
|
declare function DetailDialogSidebarFooter({
|
|
62
62
|
className,
|
|
63
63
|
children,
|
|
64
64
|
...props
|
|
65
|
-
}: React.ComponentProps<'div'>):
|
|
65
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
66
66
|
declare function DetailDialogSidebarSeparator({
|
|
67
67
|
className,
|
|
68
68
|
...props
|
|
69
|
-
}: React.ComponentProps<typeof Separator>):
|
|
69
|
+
}: React.ComponentProps<typeof Separator>): react_jsx_runtime2.JSX.Element;
|
|
70
70
|
declare function DetailDialogSidebarContent({
|
|
71
71
|
className,
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<'div'>):
|
|
73
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
74
74
|
declare function DetailDialogSidebarGroup({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'div'>):
|
|
77
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
78
78
|
declare function DetailDialogSidebarGroupLabel({
|
|
79
79
|
className,
|
|
80
80
|
asChild,
|
|
81
81
|
...props
|
|
82
82
|
}: React.ComponentProps<'div'> & {
|
|
83
83
|
asChild?: boolean;
|
|
84
|
-
}):
|
|
84
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
85
85
|
declare function DetailDialogSidebarGroupAction({
|
|
86
86
|
className,
|
|
87
87
|
asChild,
|
|
88
88
|
...props
|
|
89
89
|
}: React.ComponentProps<'button'> & {
|
|
90
90
|
asChild?: boolean;
|
|
91
|
-
}):
|
|
91
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
92
92
|
declare function DetailDialogSidebarGroupContent({
|
|
93
93
|
className,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<'div'>):
|
|
95
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
96
96
|
declare function DetailDialogSidebarMenu({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'ul'>):
|
|
99
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime2.JSX.Element;
|
|
100
100
|
declare function DetailDialogSidebarMenuItem({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'li'>):
|
|
103
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime2.JSX.Element;
|
|
104
104
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
105
105
|
variant?: "default" | "outline" | null | undefined;
|
|
106
106
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
@@ -117,7 +117,7 @@ declare function DetailDialogSidebarMenuButton({
|
|
|
117
117
|
asChild?: boolean;
|
|
118
118
|
isActive?: boolean;
|
|
119
119
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
120
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
120
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime2.JSX.Element;
|
|
121
121
|
declare function DetailDialogSidebarMenuAction({
|
|
122
122
|
className,
|
|
123
123
|
asChild,
|
|
@@ -126,26 +126,26 @@ declare function DetailDialogSidebarMenuAction({
|
|
|
126
126
|
}: React.ComponentProps<'button'> & {
|
|
127
127
|
asChild?: boolean;
|
|
128
128
|
showOnHover?: boolean;
|
|
129
|
-
}):
|
|
129
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
130
130
|
declare function DetailDialogSidebarMenuBadge({
|
|
131
131
|
className,
|
|
132
132
|
...props
|
|
133
|
-
}: React.ComponentProps<'div'>):
|
|
133
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
134
134
|
declare function DetailDialogSidebarMenuSkeleton({
|
|
135
135
|
className,
|
|
136
136
|
showIcon,
|
|
137
137
|
...props
|
|
138
138
|
}: React.ComponentProps<'div'> & {
|
|
139
139
|
showIcon?: boolean;
|
|
140
|
-
}):
|
|
140
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
141
141
|
declare function DetailDialogSidebarMenuSub({
|
|
142
142
|
className,
|
|
143
143
|
...props
|
|
144
|
-
}: React.ComponentProps<'ul'>):
|
|
144
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime2.JSX.Element;
|
|
145
145
|
declare function DetailDialogSidebarMenuSubItem({
|
|
146
146
|
className,
|
|
147
147
|
...props
|
|
148
|
-
}: React.ComponentProps<'li'>):
|
|
148
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime2.JSX.Element;
|
|
149
149
|
declare function DetailDialogSidebarMenuSubButton({
|
|
150
150
|
asChild,
|
|
151
151
|
size,
|
|
@@ -156,7 +156,7 @@ declare function DetailDialogSidebarMenuSubButton({
|
|
|
156
156
|
asChild?: boolean;
|
|
157
157
|
size?: 'sm' | 'md';
|
|
158
158
|
isActive?: boolean;
|
|
159
|
-
}):
|
|
159
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
160
160
|
//#endregion
|
|
161
161
|
export { DetailDialogSidebarContent, DetailDialogSidebarFooter, DetailDialogSidebarGroup, DetailDialogSidebarGroupAction, DetailDialogSidebarGroupContent, DetailDialogSidebarGroupLabel, DetailDialogSidebarHeader, DetailDialogSidebarMenu, DetailDialogSidebarMenuAction, DetailDialogSidebarMenuBadge, DetailDialogSidebarMenuButton, DetailDialogSidebarMenuItem, DetailDialogSidebarMenuSkeleton, DetailDialogSidebarMenuSub, DetailDialogSidebarMenuSubButton, DetailDialogSidebarMenuSubItem, DetailDialogSidebarRail, DetailDialogSidebarSeparator, DetailDialogSidebarTrigger, Sidebar, SidebarInset, SidebarProvider, useSidebar };
|
|
162
162
|
//# sourceMappingURL=sidebar.d.cts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
1
|
+
import { t as Button } from "../../../button-IfNjnUO-.mjs";
|
|
2
2
|
import { Separator } from "../../../ui/separator.mjs";
|
|
3
3
|
import { TooltipContent } from "../../../ui/tooltip.mjs";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
6
6
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
7
|
|
|
8
8
|
//#region packages/components/dialogs/detail-dialog/components/sidebar.d.ts
|
|
@@ -28,7 +28,7 @@ declare function SidebarProvider({
|
|
|
28
28
|
defaultOpen?: boolean;
|
|
29
29
|
open?: boolean;
|
|
30
30
|
onOpenChange?: (open: boolean) => void;
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
32
32
|
declare function Sidebar({
|
|
33
33
|
side,
|
|
34
34
|
variant,
|
|
@@ -40,67 +40,67 @@ declare function Sidebar({
|
|
|
40
40
|
side?: 'left' | 'right';
|
|
41
41
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
42
42
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
43
|
-
}):
|
|
43
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
44
44
|
declare function DetailDialogSidebarTrigger({
|
|
45
45
|
className,
|
|
46
46
|
onClick,
|
|
47
47
|
...props
|
|
48
|
-
}: React.ComponentProps<typeof Button>):
|
|
48
|
+
}: React.ComponentProps<typeof Button>): react_jsx_runtime4.JSX.Element;
|
|
49
49
|
declare function DetailDialogSidebarRail({
|
|
50
50
|
className,
|
|
51
51
|
...props
|
|
52
|
-
}: React.ComponentProps<'button'>):
|
|
52
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime4.JSX.Element;
|
|
53
53
|
declare function SidebarInset({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<'main'>):
|
|
56
|
+
}: React.ComponentProps<'main'>): react_jsx_runtime4.JSX.Element;
|
|
57
57
|
declare function DetailDialogSidebarHeader({
|
|
58
58
|
className,
|
|
59
59
|
...props
|
|
60
|
-
}: React.ComponentProps<'div'>):
|
|
60
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime4.JSX.Element;
|
|
61
61
|
declare function DetailDialogSidebarFooter({
|
|
62
62
|
className,
|
|
63
63
|
children,
|
|
64
64
|
...props
|
|
65
|
-
}: React.ComponentProps<'div'>):
|
|
65
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime4.JSX.Element;
|
|
66
66
|
declare function DetailDialogSidebarSeparator({
|
|
67
67
|
className,
|
|
68
68
|
...props
|
|
69
|
-
}: React.ComponentProps<typeof Separator>):
|
|
69
|
+
}: React.ComponentProps<typeof Separator>): react_jsx_runtime4.JSX.Element;
|
|
70
70
|
declare function DetailDialogSidebarContent({
|
|
71
71
|
className,
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<'div'>):
|
|
73
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime4.JSX.Element;
|
|
74
74
|
declare function DetailDialogSidebarGroup({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'div'>):
|
|
77
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime4.JSX.Element;
|
|
78
78
|
declare function DetailDialogSidebarGroupLabel({
|
|
79
79
|
className,
|
|
80
80
|
asChild,
|
|
81
81
|
...props
|
|
82
82
|
}: React.ComponentProps<'div'> & {
|
|
83
83
|
asChild?: boolean;
|
|
84
|
-
}):
|
|
84
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
85
85
|
declare function DetailDialogSidebarGroupAction({
|
|
86
86
|
className,
|
|
87
87
|
asChild,
|
|
88
88
|
...props
|
|
89
89
|
}: React.ComponentProps<'button'> & {
|
|
90
90
|
asChild?: boolean;
|
|
91
|
-
}):
|
|
91
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
92
92
|
declare function DetailDialogSidebarGroupContent({
|
|
93
93
|
className,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<'div'>):
|
|
95
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime4.JSX.Element;
|
|
96
96
|
declare function DetailDialogSidebarMenu({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'ul'>):
|
|
99
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime4.JSX.Element;
|
|
100
100
|
declare function DetailDialogSidebarMenuItem({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'li'>):
|
|
103
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime4.JSX.Element;
|
|
104
104
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
105
105
|
variant?: "default" | "outline" | null | undefined;
|
|
106
106
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
@@ -117,7 +117,7 @@ declare function DetailDialogSidebarMenuButton({
|
|
|
117
117
|
asChild?: boolean;
|
|
118
118
|
isActive?: boolean;
|
|
119
119
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
120
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
120
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime4.JSX.Element;
|
|
121
121
|
declare function DetailDialogSidebarMenuAction({
|
|
122
122
|
className,
|
|
123
123
|
asChild,
|
|
@@ -126,26 +126,26 @@ declare function DetailDialogSidebarMenuAction({
|
|
|
126
126
|
}: React.ComponentProps<'button'> & {
|
|
127
127
|
asChild?: boolean;
|
|
128
128
|
showOnHover?: boolean;
|
|
129
|
-
}):
|
|
129
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
130
130
|
declare function DetailDialogSidebarMenuBadge({
|
|
131
131
|
className,
|
|
132
132
|
...props
|
|
133
|
-
}: React.ComponentProps<'div'>):
|
|
133
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime4.JSX.Element;
|
|
134
134
|
declare function DetailDialogSidebarMenuSkeleton({
|
|
135
135
|
className,
|
|
136
136
|
showIcon,
|
|
137
137
|
...props
|
|
138
138
|
}: React.ComponentProps<'div'> & {
|
|
139
139
|
showIcon?: boolean;
|
|
140
|
-
}):
|
|
140
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
141
141
|
declare function DetailDialogSidebarMenuSub({
|
|
142
142
|
className,
|
|
143
143
|
...props
|
|
144
|
-
}: React.ComponentProps<'ul'>):
|
|
144
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime4.JSX.Element;
|
|
145
145
|
declare function DetailDialogSidebarMenuSubItem({
|
|
146
146
|
className,
|
|
147
147
|
...props
|
|
148
|
-
}: React.ComponentProps<'li'>):
|
|
148
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime4.JSX.Element;
|
|
149
149
|
declare function DetailDialogSidebarMenuSubButton({
|
|
150
150
|
asChild,
|
|
151
151
|
size,
|
|
@@ -156,7 +156,7 @@ declare function DetailDialogSidebarMenuSubButton({
|
|
|
156
156
|
asChild?: boolean;
|
|
157
157
|
size?: 'sm' | 'md';
|
|
158
158
|
isActive?: boolean;
|
|
159
|
-
}):
|
|
159
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
160
160
|
//#endregion
|
|
161
161
|
export { DetailDialogSidebarContent, DetailDialogSidebarFooter, DetailDialogSidebarGroup, DetailDialogSidebarGroupAction, DetailDialogSidebarGroupContent, DetailDialogSidebarGroupLabel, DetailDialogSidebarHeader, DetailDialogSidebarMenu, DetailDialogSidebarMenuAction, DetailDialogSidebarMenuBadge, DetailDialogSidebarMenuButton, DetailDialogSidebarMenuItem, DetailDialogSidebarMenuSkeleton, DetailDialogSidebarMenuSub, DetailDialogSidebarMenuSubButton, DetailDialogSidebarMenuSubItem, DetailDialogSidebarRail, DetailDialogSidebarSeparator, DetailDialogSidebarTrigger, Sidebar, SidebarInset, SidebarProvider, useSidebar };
|
|
162
162
|
//# sourceMappingURL=sidebar.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import"../../../button.variants-DuuH1O0_.mjs";import{t as e}from"../../../button-DXPSlb3I.mjs";import{t}from"../../../skeleton-Ba6koCVf.mjs";import{i as n,n as r,r as i,t as a}from"../../../tooltip-B3dTcgcc.mjs";import{t as o}from"../../../separator-Bf0gymN4.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../../sheet-oadGRiie.mjs";import{cn as f}from"@customafk/react-toolkit/utils";import{cva as p}from"class-variance-authority";import{createContext as m,use as h,useCallback as g,useEffect as _,useMemo as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{MenuIcon as S}from"lucide-react";import{Slot as C}from"radix-ui";import{useIsMobile as w}from"@customafk/react-toolkit/hooks/useMobile";const T=m(null);function E(){let e=h(T);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function D({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=w(),[l,u]=y(!1),[d,p]=y(e),m=t??d,h=g(e=>{let t=typeof e==`function`?e(m):e;n?n(t):p(t),document.cookie=`detai_dialog_sidebar_state=${t}; path=/; max-age=604800`},[n,m]),x=g(()=>c?u(e=>!e):h(e=>!e),[c,h]);_(()=>{let e=e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let S=m?`expanded`:`collapsed`,C=v(()=>({state:S,isMobile:c,toggleSidebar:x,open:m,setOpen:h,openMobile:l,setOpenMobile:u}),[S,c,m,h,l,x]);return b(T.Provider,{value:C,children:b(i,{delayDuration:0,children:b(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`20rem`,"--sidebar-width-icon":`3rem`,...a},className:f(`group/sidebar-wrapper flex h-full min-h-[85dvh] w-full items-start has-data-[variant=inset]:bg-sidebar`,r),...s,children:o})})})}function O({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{state:o,isMobile:p,openMobile:m,setOpenMobile:h}=E();return n===`none`?b(`div`,{"data-slot":`sidebar`,className:f(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):p?b(d,{open:m,onOpenChange:h,...a,children:x(l,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`z-20 hidden w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground shadow-nav md:flex [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[x(c,{className:`sr-only`,children:[b(u,{children:`Sidebar`}),b(s,{children:`Displays the mobile sidebar.`})]}),b(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):x(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":o,"data-collapsible":o===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[b(`div`,{"data-slot":`sidebar-gap`,className:f(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),b(`div`,{"data-slot":`sidebar-container`,className:f(`absolute inset-y-0 z-20 hidden w-(--sidebar-width) shadow-nav transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,r),...a,children:b(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:f(`flex size-full flex-col shadow-nav`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:shadow-sm`),children:i})})]})}function k({className:t,onClick:n,...r}){let{toggleSidebar:i}=E();return x(e,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`secondary`,size:`icon`,className:f(`size-10 rounded-full [&_svg]:size-6!`,t),onClick:e=>{n?.(e),i()},...r,children:[b(S,{}),b(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function A({className:e,...t}){let{toggleSidebar:n}=E();return b(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:f(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear sm:flex`,`after:absolute`,`after:inset-y-0`,`after:left-1/2 after:w-0.5`,`hover:after:bg-sidebar-border`,`group-data-[side=left]:-right-4`,`group-data-[side=right]:left-0`,`in-data-[side=left]:cursor-w-resize`,`in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize`,`[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`group-data-[collapsible=offcanvas]:translate-x-0`,`group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function j({className:e,...t}){return b(`main`,{"data-slot":`sidebar-inset`,className:f(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2`,`md:peer-data-[variant=inset]:ml-0`,`md:peer-data-[variant=inset]:rounded-xl`,`md:peer-data-[variant=inset]:shadow-sm`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function M({className:e,...t}){return b(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function N({className:e,children:t,...n}){let{open:r}=E();return b(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:f(`flex flex-col gap-2 p-2`,e),...n,children:x(B,{children:[r&&b(V,{children:t}),b(V,{children:b(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})}function P({className:e,...t}){return b(o,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:f(`mx-2 w-auto bg-sidebar-border`,e),...t})}function F({className:e,...t}){return b(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:f(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,`group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function I({className:e,...t}){return b(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:f(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function L({className:e,asChild:t=!1,...n}){return b(t?C.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:f(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function R({className:e,asChild:t=!1,...n}){return b(t?C.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:f(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute`,`after:-inset-2`,`md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n})}function z({className:e,...t}){return b(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:f(`w-full text-sm`,e),...t})}function B({className:e,...t}){return b(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:f(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function V({className:e,...t}){return b(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:f(`group/menu-item relative`,e),...t})}const H=p([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:font-normal`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-8!`,`group-data-[collapsible=icon]:p-2!`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function U({asChild:e=!1,isActive:t=!1,variant:i=`default`,size:o=`default`,tooltip:s,className:c,...l}){let u=e?C.Slot:`button`,{state:d}=E(),p=b(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":o,"data-active":t,className:f(H({variant:i,size:o}),c),...l});return s?(typeof s==`string`&&(s={children:s}),x(a,{children:[b(n,{asChild:!0,children:p}),b(r,{side:`right`,align:`center`,hidden:d!==`collapsed`,...s})]})):p}function W({className:e,asChild:t=!1,showOnHover:n=!1,...r}){return b(t?C.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:f(`text-sidebar-foreground ring-sidebar-ring`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,n&&`$group-focus-within/menu-item:opacity-100`,n&&`group-hover/menu-item:opacity-100`,n&&`data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function G({className:e,...t}){return b(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:f(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 font-medium text-sidebar-foreground text-xs tabular-nums`,`peer-hover/menu-button:text-sidebar-accent-foreground`,`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function K({className:e,showIcon:n=!1,...r}){let i=v(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return x(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:f(`flex h-8 items-center gap-2 rounded-md px-2`,e),...r,children:[n&&b(t,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),b(t,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})}function q({className:e,...t}){return b(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:f(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-sidebar-border border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function J({className:e,...t}){return b(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:f(`group/menu-sub-item relative`,e),...t})}function Y({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){return b(e?C.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:f(`text-sidebar-foreground ring-sidebar-ring`,`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`focus-visible:ring-2`,`disabled:pointer-events-none`,`disabled:opacity-50`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`[&>span:last-child]:truncate`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent`,`data-[active=true]:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:hidden`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,r),...i})}export{F as DetailDialogSidebarContent,N as DetailDialogSidebarFooter,I as DetailDialogSidebarGroup,R as DetailDialogSidebarGroupAction,z as DetailDialogSidebarGroupContent,L as DetailDialogSidebarGroupLabel,M as DetailDialogSidebarHeader,B as DetailDialogSidebarMenu,W as DetailDialogSidebarMenuAction,G as DetailDialogSidebarMenuBadge,U as DetailDialogSidebarMenuButton,V as DetailDialogSidebarMenuItem,K as DetailDialogSidebarMenuSkeleton,q as DetailDialogSidebarMenuSub,Y as DetailDialogSidebarMenuSubButton,J as DetailDialogSidebarMenuSubItem,A as DetailDialogSidebarRail,P as DetailDialogSidebarSeparator,k as DetailDialogSidebarTrigger,O as Sidebar,j as SidebarInset,D as SidebarProvider,E as useSidebar};
|
|
1
|
+
"use client";import"../../../button.variants-DuuH1O0_.mjs";import{t as e}from"../../../button-B2FJrOBP.mjs";import{t}from"../../../skeleton-Ba6koCVf.mjs";import{i as n,n as r,r as i,t as a}from"../../../tooltip-B3dTcgcc.mjs";import{t as o}from"../../../separator-Bf0gymN4.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../../sheet-oadGRiie.mjs";import{cn as f}from"@customafk/react-toolkit/utils";import{cva as p}from"class-variance-authority";import{createContext as m,use as h,useCallback as g,useEffect as _,useMemo as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{MenuIcon as S}from"lucide-react";import{Slot as C}from"radix-ui";import{useIsMobile as w}from"@customafk/react-toolkit/hooks/useMobile";const T=m(null);function E(){let e=h(T);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function D({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=w(),[l,u]=y(!1),[d,p]=y(e),m=t??d,h=g(e=>{let t=typeof e==`function`?e(m):e;n?n(t):p(t),document.cookie=`detai_dialog_sidebar_state=${t}; path=/; max-age=604800`},[n,m]),x=g(()=>c?u(e=>!e):h(e=>!e),[c,h]);_(()=>{let e=e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let S=m?`expanded`:`collapsed`,C=v(()=>({state:S,isMobile:c,toggleSidebar:x,open:m,setOpen:h,openMobile:l,setOpenMobile:u}),[S,c,m,h,l,x]);return b(T.Provider,{value:C,children:b(i,{delayDuration:0,children:b(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`20rem`,"--sidebar-width-icon":`3rem`,...a},className:f(`group/sidebar-wrapper flex h-full min-h-[85dvh] w-full items-start has-data-[variant=inset]:bg-sidebar`,r),...s,children:o})})})}function O({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{state:o,isMobile:p,openMobile:m,setOpenMobile:h}=E();return n===`none`?b(`div`,{"data-slot":`sidebar`,className:f(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):p?b(d,{open:m,onOpenChange:h,...a,children:x(l,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`z-20 hidden w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground shadow-nav md:flex [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[x(c,{className:`sr-only`,children:[b(u,{children:`Sidebar`}),b(s,{children:`Displays the mobile sidebar.`})]}),b(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):x(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":o,"data-collapsible":o===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[b(`div`,{"data-slot":`sidebar-gap`,className:f(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),b(`div`,{"data-slot":`sidebar-container`,className:f(`absolute inset-y-0 z-20 hidden w-(--sidebar-width) shadow-nav transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,r),...a,children:b(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:f(`flex size-full flex-col shadow-nav`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:shadow-sm`),children:i})})]})}function k({className:t,onClick:n,...r}){let{toggleSidebar:i}=E();return x(e,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`secondary`,size:`icon`,className:f(`size-10 rounded-full [&_svg]:size-6!`,t),onClick:e=>{n?.(e),i()},...r,children:[b(S,{}),b(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function A({className:e,...t}){let{toggleSidebar:n}=E();return b(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:f(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear sm:flex`,`after:absolute`,`after:inset-y-0`,`after:left-1/2 after:w-0.5`,`hover:after:bg-sidebar-border`,`group-data-[side=left]:-right-4`,`group-data-[side=right]:left-0`,`in-data-[side=left]:cursor-w-resize`,`in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize`,`[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`group-data-[collapsible=offcanvas]:translate-x-0`,`group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function j({className:e,...t}){return b(`main`,{"data-slot":`sidebar-inset`,className:f(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2`,`md:peer-data-[variant=inset]:ml-0`,`md:peer-data-[variant=inset]:rounded-xl`,`md:peer-data-[variant=inset]:shadow-sm`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function M({className:e,...t}){return b(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function N({className:e,children:t,...n}){let{open:r}=E();return b(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:f(`flex flex-col gap-2 p-2`,e),...n,children:x(B,{children:[r&&b(V,{children:t}),b(V,{children:b(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})}function P({className:e,...t}){return b(o,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:f(`mx-2 w-auto bg-sidebar-border`,e),...t})}function F({className:e,...t}){return b(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:f(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,`group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function I({className:e,...t}){return b(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:f(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function L({className:e,asChild:t=!1,...n}){return b(t?C.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:f(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function R({className:e,asChild:t=!1,...n}){return b(t?C.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:f(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute`,`after:-inset-2`,`md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n})}function z({className:e,...t}){return b(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:f(`w-full text-sm`,e),...t})}function B({className:e,...t}){return b(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:f(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function V({className:e,...t}){return b(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:f(`group/menu-item relative`,e),...t})}const H=p([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:font-normal`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-8!`,`group-data-[collapsible=icon]:p-2!`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function U({asChild:e=!1,isActive:t=!1,variant:i=`default`,size:o=`default`,tooltip:s,className:c,...l}){let u=e?C.Slot:`button`,{state:d}=E(),p=b(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":o,"data-active":t,className:f(H({variant:i,size:o}),c),...l});return s?(typeof s==`string`&&(s={children:s}),x(a,{children:[b(n,{asChild:!0,children:p}),b(r,{side:`right`,align:`center`,hidden:d!==`collapsed`,...s})]})):p}function W({className:e,asChild:t=!1,showOnHover:n=!1,...r}){return b(t?C.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:f(`text-sidebar-foreground ring-sidebar-ring`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,n&&`$group-focus-within/menu-item:opacity-100`,n&&`group-hover/menu-item:opacity-100`,n&&`data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function G({className:e,...t}){return b(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:f(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 font-medium text-sidebar-foreground text-xs tabular-nums`,`peer-hover/menu-button:text-sidebar-accent-foreground`,`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function K({className:e,showIcon:n=!1,...r}){let i=v(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return x(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:f(`flex h-8 items-center gap-2 rounded-md px-2`,e),...r,children:[n&&b(t,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),b(t,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})}function q({className:e,...t}){return b(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:f(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-sidebar-border border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function J({className:e,...t}){return b(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:f(`group/menu-sub-item relative`,e),...t})}function Y({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){return b(e?C.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:f(`text-sidebar-foreground ring-sidebar-ring`,`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`focus-visible:ring-2`,`disabled:pointer-events-none`,`disabled:opacity-50`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`[&>span:last-child]:truncate`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent`,`data-[active=true]:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:hidden`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,r),...i})}export{F as DetailDialogSidebarContent,N as DetailDialogSidebarFooter,I as DetailDialogSidebarGroup,R as DetailDialogSidebarGroupAction,z as DetailDialogSidebarGroupContent,L as DetailDialogSidebarGroupLabel,M as DetailDialogSidebarHeader,B as DetailDialogSidebarMenu,W as DetailDialogSidebarMenuAction,G as DetailDialogSidebarMenuBadge,U as DetailDialogSidebarMenuButton,V as DetailDialogSidebarMenuItem,K as DetailDialogSidebarMenuSkeleton,q as DetailDialogSidebarMenuSub,Y as DetailDialogSidebarMenuSubButton,J as DetailDialogSidebarMenuSubItem,A as DetailDialogSidebarRail,P as DetailDialogSidebarSeparator,k as DetailDialogSidebarTrigger,O as Sidebar,j as SidebarInset,D as SidebarProvider,E as useSidebar};
|
|
2
2
|
//# sourceMappingURL=sidebar.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-rdXrPUao.cjs`),require(`../../button-
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-rdXrPUao.cjs`),require(`../../button-CYw2AqT0.cjs`),require(`../../skeleton-CHympz8k.cjs`);const t=require(`../../flex-twCgWyx1.cjs`),n=require(`../../date-em5f7hCx.cjs`);require(`../../tooltip-DC6i1A25.cjs`);const r=require(`../../typography/title.cjs`);require(`../../separator-C3ip6sbh.cjs`),require(`../../sheet-5MJRtrfG.cjs`);const i=require(`./components/sidebar.cjs`);let a=require(`react/jsx-runtime`),o=require(`lucide-react`),s=require(`radix-ui`);const c=({open:e,isLoading:c,title:l,createdAt:u,onOpenChange:d,sidebar:f,children:p})=>{let{content:m,footer:h}=f||{};return(0,a.jsx)(s.Dialog.Root,{"data-slot":`detail-dialog`,open:e,onOpenChange:d,children:(0,a.jsxs)(s.Dialog.Portal,{"data-slot":`detail-dialog-portal`,children:[(0,a.jsx)(s.Dialog.Overlay,{"data-slot":`detail-dialog-overlay`,className:`data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in`}),(0,a.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:(0,a.jsxs)(s.Dialog.Content,{"data-slot":`dialog-content`,className:`data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 relative z-50 grid h-full max-h-dvh w-full max-w-svw gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg md:max-h-[90dvh] md:max-w-[90svw] md:rounded-lg xl:max-h-[90dvh] xl:max-w-[90svw] 2xl:max-h-[90dvh] 2xl:max-w-[90svw]`,onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,a.jsxs)(i.SidebarProvider,{children:[(0,a.jsxs)(i.Sidebar,{collapsible:`icon`,children:[(0,a.jsx)(i.DetailDialogSidebarHeader,{children:(0,a.jsx)(i.DetailDialogSidebarMenu,{children:(0,a.jsx)(i.DetailDialogSidebarMenuItem,{children:(0,a.jsxs)(i.DetailDialogSidebarMenuButton,{size:`lg`,tabIndex:-1,children:[(0,a.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,a.jsx)(o.CatIcon,{size:16})}),(0,a.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,a.jsx)(`span`,{className:`truncate font-medium`,children:f?.title||`Detail Dialog`}),(0,a.jsx)(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),(0,a.jsx)(i.DetailDialogSidebarContent,{children:m}),(0,a.jsx)(i.DetailDialogSidebarFooter,{children:h})]}),(0,a.jsx)(`main`,{"data-slot":`detail-dialog-main`,className:`relative h-full flex-1`,children:(0,a.jsxs)(t.t,{padding:`none`,gap:`none`,vertical:!0,align:`stretch`,className:`absolute inset-0 size-full`,children:[(0,a.jsxs)(`header`,{className:`flex w-full flex-0 items-start gap-x-2.5 border-border-weak border-b bg-card py-2.5 pr-12 pl-2`,children:[(0,a.jsx)(i.DetailDialogSidebarTrigger,{}),(0,a.jsxs)(t.t,{vertical:!0,align:`start`,padding:`none`,width:`null`,wrap:!1,className:`flex-1 gap-0`,children:[(0,a.jsx)(r.Title,{level:5,className:`line-clamp-1 truncate text-wrap`,children:l||`Detail Dialog`}),!!u&&(0,a.jsxs)(t.t,{padding:`none`,className:`relative items-center text-text-positive-weak`,children:[(0,a.jsx)(o.CalendarIcon,{size:12}),(0,a.jsx)(n.t,{showTime:!0,showHoliday:!0,date:u,format:`full`})]})]})]}),c?(0,a.jsx)(t.t,{justify:`center`,className:`inset-shadow-sm w-full flex-1 bg-muted-muted`,children:(0,a.jsx)(`div`,{className:`loader`})}):(0,a.jsx)(`section`,{"data-slot":`detail-dialog-body-loading`,className:`relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-muted-bg-subtle`,children:p})]})})]}),(0,a.jsx)(s.Dialog.Close,{"data-slot":`dialog-close`,tabIndex:-1,asChild:!0,className:`absolute top-3 right-3`,children:(0,a.jsx)(`button`,{className:`flex cursor-pointer items-center justify-center rounded-[100px] p-2 text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive active:bg-muted-weak active:text-text-positive-strong disabled:pointer-events-none disabled:opacity-60`,children:(0,a.jsx)(o.XIcon,{size:24})})})]})})]})})};exports.DetailDialog=c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../button.variants-DuuH1O0_.mjs";import"../../button-
|
|
1
|
+
import"../../button.variants-DuuH1O0_.mjs";import"../../button-B2FJrOBP.mjs";import"../../skeleton-Ba6koCVf.mjs";import{t as e}from"../../flex-BP8sTi70.mjs";import{t}from"../../date-By93kONr.mjs";import"../../tooltip-B3dTcgcc.mjs";import{Title as n}from"../../typography/title.mjs";import"../../separator-Bf0gymN4.mjs";import"../../sheet-oadGRiie.mjs";import{DetailDialogSidebarContent as r,DetailDialogSidebarFooter as i,DetailDialogSidebarHeader as a,DetailDialogSidebarMenu as o,DetailDialogSidebarMenuButton as s,DetailDialogSidebarMenuItem as c,DetailDialogSidebarTrigger as l,Sidebar as u,SidebarProvider as d}from"./components/sidebar.mjs";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CalendarIcon as m,CatIcon as h,XIcon as g}from"lucide-react";import{Dialog as _}from"radix-ui";const v=({open:v,isLoading:y,title:b,createdAt:x,onOpenChange:S,sidebar:C,children:w})=>{let{content:T,footer:E}=C||{};return f(_.Root,{"data-slot":`detail-dialog`,open:v,onOpenChange:S,children:p(_.Portal,{"data-slot":`detail-dialog-portal`,children:[f(_.Overlay,{"data-slot":`detail-dialog-overlay`,className:`data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in`}),f(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:p(_.Content,{"data-slot":`dialog-content`,className:`data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 relative z-50 grid h-full max-h-dvh w-full max-w-svw gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg md:max-h-[90dvh] md:max-w-[90svw] md:rounded-lg xl:max-h-[90dvh] xl:max-w-[90svw] 2xl:max-h-[90dvh] 2xl:max-w-[90svw]`,onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:[p(d,{children:[p(u,{collapsible:`icon`,children:[f(a,{children:f(o,{children:f(c,{children:p(s,{size:`lg`,tabIndex:-1,children:[f(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:f(h,{size:16})}),p(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[f(`span`,{className:`truncate font-medium`,children:C?.title||`Detail Dialog`}),f(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),f(r,{children:T}),f(i,{children:E})]}),f(`main`,{"data-slot":`detail-dialog-main`,className:`relative h-full flex-1`,children:p(e,{padding:`none`,gap:`none`,vertical:!0,align:`stretch`,className:`absolute inset-0 size-full`,children:[p(`header`,{className:`flex w-full flex-0 items-start gap-x-2.5 border-border-weak border-b bg-card py-2.5 pr-12 pl-2`,children:[f(l,{}),p(e,{vertical:!0,align:`start`,padding:`none`,width:`null`,wrap:!1,className:`flex-1 gap-0`,children:[f(n,{level:5,className:`line-clamp-1 truncate text-wrap`,children:b||`Detail Dialog`}),!!x&&p(e,{padding:`none`,className:`relative items-center text-text-positive-weak`,children:[f(m,{size:12}),f(t,{showTime:!0,showHoliday:!0,date:x,format:`full`})]})]})]}),y?f(e,{justify:`center`,className:`inset-shadow-sm w-full flex-1 bg-muted-muted`,children:f(`div`,{className:`loader`})}):f(`section`,{"data-slot":`detail-dialog-body-loading`,className:`relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-muted-bg-subtle`,children:w})]})})]}),f(_.Close,{"data-slot":`dialog-close`,tabIndex:-1,asChild:!0,className:`absolute top-3 right-3`,children:f(`button`,{className:`flex cursor-pointer items-center justify-center rounded-[100px] p-2 text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive active:bg-muted-weak active:text-text-positive-strong disabled:pointer-events-none disabled:opacity-60`,children:f(g,{size:24})})})]})})]})})};export{v as DetailDialog};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../paragraph-B72bHMf7.cjs`);require(`../../button.variants-rdXrPUao.cjs`);const n=require(`../../button-C58TS8Pc.cjs`),r=require(`../../flex-twCgWyx1.cjs`),i=require(`../../date-em5f7hCx.cjs`),a=require(`../../badge-cvLJyaCA.cjs`),o=require(`../../tooltip-DC6i1A25.cjs`),s=require(`../../avatar-aVxo69zP.cjs`),c=require(`../../separator-C3ip6sbh.cjs`),l=require(`../../dropdown-menu-BuyuU6uF.cjs`),u=require(`../../checkbox-C0fSWwmD.cjs`),d=require(`../../spinner-Chm_2fLr.cjs`),f=require(`../../resizable-mlGS6Zto.cjs`),p=require(`../../input-BFWWaN-v.cjs`);let m=require(`@customafk/react-toolkit/utils`),h=require(`react`),g=require(`react/jsx-runtime`),_=require(`lucide-react`),v=require(`@customafk/react-toolkit/color-hash`),y=require(`@tanstack/react-table`),b=require(`@tanstack/react-virtual`),x=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const S=()=>(0,g.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,g.jsx)(_.MinusIcon,{size:16}),(0,g.jsx)(_.MinusIcon,{size:16})]}),C=({label:e,onClick:t,onRemove:n})=>e?n?(0,g.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,g.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,g.jsx)(_.XIcon,{size:12})})]}):(0,g.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,g.jsx)(S,{}),w=({value:e})=>e==null?(0,g.jsx)(S,{}):e===!1?(0,g.jsx)(`div`,{className:`text-danger-strong`,children:(0,g.jsx)(_.XIcon,{})}):(0,g.jsx)(`div`,{className:`text-success-strong`,children:(0,g.jsx)(_.CheckIcon,{})}),ee=({date:e})=>e==null?(0,g.jsx)(S,{}):(0,g.jsx)(o.r,{children:(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{asChild:!0,children:(0,g.jsx)(a.t,{className:`h-fit`,children:(0,g.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,g.jsx)(o.n,{className:`rounded px-2`,children:(0,g.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),T=({content:e})=>e==null?(0,g.jsx)(S,{}):(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{children:(0,g.jsx)(t.t,{variant:`sm`,className:`line-clamp-2 whitespace-pre-line break-all`,children:e})}),(0,g.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,g.jsx)(t.t,{variant:`xs`,className:`whitespace-pre-line text-wrap break-keep text-text-negative-weak`,children:e}),(0,g.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),E=({items:e=[]})=>(0,g.jsxs)(l.t,{children:[(0,g.jsx)(l.h,{asChild:!0,children:(0,g.jsx)(n.t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:(0,g.jsx)(_.MoreVerticalIcon,{})})}),(0,g.jsx)(l.r,{children:(0,g.jsx)(l.i,{children:e.map(e=>(0,g.jsx)(l.a,{className:`px-3`,onSelect:t=>{e.onClick(e.id),t.stopPropagation()},children:e.label},e.id))})})]}),D=({name:e})=>e?(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{children:(0,g.jsx)(t.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start`,children:e})}),(0,g.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,g.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,g.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,g.jsx)(S,{}),O=({href:e,label:t})=>(0,g.jsxs)(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,g.jsx)(`span`,{children:t||e}),(0,g.jsx)(_.ExternalLinkIcon,{size:14})]}),k=({value:e})=>(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{asChild:!0,children:(0,g.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,g.jsx)(o.n,{align:`start`,children:(0,g.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:t})=>(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{children:(0,g.jsx)(n.t,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:(0,h.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),await t?.()},[t]),children:(0,g.jsx)(_.Trash2Icon,{})})}),(0,g.jsx)(o.n,{children:(0,g.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,h.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:n,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=(0,h.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=(0,h.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,h.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]),p=(0,h.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return p===`0`||p===`N/A`||!p?(0,g.jsx)(S,{}):(0,g.jsxs)(r.t,{padding:`none`,className:(0,m.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:[n,(0,g.jsx)(`p`,{children:p}),i]})});M.displayName=`UITableStatisticDisplay`;const N=({uuid:e,username:n,email:i})=>(0,g.jsxs)(r.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,g.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,g.jsx)(s.n,{className:`bg-muted-weak`,children:(0,g.jsx)(_.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,g.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,g.jsx)(s.n,{style:{backgroundColor:v.colorHashLight.hex(e)},children:(0,g.jsx)(_.UserRoundIcon,{size:28,className:`text-white`})})}),(0,g.jsxs)(r.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,g.jsx)(t.t,{className:`font-medium text-sm text-text-positive-weak`,children:n??`Unknown User`}),(0,g.jsx)(t.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),te=60,ne=60,re=20,ie=20,ae=(0,h.createContext)(null),oe=()=>{let e=(0,h.use)(ae);if(!e)throw Error(`useTableInnerWrapperContext must be used within a TableInnerWrapperProvider`);return e},se=(0,h.createContext)(null),ce=()=>{let e=(0,h.use)(se);if(!e)throw Error(`useTableInnerTableContext must be used within a TableInnerTableProvider`);return e},le=(0,h.createContext)(null),ue=()=>{let e=(0,h.use)(le);if(!e)throw Error(`useTableHeaderRowContext must be used within a TableHeaderRowProvider`);return e},de=(0,h.createContext)(null),fe=()=>{let e=(0,h.use)(de);if(!e)throw Error(`useTableBodyContext must be used within a TableBodyProvider`);return e},pe=(0,h.createContext)(null),me=()=>{let e=(0,h.use)(pe);if(!e)throw Error(`useTableRowContext must be used within a TableRowProvider`);return e},P=(0,h.createContext)(null),F=()=>{let e=(0,h.use)(P);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},I=(0,h.memo)(({isPinned:e,onLeftPin:t,onRightPin:n,onUnpin:r,className:i})=>{let a=(0,h.useCallback)(()=>{t?.(`left`)},[t]),o=(0,h.useCallback)(()=>{n?.(`right`)},[n]),s=(0,h.useCallback)(()=>{r?.(!1)},[r]);return(0,g.jsxs)(l.t,{children:[(0,g.jsx)(l.h,{asChild:!0,children:(0,g.jsx)(`button`,{className:(0,m.cn)(`absolute right-2 z-10 p-0.5 opacity-0`,`cursor-pointer rounded-full transition-all`,`text-text-positive-weak`,`[&>svg]:size-4`,`group-hover:opacity-100`,`hover:bg-muted-muted hover:text-text-positive`,i),children:(0,g.jsx)(_.EllipsisVerticalIcon,{})})}),(0,g.jsx)(l.r,{align:`end`,className:`w-64 p-4`,children:(0,g.jsxs)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,g.jsx)(h.Activity,{mode:e?`visible`:`hidden`,children:(0,g.jsxs)(l.a,{onClick:s,children:[!!e&&`Unpin`,(0,g.jsx)(l.d,{children:(0,g.jsx)(_.PinOffIcon,{className:`size-4`})})]})}),(0,g.jsxs)(h.Activity,{mode:e?`hidden`:`visible`,children:[(0,g.jsxs)(l.a,{onClick:a,children:[e?`Unpin`:`Pin to Left`,(0,g.jsx)(l.d,{children:(0,g.jsx)(_.MoveLeftIcon,{className:`size-4`})})]}),(0,g.jsxs)(l.a,{onClick:o,children:[e?`Unpin`:`Pin to Right`,(0,g.jsx)(l.d,{children:(0,g.jsx)(_.MoveRightIcon,{className:`size-4`})})]})]})]})})]})});I.displayName=`UITableHeadCellOption`;const L=(0,h.memo)(({isPinned:e,isAllRowsSelected:t,style:n,onToggleAllRowsSelected:r,...i})=>{let a=(0,h.useCallback)(e=>{r?.(!!e)},[r]);return(0,g.jsx)(`th`,{slot:`table-header-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:(0,m.cn)(e?`sticky`:`relative`),...i,children:(0,g.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,g.jsx)(u.t,{"aria-label":`Select All Rows`,checked:t,onCheckedChange:a})})})});L.displayName=`UITableHeadCellSelect`;const R=(0,h.memo)(({isEmpty:e,isFetching:t})=>!e&&!t?null:(0,g.jsxs)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:[t&&(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,g.jsx)(d.t,{className:`size-12`}),(0,g.jsx)(`p`,{children:`Loading data...`})]}),e&&!t&&(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,g.jsx)(_.BoxIcon,{strokeWidth:1,size:48}),(0,g.jsx)(`p`,{children:`No data available`})]})]}));R.displayName=`UITableEmptyDisplay`;const z=(0,h.memo)(({className:e,children:t,...n})=>(0,g.jsx)(`div`,{slot:`table-wrapper`,className:(0,m.cn)(`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2`,e),...n,children:t}));z.displayName=`UITableWrapper`;const B=(0,h.memo)(({children:e,...t})=>{let{innerWrapperId:n}=oe();return(0,g.jsx)(`div`,{id:n,slot:`table-inner-wrapper`,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border bg-card`,...t,children:e})});B.displayName=`UITableInnerWrapper`;const V=(0,h.memo)(({children:e,...t})=>{let{table:n,innerTableId:r,totalSize:i}=ce(),a=(0,h.useRef)(null);return(0,h.useEffect)(()=>{if(!a.current)return;let e=n.getFlatHeaders(),t=new ResizeObserver(t=>{requestAnimationFrame(()=>{let r=t[0].target;if(r instanceof HTMLTableElement){let i=t[0];if(!i)return;let a=i.contentRect.width,{left:o=[],right:s=[]}=n.getState().columnPinning,c=0,l=0,u=0,d=e.map(e=>{let{id:t}=e,n=t===`select`||t===`actions`,r=o.includes(t)||s.includes(t),i=e.getSize(),a=e.column.columnDef.maxSize;return n?(c+=60,{id:t,isFlex:!1,width:60}):r?(c+=i,{id:t,isFlex:!1,width:i}):e.column.columnDef.size||i!==150?(u+=i,{id:t,isFlex:!1,width:i}):(l++,{id:t,isFlex:!0,maxSize:a})}),f=a-c-u,p=l>0?Math.max(0,Math.floor(f/l)):0;d.forEach(e=>{if(e.isFlex){let t=e.maxSize?Math.min(p,e.maxSize):p;r.style.setProperty(`--header-${e.id}-size`,`${t}`),r.style.setProperty(`--col-${e.id}-size`,`${t}`),e.maxSize&&r.style.setProperty(`--col-${e.id}-maxSize`,`${e.maxSize}`)}else r.style.setProperty(`--header-${e.id}-size`,`${e.width}`),r.style.setProperty(`--col-${e.id}-size`,`${e.width}`)})}})});return t.observe(a.current),()=>t.disconnect()},[n.getState().columnSizingInfo,n.getState().columnSizing,n.getState().columnPinning]),(0,g.jsx)(`table`,{id:r,ref:a,slot:`table-inner-table`,className:`grid w-full table-fixed caption-bottom border-collapse border-spacing-0 flex-col content-start [&_tfoot_td]:border-t`,style:{minWidth:i},...t,children:e})});V.displayName=`UITableInnerTable`;const H=(0,h.memo)(({className:e,children:t,...n})=>(0,g.jsx)(`thead`,{slot:`table-head`,className:(0,m.cn)(`sticky top-0 z-20 h-9 w-full`,`grid select-none bg-muted-bg-subtle`,`border-b border-b-border shadow`,`font-medium text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:inline-flex`,`[&_th]:items-center`,`[&_th]:transition-all`,`[&_th]:duration-300`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`,e),...n,children:t}));H.displayName=`UITableHead`;const U=(0,h.memo)(({headerGroup:e,className:t,...n})=>{let{isAllRowsSelected:r,columnPinningState:i,leftPinnedHeaders:a,rightPinnedHeaders:o,onToggleAllRowsSelected:s}=ue(),c=o[0]?.id,l=a[a.length-1]?.id;return(0,g.jsx)(`tr`,{slot:`table-head-row`,className:(0,m.cn)(`flex`,t),...n,children:e.headers.map((e,t)=>{let n=e.column.getIsVisible(),a=i.left?.includes(e.id)?`left`:i.right?.includes(e.id)?`right`:!1;return e.id===`select`?(0,g.jsx)(L,{isPinned:a,isAllRowsSelected:r,onToggleAllRowsSelected:s},e.id):(0,g.jsx)(W,{isVisible:n,isPinned:a,isFirstCell:e.id===c,isLastCell:e.id===l,isOptionsVisible:![`select`,`actions`].includes(e.id),headerId:e.id,headerColumn:e.column,colSpan:e.colSpan,onColumnPin:e.column.pin,onToggleVisibility:e.column.toggleVisibility,children:(0,y.flexRender)(e.column.columnDef.header,e.getContext())},`${e.id}-${t}`)})})});U.displayName=`UITableHeadRow`;const W=(0,h.memo)(({isVisible:e=!0,isPinned:t=!1,isFirstCell:n=!1,isLastCell:r=!1,isOptionsVisible:i=!0,headerId:a,headerColumn:o,className:s,children:c,onColumnPin:l,onToggleVisibility:u,...d})=>{let f=(0,h.useMemo)(()=>t?20:void 0,[t]),p=(0,h.useMemo)(()=>{let e=o?.getStart?.(`left`);return t===`left`&&typeof e==`number`?`${e}px`:void 0},[t,o]),_=(0,h.useMemo)(()=>{let e=o?.getAfter?.(`right`);return t===`right`&&typeof e==`number`?`${e}px`:void 0},[t,o]),v=(0,h.useMemo)(()=>`calc(var(--header-${a}-size) * 1px)`,[a]),y=(0,h.useMemo)(()=>o?.columnDef.minSize?`calc(var(--col-${a}-minSize) * 1px)`:void 0,[a,o]),b=(0,h.useMemo)(()=>o?.columnDef.maxSize?`calc(var(--col-${a}-maxSize) * 1px)`:void 0,[a,o]);return(0,g.jsxs)(`th`,{slot:`table-head-cell`,"data-pinned":t,"data-header":a,style:{zIndex:f,left:p,right:_,width:v,minWidth:y,maxWidth:b},className:(0,m.cn)(`group flex`,t?`sticky`:`relative`,t===`left`&&r&&`border-r border-r-border`,t===`right`&&n&&`border-l border-l-border`,o?.columnDef.meta?.position===`center`&&`justify-center`,o?.columnDef.meta?.position===`end`&&`justify-end`,o?.columnDef.meta?.position===`start`&&`justify-start`,s),...d,children:[(0,g.jsx)(`div`,{className:`truncate pl-4`,children:c}),i&&(0,g.jsx)(I,{isPinned:t,isVisible:e,onLeftPin:l,onRightPin:l,onUnpin:l})]})});W.displayName=`UITableHeadCell`;const G=(0,h.memo)(({height:e,className:t,children:n,...r})=>{let{isFetching:i,isEmpty:a}=fe();return a||i?null:(0,g.jsx)(`tbody`,{slot:`table-body`,style:{height:e},className:(0,m.cn)(`relative w-full`,`grid`,`[&_tr]:absolute`,`[&_tr]:flex`,`[&_tr]:flex-none`,`[&_tr]:w-full`,`[&_tr]:cursor-pointer [&_tr]:focus:outline-none`,`[&_tr]:border-b [&_tr]:border-b-border`,`[&_td]:z-10`,`[&_td]:transition-all`,`[&_td]:duration-300`,`[&_td]:flex`,`[&_td]:flex-none`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[selected=true]:bg-muted-muted!`,`[&_td]:data-[selected=true]:hover:bg-muted-muted!`,`[&_td>div]:inline-flex`,`[&_td>div]:items-center`,`[&_td>div]:w-full`,`[&_td:not([data-pinned=false])]:z-20`,`[&_td:not([data-pinned=false])]:sticky`,`[&_td:not([data-pinned=false])]:bg-card`,`**:data-lastcell:border-r`,`**:data-firstcell:border-l`,t),...r,children:n})});G.displayName=`UITableBody`;const K=(0,h.memo)(({row:e,isSelected:t,virtualRowIndex:n,virtualRowStart:r,children:i,...a})=>{let{keyOfClickRow:o,isAllRowsSelected:s,columnPinningState:c,leftPinnedHeaders:l,rightPinnedHeaders:u,onClickRow:d}=me(),f=(0,h.useMemo)(()=>c.left??[],[c]),p=(0,h.useMemo)(()=>c.right??[],[c]),m=(0,h.useMemo)(()=>u?.[0]?.id,[u]),_=(0,h.useMemo)(()=>l?.[l.length-1]?.id,[l]),v=(0,h.useCallback)(t=>{let r=o?e.original?.[o]:void 0;d?.(n,typeof r==`string`||typeof r==`number`?r:void 0),t.preventDefault(),t.stopPropagation()},[o,d,e,n]);return(0,g.jsx)(`tr`,{slot:`table-row`,"data-index":n,style:{transform:`translateY(${r}px)`},className:`group`,onClick:v,...a,children:e.getVisibleCells().map((e,r)=>{let i=f.includes(e.column.id),a=p.includes(e.column.id),o=i?`left`:a?`right`:!1;return e.column.id===`actions`?(0,g.jsx)(J,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,virtualRowIndex:n,column:e.column,getContext:e.getContext},`${e.id}-${r}`):e.column.id===`select`?(0,g.jsx)(q,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isSelected:s||t,onToggleRowSelected:e.row.toggleSelected},`${e.id}-${r}`):(0,g.jsx)(Y,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isFirstCell:e.column.id===m,isLastCell:e.column.id===_,colId:e.column.id,position:e.column.columnDef.meta?.position??`start`,column:e.column,getContext:e.getContext},`${e.id}-${r}`)})})});K.displayName=`UITableRow`;const q=(0,h.memo)(({isPinned:e,isSelected:t=!1,className:n,onToggleRowSelected:r,...i})=>{let a=(0,h.useCallback)(e=>{r?.(!!e)},[r]);return(0,g.jsx)(`td`,{slot:`table-body-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:(0,m.cn)(`group-hover:bg-muted-bg-subtle!`,e?`sticky`:`relative`,n),...i,children:(0,g.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`flex! w-full! items-center justify-center bg-transparent text-center align-middle`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,g.jsx)(u.t,{"aria-label":`Select Row`,checked:t,onCheckedChange:a})})})});q.displayName=`UITableCellSelect`;const J=(0,h.memo)(({virtualRowIndex:e,column:t,getContext:n,className:r,...i})=>{let a=(0,h.useMemo)(()=>(0,y.flexRender)(t?.columnDef.cell,n()),[t,n]);return(0,g.jsx)(`td`,{"data-col":`actions`,"data-cell":e,className:`sticky inset-y-0 right-0 z-50 flex items-center pr-4 group-hover:bg-muted-bg-subtle!`,...i,children:a})});J.displayName=`UITableCellActions`;const Y=(0,h.memo)(({isPinned:e=!1,isFirstCell:t=!1,isLastCell:n=!1,colId:r,position:i=`start`,column:a,getContext:o,...s})=>{let{innerTableId:c,table:l}=ce(),u=(0,h.useRef)(document.querySelector(`table[id="${c}"]`)),d=(0,h.useRef)(null),f=(0,h.useMemo)(()=>{let t=a?.getStart(`left`);return e===`left`&&typeof t==`number`?`${t}px`:void 0},[e,a]),p=(0,h.useMemo)(()=>{let t=a?.getAfter(`right`);return e===`right`&&typeof t==`number`?`${t}px`:void 0},[e,a]),_=(0,h.useMemo)(()=>`calc(var(--col-${r}-size) * 1px)`,[r]),v=(0,h.useMemo)(()=>a?.columnDef.minSize?`calc(var(--col-${r}-minSize) * 1px)`:void 0,[r,a]),b=(0,h.useMemo)(()=>a?.columnDef.maxSize?`calc(var(--col-${r}-maxSize) * 1px)`:void 0,[r,a]),x=(0,h.useMemo)(()=>(0,y.flexRender)(a?.columnDef.cell,o()),[a,o]);return(0,h.useEffect)(()=>{if(!d.current)return;let e=d.current.scrollWidth,t=a?.getSize();t&&e>t&&u.current instanceof HTMLTableElement&&typeof r==`string`&&a?.columnDef.meta?.fitContent&&l.setColumnSizing(t=>({...t,[r]:e+32}))},[r,a,l]),(0,g.jsx)(`td`,{slot:`table-body-cell`,"data-pinned":e,"data-lastcell":n||void 0,"data-firstcell":t||void 0,style:{left:f,right:p,width:_,minWidth:v,maxWidth:b},className:`group-hover:bg-muted-bg-subtle!`,...s,children:(0,g.jsx)(`div`,{ref:d,slot:`table-body-cell-inner`,className:(0,m.cn)(i===`start`&&`justify-start`,i===`center`&&`justify-center`,i===`end`&&`justify-end`),children:x})})});Y.displayName=`UITableCell`;const he=(0,h.memo)(({className:e,children:t,...n})=>(0,g.jsx)(`tfoot`,{slot:`table-footer`,className:(0,m.cn)(`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,e),...n,children:t}));he.displayName=`UITableFooter`;const X=(0,h.memo)(({virtualRowIndex:e,virtualRowStart:t,fetchMoreData:n})=>{let{innerWrapperId:r}=oe(),i=(0,h.useRef)(document.querySelector(`div[id="${r}"]`)),a=(0,h.useRef)(null),[o,s]=(0,h.useState)(`idle`),[c,l]=(0,h.useState)(0),u=(0,h.useCallback)(async()=>{try{s(`fetching`),await n?.(),s(`idle`)}catch(e){console.error(`Error fetching more data:`,e),s(`error`)}},[n]);return(0,h.useEffect)(()=>{if(!i.current)return;let e=new ResizeObserver(e=>{l(e[0].contentRect.width)});return e.observe(i.current),()=>e.disconnect()},[]),n?(0,g.jsx)(`tr`,{ref:a,"data-index":e,style:{transform:`translateY(${t}px)`,width:c},className:`sticky! left-0 h-10`,children:(0,g.jsx)(`td`,{className:`absolute left-0 flex w-full items-center justify-center text-xs`,children:(0,g.jsxs)(`button`,{type:`button`,disabled:o===`fetching`,className:(0,m.cn)(`flex cursor-pointer gap-x-0.5`,o===`fetching`&&`cursor-not-allowed`,o===`idle`&&`text-text-positive-weak hover:text-text-positive`,o===`error`&&`text-danger hover:text-danger-strong`),onClick:u,children:[o===`idle`&&(0,g.jsx)(_.ChevronDown,{className:`size-4`}),o===`fetching`&&(0,g.jsx)(d.t,{className:`size-4 animate-spin`}),o===`error`&&(0,g.jsx)(_.AlertTriangle,{className:`size-4 text-danger`}),o===`idle`&&`Load More`,o===`fetching`&&`Loading...`,o===`error`&&`Error! Retry?`]})})}):null});X.displayName=`UITableLoadMore`;const ge=()=>{let{table:e,isEmpty:t,isFetching:n,fetchMoreData:r}=F(),{rowSelectionState:i}=fe(),a=(0,h.useRef)(null),{rows:o}=e.getRowModel(),s=(0,b.useVirtualizer)({count:o.length+1,estimateSize:()=>40,getScrollElement:()=>a.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2}),c=(0,h.useMemo)(()=>{let e=s.getTotalSize(),t=a.current?.clientHeight||0;return e<t?`${t}px`:`${e}px`},[s.getTotalSize()]);return(0,g.jsx)(f.r,{direction:`horizontal`,style:{direction:e.options.columnResizeDirection},className:`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border border-r border-r-border bg-slate-50 p-0 text-sm`,children:(0,g.jsx)(f.n,{className:`relative`,children:(0,g.jsxs)(B,{ref:a,children:[(0,g.jsxs)(V,{children:[(0,g.jsx)(H,{children:e.getHeaderGroups().map(e=>(0,g.jsx)(U,{headerGroup:e},e.id))}),(0,g.jsx)(G,{height:c,children:s.getVirtualItems().map(e=>{let t=o[e.index],n=Object.entries(i).some(([e,n])=>e===`${t?.id}`&&n);return t?(0,g.jsx)(K,{ref:s.measureElement,row:t,isSelected:n,virtualRowIndex:e.index,virtualRowStart:e.start},e.index):(0,g.jsx)(X,{virtualRowIndex:e.index,virtualRowStart:e.start,fetchMoreData:r},e.index)})})]}),(0,g.jsx)(R,{isEmpty:t,isFetching:n})]})})})},_e=({checked:e,title:t,onCheckedChange:n})=>(0,g.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,g.jsx)(u.t,{checked:e,onCheckedChange:n}),(0,g.jsx)(`p`,{className:`text-sm`,children:t})]}),ve=()=>{let{table:e}=F(),[t,r]=(0,h.useState)(null);return(0,g.jsx)(f.n,{defaultSize:25,className:(0,m.cn)(`bg-card`,t===null?`max-w-8!`:`min-w-64`),children:(0,g.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,g.jsxs)(`div`,{className:`flex-1`,children:[(0,g.jsx)(h.Activity,{mode:t===`columns`?`visible`:`hidden`,children:(0,g.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,g.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,g.jsx)(c.t,{}),(0,g.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,g.jsx)(_e,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,g.jsx)(h.Activity,{mode:t===`filters`?`visible`:`hidden`,children:(0,g.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,g.jsxs)(n.t,{variant:`outline`,color:`muted`,children:[(0,g.jsx)(_.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,g.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,g.jsxs)(`button`,{className:(0,m.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,t===`columns`&&`bg-card`),onClick:()=>r(t===`columns`?null:`columns`),children:[(0,g.jsx)(_.Columns4Icon,{size:18}),(0,g.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,g.jsx)(c.t,{}),(0,g.jsxs)(`button`,{className:(0,m.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,t===`filters`&&`bg-card`),onClick:()=>r(t===`filters`?null:`filters`),children:[(0,g.jsx)(_.ListFilterIcon,{size:18}),(0,g.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,g.jsx)(c.t,{})]})]})})},ye=(0,h.memo)(({innerWrapperId:e,children:t})=>{let n=(0,h.useMemo)(()=>({innerWrapperId:e}),[e]);return(0,g.jsx)(ae.Provider,{value:n,children:t})});ye.displayName=`UITableInnerWrapperProvider`;const be=(0,h.memo)(({table:e,innerTableId:t,totalSize:n,children:r})=>{let i=(0,h.useMemo)(()=>({table:e,innerTableId:t,totalSize:n}),[e,t,n]);return(0,g.jsx)(se.Provider,{value:i,children:r})});be.displayName=`UITableInnerTableProvider`;const xe=(0,h.memo)(({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i,children:a})=>{let o=(0,h.useMemo)(()=>({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i}),[e,t,n,r,i]);return(0,g.jsx)(le.Provider,{value:o,children:a})});xe.displayName=`UITableHeadRowProvider`;const Se=(0,h.memo)(({isFetching:e,isEmpty:t,rowSelectionState:n,children:r})=>{let i=(0,h.useMemo)(()=>({isFetching:e,isEmpty:t,rowSelectionState:n}),[e,t,n]);return(0,g.jsx)(de.Provider,{value:i,children:r})});Se.displayName=`UITableBodyProvider`;const Z=(0,h.memo)(({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a,children:o})=>{let s=(0,h.useMemo)(()=>({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a}),[e,t,n,r,i,a]);return(0,g.jsx)(pe.Provider,{value:s,children:o})});Z.displayName=`UITableRowProvider`;const Ce=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o=[],rightPinnedColumns:s=[],keyOfClickRow:c,onClickRow:l,onRowSelection:u,onColumnPinning:d,fetchMoreData:f,children:p})=>{let m=(0,h.useId)(),_=(0,h.useId)(),[v,b]=(0,h.useState)({}),[x,S]=(0,h.useState)({right:s,left:[`select`,...o]}),[C,w]=(0,h.useState)({}),ee=(0,h.useCallback)(e=>(b(e),u?.(e instanceof Function?e(v):e),e),[v,u]),T=(0,h.useCallback)(e=>{S(e),d?.(e instanceof Function?e(x):e)},[x,d]),E=(0,y.useReactTable)({data:r,columns:i,state:{rowSelection:v,columnPinning:x,expanded:C},defaultColumn:{enableResizing:!1,size:void 0,minSize:void 0,maxSize:void 0},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,autoResetAll:!1,autoResetExpanded:!1,autoResetPageIndex:!1,getSubRows:e=>e.subRows,getCoreRowModel:(0,y.getCoreRowModel)(),getGroupedRowModel:(0,y.getGroupedRowModel)(),getExpandedRowModel:(0,y.getExpandedRowModel)(),onRowSelectionChange:ee,onColumnPinningChange:T,onExpandedChange:w}),D=(0,h.useMemo)(()=>{let{rows:e}=E.getRowModel();return e},[E.getRowModel().rows,E.getState().columnPinning]),O=(0,h.useMemo)(()=>!t&&D.length===0,[D,t]),k=(0,h.useMemo)(()=>({title:e,table:E,isEmpty:O,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:f}),[e,E,O,n,t,a,f,E.getState().columnPinning,E.getState().expanded]),A=(0,h.useMemo)(()=>E.getState(),[E.getState()]),j=(0,h.useMemo)(()=>E.getIsAllRowsSelected(),[E.getIsAllRowsSelected()]),M=(0,h.useMemo)(()=>A.rowSelection,[A.rowSelection]),N=(0,h.useMemo)(()=>A.columnPinning,[A.columnPinning]),te=(0,h.useMemo)(()=>E.getLeftHeaderGroups()[0]?.headers||[],[E.getState().columnPinning]),ne=(0,h.useMemo)(()=>E.getRightHeaderGroups()[0]?.headers||[],[E.getState().columnPinning]),re=(0,h.useMemo)(()=>E.getTotalSize(),[E.getTotalSize()]);return(0,g.jsx)(P.Provider,{value:k,children:(0,g.jsx)(ye,{innerWrapperId:m,children:(0,g.jsx)(be,{table:E,innerTableId:_,totalSize:re,children:(0,g.jsx)(xe,{isAllRowsSelected:j,columnPinningState:N,leftPinnedHeaders:te,rightPinnedHeaders:ne,onToggleAllRowsSelected:E.toggleAllRowsSelected,children:(0,g.jsx)(Se,{isFetching:t,isEmpty:O,rowSelectionState:M,children:(0,g.jsx)(Z,{keyOfClickRow:c,isAllRowsSelected:j,columnPinningState:N,leftPinnedHeaders:te,rightPinnedHeaders:ne,onClickRow:l,children:p})})})})})})},we=({onSearch:e,onChange:t,...n})=>{let r=(0,x.useDebounceCallback)(t=>{e?.(t)},500);return(0,g.jsxs)(`div`,{className:`relative w-full max-w-80 flex-1`,children:[(0,g.jsx)(p.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,g.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,g.jsx)(_.SearchIcon,{size:16})}),(0,g.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,g.jsx)(_.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]})},Q=({children:e,disabled:t,onClick:n})=>(0,g.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}),Te=({onCreate:e,onDownload:t,onRefresh:n})=>(0,g.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,g.jsx)(Q,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,g.jsx)(_.CirclePlus,{})}),(0,g.jsx)(Q,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,g.jsx)(_.RefreshCwIcon,{})}),(0,g.jsx)(Q,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,g.jsx)(_.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=F();return(0,g.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,g.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,g.jsx)(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};$.displayName=`TableTooltip`,exports.UITableBadgeDisplay=C,exports.UITableBody=G,exports.UITableBooleanDisplay=w,exports.UITableCell=Y,exports.UITableCellActions=J,exports.UITableCellSelect=q,exports.UITableContainer=ge,exports.UITableDateDisplay=ee,exports.UITableDescriptionDisplay=T,exports.UITableEmptyDisplay=R,exports.UITableFilter=ve,exports.UITableFooter=he,exports.UITableHead=H,exports.UITableHeadCell=W,exports.UITableHeadCellOption=I,exports.UITableHeadCellSelect=L,exports.UITableHeadRow=U,exports.UITableInnerTable=V,exports.UITableInnerWrapper=B,exports.UITableLoadMore=X,exports.UITableMoreButton=E,exports.UITableNameDisplay=D,exports.UITablePermalink=O,exports.UITablePhoneNumberDisplay=k,exports.UITableProvider=Ce,exports.UITableRemoveButton=A,exports.UITableRow=K,exports.UITableStatisticDisplay=M,exports.UITableTooltip=$,exports.UITableTooltipActions=Te,exports.UITableTooltipFilter=we,exports.UITableUserDataDisplay=N,exports.UITableWrapper=z;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../paragraph-B72bHMf7.cjs`);require(`../../button.variants-rdXrPUao.cjs`);const n=require(`../../button-CYw2AqT0.cjs`),r=require(`../../flex-twCgWyx1.cjs`),i=require(`../../date-em5f7hCx.cjs`),a=require(`../../badge-cvLJyaCA.cjs`),o=require(`../../tooltip-DC6i1A25.cjs`),s=require(`../../avatar-aVxo69zP.cjs`),c=require(`../../separator-C3ip6sbh.cjs`),l=require(`../../dropdown-menu-BuyuU6uF.cjs`),u=require(`../../checkbox-C0fSWwmD.cjs`),d=require(`../../spinner-Chm_2fLr.cjs`),f=require(`../../resizable-mlGS6Zto.cjs`),p=require(`../../input-BFWWaN-v.cjs`);let m=require(`@customafk/react-toolkit/utils`),h=require(`react`),g=require(`react/jsx-runtime`),_=require(`lucide-react`),v=require(`@customafk/react-toolkit/color-hash`),y=require(`@tanstack/react-table`),b=require(`@tanstack/react-virtual`),x=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const S=()=>(0,g.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,g.jsx)(_.MinusIcon,{size:16}),(0,g.jsx)(_.MinusIcon,{size:16})]}),C=({label:e,onClick:t,onRemove:n})=>e?n?(0,g.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,g.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,g.jsx)(_.XIcon,{size:12})})]}):(0,g.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,g.jsx)(S,{}),w=({value:e})=>e==null?(0,g.jsx)(S,{}):e===!1?(0,g.jsx)(`div`,{className:`text-danger-strong`,children:(0,g.jsx)(_.XIcon,{})}):(0,g.jsx)(`div`,{className:`text-success-strong`,children:(0,g.jsx)(_.CheckIcon,{})}),ee=({date:e})=>e==null?(0,g.jsx)(S,{}):(0,g.jsx)(o.r,{children:(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{asChild:!0,children:(0,g.jsx)(a.t,{className:`h-fit`,children:(0,g.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,g.jsx)(o.n,{className:`rounded px-2`,children:(0,g.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),T=({content:e})=>e==null?(0,g.jsx)(S,{}):(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{children:(0,g.jsx)(t.t,{variant:`sm`,className:`line-clamp-2 whitespace-pre-line break-all`,children:e})}),(0,g.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,g.jsx)(t.t,{variant:`xs`,className:`whitespace-pre-line text-wrap break-keep text-text-negative-weak`,children:e}),(0,g.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),E=({items:e=[]})=>(0,g.jsxs)(l.t,{children:[(0,g.jsx)(l.h,{asChild:!0,children:(0,g.jsx)(n.t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:(0,g.jsx)(_.MoreVerticalIcon,{})})}),(0,g.jsx)(l.r,{children:(0,g.jsx)(l.i,{children:e.map(e=>(0,g.jsx)(l.a,{className:`px-3`,onSelect:t=>{e.onClick(e.id),t.stopPropagation()},children:e.label},e.id))})})]}),D=({name:e})=>e?(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{children:(0,g.jsx)(t.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start`,children:e})}),(0,g.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,g.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,g.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,g.jsx)(S,{}),O=({href:e,label:t})=>(0,g.jsxs)(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,g.jsx)(`span`,{children:t||e}),(0,g.jsx)(_.ExternalLinkIcon,{size:14})]}),k=({value:e})=>(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{asChild:!0,children:(0,g.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,g.jsx)(o.n,{align:`start`,children:(0,g.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:t})=>(0,g.jsxs)(o.t,{children:[(0,g.jsx)(o.i,{children:(0,g.jsx)(n.t,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:(0,h.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),await t?.()},[t]),children:(0,g.jsx)(_.Trash2Icon,{})})}),(0,g.jsx)(o.n,{children:(0,g.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,h.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:n,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=(0,h.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=(0,h.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,h.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]),p=(0,h.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return p===`0`||p===`N/A`||!p?(0,g.jsx)(S,{}):(0,g.jsxs)(r.t,{padding:`none`,className:(0,m.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:[n,(0,g.jsx)(`p`,{children:p}),i]})});M.displayName=`UITableStatisticDisplay`;const N=({uuid:e,username:n,email:i})=>(0,g.jsxs)(r.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,g.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,g.jsx)(s.n,{className:`bg-muted-weak`,children:(0,g.jsx)(_.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,g.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,g.jsx)(s.n,{style:{backgroundColor:v.colorHashLight.hex(e)},children:(0,g.jsx)(_.UserRoundIcon,{size:28,className:`text-white`})})}),(0,g.jsxs)(r.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,g.jsx)(t.t,{className:`font-medium text-sm text-text-positive-weak`,children:n??`Unknown User`}),(0,g.jsx)(t.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),te=60,ne=60,re=20,ie=20,ae=(0,h.createContext)(null),oe=()=>{let e=(0,h.use)(ae);if(!e)throw Error(`useTableInnerWrapperContext must be used within a TableInnerWrapperProvider`);return e},se=(0,h.createContext)(null),ce=()=>{let e=(0,h.use)(se);if(!e)throw Error(`useTableInnerTableContext must be used within a TableInnerTableProvider`);return e},le=(0,h.createContext)(null),ue=()=>{let e=(0,h.use)(le);if(!e)throw Error(`useTableHeaderRowContext must be used within a TableHeaderRowProvider`);return e},de=(0,h.createContext)(null),fe=()=>{let e=(0,h.use)(de);if(!e)throw Error(`useTableBodyContext must be used within a TableBodyProvider`);return e},pe=(0,h.createContext)(null),me=()=>{let e=(0,h.use)(pe);if(!e)throw Error(`useTableRowContext must be used within a TableRowProvider`);return e},P=(0,h.createContext)(null),F=()=>{let e=(0,h.use)(P);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},I=(0,h.memo)(({isPinned:e,onLeftPin:t,onRightPin:n,onUnpin:r,className:i})=>{let a=(0,h.useCallback)(()=>{t?.(`left`)},[t]),o=(0,h.useCallback)(()=>{n?.(`right`)},[n]),s=(0,h.useCallback)(()=>{r?.(!1)},[r]);return(0,g.jsxs)(l.t,{children:[(0,g.jsx)(l.h,{asChild:!0,children:(0,g.jsx)(`button`,{className:(0,m.cn)(`absolute right-2 z-10 p-0.5 opacity-0`,`cursor-pointer rounded-full transition-all`,`text-text-positive-weak`,`[&>svg]:size-4`,`group-hover:opacity-100`,`hover:bg-muted-muted hover:text-text-positive`,i),children:(0,g.jsx)(_.EllipsisVerticalIcon,{})})}),(0,g.jsx)(l.r,{align:`end`,className:`w-64 p-4`,children:(0,g.jsxs)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,g.jsx)(h.Activity,{mode:e?`visible`:`hidden`,children:(0,g.jsxs)(l.a,{onClick:s,children:[!!e&&`Unpin`,(0,g.jsx)(l.d,{children:(0,g.jsx)(_.PinOffIcon,{className:`size-4`})})]})}),(0,g.jsxs)(h.Activity,{mode:e?`hidden`:`visible`,children:[(0,g.jsxs)(l.a,{onClick:a,children:[e?`Unpin`:`Pin to Left`,(0,g.jsx)(l.d,{children:(0,g.jsx)(_.MoveLeftIcon,{className:`size-4`})})]}),(0,g.jsxs)(l.a,{onClick:o,children:[e?`Unpin`:`Pin to Right`,(0,g.jsx)(l.d,{children:(0,g.jsx)(_.MoveRightIcon,{className:`size-4`})})]})]})]})})]})});I.displayName=`UITableHeadCellOption`;const L=(0,h.memo)(({isPinned:e,isAllRowsSelected:t,style:n,onToggleAllRowsSelected:r,...i})=>{let a=(0,h.useCallback)(e=>{r?.(!!e)},[r]);return(0,g.jsx)(`th`,{slot:`table-header-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:(0,m.cn)(e?`sticky`:`relative`),...i,children:(0,g.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,g.jsx)(u.t,{"aria-label":`Select All Rows`,checked:t,onCheckedChange:a})})})});L.displayName=`UITableHeadCellSelect`;const R=(0,h.memo)(({isEmpty:e,isFetching:t})=>!e&&!t?null:(0,g.jsxs)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:[t&&(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,g.jsx)(d.t,{className:`size-12`}),(0,g.jsx)(`p`,{children:`Loading data...`})]}),e&&!t&&(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,g.jsx)(_.BoxIcon,{strokeWidth:1,size:48}),(0,g.jsx)(`p`,{children:`No data available`})]})]}));R.displayName=`UITableEmptyDisplay`;const z=(0,h.memo)(({className:e,children:t,...n})=>(0,g.jsx)(`div`,{slot:`table-wrapper`,className:(0,m.cn)(`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2`,e),...n,children:t}));z.displayName=`UITableWrapper`;const B=(0,h.memo)(({children:e,...t})=>{let{innerWrapperId:n}=oe();return(0,g.jsx)(`div`,{id:n,slot:`table-inner-wrapper`,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border bg-card`,...t,children:e})});B.displayName=`UITableInnerWrapper`;const V=(0,h.memo)(({children:e,...t})=>{let{table:n,innerTableId:r,totalSize:i}=ce(),a=(0,h.useRef)(null);return(0,h.useEffect)(()=>{if(!a.current)return;let e=n.getFlatHeaders(),t=new ResizeObserver(t=>{requestAnimationFrame(()=>{let r=t[0].target;if(r instanceof HTMLTableElement){let i=t[0];if(!i)return;let a=i.contentRect.width,{left:o=[],right:s=[]}=n.getState().columnPinning,c=0,l=0,u=0,d=e.map(e=>{let{id:t}=e,n=t===`select`||t===`actions`,r=o.includes(t)||s.includes(t),i=e.getSize(),a=e.column.columnDef.maxSize;return n?(c+=60,{id:t,isFlex:!1,width:60}):r?(c+=i,{id:t,isFlex:!1,width:i}):e.column.columnDef.size||i!==150?(u+=i,{id:t,isFlex:!1,width:i}):(l++,{id:t,isFlex:!0,maxSize:a})}),f=a-c-u,p=l>0?Math.max(0,Math.floor(f/l)):0;d.forEach(e=>{if(e.isFlex){let t=e.maxSize?Math.min(p,e.maxSize):p;r.style.setProperty(`--header-${e.id}-size`,`${t}`),r.style.setProperty(`--col-${e.id}-size`,`${t}`),e.maxSize&&r.style.setProperty(`--col-${e.id}-maxSize`,`${e.maxSize}`)}else r.style.setProperty(`--header-${e.id}-size`,`${e.width}`),r.style.setProperty(`--col-${e.id}-size`,`${e.width}`)})}})});return t.observe(a.current),()=>t.disconnect()},[n.getState().columnSizingInfo,n.getState().columnSizing,n.getState().columnPinning]),(0,g.jsx)(`table`,{id:r,ref:a,slot:`table-inner-table`,className:`grid w-full table-fixed caption-bottom border-collapse border-spacing-0 flex-col content-start [&_tfoot_td]:border-t`,style:{minWidth:i},...t,children:e})});V.displayName=`UITableInnerTable`;const H=(0,h.memo)(({className:e,children:t,...n})=>(0,g.jsx)(`thead`,{slot:`table-head`,className:(0,m.cn)(`sticky top-0 z-20 h-9 w-full`,`grid select-none bg-muted-bg-subtle`,`border-b border-b-border shadow`,`font-medium text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:inline-flex`,`[&_th]:items-center`,`[&_th]:transition-all`,`[&_th]:duration-300`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`,e),...n,children:t}));H.displayName=`UITableHead`;const U=(0,h.memo)(({headerGroup:e,className:t,...n})=>{let{isAllRowsSelected:r,columnPinningState:i,leftPinnedHeaders:a,rightPinnedHeaders:o,onToggleAllRowsSelected:s}=ue(),c=o[0]?.id,l=a[a.length-1]?.id;return(0,g.jsx)(`tr`,{slot:`table-head-row`,className:(0,m.cn)(`flex`,t),...n,children:e.headers.map((e,t)=>{let n=e.column.getIsVisible(),a=i.left?.includes(e.id)?`left`:i.right?.includes(e.id)?`right`:!1;return e.id===`select`?(0,g.jsx)(L,{isPinned:a,isAllRowsSelected:r,onToggleAllRowsSelected:s},e.id):(0,g.jsx)(W,{isVisible:n,isPinned:a,isFirstCell:e.id===c,isLastCell:e.id===l,isOptionsVisible:![`select`,`actions`].includes(e.id),headerId:e.id,headerColumn:e.column,colSpan:e.colSpan,onColumnPin:e.column.pin,onToggleVisibility:e.column.toggleVisibility,children:(0,y.flexRender)(e.column.columnDef.header,e.getContext())},`${e.id}-${t}`)})})});U.displayName=`UITableHeadRow`;const W=(0,h.memo)(({isVisible:e=!0,isPinned:t=!1,isFirstCell:n=!1,isLastCell:r=!1,isOptionsVisible:i=!0,headerId:a,headerColumn:o,className:s,children:c,onColumnPin:l,onToggleVisibility:u,...d})=>{let f=(0,h.useMemo)(()=>t?20:void 0,[t]),p=(0,h.useMemo)(()=>{let e=o?.getStart?.(`left`);return t===`left`&&typeof e==`number`?`${e}px`:void 0},[t,o]),_=(0,h.useMemo)(()=>{let e=o?.getAfter?.(`right`);return t===`right`&&typeof e==`number`?`${e}px`:void 0},[t,o]),v=(0,h.useMemo)(()=>`calc(var(--header-${a}-size) * 1px)`,[a]),y=(0,h.useMemo)(()=>o?.columnDef.minSize?`calc(var(--col-${a}-minSize) * 1px)`:void 0,[a,o]),b=(0,h.useMemo)(()=>o?.columnDef.maxSize?`calc(var(--col-${a}-maxSize) * 1px)`:void 0,[a,o]);return(0,g.jsxs)(`th`,{slot:`table-head-cell`,"data-pinned":t,"data-header":a,style:{zIndex:f,left:p,right:_,width:v,minWidth:y,maxWidth:b},className:(0,m.cn)(`group flex`,t?`sticky`:`relative`,t===`left`&&r&&`border-r border-r-border`,t===`right`&&n&&`border-l border-l-border`,o?.columnDef.meta?.position===`center`&&`justify-center`,o?.columnDef.meta?.position===`end`&&`justify-end`,o?.columnDef.meta?.position===`start`&&`justify-start`,s),...d,children:[(0,g.jsx)(`div`,{className:`truncate pl-4`,children:c}),i&&(0,g.jsx)(I,{isPinned:t,isVisible:e,onLeftPin:l,onRightPin:l,onUnpin:l})]})});W.displayName=`UITableHeadCell`;const G=(0,h.memo)(({height:e,className:t,children:n,...r})=>{let{isFetching:i,isEmpty:a}=fe();return a||i?null:(0,g.jsx)(`tbody`,{slot:`table-body`,style:{height:e},className:(0,m.cn)(`relative w-full`,`grid`,`[&_tr]:absolute`,`[&_tr]:flex`,`[&_tr]:flex-none`,`[&_tr]:w-full`,`[&_tr]:cursor-pointer [&_tr]:focus:outline-none`,`[&_tr]:border-b [&_tr]:border-b-border`,`[&_td]:z-10`,`[&_td]:transition-all`,`[&_td]:duration-300`,`[&_td]:flex`,`[&_td]:flex-none`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[selected=true]:bg-muted-muted!`,`[&_td]:data-[selected=true]:hover:bg-muted-muted!`,`[&_td>div]:inline-flex`,`[&_td>div]:items-center`,`[&_td>div]:w-full`,`[&_td:not([data-pinned=false])]:z-20`,`[&_td:not([data-pinned=false])]:sticky`,`[&_td:not([data-pinned=false])]:bg-card`,`**:data-lastcell:border-r`,`**:data-firstcell:border-l`,t),...r,children:n})});G.displayName=`UITableBody`;const K=(0,h.memo)(({row:e,isSelected:t,virtualRowIndex:n,virtualRowStart:r,children:i,...a})=>{let{keyOfClickRow:o,isAllRowsSelected:s,columnPinningState:c,leftPinnedHeaders:l,rightPinnedHeaders:u,onClickRow:d}=me(),f=(0,h.useMemo)(()=>c.left??[],[c]),p=(0,h.useMemo)(()=>c.right??[],[c]),m=(0,h.useMemo)(()=>u?.[0]?.id,[u]),_=(0,h.useMemo)(()=>l?.[l.length-1]?.id,[l]),v=(0,h.useCallback)(t=>{let r=o?e.original?.[o]:void 0;d?.(n,typeof r==`string`||typeof r==`number`?r:void 0),t.preventDefault(),t.stopPropagation()},[o,d,e,n]);return(0,g.jsx)(`tr`,{slot:`table-row`,"data-index":n,style:{transform:`translateY(${r}px)`},className:`group`,onClick:v,...a,children:e.getVisibleCells().map((e,r)=>{let i=f.includes(e.column.id),a=p.includes(e.column.id),o=i?`left`:a?`right`:!1;return e.column.id===`actions`?(0,g.jsx)(J,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,virtualRowIndex:n,column:e.column,getContext:e.getContext},`${e.id}-${r}`):e.column.id===`select`?(0,g.jsx)(q,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isSelected:s||t,onToggleRowSelected:e.row.toggleSelected},`${e.id}-${r}`):(0,g.jsx)(Y,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isFirstCell:e.column.id===m,isLastCell:e.column.id===_,colId:e.column.id,position:e.column.columnDef.meta?.position??`start`,column:e.column,getContext:e.getContext},`${e.id}-${r}`)})})});K.displayName=`UITableRow`;const q=(0,h.memo)(({isPinned:e,isSelected:t=!1,className:n,onToggleRowSelected:r,...i})=>{let a=(0,h.useCallback)(e=>{r?.(!!e)},[r]);return(0,g.jsx)(`td`,{slot:`table-body-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:(0,m.cn)(`group-hover:bg-muted-bg-subtle!`,e?`sticky`:`relative`,n),...i,children:(0,g.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`flex! w-full! items-center justify-center bg-transparent text-center align-middle`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,g.jsx)(u.t,{"aria-label":`Select Row`,checked:t,onCheckedChange:a})})})});q.displayName=`UITableCellSelect`;const J=(0,h.memo)(({virtualRowIndex:e,column:t,getContext:n,className:r,...i})=>{let a=(0,h.useMemo)(()=>(0,y.flexRender)(t?.columnDef.cell,n()),[t,n]);return(0,g.jsx)(`td`,{"data-col":`actions`,"data-cell":e,className:`sticky inset-y-0 right-0 z-50 flex items-center pr-4 group-hover:bg-muted-bg-subtle!`,...i,children:a})});J.displayName=`UITableCellActions`;const Y=(0,h.memo)(({isPinned:e=!1,isFirstCell:t=!1,isLastCell:n=!1,colId:r,position:i=`start`,column:a,getContext:o,...s})=>{let{innerTableId:c,table:l}=ce(),u=(0,h.useRef)(document.querySelector(`table[id="${c}"]`)),d=(0,h.useRef)(null),f=(0,h.useMemo)(()=>{let t=a?.getStart(`left`);return e===`left`&&typeof t==`number`?`${t}px`:void 0},[e,a]),p=(0,h.useMemo)(()=>{let t=a?.getAfter(`right`);return e===`right`&&typeof t==`number`?`${t}px`:void 0},[e,a]),_=(0,h.useMemo)(()=>`calc(var(--col-${r}-size) * 1px)`,[r]),v=(0,h.useMemo)(()=>a?.columnDef.minSize?`calc(var(--col-${r}-minSize) * 1px)`:void 0,[r,a]),b=(0,h.useMemo)(()=>a?.columnDef.maxSize?`calc(var(--col-${r}-maxSize) * 1px)`:void 0,[r,a]),x=(0,h.useMemo)(()=>(0,y.flexRender)(a?.columnDef.cell,o()),[a,o]);return(0,h.useEffect)(()=>{if(!d.current)return;let e=d.current.scrollWidth,t=a?.getSize();t&&e>t&&u.current instanceof HTMLTableElement&&typeof r==`string`&&a?.columnDef.meta?.fitContent&&l.setColumnSizing(t=>({...t,[r]:e+32}))},[r,a,l]),(0,g.jsx)(`td`,{slot:`table-body-cell`,"data-pinned":e,"data-lastcell":n||void 0,"data-firstcell":t||void 0,style:{left:f,right:p,width:_,minWidth:v,maxWidth:b},className:`group-hover:bg-muted-bg-subtle!`,...s,children:(0,g.jsx)(`div`,{ref:d,slot:`table-body-cell-inner`,className:(0,m.cn)(i===`start`&&`justify-start`,i===`center`&&`justify-center`,i===`end`&&`justify-end`),children:x})})});Y.displayName=`UITableCell`;const he=(0,h.memo)(({className:e,children:t,...n})=>(0,g.jsx)(`tfoot`,{slot:`table-footer`,className:(0,m.cn)(`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,e),...n,children:t}));he.displayName=`UITableFooter`;const X=(0,h.memo)(({virtualRowIndex:e,virtualRowStart:t,fetchMoreData:n})=>{let{innerWrapperId:r}=oe(),i=(0,h.useRef)(document.querySelector(`div[id="${r}"]`)),a=(0,h.useRef)(null),[o,s]=(0,h.useState)(`idle`),[c,l]=(0,h.useState)(0),u=(0,h.useCallback)(async()=>{try{s(`fetching`),await n?.(),s(`idle`)}catch(e){console.error(`Error fetching more data:`,e),s(`error`)}},[n]);return(0,h.useEffect)(()=>{if(!i.current)return;let e=new ResizeObserver(e=>{l(e[0].contentRect.width)});return e.observe(i.current),()=>e.disconnect()},[]),n?(0,g.jsx)(`tr`,{ref:a,"data-index":e,style:{transform:`translateY(${t}px)`,width:c},className:`sticky! left-0 h-10`,children:(0,g.jsx)(`td`,{className:`absolute left-0 flex w-full items-center justify-center text-xs`,children:(0,g.jsxs)(`button`,{type:`button`,disabled:o===`fetching`,className:(0,m.cn)(`flex cursor-pointer gap-x-0.5`,o===`fetching`&&`cursor-not-allowed`,o===`idle`&&`text-text-positive-weak hover:text-text-positive`,o===`error`&&`text-danger hover:text-danger-strong`),onClick:u,children:[o===`idle`&&(0,g.jsx)(_.ChevronDown,{className:`size-4`}),o===`fetching`&&(0,g.jsx)(d.t,{className:`size-4 animate-spin`}),o===`error`&&(0,g.jsx)(_.AlertTriangle,{className:`size-4 text-danger`}),o===`idle`&&`Load More`,o===`fetching`&&`Loading...`,o===`error`&&`Error! Retry?`]})})}):null});X.displayName=`UITableLoadMore`;const ge=()=>{let{table:e,isEmpty:t,isFetching:n,fetchMoreData:r}=F(),{rowSelectionState:i}=fe(),a=(0,h.useRef)(null),{rows:o}=e.getRowModel(),s=(0,b.useVirtualizer)({count:o.length+1,estimateSize:()=>40,getScrollElement:()=>a.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2}),c=(0,h.useMemo)(()=>{let e=s.getTotalSize(),t=a.current?.clientHeight||0;return e<t?`${t}px`:`${e}px`},[s.getTotalSize()]);return(0,g.jsx)(f.r,{direction:`horizontal`,style:{direction:e.options.columnResizeDirection},className:`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border border-r border-r-border bg-slate-50 p-0 text-sm`,children:(0,g.jsx)(f.n,{className:`relative`,children:(0,g.jsxs)(B,{ref:a,children:[(0,g.jsxs)(V,{children:[(0,g.jsx)(H,{children:e.getHeaderGroups().map(e=>(0,g.jsx)(U,{headerGroup:e},e.id))}),(0,g.jsx)(G,{height:c,children:s.getVirtualItems().map(e=>{let t=o[e.index],n=Object.entries(i).some(([e,n])=>e===`${t?.id}`&&n);return t?(0,g.jsx)(K,{ref:s.measureElement,row:t,isSelected:n,virtualRowIndex:e.index,virtualRowStart:e.start},e.index):(0,g.jsx)(X,{virtualRowIndex:e.index,virtualRowStart:e.start,fetchMoreData:r},e.index)})})]}),(0,g.jsx)(R,{isEmpty:t,isFetching:n})]})})})},_e=({checked:e,title:t,onCheckedChange:n})=>(0,g.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,g.jsx)(u.t,{checked:e,onCheckedChange:n}),(0,g.jsx)(`p`,{className:`text-sm`,children:t})]}),ve=()=>{let{table:e}=F(),[t,r]=(0,h.useState)(null);return(0,g.jsx)(f.n,{defaultSize:25,className:(0,m.cn)(`bg-card`,t===null?`max-w-8!`:`min-w-64`),children:(0,g.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,g.jsxs)(`div`,{className:`flex-1`,children:[(0,g.jsx)(h.Activity,{mode:t===`columns`?`visible`:`hidden`,children:(0,g.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,g.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,g.jsx)(c.t,{}),(0,g.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,g.jsx)(_e,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,g.jsx)(h.Activity,{mode:t===`filters`?`visible`:`hidden`,children:(0,g.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,g.jsxs)(n.t,{variant:`outline`,color:`muted`,children:[(0,g.jsx)(_.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,g.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,g.jsxs)(`button`,{className:(0,m.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,t===`columns`&&`bg-card`),onClick:()=>r(t===`columns`?null:`columns`),children:[(0,g.jsx)(_.Columns4Icon,{size:18}),(0,g.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,g.jsx)(c.t,{}),(0,g.jsxs)(`button`,{className:(0,m.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,t===`filters`&&`bg-card`),onClick:()=>r(t===`filters`?null:`filters`),children:[(0,g.jsx)(_.ListFilterIcon,{size:18}),(0,g.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,g.jsx)(c.t,{})]})]})})},ye=(0,h.memo)(({innerWrapperId:e,children:t})=>{let n=(0,h.useMemo)(()=>({innerWrapperId:e}),[e]);return(0,g.jsx)(ae.Provider,{value:n,children:t})});ye.displayName=`UITableInnerWrapperProvider`;const be=(0,h.memo)(({table:e,innerTableId:t,totalSize:n,children:r})=>{let i=(0,h.useMemo)(()=>({table:e,innerTableId:t,totalSize:n}),[e,t,n]);return(0,g.jsx)(se.Provider,{value:i,children:r})});be.displayName=`UITableInnerTableProvider`;const xe=(0,h.memo)(({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i,children:a})=>{let o=(0,h.useMemo)(()=>({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i}),[e,t,n,r,i]);return(0,g.jsx)(le.Provider,{value:o,children:a})});xe.displayName=`UITableHeadRowProvider`;const Se=(0,h.memo)(({isFetching:e,isEmpty:t,rowSelectionState:n,children:r})=>{let i=(0,h.useMemo)(()=>({isFetching:e,isEmpty:t,rowSelectionState:n}),[e,t,n]);return(0,g.jsx)(de.Provider,{value:i,children:r})});Se.displayName=`UITableBodyProvider`;const Z=(0,h.memo)(({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a,children:o})=>{let s=(0,h.useMemo)(()=>({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a}),[e,t,n,r,i,a]);return(0,g.jsx)(pe.Provider,{value:s,children:o})});Z.displayName=`UITableRowProvider`;const Ce=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o=[],rightPinnedColumns:s=[],keyOfClickRow:c,onClickRow:l,onRowSelection:u,onColumnPinning:d,fetchMoreData:f,children:p})=>{let m=(0,h.useId)(),_=(0,h.useId)(),[v,b]=(0,h.useState)({}),[x,S]=(0,h.useState)({right:s,left:[`select`,...o]}),[C,w]=(0,h.useState)({}),ee=(0,h.useCallback)(e=>(b(e),u?.(e instanceof Function?e(v):e),e),[v,u]),T=(0,h.useCallback)(e=>{S(e),d?.(e instanceof Function?e(x):e)},[x,d]),E=(0,y.useReactTable)({data:r,columns:i,state:{rowSelection:v,columnPinning:x,expanded:C},defaultColumn:{enableResizing:!1,size:void 0,minSize:void 0,maxSize:void 0},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,autoResetAll:!1,autoResetExpanded:!1,autoResetPageIndex:!1,getSubRows:e=>e.subRows,getCoreRowModel:(0,y.getCoreRowModel)(),getGroupedRowModel:(0,y.getGroupedRowModel)(),getExpandedRowModel:(0,y.getExpandedRowModel)(),onRowSelectionChange:ee,onColumnPinningChange:T,onExpandedChange:w}),D=(0,h.useMemo)(()=>{let{rows:e}=E.getRowModel();return e},[E.getRowModel().rows,E.getState().columnPinning]),O=(0,h.useMemo)(()=>!t&&D.length===0,[D,t]),k=(0,h.useMemo)(()=>({title:e,table:E,isEmpty:O,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:f}),[e,E,O,n,t,a,f,E.getState().columnPinning,E.getState().expanded]),A=(0,h.useMemo)(()=>E.getState(),[E.getState()]),j=(0,h.useMemo)(()=>E.getIsAllRowsSelected(),[E.getIsAllRowsSelected()]),M=(0,h.useMemo)(()=>A.rowSelection,[A.rowSelection]),N=(0,h.useMemo)(()=>A.columnPinning,[A.columnPinning]),te=(0,h.useMemo)(()=>E.getLeftHeaderGroups()[0]?.headers||[],[E.getState().columnPinning]),ne=(0,h.useMemo)(()=>E.getRightHeaderGroups()[0]?.headers||[],[E.getState().columnPinning]),re=(0,h.useMemo)(()=>E.getTotalSize(),[E.getTotalSize()]);return(0,g.jsx)(P.Provider,{value:k,children:(0,g.jsx)(ye,{innerWrapperId:m,children:(0,g.jsx)(be,{table:E,innerTableId:_,totalSize:re,children:(0,g.jsx)(xe,{isAllRowsSelected:j,columnPinningState:N,leftPinnedHeaders:te,rightPinnedHeaders:ne,onToggleAllRowsSelected:E.toggleAllRowsSelected,children:(0,g.jsx)(Se,{isFetching:t,isEmpty:O,rowSelectionState:M,children:(0,g.jsx)(Z,{keyOfClickRow:c,isAllRowsSelected:j,columnPinningState:N,leftPinnedHeaders:te,rightPinnedHeaders:ne,onClickRow:l,children:p})})})})})})},we=({onSearch:e,onChange:t,...n})=>{let r=(0,x.useDebounceCallback)(t=>{e?.(t)},500);return(0,g.jsxs)(`div`,{className:`relative w-full max-w-80 flex-1`,children:[(0,g.jsx)(p.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,g.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,g.jsx)(_.SearchIcon,{size:16})}),(0,g.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,g.jsx)(_.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]})},Q=({children:e,disabled:t,onClick:n})=>(0,g.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}),Te=({onCreate:e,onDownload:t,onRefresh:n})=>(0,g.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,g.jsx)(Q,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,g.jsx)(_.CirclePlus,{})}),(0,g.jsx)(Q,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,g.jsx)(_.RefreshCwIcon,{})}),(0,g.jsx)(Q,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,g.jsx)(_.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=F();return(0,g.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,g.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,g.jsx)(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};$.displayName=`TableTooltip`,exports.UITableBadgeDisplay=C,exports.UITableBody=G,exports.UITableBooleanDisplay=w,exports.UITableCell=Y,exports.UITableCellActions=J,exports.UITableCellSelect=q,exports.UITableContainer=ge,exports.UITableDateDisplay=ee,exports.UITableDescriptionDisplay=T,exports.UITableEmptyDisplay=R,exports.UITableFilter=ve,exports.UITableFooter=he,exports.UITableHead=H,exports.UITableHeadCell=W,exports.UITableHeadCellOption=I,exports.UITableHeadCellSelect=L,exports.UITableHeadRow=U,exports.UITableInnerTable=V,exports.UITableInnerWrapper=B,exports.UITableLoadMore=X,exports.UITableMoreButton=E,exports.UITableNameDisplay=D,exports.UITablePermalink=O,exports.UITablePhoneNumberDisplay=k,exports.UITableProvider=Ce,exports.UITableRemoveButton=A,exports.UITableRow=K,exports.UITableStatisticDisplay=M,exports.UITableTooltip=$,exports.UITableTooltipActions=Te,exports.UITableTooltipFilter=we,exports.UITableUserDataDisplay=N,exports.UITableWrapper=z;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AnyEntity } from "../../types-Bd0JePtp.cjs";
|
|
2
|
-
import { t as Input } from "../../input-
|
|
2
|
+
import { t as Input } from "../../input-Bm0YXroi.cjs";
|
|
3
3
|
import * as react_jsx_runtime346 from "react/jsx-runtime";
|
|
4
4
|
import * as react267 from "react";
|
|
5
5
|
import { AccessorKeyColumnDef, CellContext, Column, ColumnPinningPosition, ColumnPinningState, Header, HeaderGroup, Row, RowSelectionState, Table } from "@tanstack/react-table";
|